Version 1.6.0-dev.6.0

svn merge -r 38486:38606 https://dart.googlecode.com/svn/branches/bleeding_edge trunk

git-svn-id: http://dart.googlecode.com/svn/trunk@38621 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index a21f374..6b35f804 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -544,6 +544,9 @@
 
 It is a compile-time error to preface a function declaration with the built-in identifier \STATIC{}.
 
+When we say that a function $f_1$ {\em forwards} to another function $f_2$, we mean that  invoking $f_1$ causes $f_2$ to  be executed with the same arguments and/or receiver as $f_1$, and returns the result of executing $f_2$ to the caller of $f_1$, unless $f_2$ throws an exception, in which case $f_1$ throws the same exception. Furthermore, we only use the term for synthetic functions introduced by the specification.
+
+
 \subsection{Formal Parameters}
 \label{formalParameters}
 
@@ -888,7 +891,7 @@
 
 If no return type is specified, the return type of the getter is  \DYNAMIC{}.
 
-A getter definition that is prefixed with the \STATIC{} modifier defines a static getter. Otherwise, it defines an instance getter. The name of the getter is given by the identifier in the definition.
+A getter definition that is prefixed with the \STATIC{} modifier defines a static getter. Otherwise, it defines an instance getter. The name of the getter is given by the identifier in the definition. The effect of a static getter declaration in class $C$ is to add an instance getter with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static getter.
 
 %It is a compile-time error if a getter`s formal parameter list is not empty.
 
@@ -921,7 +924,7 @@
 
 If no return type is specified, the return type of the setter is  \DYNAMIC{}.
 
-A setter definition that is prefixed with the \STATIC{} modifier defines a static setter. Otherwise, it defines an instance setter. The name of a setter is  obtained by appending the  string `='  to the identifier given in its signature.
+A setter definition that is prefixed with the \STATIC{} modifier defines a static setter. Otherwise, it defines an instance setter. The name of a setter is  obtained by appending the  string `='  to the identifier given in its signature. The effect of a static setter declaration in class $C$ is to add an instance setter with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static setter.
 
 \commentary{Hence, a setter name can never conflict with, override or be overridden by a getter or method.}
 
@@ -1420,6 +1423,8 @@
 
 {\em Static methods} are functions, other than getters or setters, whose declarations are immediately contained within a class declaration and that are declared \STATIC{}. The static methods of a class $C$ are those static methods declared by $C$.
 
+The effect of a static method declaration in class $C$ is to add an instance method with the same name and signature to the \code{Type} object for class $C$ that forwards (\ref{functionDeclarations})  to the static method.
+
 \rationale{
 Inheritance of static methods has little utility in Dart. Static methods cannot be overridden. Any required static function can be obtained from its declaring library, and there is no need to bring it into scope via inheritance. Experience shows that developers are confused by the idea of inherited methods that are not instance methods.
 
@@ -2068,7 +2073,7 @@
 An expression $e$ may always be enclosed in parentheses, but this never has any semantic effect on $e$.
 
 \commentary{
-Sadly, it may have an effect on the surrounding expression. Given a class $C$ with static method $m => 42$, $C.m()$ returns 42, but $(C).m()$ produces a \code{NoSuchMethodError}.  This anomaly can be corrected by ensuring that every instance of \code{Type} has instance members corresponding to its static members. This issue may be addressed in future versions of Dart .
+Sadly, it may have an effect on the surrounding expression. Given a class $C$ with static method $m => 42$, $C.m()$ returns 42, but $(C).m()$ produces a \code{NoSuchMethodError}.  This anomaly can be corrected by removing the restrictions on calling the members of instances of \code{Type}. This issue may be addressed in future versions of Dart.
 }
 
  \subsubsection{Object Identity}
@@ -2122,9 +2127,9 @@
 \item A qualified reference to a static constant variable (\ref{variables}) that is not qualified by a deferred prefix. 
 \commentary {For example, If class C declares a constant static variable v, C.v is a constant. The same is true if C is accessed via a prefix p; p.C.v is a constant  unless p is a deferred prefix.
 }
-\item An identifier expression that denotes a constant variable. %CHANGE in googledoc
-\item A simple or qualified identifier denoting a class or a type alias. 
-\commentary {For example, if C is a class or typedef C is a constant, and if C is imported with a prefix p,  p.C is a constant.
+\item An identifier expression that denotes a constant variable. 
+\item A qualified reference to a static constant variable (\ref{variables}) that is not qualified by a deferred prefix. 
+\commentary {For example, If class C declares a constant static variable v, C.v is a constant. The same is true if C is accessed via a prefix p; p.C.v is a constant  unless p is a deferred prefix.
 }
 \item A constant constructor invocation (\ref{const}) that is not qualified by a deferred prefix.  
 \item A constant list literal (\ref{lists}).
@@ -2989,100 +2994,14 @@
 As discussed in section \ref{errorsAndWarnings}, the handling of a suspended isolate is the responsibility of the embedder.
 }
 
-\subsection{ Property Extraction}
-\label{propertyExtraction}
 
-{\em Property extraction} allows for a member of an object to be concisely extracted from the object.
-If $e$ is an expression that evaluates to an object $o$, and if $m$ is the name of a concrete method member of $e$, then $e.m$ is defined to be equivalent to:
-
-\begin{itemize}
-
-\item  
-\begin{dartCode}
-$(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{
-  \RETURN{} $ u.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$
-\} 
-\end{dartCode}
-
-if $m$ has required parameters $r_1, \ldots, r_n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
-\item 
-\begin{dartCode}
-$(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{
-  \RETURN{} $u.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$;
-\}
-\end{dartCode}
-
-if $m$ has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
-\end{itemize}
-
-where $u$ is a fresh final variable bound to $o$, except that:
-\begin{enumerate}
-\item  iff  \code{identical($o_1, o_2$)}  then \cd{$o_1.m$ == $o_2.m$}.
-\item The static type of the property extraction is the static type of function $T.m$, where $T$ is the static type of $e$, if $T.m$ is defined. Otherwise the static type of $e.m$ is \DYNAMIC{}.
-\end{enumerate}
-
-\commentary{
-There is no guarantee that \cd{identical($o_1.m, o_2.m$)}. Dart implementations are not required to canonicalize these or any other closures.
-}
-% local functions that have a closure extracted are always different
-
-\rationale{
-The special treatment of equality in this case facilitates the use of extracted property functions in APIs where callbacks such as event listeners must often be registered and later unregistered. A common example is the DOM API in web browsers.
-}
-
-Otherwise
-%, if $m$ is the name of a getter (\ref{getters}) member of $e$ (declared implicitly or explicitly) then 
-$e.m$ is treated as a getter invocation (\ref{getterInvocation})).
-
-
-\commentary{Observations:
-\begin{enumerate}
-\item One cannot extract a getter or a setter.
-\item One can tell whether one implemented a property via a method or via field/getter, which means that one has to plan ahead as to what construct to use, and that choice is reflected in the interface of the class.
-\end{enumerate}
-} 
-
-Let $S$ be the superclass of the immediately enclosing class. If $m$ is the name of a concrete method member of $S$, then the expression  $\SUPER{}.m$ is defined to be equivalent to:
-
-\begin{itemize}
- %\item $(r_1, \ldots, r_n)\{\RETURN{}$ $o.m(r_1, \ldots, r_n);\}$ if $m$ has only required parameters $r_1, \ldots r_n$.
-%\item $(r_1, \ldots, r_n, rest)\{return$  $o.m(r_1, \ldots, r_n, rest);\}$ if $m$ has required parameters $r_1, \ldots r_n$, and a rest parameter $rest$.
-%\item
-\item  
-\begin{dartCode}
-$(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$\{
-   \RETURN{} \SUPER{}$.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k)$;
-\}
-\end{dartCode}
-
-if $m$ has required parameters $r_1, \ldots, r_n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
-\item 
-\begin{dartCode}
-$(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{
-   \RETURN{} \SUPER{}$.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$;
-\} 
-\end{dartCode}
-
-if $m$ has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
-\end{itemize}
-
-Except that:
-\begin{enumerate}
-\item  iff  \code{identical($o_1, o_2$)}  then \cd{$o_1.m$ == $o_2.m$}.
-\item 
-The static type of the property extraction is the static type of the method $S.m$,  if $S.m$ is defined. Otherwise the static type of $\SUPER{}.m$ is \DYNAMIC{}.
-\end{enumerate}
-
-Otherwise
-%, if $m$ is the name of a getter (\ref{getters}) member of $S$ (declared implicitly or explicitly) then 
-$\SUPER{}.m$ is treated as a getter invocation (\ref{getterInvocation})).
 
 \subsection{ Function Invocation}
 \label{functionInvocation}
  
-Function invocation occurs in the following cases: when a function expression  (\ref{functionExpressions}) is invoked (\ref{functionExpressionInvocation}), when a method (\ref{methodInvocation}), getter (\ref{getterInvocation}) or setter (\ref{assignment}) is invoked or when a constructor is invoked (either via instance creation (\ref{instanceCreation}), constructor redirection (\ref{redirectingConstructors}) or super initialization). The various kinds of function invocation differ as to how the function to be invoked, $f$,  is determined, as well as whether \THIS{} is bound. Once $f$ has been determined, the formal parameters of $f$ are bound to corresponding actual arguments. The body of $f$ is then executed with the aforementioned bindings. Execution of the body terminates when the first of the following occurs:
+Function invocation occurs in the following cases: when a function expression  (\ref{functionExpressions}) is invoked (\ref{functionExpressionInvocation}), when a method (\ref{methodInvocation}), getter (\ref{topLevelGetterInvocation}, \ref{propertyExtraction}) or setter (\ref{assignment}) is invoked or when a constructor is invoked (either via instance creation (\ref{instanceCreation}), constructor redirection (\ref{redirectingConstructors}) or super initialization). The various kinds of function invocation differ as to how the function to be invoked, $f$,  is determined, as well as whether \THIS{} is bound. Once $f$ has been determined, the formal parameters of $f$ are bound to corresponding actual arguments. The body of $f$ is then executed with the aforementioned bindings. Execution of the body terminates when the first of the following occurs:
 \begin{itemize}
-\item An uncaught exception is thrown. 
+\item An exception is thrown and not caught within the current function activation. 
 \item A return statement (\ref{return}) immediately nested in the body of $f$ is executed.
 \item The last statement of the body completes execution.
 \end{itemize}
@@ -3156,15 +3075,7 @@
 
 $id(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$, 
 
-where $id$ is an identifier or an identifier qualified with a library prefix. 
-
-If $id$ is qualified with a deferred prefix $p$ and $p$ has not been successfully loaded, then:
-\begin{itemize}
-\item
-If the invocation has the form $p$\code{.loadLibrary()} then an attempt to load the library represented by the prefix $p$ is initiated as discussed in section \ref{imports}. 
-\item
- Otherwise, a \code{NoSuchMethodError} is thrown.
- \end{itemize}
+where $id$ is an identifier. 
 
 If there exists a lexically visible declaration named $id$, let $f_{id}$ be the innermost such declaration. Then:
 \begin{itemize}
@@ -3218,6 +3129,45 @@
 %\item Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static warning if $F$ is not a supertype of  $(T_1, \ldots, T_n, [T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}]) \to \bot$.
 %\end{itemize}
 
+\subsection{Lookup}
+
+\subsubsection{Method Lookup}
+\label{methodLookup}
+
+The result of a lookup of a method $m$ in object $o$ with respect to library $L$ is the result of  a lookup of method $m$ in class $C$ with respect to library $L$, where $C$ is the class of $o$.
+
+The result of  a lookup of method $m$ in class $C$ with respect to library $L$ is:
+If $C$ declares a concrete instance method named $m$ that is accessible to $L$,  then that method is the result of the lookup. Otherwise, if $C$ has a superclass $S$, then the result of the lookup is the result of looking up $m$  in $S$ with respect to $L$. Otherwise, we say that the method lookup has failed.
+
+\rationale {
+The motivation for skipping abstract members during lookup is largely to allow smoother mixin composition. 
+}
+
+
+\subsubsection{ Getter and Setter Lookup}
+\label{getterAndSetterLookup}
+
+The result of a lookup of a getter (respectively setter) $m$ in object $o$  with respect  to  library $L$ is the result of looking up getter (respectively setter) $m$ in class $C$ with respect to $L$, where $C$ is the class of $o$.
+
+The result of a lookup of a getter (respectively setter) $m$ in class $C$  with respect to library $L$ is:
+If $C$ declares a concrete instance getter (respectively setter) named $m$  that is accessible to $L$,  then that getter (respectively setter) is the result of the lookup. Otherwise, if $C$ has a superclass $S$, then the result of the lookup is the result of looking up getter (respectively setter) $m$ in $S$ with respect to $L$. Otherwise, we say that the lookup has failed.
+
+\rationale {
+The motivation for skipping abstract members during lookup is largely to allow smoother mixin composition. 
+}
+
+
+\subsection{Top level Getter Invocation}
+\label{topLevelGetterInvocation}
+
+Evaluation of a top-level getter invocation $i$ of the form $m$, where $m$ is an identifier, proceeds as follows:
+
+The getter function $m$ is invoked. The value of $i$ is the result returned by the call to the getter function.
+\commentary{
+Note that the invocation is always defined. Per the rules for identifier references, an identifier will not be treated as a top-level getter invocation unless the getter $i$ is defined. 
+}
+
+The static type of $i$ is the declared return type of $m$.
 
 \subsection{ Method Invocation}
 \label{methodInvocation}
@@ -3229,17 +3179,7 @@
 
 An ordinary method invocation $i$ has the form 
 
-$o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ where $o$ is not the name of a class or a library prefix.
-
-Method invocation involves method lookup, defined next.
-The result of a lookup of a method $m$ in object $o$ with respect to library $L$ is the result of  a lookup of method $m$ in class $C$ with respect to library $L$, where $C$ is the class of $o$.
-
-The result of  a lookup of method $m$ in class $C$ with respect to library $L$ is:
-If $C$ declares a concrete instance method named $m$ that is accessible to $L$,  then that method is the result of the lookup. Otherwise, if $C$ has a superclass $S$, then the result of the lookup is the result of looking up $m$  in $S$ with respect to $L$. Otherwise, we say that the method lookup has failed.
-
-\rationale {
-The motivation for skipping abstract members during lookup is largely to allow smoother mixin composition. 
-}
+$o.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
 
 Evaluation of an ordinary method invocation $i$ of the form 
 
@@ -3247,7 +3187,7 @@
 
 proceeds as follows:
 
-First, the expression $o$ is evaluated to a value $v_o$. Next, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $f$ be the result of looking up method $m$  in $v_o$ with respect to the current library $L$. 
+First, the expression $o$ is evaluated to a value $v_o$. Next, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated yielding actual argument objects $o_1, \ldots , o_{n+k}$. Let $f$ be the result of looking up (\ref{methodLookup}) method $m$  in $v_o$ with respect to the current library $L$. 
 
 Let $p_1 \ldots p_h$ be the required parameters of $f$,  let $p_1 \ldots p_m$ be the positional parameters of $f$ and let $p_{h+1}, \ldots, p_{h+l}$ be the optional parameters declared by $f$.
 
@@ -3255,11 +3195,13 @@
 We have an argument list consisting of $n$ positional arguments and $k$ named arguments. We have a function with $h$ required parameters and $l$ optional parameters. The number of positional arguments must be at least as large as the number of required parameters, and no larger than the number of positional parameters. All named arguments must have a corresponding named parameter. 
 }
 
-If  $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n+1 \le i \le n+k$,  must have a corresponding named parameter in the set $\{p_{m+1}, \ldots, p_{h+l}\}$ or the method lookup also fails.  Otherwise method lookup has succeeded.
+If  $n < h$, or $n > m$, the method lookup has failed. Furthermore, each $x_i, n+1 \le i \le n+k$,  must have a corresponding named parameter in the set $\{p_{m+1}, \ldots, p_{h+l}\}$ or the method lookup also fails.  If $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, then if $m$ is a method that forwards (\ref{functionDeclarations}) to a static method, method lookup fails. Otherwise method lookup has succeeded.
 
 If the method lookup succeeded, the body of $f$ is executed with respect to the bindings that resulted from the evaluation of the argument list, and with \THIS{} bound to $v_o$. The value of $i$ is the value returned after $f$ is executed.
 
-If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $v_o$ with respect to $L$. If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $o.m$. Then the value of $i$ is the result of invoking 
+If the method lookup has failed, then let $g$ be the result of looking up getter (\ref{getterAndSetterLookup}) $m$ in $v_o$ with respect to $L$. 
+f $v_o$ is an instance of \code{Type} but $o$ is not a constant type literal, then if $g$ is a getter that forwards to a static getter, getter lookup fails.
+If the getter lookup succeeded, let $v_g$ be the value of the getter invocation $o.m$. Then the value of $i$ is the result of invoking 
 the static method \code{Function.apply()} with arguments $v.g, [o_1, \ldots , o_n], \{x_{n+1}: o_{n+1}, \ldots , x_{n+k}: o_{n+k}\}$.
 
 If  getter lookup has also failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
@@ -3270,12 +3212,12 @@
 \item \code{im.namedArguments} evaluates to an immutable map with the same keys and values as \code{\{$x_{n+1}: o_{n+1}, \ldots, x_{n+k} : o_{n+k}$\}}.
 \end{itemize}
 
-Then the method \code{noSuchMethod()} is looked up in $o$ and invoked with argument $im$, and the result of this invocation is the result of evaluating $i$. However, if the implementation found cannot be invoked with a single positional argument, the implementation  of \code{noSuchMethod()} in class \code{Object} is invoked on $o$ with argument $im'$, where $im'$ is an instance of \code{Invocation} such that :
+Then the method \code{noSuchMethod()} is looked up in $v_o$ and invoked with argument $im$, and the result of this invocation is the result of evaluating $i$. However, if the implementation found cannot be invoked with a single positional argument, the implementation  of \code{noSuchMethod()} in class \code{Object} is invoked on $v_o$ with argument $im'$, where $im'$ is an instance of \code{Invocation} such that :
 \begin{itemize}
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
 \item  \code{im.memberName} evaluates to \code{noSuchMethod'}.
 \item \code{im.positionalArguments} evaluates to an immutable list whose sole element is  $im$.
-\item \code{im.namedArguments} evaluates to an empty immutable map.
+\item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
 and the result of the latter invocation is the result of evaluating $i$.
@@ -3293,13 +3235,16 @@
 
 \commentary{Notice that the wording carefully avoids re-evaluating the receiver $o$ and the arguments $a_i$. }
 
-Let $T$ be the  static type of $o$. It is a static type warning if $T$ does not have an accessible  (\ref{privacy}) instance member named $m$ unless $T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}.   If $T.m$ exists, it  is a static type warning if the type $F$ of $T.m$ may not be assigned to a function type. If $T.m$ does not exist, or if $F$ is not a function type, the static type of $i$ is \DYNAMIC{}; otherwise the static type of $i$ is the declared return type of  $F$.  
-% The following is not needed because it is specified in 'Binding Actuals to Formals" Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static warning if $F$ is not a supertype of  $(T_1, \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \to \bot$.
+Let $T$ be the  static type of $o$. It is a static type warning if $T$ does not have an accessible  (\ref{privacy}) instance member named $m$ unless  either:
+\begin{itemize}
+\item
+$T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}.  Or
+\item  $T$ is \code{Type}, $e$ is a constant type literal and the class corresponding to $e$ has a static getter named $m$.
+\end{itemize}
 
+If $T.m$ exists, it  is a static type warning if the type $F$ of $T.m$ may not be assigned to a function type. If $T.m$ does not exist, or if $F$ is not a function type, the static type of $i$ is \DYNAMIC{}; otherwise the static type of $i$ is the declared return type of  $F$.  
 
-
-%\subsubsection{This Invocation}
-% Maybe this has no significance the way the language is set up?
+It is a compile-time error to invoke any of the methods of class \cd{Object} on a prefix object (\ref{imports}) or on a constant type literal that is  immediately followed by the token `.'.
 
 
 \subsubsection{Cascaded Invocations}
@@ -3320,46 +3265,6 @@
 
 A cascaded method invocation expression of the form {\em e..suffix} is equivalent to the expression \code{(t)\{t.{\em suffix}; \RETURN{} t;\}($e$)}.
 
-\subsubsection{Static Invocation}
-\label{staticInvocation}
-
-A static method invocation $i$ has the form 
-
-$C.m(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ 
-
-where $C$ denotes a class in the current scope.
-
-It is a static warning if $C$ does not declare a static method or getter $m$.
-
-\rationale{
-Note that the absence of $C.m$ is statically detectable. Nevertheless, we choose not to define this situation as an error.  The goal is to allow coding to proceed in the order that suits the developer rather than eagerly insisting on consistency. The warnings are given statically at compile-time to help developers catch errors. However, developers need not correct these problems immediately in order to make progress.
-}
-
-\commentary{
-Note the requirement that $C$ {\em declare} the method. This means that static methods declared in superclasses of $C$ cannot be invoked via $C$.
-}
-
-
-Evaluation of $i$ proceeds as follows:
-
-If $C$ is a deferred type  (\ref{staticTypes}) with prefix $p$, and $p$ has not been successfully loaded, or
-if $C$ does not declare a static method or getter $m$ then the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated, after which a \code{NoSuchMethodError} is thrown. 
-
-Otherwise, evaluation proceeds as follows:
-\begin{itemize}
-\item
-If the member $m$ declared by $C$ is a getter, then $i$ is equivalent to the expression $(C.m)(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$. 
-\item Otherwise, let $f$ be the the method $m$ declared in class $C$. Next, the argument list $(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$ is evaluated.
-The body of $f$ is then executed with respect to the bindings that resulted from the evaluation of the argument list. The value of $i$ is the value returned after the body of $f$ is executed.
-\end{itemize}
-
-It is a static type warning if the type $F$ of $C.m$ may not be assigned to a function type.  If $F$ is not a function type, or if $C.m$ does not exist, the static type of $i$ is \DYNAMIC{}. Otherwise 
-the static type of $i$ is the declared return type of  $F$.  
-% The following is not needed because it is specified in 'Binding Actuals to Formals"Let $T_i$ be the static type of $a_i, i \in 1 .. n+k$. It is a static warning if $F$ is not a supertype of  $(T_1, \ldots, T_n, \{T_{n+1}$ $x_{n+1}, \ldots, T_{n+k}$ $x_{n+k}\}) \to \bot$.
-
- 
-
-
 \subsubsection{Super Invocation}
 \label{superInvocation}
 
@@ -3391,7 +3296,7 @@
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
 \item  \code{im.memberName} evaluates to \code{noSuchMethod}.
 \item \code{im.positionalArguments} evaluates to an immutable list whose sole element is  $im$.
-\item \code{im.namedArguments} evaluates to an empty immutable map.
+\item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
 and the result of this latter invocation is the result of evaluating $i$.
@@ -3416,27 +3321,22 @@
 }
 
 
-\subsection{ Getter and Setter Lookup}
-\label{getterAndSetterLookup}
 
-The result of a lookup of a getter (respectively setter) $m$ in object $o$  with respect  to  library $L$ is the result of looking up getter (respectively setter) $m$ in class $C$ with respect to $L$, where $C$ is the class of $o$.
+\subsection{ Property Extraction}
+\label{propertyExtraction}
 
-The result of a lookup of a getter (respectively setter) $m$ in class $C$  with respect to library $L$ is:
-If $C$ declares a concrete instance getter (respectively setter) named $m$  that is accessible to $L$,  then that getter (respectively setter) is the result of the lookup. Otherwise, if $C$ has a superclass $S$, then the result of the lookup is the result of looking up getter (respectively setter) $m$ in $S$ with respect to $L$. Otherwise, we say that the lookup has failed.
+{\em Property extraction} allows for a member of an object to be concisely extracted from the object.
+A property extraction can be either:
+\begin{enumerate}
+\item A {\em closurization} (\ref{closurization}) which allows a method to be treated as if it were a getter for a function valued object. Or
+\item A {\em getter invocation} which returns the result of invoking of a getter method.
+\end{enumerate}
 
-\rationale {
-The motivation for skipping abstract members during lookup is largely to allow smoother mixin composition. 
-}
+Evaluation of a property extraction $i$ of the form $e.m$ proceeds as follows:
 
-\subsection{ Getter Invocation}
-\label{getterInvocation}
+First, the expression $e$ is evaluated to an object $o$. Let $f$ be the result of looking up (\ref{methodLookup}) method  (\ref{instanceMethods}) $m$ in $o$ with respect to the current library $L$.  If $o$ is an instance of \code{Type} but $e$ is not a constant type literal, then if $m$ is a method that forwards (\ref{functionDeclarations}) to a static method,  method lookup fails. If method lookup succeeds and $f$ is a concrete method then $i$ evaluates to the closurization of $o.m$.  
 
-A getter invocation provides access to the value of a property.
-
-Evaluation of a getter invocation $i$ of the form $e.m$ proceeds as follows:
-
-First, the expression $e$ is evaluated to an object $o$. Then, the getter function (\ref{getters}) $m$ is looked up (\ref{getterAndSetterLookup}) in $o$  with respect to  the current library, and its body is executed with \THIS{} bound to $o$.  The value of the getter invocation expression is the result returned by the call to the getter function. 
-
+Otherwise, $i$ is a getter invocation, and the getter function (\ref{getters}) $m$ is looked up (\ref{getterAndSetterLookup}) in $o$  with respect to $L$. If $o$ is an instance of \code{Type} but $e$ is not a constant type literal, then if $m$ is a getter that forwards  to a static getter,  getter lookup fails. Otherwise, the body of $m$ is executed with \THIS{} bound to $o$.  The value of $i$ is the result returned by the call to the getter function. 
 
 If the getter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
@@ -3450,32 +3350,38 @@
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
 \item  \code{im.memberName} evaluates to \code{noSuchMethod}.
 \item \code{im.positionalArguments} evaluates to an immutable list whose sole element is  $im$.
-\item \code{im.namedArguments} evaluates to an empty immutable map.
+\item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
 and the result of this latter invocation is the result of evaluating $i$.
 
-Let $T$ be the  static type of $e$. It is a static type warning if $T$ does not have a getter named $m$ unless $T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}. The static type of $i$ is the declared return type of $T.m$, if $T.m$ exists; otherwise the static type of $i$  is  \DYNAMIC{}. 
+It is a compile-time error if $m$ is a member of class \cd{Object} and $e$ is either a prefix object (\ref{imports}) or a constant type literal.
 
-Evaluation of a getter invocation $i$ of the form $C.m$ proceeds as follows:
-
-If  there is no class $C$ in the enclosing lexical scope of $i$, or if  $C$ does not declare, implicitly or explicitly, a getter named $m$, then a \code{NoSuchMethodError} is thrown. 
-Otherwise, the getter function $C.m$ is invoked. The value of $i$ is the result returned by the call to the getter function. 
-
-It is a static warning  if there is no class $C$ in the enclosing lexical scope of $i$, or if  $C$ does not declare, implicitly or explicitly, a getter named $m$. The static type of $i$ is the declared return type of $C.m$ if it exists or \DYNAMIC{} otherwise. 
-
-Evaluation of a top-level getter invocation $i$ of the form $m$, where $m$ is an identifier, proceeds as follows:
-
-The getter function $m$ is invoked. The value of $i$ is the result returned by the call to the getter function.
-\commentary{
-Note that the invocation is always defined. Per the rules for identifier references, an identifier will not be treated as a top-level getter invocation unless the getter $i$ is defined. 
+\commentary {
+This precludes \code{int.toString} but not \code{(int).toString} because in the latter case, $e$ is a parenthesized expression.
 }
 
-The static type of $i$ is the declared return type of $m$.
+Let $T$ be the  static type of $e$. It is a static type warning if $T$ does not have a method or getter named $m$ unless either:
+\begin{itemize}
+\item
+$T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}.  Or
+\item  $T$ is \code{Type}, $e$ is a constant type literal and the class corresponding to $e$ has a static method or getter named $m$.
+\end{itemize}
 
-Evaluation of super getter invocation $i$ of the form $\SUPER{}.m$ proceeds as follows:
+If $i$ is a getter invocation, the static type of $i$ is:
+\begin{itemize}
+\item The declared return type of $T.m$, if $T.m$ exists.
+\item The declared return type of $m$, if  $T$ is \code{Type}, $e$ is a constant type literal and the class corresponding to $e$ has a static method or getter named $m$.
+\item  The type \DYNAMIC{} otherwise.  
+\end{itemize}
 
-Let $S$ be the superclass of the immediately enclosing class. The getter function (\ref{getters}) $m$ is looked up (\ref{getterAndSetterLookup}) in $S$  with respect to  the current library, and its body is executed with \THIS{} bound to the current value of  \THIS{}.  The value of the getter invocation expression is the result returned by the call to the getter function. 
+If $i$ is a closurization, its static type is as described in section \ref{closurization}.
+
+Evaluation of a property extraction $i$ of the form $\SUPER.m$ proceeds as follows:
+
+ Let $S$ be the superclass of the immediately enclosing class. Let $f$ be the result of looking up method $m$ in $S$ with respect to the current library $L$.  If $f$ is a concrete method then $i$ evaluates to the closurization of $\SUPER.m$ with respect to superclass $S$(\ref{closurization}).  
+ 
+ Otherwise, $i$ is a getter invocation and the getter function $m$ is looked up in $S$  with respect to $L$, and its body is executed with \THIS{} bound to the current value of  \THIS{}.  The value of $i$ is the result returned by the call to the getter function. 
 
 If the getter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
@@ -3489,22 +3395,96 @@
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
 \item  \code{im.memberName} evaluates to \code{noSuchMethod}.
 \item \code{im.positionalArguments} evaluates to an immutable list whose sole element is  $im$.
-\item \code{im.namedArguments} evaluates to an empty immutable map.
+\item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
 and the result of this latter invocation is the result of evaluating $i$.
 
-It is a static type warning if $S$ does not have a getter named $m$.  The static type of $i$ is the declared return type of $S.m$, if $S.m$ exists; otherwise the static type of $i$  is  \DYNAMIC{}. 
-
-Evaluation of a getter invocation of the form $p.C.v$, where $p$ is a deferred prefix, proceeds as follows:
-
-If $p$ has been successfully loaded, the assignment is evaluated exactly like the invocation $K.v$, where $K$ denotes the top level member $C$ of the library represented by $p$. Otherwise a \code{NoSuchMethodError} is thrown.
+It is a static type warning if $S$ does not have a method or getter named $m$.  If $i$ is a getter invocation, the static type of $i$ is the declared return type of $S.m$, if $S.m$ exists and  \DYNAMIC{} otherwise. If $i$ is a closurization, its static type is as described in section \ref{closurization}.
 
 
-Evaluation of a top-level getter invocation $i$ of the form $p.m$, where $p$ is a deferred prefix and  $m$ is an identifier, proceeds as follows:
+\subsubsection{Closurization}
+\label{closurization}
 
-If $p$ has been successfully loaded, the invocation is evaluated exactly like the invocation $w$, where $w$ denotes the top level member named $m$ of the library represented by $p$. Otherwise a \code{NoSuchMethodError} is thrown.
+The {\em closurization of $o.m$} is defined to be equivalent to:
+
+\begin{itemize}
+
+\item  
+\begin{dartCode}
+$(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$ \{
+  \RETURN{} $ u.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k);$
+\} 
+\end{dartCode}
+
+if $m$ has required parameters $r_1, \ldots, r_n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
+\item 
+\begin{dartCode}
+$(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{
+  \RETURN{} $u.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$;
+\}
+\end{dartCode}
+
+if $m$ has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
+\end{itemize}
+
+where $u$ is a fresh final variable bound to $o$, except that:
+\begin{enumerate}
+\item  Iff  \code{identical($o_1, o_2$)}  then \cd{$o_1.m$ == $o_2.m$}.
+\item The static type of the property extraction is the static type of function $T.m$, where $T$ is the static type of $e$, if $T.m$ is defined. Otherwise the static type of $e.m$ is \DYNAMIC{}.
+\end{enumerate}
+
+\commentary{
+There is no guarantee that \cd{identical($o_1.m, o_2.m$)}. Dart implementations are not required to canonicalize these or any other closures.
+}
+% local functions that have a closure extracted are always different
+
+\rationale{
+The special treatment of equality in this case facilitates the use of extracted property functions in APIs where callbacks such as event listeners must often be registered and later unregistered. A common example is the DOM API in web browsers.
+}
+
+
+
+
+\commentary{Observations:
+\begin{enumerate}
+\item One cannot closurize a getter or a setter.
+\item One can tell whether one implemented a property via a method or via field/getter, which means that one has to plan ahead as to what construct to use, and that choice is reflected in the interface of the class.
+\end{enumerate}
+} 
+
+
  
+The closurization of $\SUPER{}.m$ with respect to superclass $S$ is defined to be equivalent to:
+
+\begin{itemize}
+ %\item $(r_1, \ldots, r_n)\{\RETURN{}$ $o.m(r_1, \ldots, r_n);\}$ if $m$ has only required parameters $r_1, \ldots r_n$.
+%\item $(r_1, \ldots, r_n, rest)\{return$  $o.m(r_1, \ldots, r_n, rest);\}$ if $m$ has required parameters $r_1, \ldots r_n$, and a rest parameter $rest$.
+%\item
+\item  
+\begin{dartCode}
+$(r_1, \ldots, r_n, \{p_1 : d_1, \ldots , p_k : d_k\})$\{
+   \RETURN{} \SUPER{}$.m(r_1, \ldots, r_n, p_1: p_1, \ldots, p_k: p_k)$;
+\}
+\end{dartCode}
+
+if $m$ has required parameters $r_1, \ldots, r_n$, and named parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
+\item 
+\begin{dartCode}
+$(r_1, \ldots, r_n, [p_1 = d_1, \ldots , p_k = d_k])$\{
+   \RETURN{} \SUPER{}$.m(r_1, \ldots, r_n, p_1, \ldots, p_k)$;
+\} 
+\end{dartCode}
+
+if $m$ has required parameters $r_1, \ldots, r_n$, and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
+\end{itemize}
+
+Except that:
+\begin{enumerate}
+\item  iff  \code{identical($o_1, o_2$)}  then \cd{$o_1.m$ == $o_2.m$}.
+\item 
+The static type of the property extraction is the static type of the method $S.m$,  if $S.m$ is defined. Otherwise the static type of $\SUPER{}.m$ is \DYNAMIC{}.
+\end{enumerate}
 
 
 \subsection{ Assignment}
@@ -3546,27 +3526,9 @@
 
 It is a static type warning if the static type of $e$ may not be assigned to the static type of $v$. The static type of the expression $v$ \code{=} $e$ is the static type of $e$.
 
-Evaluation of an assignment of the form $C.v$ \code{=} $e$ proceeds as follows:
-
-If $C$ does not denote a class available in the current scope, the assignment is treated as an assignment  $e_1.v= e$, where $e_1$ is the expression $C$. Otherwise, 
-the expression $e$ is evaluated to an object $o$.  
-If 
-%there is no class $C$ in the enclosing lexical scope of the assignment, or if 
-$C$ does not declare, implicitly or explicitly, a setter $v=$, then a \code{NoSuchMethodError} is thrown. Otherwise, the setter $C.v=$ is invoked with its formal parameter bound to $o$. The value of the assignment expression is $o$. 
-
-It is a static warning if 
-% there is no class $C$ in the enclosing lexical scope of the assignment, or if 
-$C$ does not declare, implicitly or explicitly, a setter $v=$.
-
-%\commentary{As of this writing, implementations treat the above situation as a compile-time error.}
-
-In checked mode, it is a dynamic type error if $o$ is not \NULL{} and the interface of the class of $o$ is not a subtype of the declared static type of $C.v$.
-
-It is a static type warning if the static type of $e$ may not be assigned to the static type of $C.v$.  The static type of the expression $C.v$ \code{=} $e$ is the static type of $e$.
-
 Evaluation of an assignment of the form $e_1.v$ \code{=} $e_2$ proceeds as follows:
 
-The expression $e_1$ is evaluated to an object $o_1$. Then, the expression $e_2$  is evaluated to an object $o_2$. Then, the setter $v=$ is looked up (\ref{getterAndSetterLookup}) in $o_1$ with respect to the current library, and its body is executed with its formal parameter bound to $o_2$ and \THIS{} bound to $o_1$. 
+The expression $e_1$ is evaluated to an object $o_1$. Then, the expression $e_2$  is evaluated to an object $o_2$. Then, the setter $v=$ is looked up (\ref{getterAndSetterLookup}) in $o_1$ with respect to the current library.  If $o_1$ is an instance of \code{Type} but $e_1$ is not a constant type literal, then if $v=$ is a setter that forwards (\ref{functionDeclarations}) to a static setter, setter lookup fails. Otherwise, the body  of $v=$ is executed with its formal parameter bound to $o_2$ and \THIS{} bound to $o_1$. 
 
 If the setter lookup has failed, then a new instance $im$  of the predefined class  \code{Invocation}  is created, such that :
 \begin{itemize}
@@ -3582,22 +3544,22 @@
 \item  \code{im.isMethod} evaluates to \code{\TRUE{}}.
 \item  \code{im.memberName} evaluates to \code{noSuchMethod}.
 \item \code{im.positionalArguments} evaluates to an immutable list whose sole element is  $im$.
-\item \code{im.namedArguments} evaluates to an empty immutable map.
+\item \code{im.namedArguments} evaluates to the value of \code{\CONST{} \{\}}.
 \end{itemize}
 
 The value of the assignment expression is $o_2$ irrespective of whether setter lookup has failed or succeeded.
 
-Evaluation of an assignment of the form $p.v \code{=} e$, where $p$ is a deferred prefix, proceeds as follows:
-
-If $p$ has been successfully loaded, the assignment is evaluated exactly like the assignment $w \code{=} e$, where $w$ denotes the top level member named $v$ of the library represented by $p$. Otherwise, $e$ is evaluated and then a \code{NoSuchMethodError} is thrown.
-
-Evaluation of an assignment of the form $p.C.v \code{=} e$, where $p$ is a deferred prefix, proceeds as follows:
-
-If $p$ has been successfully loaded, the assignment is evaluated exactly like the assignment $K.v = e$, where $K$ denotes the top level member $C$ of the library represented by $p$. Otherwise $e$ is evaluated and then a \code{NoSuchMethodError} is thrown.
-
 In checked mode, it is a dynamic type error if $o_2$ is not \NULL{} and the interface of the class of $o_2$ is not a subtype of the actual type of $e_1.v$.
 
-Let $T$ be the static type of $e_1$. It is a static type warning if $T$ does not have an accessible instance setter named $v=$ unless $T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}. It is a static type warning if the static type of $e_2$ may not be assigned to $T$.   The static type of the expression $e_1v$ \code{=} $e_2$ is the static type of $e_2$.
+Let $T$ be the static type of $e_1$. It is a static type warning if $T$ does not have an accessible instance setter named $v=$ unless either:
+\begin{itemize}
+\item $T$ or a superinterface of $T$ is annotated with an annotation denoting a constant identical to the constant \code{@proxy} defined in \code{dart:core}. Or
+\item $T$ is \code{Type}, $e_1$ is a constant type literal and the class corresponding to $e_1$ has a static setter named $v=$. 
+\end{itemize}
+
+
+
+It is a static type warning if the static type of $e_2$ may not be assigned to $T$.   The static type of the expression $e_1v$ \code{=} $e_2$ is the static type of $e_2$.
 
 Evaluation of an assignment of the form $e_1[e_2]$ \code{=} $e_3$ is equivalent to the evaluation of the expression \code{(a, i, e)\{a.[]=(i, e); \RETURN{} e; \} ($e_1, e_2, e_3$)}.  The static type of the expression $e_1[e_2]$ \code{=} $e_3$ is the static type of $e_3$.
 
@@ -3605,13 +3567,15 @@
 
 It is as static warning if an assignment of the form $v = e$ occurs inside a top level or static function (be it function, method, getter, or setter) or variable initializer and there is neither a local variable declaration with name $v$  nor setter declaration with name $v=$ in the lexical scope enclosing the assignment.
 
+It is a compile-time error to invoke any of the setters of class \cd{Object} on a prefix object (\ref{imports}) or on a constant type literal that is  immediately followed by the token `.'.
+
 
 
 \subsubsection{Compound Assignment}
 \label{compoundAssignment}
 
 A compound assignment of the form $v$ $op\code{=} e$ is equivalent to $v \code{=} v$ $op$ $e$. A compound assignment of the form $C.v$ $op \code{=} e$ is equivalent to $C.v \code{=} C.v$ $op$ $e$. A compound assignment of the form $e_1.v$ $op = e_2$ is equivalent to \code{((x) $=>$ x.v = x.v $op$ $e_2$)($e_1$)} where $x$ is a variable that is not used in $e_2$. A compound assignment of the form  $e_1[e_2]$ $op\code{=} e_3$ is equivalent to 
-\code{((a, i) $=>$ a[i] = a[i] $op$ $e_3$)($e_1, e_2$)} where $a$ and $i$ are a variables that are not used in $e_3$. A compound assignment of the form $p.v$ $op\code{=} e$, where $p$ is a deferred prefix,  is equivalent to $p.v \code{=} p.v$ $op$ $e$. A compound assignment of the form $p.C.v$ $op\code{=} e$, where $p$ is a deferred prefix,  is equivalent to $p.C.v \code{=} p.C.v$ $op$ $e$.
+\code{((a, i) $=>$ a[i] = a[i] $op$ $e_3$)($e_1, e_2$)} where $a$ and $i$ are a variables that are not used in $e_3$. 
 
 
 \begin{grammar}
@@ -4020,11 +3984,11 @@
 
 %An assignable expression of the form $e.id(a_1, \ldots, a_n)$ is evaluated as a method invocation (\ref{methodInvocation}).
 
-An assignable expression of the form $e.id$ is evaluated as a getter invocation  (\ref{getterInvocation}).
+An assignable expression of the form $e.id$ is evaluated as a property extraction  (\ref{propertyExtraction}).
 
 An assignable expression of the form \code{$e_1$[$e_2$]} is evaluated as a method invocation of the operator method \code{[]} on $e_1$ with argument $e_2$.
 
-An assignable expression of the form \code{\SUPER{}.id}  is evaluated as a getter invocation.
+An assignable expression of the form \code{\SUPER{}.id}  is evaluated as a property extraction.
 
 An assignable expression of the form \code{\SUPER{}[$e_2$]} is equivalent to the method invocation  \code{\SUPER{}.[]($e_2$)}.
 
@@ -4089,7 +4053,7 @@
       . 
 \end{grammar}
 
-A built-in identifier is one of the identifiers produced by the production {\em BUILT\_IN\_IDENTIFIER}. It is a compile-time error if a built-in identifier is used as the declared name of a class, type parameter or type alias. It is a compile-time error to use a built-in identifier other than \DYNAMIC{} as a type annotation.
+A built-in identifier is one of the identifiers produced by the production {\em BUILT\_IN\_IDENTIFIER}. It is a compile-time error if a built-in identifier is used as the declared name of a prefix, class, type parameter or type alias. It is a compile-time error to use a built-in identifier other than \DYNAMIC{} as a type annotation.
 
 \rationale{
 Built-in identifiers are identifiers that are used as keywords in Dart, but are not reserved words in Javascript. To minimize incompatibilities when porting Javascript code to Dart, we do not make these into reserved words. A built-in identifier may not be used to name a class or type. In other words, they are treated as reserved words when used as types.  This eliminates many confusing situations without causing compatibility problems. After all, a Javascript program has no type declarations or annotations so no clash can occur.  Furthermore, types should begin with an uppercase letter (see the appendix) and so no clash should occur in any Dart user program anyway.
@@ -4102,7 +4066,8 @@
 %If no such member exists, let $d$ be the declaration of the static member name $id$ declared in a superclass of the current class, if it exists.
 
 \begin{itemize}
-\item If $d$ is a class or type alias $T$, the value of $e$ is an instance of class \code{Type} reifying $T$.
+\item if $d$ is a prefix $p$, a compile-time error occurs unless the token immediately following $d$ is \code{'.'}.
+\item If $d$ is a class or type alias $T$, the value of $e$ is an instance of  class \code{Type} (or a subclass thereof) reifying $T$.
 \item If $d$ is a type parameter $T$, then the value of $e$ is the value of the actual type argument corresponding to $T$ that was  passed to the generative constructor that created the current binding of \THIS{}. If, however, $e$ occurs inside a static member, a compile-time error occurs.
 
 %\commentary{ We are assured that \THIS{} is well defined, because if we were in a static member the reference to $T$ is a compile-time error (\ref{generics}.)}
@@ -4116,8 +4081,8 @@
 \item If $d$ is a local variable or formal parameter then $e$ evaluates to the current binding of $id$. 
 %\item If $d$ is a library variable, local variable, or formal parameter, then $e$ evaluates to the current binding of $id$. \commentary{This case also applies if d is a library or local function declaration, as these are equivalent to function-valued variable declarations.}
 \item If $d$ is a static method, top-level function or local function then $e$ evaluates to the function defined by $d$.
-\item If $d$ is the declaration of a static variable, static getter or static setter declared in class $C$, then $e$ is equivalent to the getter invocation (\ref{getterInvocation}) $C.id$. 
-\item If $d$ is the declaration of a library variable, top-level getter or top-level setter, then $e$ is equivalent to the getter invocation $id$. 
+\item If $d$ is the declaration of a static variable, static getter or static setter declared in class $C$, then $e$ is equivalent to the property extraction (\ref{propertyExtraction}) $C.id$. 
+\item If $d$ is the declaration of a library variable, top-level getter or top-level setter, then $e$ is equivalent to the top level getter invocation (\ref{topLevelGetterInvocation}) $id$. 
 \item Otherwise, if $e$ occurs inside a top level or static function (be it function, method, getter,  or setter) or variable initializer, evaluation of $e$ causes a \code{NoSuchMethod} to be thrown.
 \item Otherwise, $e$ is equivalent to the property extraction (\ref{propertyExtraction}) \THIS{}.$id$.
 % This implies that referring to an undefined static getter by simple name is an error, whereas doing so by qualified name is only a warning. Same with assignments.  Revise?
@@ -4129,8 +4094,8 @@
 \item If $d$ is a class, type alias or type parameter the static type of $e$ is \code{Type}.
 \item If $d$ is a local variable or formal parameter the static type of $e$ is the type of the variable $id$, unless $id$ is known to have some type $T$, in which case the static type of $e$ is $T$, provided that $T$ is more specific than any other type $S$ such that $v$ is known to have type $S$. 
 \item If $d$ is a static method, top-level function or local function the static type of $e$ is the function type defined by $d$.
-\item If $d$ is the declaration of a static variable, static getter or static setter declared in class $C$, the static type of $e$ is the static type of the getter invocation (\ref{getterInvocation}) $C.id$.
-\item If $d$ is the declaration of a library variable, top-level getter or top-level setter, the static type of $e$  is the static type of the getter invocation $id$. 
+\item If $d$ is the declaration of a static variable, static getter or static setter declared in class $C$, the static type of $e$ is the static type of the getter invocation (\ref{propertyExtraction}) $C.id$.
+\item If $d$ is the declaration of a library variable, top-level getter or top-level setter, the static type of $e$  is the static type of the top level getter invocation $id$. 
 \item Otherwise, if $e$ occurs inside a top level or static function (be it function, method, getter,  or setter) or variable initializer, the static type of $e$ is \DYNAMIC{}.
 \item Otherwise, the static type of $e$ is the type of the property extraction (\ref{propertyExtraction}) \THIS{}.$id$.
 \end{itemize}
@@ -5129,17 +5094,18 @@
 
 Let $I$ be an import directive that refers to a URI via the string $s_1$. Evaluation of $I$  proceeds as follows:
 
-If $I$ is a deferred import, no evaluation takes place. Instead, the following names are added to the scope of $L$:
-\begin{itemize}
-\item
-The name of the prefix, $p$ denoting a deferred prefix declaration.
-\item
-The name \code{$p$.loadLibrary}, denoting a top level function with no arguments, whose semantics are described below.
-\end{itemize}
- 
-A deferred prefix $p$ may be loaded explicitly via the function call \code{$p$.loadLibrary}, which returns a future $f$. The effect of the call is to cause an immediate import $IÕ$ to be executed at some future time, where $IÕ$ is is derived from $I$ by eliding the word \DEFERRED{} and adding a \HIDE{} \code{loadLibrary}  combinator clause. When $IÕ$ executes without error, $f$ completes successfully. If $IÕ$ executes without error, we say that the call to \code{$p$.loadLibrary} has succeeded, otherwise we say the call has failed.
+If $I$ is a deferred import, no evaluation takes place. Instead, an mapping the name of the prefix, $p$ to a {\em deferred prefix object} is added to the scope of $L$.
+The deferred prefix object has the following methods:
 
-After a call succeeds, the names $p$ and \code{$p$.loadLibrary} remain in the top-level scope of $L$, and so it is possible to call \code{loadLibrary} again. If a call fails, nothing happens, and one again has the option to call \code{loadLibrary} again. Whether a repeated call to \code{loadLibrary} succeeds will vary as described below.
+\begin{itemize}
+\item \code{loadLibrary}. This method returns a future $f$. When called, the method causes an immediate import $IÕ$ to be executed at some future time, where $IÕ$ is is derived from $I$ by eliding the word \DEFERRED{} and adding a \HIDE{} \code{loadLibrary}  combinator clause. When $IÕ$ executes without error, $f$ completes successfully. If $IÕ$ executes without error, we say that the call to \code{loadLibrary} has succeeded, otherwise we say the call has failed.
+\item  For every top level function $f$ named $id$ in $L$, a corresponding method named $id$ with the same signature as $f$. Calling the method results in a runtime error.
+\item For every top level getter $g$ named $id$ in $L$, a corresponding getter named $id$ with the same signature as $g$.  Calling the method results in a runtime error.
+\item For every top level setter $s$ named $id$ in $L$, a corresponding setter named $id$ with the same signature as $s$.  Calling the method results in a runtime error.
+\item For every type $T$ named $id$ in $L$, a corresponding getter named $id$ with return type \code{Type}.  Calling the method results in a runtime error.
+\end{itemize}
+
+After a call succeeds, the name $p$ is mapped to a non-deferred prefix object as described below. In addition, the prefix object also supports the \code{loadLibrary} method, and so it is possible to call \code{loadLibrary} again. If a call fails, nothing happens, and one again has the option to call \code{loadLibrary} again. Whether a repeated call to \code{loadLibrary} succeeds will vary as described below.
 
 The effect of a repeated call to \code{$p$.loadLibrary} is as follows:
 \begin{itemize}
@@ -5191,7 +5157,16 @@
 where $hide(l, n)$ takes a list of identfiers $l$ and a namespace $n$, and produces a namespace that is identical to $n$ except that for each name $k$ in $l$, $k$ and $k=$ are undefined. 
 \end{itemize}
  
-Next, if $I$ includes a prefix clause of the form \AS{} $p$, let $NS =  prefix(p, NS_n)$ where $prefix(id, n)$, takes an identifier $id$ and produces a namespace that has, for each entry mapping key $k$ to declaration $d$ in $n$,  an entry mapping $id.k$ to $d$. Otherwise, let $NS = NS_n$.
+Next, if $I$ includes a prefix clause of the form \AS{} $p$, let $NS =  NS_n \cup \{p: prefixObject(NS_n)\}$ where $prefixObject(NS_n)$ is a {\em prefix object} for the namespace $NS_n$, which is an object that has the following members:
+
+\begin{itemize}
+\item  For every top level function $f$ named $id$ in $NS_n$, a corresponding method with the same name and signature as $f$ that forwards  (\ref{functionDeclarations}) to $f$.
+\item For every top level getter  with the same name and signature as $g$ named $id$ in $NS_n$, a corresponding getter  that forwards to $g$.
+\item For every top level setter $s$  with the same name and signature as named $id$ in $NS_n$, a corresponding setter  that forwards to  $s$.
+\item For every type $T$ named $id$ in $NS_n$, a corresponding getter named $id$ with return type \code{Type}, that, when invoked, returns the type object for $T$.
+\end{itemize}
+
+Otherwise, let $NS = NS_n$.
 It is a compile-time error if the current library declares a top-level member named $p$.
 
 % This is problematic, because it implies that p.T would be available even in a scope that declared p. We really need to think of p as a single object with properties p.T etc., except it isn't really that
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 285e82f..995de16 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -56,13 +56,18 @@
   @override
   void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) {
     AnalysisContext context = analysisServer.folderMap[contextFolder];
-    context.applyChanges(changeSet);
-    analysisServer.schedulePerformAnalysisOperation(context);
+    if (context != null) {
+      context.applyChanges(changeSet);
+      analysisServer.schedulePerformAnalysisOperation(context);
+    }
   }
 
   @override
   void removeContext(Folder folder) {
-    analysisServer.folderMap.remove(folder);
+    AnalysisContext context = analysisServer.folderMap.remove(folder);
+    analysisServer.sendContextAnalysisCancelledNotifications(
+        context,
+        'Context was removed');
   }
 
   @override
@@ -572,11 +577,16 @@
   }
 
   /**
-   * Returns all the [AnalysisErrorInfo] for [file].
-   * It does not wait for all errors to be computed, and returns just the
-   * current state.
+   * Return an analysis error info containing the array of all of the errors and
+   * the line info associated with [file].
    *
-   * May return `null`.
+   * Returns `null` if [file] does not belong to any [AnalysisContext].
+   *
+   * The array of errors will be empty if [file] does not exist or if there are
+   * no errors in [file]. The errors contained in the array can be incomplete.
+   *
+   * This method does not wait for all errors to be computed, and returns just
+   * the current state.
    */
   AnalysisErrorInfo getErrors(String file) {
     // prepare AnalysisContext
@@ -643,12 +653,6 @@
    *
    * 2. We should complete the future as soon as the file is analyzed (not wait
    *    until the context is completely finished)
-   *
-   * 3. Since contexts can be created and deleted asynchronously as a result of
-   *    changes to the filesystem, there's a danger that the future might never
-   *    get completed. We should add a mechanism to make sure that we return an
-   *    error for any getErrors request that is unsatisfiable due to its context
-   *    being deleted.
    */
   Future onFileAnalysisComplete(String file) {
     // prepare AnalysisContext
@@ -672,13 +676,24 @@
    * done.
    */
   void sendContextAnalysisDoneNotifications(AnalysisContext context) {
-    Completer completer = contextAnalysisDoneCompleters[context];
+    Completer completer = contextAnalysisDoneCompleters.remove(context);
     if (completer != null) {
       completer.complete();
     }
   }
 
   /**
+   * This method is called when analysis of the given [AnalysisContext] is
+   * cancelled.
+   */
+  void sendContextAnalysisCancelledNotifications(AnalysisContext context, String message) {
+    Completer completer = contextAnalysisDoneCompleters.remove(context);
+    if (completer != null) {
+      completer.completeError(message);
+    }
+  }
+
+  /**
    * Return the [CompilationUnit] of the Dart file with the given [path].
    * Return `null` if the file is not a part of any context.
    */
diff --git a/pkg/analysis_server/lib/src/computer/error.dart b/pkg/analysis_server/lib/src/computer/error.dart
index 5db2e2a..21960c5 100644
--- a/pkg/analysis_server/lib/src/computer/error.dart
+++ b/pkg/analysis_server/lib/src/computer/error.dart
@@ -7,11 +7,31 @@
 import 'package:analysis_server/src/computer/element.dart';
 import 'package:analysis_services/constants.dart';
 import 'package:analysis_services/json.dart';
+import 'package:analyzer/src/generated/engine.dart' as engine;
 import 'package:analyzer/src/generated/error.dart' as engine;
 import 'package:analyzer/src/generated/source.dart' as engine;
 
 
 /**
+ * Returns a JSON correponding to the given list of Engine errors.
+ */
+List<Map<String, Object>> engineErrorInfoToJson(engine.AnalysisErrorInfo info) {
+  return engineErrorsToJson(info.lineInfo, info.errors);
+}
+
+
+/**
+ * Returns a JSON correponding to the given list of Engine errors.
+ */
+List<Map<String, Object>> engineErrorsToJson(engine.LineInfo lineInfo,
+    List<engine.AnalysisError> errors) {
+  return errors.map((engine.AnalysisError error) {
+    return new AnalysisError.fromEngine(lineInfo, error).toJson();
+  }).toList();
+}
+
+
+/**
  * An indication of an error, warning, or hint that was produced by the
  * analysis. 
  */
@@ -49,7 +69,7 @@
     String severity = errorCode.errorSeverity.toString();
     String type = errorCode.type.toString();
     String message = error.message;
-    String correction = errorCode.correction;
+    String correction = error.correction;
     return new AnalysisError(severity, type, location, message, correction);
   }
 
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index ef166c8..0b4019b 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -8,13 +8,13 @@
 
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/computer/computer_hover.dart';
+import 'package:analysis_server/src/computer/error.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_services/constants.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/error.dart';
+
 
 /**
  * Instances of the class [AnalysisDomainHandler] implement a [RequestHandler]
@@ -42,11 +42,18 @@
       if (errorInfo == null) {
         response.setResult(ERRORS, []);
       } else {
-        response.setResult(ERRORS, errorInfo.errors.map((AnalysisError error) {
-          return errorToJson(errorInfo.lineInfo, error);
-        }).toList());
+        response.setResult(ERRORS, engineErrorInfoToJson(errorInfo));
       }
       server.sendResponse(response);
+    }).catchError((message) {
+      if (message is! String) {
+        AnalysisEngine.instance.logger.logError(
+            'Illegal error message during getErrors: $message');
+        message = '';
+      }
+      Response response = new Response.getErrorsError(request, message);
+      response.setResult(ERRORS, []);
+      server.sendResponse(response);
     });
     // delay response
     return Response.DELAYED_RESPONSE;
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index 68a3dbc..8bcc01c 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -95,7 +95,7 @@
       engine.AnalysisErrorInfo errorInfo = server.getErrors(file);
       if (errorInfo != null) {
         for (engine.AnalysisError error in errorInfo.errors) {
-          List<Fix> fixes = computeFixes(searchEngine, file, unit, error);
+          List<Fix> fixes = computeFixes(searchEngine, unit, error);
           if (fixes.isNotEmpty) {
             AnalysisError serverError =
                 new AnalysisError.fromEngine(errorInfo.lineInfo, error);
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index c4ccdc2..914d5d5 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -20,47 +20,16 @@
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/html.dart';
 import 'package:analyzer/src/generated/source.dart';
-
-
-Map<String, Object> errorToJson(LineInfo lineInfo, AnalysisError analysisError)
-    {
-  ErrorCode errorCode = analysisError.errorCode;
-  // prepare location
-  int offset = analysisError.offset;
-  Map<String, Object> location = {
-    FILE: analysisError.source.fullName,
-    OFFSET: offset,
-    LENGTH: analysisError.length
-  };
-  if (lineInfo != null) {
-    LineInfo_Location lineLocation = lineInfo.getLocation(offset);
-    if (lineLocation != null) {
-      location[START_LINE] = lineLocation.lineNumber;
-      location[START_COLUMN] = lineLocation.columnNumber;
-    }
-  }
-  // fill JSON
-  Map<String, Object> result = {
-    // TODO(scheglov) add Enum.fullName ?
-    SEVERITY: errorCode.errorSeverity.name,
-    TYPE: errorCode.type.name,
-    LOCATION: location,
-    MESSAGE: analysisError.message
-  };
-  if (analysisError.correction != null) {
-    result[CORRECTION] = analysisError.correction;
-  }
-  return result;
-}
+import 'package:analysis_server/src/computer/error.dart' as server_prefix;
 
 
 void sendAnalysisNotificationErrors(AnalysisServer server, String file,
     LineInfo lineInfo, List<AnalysisError> errors) {
   Notification notification = new Notification(ANALYSIS_ERRORS);
   notification.setParameter(FILE, file);
-  notification.setParameter(ERRORS, errors.map((error) {
-    return errorToJson(lineInfo, error);
-  }).toList());
+  notification.setParameter(
+      ERRORS,
+      server_prefix.engineErrorsToJson(lineInfo, errors));
   server.sendNotification(notification);
 }
 
@@ -69,8 +38,9 @@
     CompilationUnit dartUnit) {
   Notification notification = new Notification(ANALYSIS_HIGHLIGHTS);
   notification.setParameter(FILE, file);
-  notification.setParameter(REGIONS, new DartUnitHighlightsComputer(
-      dartUnit).compute());
+  notification.setParameter(
+      REGIONS,
+      new DartUnitHighlightsComputer(dartUnit).compute());
   server.sendNotification(notification);
 }
 
@@ -79,8 +49,9 @@
     CompilationUnit dartUnit) {
   Notification notification = new Notification(ANALYSIS_NAVIGATION);
   notification.setParameter(FILE, file);
-  notification.setParameter(REGIONS, new DartUnitNavigationComputer(
-      dartUnit).compute());
+  notification.setParameter(
+      REGIONS,
+      new DartUnitNavigationComputer(dartUnit).compute());
   server.sendNotification(notification);
 }
 
@@ -89,8 +60,9 @@
     CompilationUnit dartUnit) {
   Notification notification = new Notification(ANALYSIS_OCCURRENCES);
   notification.setParameter(FILE, file);
-  notification.setParameter(OCCURRENCES, new DartUnitOccurrencesComputer(
-      dartUnit).compute());
+  notification.setParameter(
+      OCCURRENCES,
+      new DartUnitOccurrencesComputer(dartUnit).compute());
   server.sendNotification(notification);
 }
 
@@ -99,18 +71,20 @@
     AnalysisContext context, Source source, CompilationUnit dartUnit) {
   Notification notification = new Notification(ANALYSIS_OUTLINE);
   notification.setParameter(FILE, source.fullName);
-  notification.setParameter(OUTLINE, new DartUnitOutlineComputer(context,
-      source, dartUnit).compute());
+  notification.setParameter(
+      OUTLINE,
+      new DartUnitOutlineComputer(context, source, dartUnit).compute());
   server.sendNotification(notification);
 }
 
 
-void sendAnalysisNotificationOverrides(AnalysisServer server,
-    String file, CompilationUnit dartUnit) {
+void sendAnalysisNotificationOverrides(AnalysisServer server, String file,
+    CompilationUnit dartUnit) {
   Notification notification = new Notification(ANALYSIS_OVERRIDES);
   notification.setParameter(FILE, file);
-  notification.setParameter(OVERRIDES, new DartUnitOverridesComputer(
-      dartUnit).compute());
+  notification.setParameter(
+      OVERRIDES,
+      new DartUnitOverridesComputer(dartUnit).compute());
   server.sendNotification(notification);
 }
 
@@ -186,7 +160,10 @@
       }
       // TODO(scheglov) use default subscriptions
       if (!source.isInSystemLibrary) {
-        sendAnalysisNotificationErrors(server, file, notice.lineInfo,
+        sendAnalysisNotificationErrors(
+            server,
+            file,
+            notice.lineInfo,
             notice.errors);
       }
     }
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
index fdfdba9..f275001 100644
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ b/pkg/analysis_server/lib/src/protocol.dart
@@ -586,6 +586,15 @@
     : this(request.id, new RequestError(-12, 'Unknown analysis option: "$optionName"'));
 
   /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by an error during `analysis.getErrors`.
+   */
+  Response.getErrorsError(Request request, String message)
+    : this(
+        request.id,
+        new RequestError(-13, 'Error during `analysis.getErrors`: $message.'));
+
+  /**
    * Initialize a newly created instance based upon the given JSON data
    */
   factory Response.fromJson(Map<String, Object> json) {
@@ -705,6 +714,11 @@
    */
   static const int CODE_SDK_ERROR = -32603;
 
+  /**
+   * An error code indicating a problem during 'analysis.getErrors'.
+   */
+  static const int CODE_ANALISYS_GET_ERRORS_ERROR = -32500;
+
   /*
    * In addition, codes -32000 to -32099 indicate a server error. They are
    * reserved for implementation-defined server-errors.
diff --git a/pkg/analysis_server/test/analysis/get_errors_test.dart b/pkg/analysis_server/test/analysis/get_errors_test.dart
index 2c261e5..0ca901f 100644
--- a/pkg/analysis_server/test/analysis/get_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/get_errors_test.dart
@@ -12,44 +12,21 @@
 import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_services/constants.dart';
 import 'package:analysis_testing/reflective_tests.dart';
+import 'package:analyzer/file_system/file_system.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
 
 
 main() {
-  group('notification.hover', () {
-    runReflectiveTests(GetErrorsTest);
-  });
+  groupSep = ' | ';
+  runReflectiveTests(GetErrorsTest);
 }
 
 
 @ReflectiveTestCase()
 class GetErrorsTest extends AbstractAnalysisTest {
-  Future<List<AnalysisError>> getErrors() {
-    return getErrorsForFile(testFile);
-  }
-
-  Future<List<AnalysisError>> getErrorsForFile(String file) {
-    return waitForTasksFinished().then((_) {
-      String requestId = 'test-getError';
-      // send the Request
-      Request request = new Request(requestId, ANALYSIS_GET_ERRORS);
-      request.setParameter(FILE, file);
-      server.handleRequest(request);
-      // wait for the Response
-      waitForResponse() {
-        for (Response response in serverChannel.responsesReceived) {
-          if (response.id == requestId) {
-            List errorsJsons = response.getResult(ERRORS);
-            return errorsJsons.map(AnalysisError.fromJson).toList();
-          }
-        }
-        return new Future(waitForResponse);
-      }
-      return new Future(waitForResponse);
-    });
-  }
+  static const String requestId = 'test-getError';
 
   @override
   void setUp() {
@@ -58,13 +35,45 @@
     createProject();
   }
 
+  test_afterAnalysisComplete() {
+    addTestFile('''
+main() {
+  print(42)
+}
+''');
+    return waitForTasksFinished().then((_) {
+      return _getErrors(testFile).then((List<AnalysisError> errors) {
+        expect(errors, hasLength(1));
+      });
+    });
+  }
+
+  test_fileDoesNotExist() {
+    String file = '$projectPath/doesNotExist.dart';
+    return _getErrors(file).then((List<AnalysisError> errors) {
+      expect(errors, isEmpty);
+    });
+  }
+
+  test_fileWithoutContext() {
+    String file = '/outside.dart';
+    addFile(file, '''
+main() {
+  print(42);
+}
+''');
+    return _getErrors(file).then((List<AnalysisError> errors) {
+      expect(errors, isEmpty);
+    });
+  }
+
   test_hasErrors() {
     addTestFile('''
 main() {
   print(42)
 }
 ''');
-    return getErrors().then((List<AnalysisError> errors) {
+    return _getErrors(testFile).then((List<AnalysisError> errors) {
       expect(errors, hasLength(1));
       {
         AnalysisError error = errors[0];
@@ -82,20 +91,45 @@
   print(42);
 }
 ''');
-    return getErrors().then((List<AnalysisError> errors) {
+    return _getErrors(testFile).then((List<AnalysisError> errors) {
       expect(errors, isEmpty);
     });
   }
 
-  test_fileWithoutContext() {
-    String file = '/outside.dart';
-    addFile(file, '''
+  test_removeContextAfterRequest() {
+    addTestFile('''
 main() {
-  print(42);
+  print(42)
 }
 ''');
-    return getErrorsForFile(file).then((List<AnalysisError> errors) {
-      expect(errors, isEmpty);
+    // handle the request synchronously
+    Request request = _createGetErrorsRequest();
+    server.handleRequest(request);
+    // remove context, causes sending a 'cancelled' error
+    {
+      Folder projectFolder = resourceProvider.getResource(projectPath);
+      server.contextDirectoryManager.removeContext(projectFolder);
+    }
+    // wait for an error response
+    return serverChannel.waitForResponse(request).then((Response response) {
+      expect(response.getResult(ERRORS), isEmpty);
+      RequestError error = response.error;
+      expect(error, isNotNull);
+      expect(error.code, -13);
+    });
+  }
+
+  Request _createGetErrorsRequest() {
+    Request request = new Request(requestId, ANALYSIS_GET_ERRORS);
+    request.setParameter(FILE, testFile);
+    return request;
+  }
+
+  Future<List<AnalysisError>> _getErrors(String file) {
+    Request request = _createGetErrorsRequest();
+    return serverChannel.sendRequest(request).then((Response response) {
+      List errorsJsons = response.getResult(ERRORS);
+      return errorsJsons.map(AnalysisError.fromJson).toList();
     });
   }
 }
diff --git a/pkg/analysis_server/test/analysis_hover_test.dart b/pkg/analysis_server/test/analysis_hover_test.dart
index 1b53eb2..5a3f28d 100644
--- a/pkg/analysis_server/test/analysis_hover_test.dart
+++ b/pkg/analysis_server/test/analysis_hover_test.dart
@@ -17,9 +17,8 @@
 
 
 main() {
-  group('notification.hover', () {
-    runReflectiveTests(AnalysisHoverTest);
-  });
+  groupSep = ' | ';
+  runReflectiveTests(AnalysisHoverTest);
 }
 
 
diff --git a/pkg/analysis_server/test/analysis_notification_highlights_test.dart b/pkg/analysis_server/test/analysis_notification_highlights_test.dart
index 0d2a202..3029716d 100644
--- a/pkg/analysis_server/test/analysis_notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis_notification_highlights_test.dart
@@ -18,12 +18,8 @@
 
 
 main() {
-  group('notification.highlights', () {
-    runReflectiveTests(AnalysisNotificationHighlightsTest);
-  });
-  group('HighlightType', () {
-    runReflectiveTests(HighlightTypeTest);
-  });
+  runReflectiveTests(AnalysisNotificationHighlightsTest);
+  runReflectiveTests(HighlightTypeTest);
 }
 
 
diff --git a/pkg/analysis_server/test/analysis_notification_navigation_test.dart b/pkg/analysis_server/test/analysis_notification_navigation_test.dart
index df89aea..ffc041e 100644
--- a/pkg/analysis_server/test/analysis_notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis_notification_navigation_test.dart
@@ -18,9 +18,7 @@
 
 
 main() {
-  group('notification.navigation', () {
-    runReflectiveTests(AnalysisNotificationNavigationTest);
-  });
+  runReflectiveTests(AnalysisNotificationNavigationTest);
 }
 
 
diff --git a/pkg/analysis_server/test/analysis_notification_occurrences_test.dart b/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
index 46dd37f..8507050 100644
--- a/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
+++ b/pkg/analysis_server/test/analysis_notification_occurrences_test.dart
@@ -19,9 +19,8 @@
 
 
 main() {
-  group('notification.occurrences', () {
-    runReflectiveTests(AnalysisNotificationOccurrencesTest);
-  });
+  groupSep = ' | ';
+  runReflectiveTests(AnalysisNotificationOccurrencesTest);
 }
 
 
diff --git a/pkg/analysis_server/test/analysis_notification_outline_test.dart b/pkg/analysis_server/test/analysis_notification_outline_test.dart
index f8909d4..a2bf49e 100644
--- a/pkg/analysis_server/test/analysis_notification_outline_test.dart
+++ b/pkg/analysis_server/test/analysis_notification_outline_test.dart
@@ -19,9 +19,7 @@
 
 
 main() {
-  group('notification.outline', () {
-    runReflectiveTests(_AnalysisNotificationOutlineTest);
-  });
+  runReflectiveTests(_AnalysisNotificationOutlineTest);
 }
 
 
diff --git a/pkg/analysis_server/test/analysis_notification_overrides_test.dart b/pkg/analysis_server/test/analysis_notification_overrides_test.dart
index 34888f0..5e59269 100644
--- a/pkg/analysis_server/test/analysis_notification_overrides_test.dart
+++ b/pkg/analysis_server/test/analysis_notification_overrides_test.dart
@@ -19,9 +19,8 @@
 
 
 main() {
-  group('notification.overrides', () {
-    runReflectiveTests(AnalysisNotificationOverridesTest);
-  });
+  groupSep = ' | ';
+  runReflectiveTests(AnalysisNotificationOverridesTest);
 }
 
 
diff --git a/pkg/analysis_server/test/completion_test.dart b/pkg/analysis_server/test/completion_test.dart
index a78605c..477cecf 100644
--- a/pkg/analysis_server/test/completion_test.dart
+++ b/pkg/analysis_server/test/completion_test.dart
@@ -19,9 +19,8 @@
 import 'analysis_abstract.dart';
 
 main() {
-  group('completion', () {
-    runReflectiveTests(CompletionTest);
-  });
+  groupSep = ' | ';
+  runReflectiveTests(CompletionTest);
 }
 
 @ReflectiveTestCase()
diff --git a/pkg/analysis_server/test/computer/element_test.dart b/pkg/analysis_server/test/computer/element_test.dart
index 9dfb2c5..8a71396 100644
--- a/pkg/analysis_server/test/computer/element_test.dart
+++ b/pkg/analysis_server/test/computer/element_test.dart
@@ -18,12 +18,8 @@
 
 main() {
   groupSep = ' | ';
-  group('Element', () {
-    runReflectiveTests(ElementTest);
-  });
-  group('ElementKind', () {
-    runReflectiveTests(ElementKindTest);
-  });
+  runReflectiveTests(ElementTest);
+  runReflectiveTests(ElementKindTest);
 }
 
 
diff --git a/pkg/analysis_server/test/computer/error_test.dart b/pkg/analysis_server/test/computer/error_test.dart
index 10848ba..57fa21f 100644
--- a/pkg/analysis_server/test/computer/error_test.dart
+++ b/pkg/analysis_server/test/computer/error_test.dart
@@ -7,54 +7,101 @@
 import 'package:analysis_server/src/computer/element.dart';
 import 'package:analysis_server/src/computer/error.dart';
 import 'package:analysis_services/constants.dart';
-import 'package:analysis_testing/abstract_single_unit.dart';
+import 'package:analysis_testing/mocks.dart';
 import 'package:analysis_testing/reflective_tests.dart';
-import 'package:analyzer/src/generated/element.dart' as engine;
-import 'package:analyzer/src/generated/engine.dart' as engine;
 import 'package:analyzer/src/generated/error.dart' as engine;
-import 'package:analyzer/src/generated/utilities_dart.dart' as engine;
+import 'package:analyzer/src/generated/source.dart';
+import 'package:typed_mock/typed_mock.dart';
 import 'package:unittest/unittest.dart';
 
 
 
 main() {
   groupSep = ' | ';
-  group('AnalysisError', () {
-    runReflectiveTests(AnalysisErrorTest);
-  });
+  runReflectiveTests(AnalysisErrorTest);
+}
+
+
+class AnalysisErrorMock extends TypedMock implements engine.AnalysisError {
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
 
 @ReflectiveTestCase()
-class AnalysisErrorTest extends AbstractSingleUnitTest {
-  void test_fromEngine() {
-    verifyNoTestUnitErrors = false;
-    resolveTestUnit('''
-main() {
-  print(42)
-}
-''');
-    engine.AnalysisErrorInfo errors = context.getErrors(testSource);
-    engine.AnalysisError engineError = errors.errors[0];
-    AnalysisError error =
-        new AnalysisError.fromEngine(errors.lineInfo, engineError);
-    {
-      Location location = error.location;
-      expect(location.file, testFile);
-      expect(location.offset, 19);
-      expect(location.length, 1);
-      expect(location.startLine, 2);
-      expect(location.startColumn, 11);
-    }
-    expect(error.message, "Expected to find ';'");
-    expect(error.severity, "ERROR");
-    expect(error.type, "SYNTACTIC_ERROR");
-    expect(
-        error.toString(),
-        'AnalysisError(location=Location(file=/test.dart; offset=19; '
-            'length=1; startLine=2; startColumn=11) '
-            'message=Expected to find \';\'; severity=ERROR; '
-            'type=SYNTACTIC_ERROR; correction=null');
+class AnalysisErrorTest {
+  Source source = new MockSource();
+  LineInfo lineInfo;
+  engine.AnalysisError engineError = new AnalysisErrorMock();
+
+  void setUp() {
+    // prepare Source
+    when(source.fullName).thenReturn('foo.dart');
+    // prepare LineInfo
+    lineInfo = new LineInfo([0, 5, 9, 20]);
+    // prepare AnalysisError
+    when(engineError.source).thenReturn(source);
+    when(
+        engineError.errorCode).thenReturn(engine.CompileTimeErrorCode.AMBIGUOUS_EXPORT);
+    when(engineError.message).thenReturn('my message');
+    when(engineError.offset).thenReturn(10);
+    when(engineError.length).thenReturn(20);
+  }
+
+  void tearDown() {
+    source = null;
+    engineError = null;
+  }
+
+  void test_fromEngine_hasCorrection() {
+    when(engineError.correction).thenReturn('my correction');
+    AnalysisError error = new AnalysisError.fromEngine(lineInfo, engineError);
+    expect(error.toJson(), {
+      SEVERITY: 'ERROR',
+      TYPE: 'COMPILE_TIME_ERROR',
+      LOCATION: {
+        FILE: 'foo.dart',
+        OFFSET: 10,
+        LENGTH: 20,
+        START_LINE: 3,
+        START_COLUMN: 2
+      },
+      MESSAGE: 'my message',
+      CORRECTION: 'my correction'
+    });
+  }
+
+  void test_fromEngine_noCorrection() {
+    when(engineError.correction).thenReturn(null);
+    AnalysisError error = new AnalysisError.fromEngine(lineInfo, engineError);
+    expect(error.toJson(), {
+      SEVERITY: 'ERROR',
+      TYPE: 'COMPILE_TIME_ERROR',
+      LOCATION: {
+        FILE: 'foo.dart',
+        OFFSET: 10,
+        LENGTH: 20,
+        START_LINE: 3,
+        START_COLUMN: 2
+      },
+      MESSAGE: 'my message'
+    });
+  }
+
+  void test_fromEngine_noLineInfo() {
+    when(engineError.correction).thenReturn(null);
+    AnalysisError error = new AnalysisError.fromEngine(null, engineError);
+    expect(error.toJson(), {
+      SEVERITY: 'ERROR',
+      TYPE: 'COMPILE_TIME_ERROR',
+      LOCATION: {
+        FILE: 'foo.dart',
+        OFFSET: 10,
+        LENGTH: 20,
+        START_LINE: -1,
+        START_COLUMN: -1
+      },
+      MESSAGE: 'my message'
+    });
   }
 
   void test_fromJson() {
@@ -68,44 +115,37 @@
         START_LINE: 2,
         START_COLUMN: 11
       },
-      MESSAGE: 'Expected to find \';\''
+      MESSAGE: 'Expected to find \';\'',
+      CORRECTION: 'my correction'
     };
     AnalysisError error = AnalysisError.fromJson(json);
     {
       Location location = error.location;
-      expect(location.file, testFile);
+      expect(location.file, '/test.dart');
       expect(location.offset, 19);
       expect(location.length, 1);
       expect(location.startLine, 2);
       expect(location.startColumn, 11);
     }
     expect(error.message, "Expected to find ';'");
-    expect(error.severity, "ERROR");
-    expect(error.type, "SYNTACTIC_ERROR");
+    expect(error.severity, 'ERROR');
+    expect(error.type, 'SYNTACTIC_ERROR');
+    expect(error.correction, "my correction");
   }
 
-  void test_toJson() {
-    verifyNoTestUnitErrors = false;
-    resolveTestUnit('''
-main() {
-  print(42)
-}
-''');
-    engine.AnalysisErrorInfo errors = context.getErrors(testSource);
-    engine.AnalysisError engineError = errors.errors[0];
-    AnalysisError error =
-        new AnalysisError.fromEngine(errors.lineInfo, engineError);
-    expect(error.toJson(), {
-      SEVERITY: 'ERROR',
-      TYPE: 'SYNTACTIC_ERROR',
-      LOCATION: {
-        FILE: '/test.dart',
-        OFFSET: 19,
-        LENGTH: 1,
-        START_LINE: 2,
-        START_COLUMN: 11
-      },
-      MESSAGE: 'Expected to find \';\''
-    });
+  void test_engineErrorsToJson() {
+    var json = engineErrorsToJson(lineInfo, [engineError]);
+    expect(json, unorderedEquals([{
+        'severity': 'ERROR',
+        'type': 'COMPILE_TIME_ERROR',
+        'location': {
+          'file': 'foo.dart',
+          'offset': 10,
+          'length': 20,
+          'startLine': 3,
+          'startColumn': 2
+        },
+        'message': 'my message'
+      }]));
   }
 }
diff --git a/pkg/analysis_server/test/edit/fix_test.dart b/pkg/analysis_server/test/edit/fix_test.dart
index 879efcf..20ce526 100644
--- a/pkg/analysis_server/test/edit/fix_test.dart
+++ b/pkg/analysis_server/test/edit/fix_test.dart
@@ -25,9 +25,7 @@
 
 main() {
   groupSep = ' | ';
-  group('ErrorFixes', () {
-    runReflectiveTests(ErrorFixesTest);
-  });
+  runReflectiveTests(ErrorFixesTest);
 }
 
 
@@ -119,7 +117,7 @@
     engine.AnalysisErrorInfo errors = context.getErrors(testSource);
     engine.AnalysisError engineError = errors.errors[0];
     List<services.Fix> servicesFixes =
-        services.computeFixes(searchEngine, testFile, testUnit, engineError);
+        services.computeFixes(searchEngine, testUnit, engineError);
     AnalysisError error =
         new AnalysisError.fromEngine(errors.lineInfo, engineError);
     ErrorFixes fixes = new ErrorFixes(error);
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index 2a8a96e..a27dd4a 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -22,9 +22,7 @@
 
 main() {
   groupSep = ' | ';
-  group('getFixes', () {
-    runReflectiveTests(FixesTest);
-  });
+  runReflectiveTests(FixesTest);
 }
 
 
diff --git a/pkg/analysis_server/test/integration/completion_domain_inttest.dart b/pkg/analysis_server/test/integration/completion_domain_inttest.dart
new file mode 100644
index 0000000..574d390
--- /dev/null
+++ b/pkg/analysis_server/test/integration/completion_domain_inttest.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2014, 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 test.integration.completion.domain;
+
+import 'dart:async';
+
+import 'package:analysis_server/src/constants.dart';
+import 'package:analysis_testing/reflective_tests.dart';
+import 'package:unittest/unittest.dart';
+
+import 'integration_tests.dart';
+
+@ReflectiveTestCase()
+class CompletionDomainIntegrationTest extends
+    AbstractAnalysisServerIntegrationTest {
+  fail_test_getSuggestions_string_var() {
+    // See dartbug.com/20188
+    String filename = 'test.dart';
+    String pathname = normalizePath(filename);
+    String text =
+        r'''
+var test = '';
+main() {
+  test.
+}
+''';
+    writeFile(filename, text);
+    setAnalysisRoots(['']);
+
+    return analysisFinished.then((_) {
+      return server.send(COMPLETION_GET_SUGGESTIONS, {
+        'file': pathname,
+        'offset': text.indexOf('test.') + 'test.'.length
+      }).then((result) {
+        // Since the feature doesn't work yet, just pause for a second to
+        // collect the output of the analysis server, and then stop the test.
+        // TODO(paulberry): finish writing the integration test once the feature
+        // it more complete.
+        return new Future.delayed(new Duration(seconds: 1), () {
+          fail('test not completed yet');
+        });
+      });
+    });
+  }
+}
+
+main() {
+  runReflectiveTests(CompletionDomainIntegrationTest);
+}
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index de0af37..af863fd 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -146,11 +146,12 @@
 // Matchers common to all domains
 // ------------------------------
 
-const Matcher isResultResponse = const MatchesJsonObject('result response',
+const Matcher isResponse = const MatchesJsonObject('response',
     const {
   'id': isString
 }, optionalFields: const {
-  'result': anything
+  'result': anything,
+  'error': isError
 });
 
 const Matcher isError = const MatchesJsonObject('Error', const {
@@ -166,12 +167,6 @@
   'data': anything
 });
 
-const Matcher isErrorResponse = const MatchesJsonObject('error response', const
-    {
-  'id': isString,
-  'error': isError
-});
-
 const Matcher isNotification = const MatchesJsonObject('notification', const {
   'event': isString
 }, optionalFields: const {
@@ -476,6 +471,12 @@
    */
   bool _debuggingStdio = false;
 
+  /**
+   * True if we've received bad data from the server, and we are aborting the
+   * test.
+   */
+  bool _receivedBadDataFromServer = false;
+
   Server._(this._process);
 
   /**
@@ -499,13 +500,29 @@
    * with "--debug", allowing a debugger to be attached.
    */
   static Future<Server> start({bool debugServer: false}) {
+    // TODO(paulberry): move the logic for finding the script, the dart
+    // executable, and the package root into a shell script.
     String dartBinary = Platform.executable;
-    String serverPath = normalize(join(dirname(Platform.script.path), '..',
+    String scriptDir = dirname(Platform.script.path);
+    String serverPath = normalize(join(scriptDir, '..',
         '..', 'bin', 'server.dart'));
+    String repoPath = normalize(join(scriptDir, '..', '..', '..', '..'));
+    String buildDirName;
+    if (Platform.isWindows) {
+      buildDirName = 'build';
+    } else if (Platform.isMacOS){
+      buildDirName = 'xcodebuild';
+    } else {
+      buildDirName = 'out';
+    }
+    String dartConfiguration = 'ReleaseIA32'; // TODO(paulberry): this is a guess
+    String buildPath = join(repoPath, buildDirName, dartConfiguration);
+    String packageRoot = join(buildPath, 'packages');
     List<String> arguments = [];
     if (debugServer) {
       arguments.add('--debug');
     }
+    arguments.add('--package-root=$packageRoot');
     arguments.add(serverPath);
     return Process.start(dartBinary, arguments).then((Process process) {
       Server server = new Server._(process);
@@ -513,7 +530,13 @@
           new LineSplitter()).listen((String line) {
         String trimmedLine = line.trim();
         server._recordStdio('RECV: $trimmedLine');
-        var message = JSON.decoder.convert(trimmedLine);
+        var message;
+        try {
+          message = JSON.decoder.convert(trimmedLine);
+        } catch (exception) {
+          server._badDataFromServer();
+          return;
+        }
         expect(message, isMap);
         Map messageAsMap = message;
         if (messageAsMap.containsKey('id')) {
@@ -529,17 +552,13 @@
             // TODO(paulberry): propagate the error info to the completer.
             completer.completeError(new UnimplementedError(
                 'Server responded with an error'));
-            // Check that the message is well-formed.  We do this after calling
-            // completer.completeError() so that we don't stall the test in the
-            // event of an error.
-            expect(message, isErrorResponse);
           } else {
             completer.complete(messageAsMap['result']);
-            // Check that the message is well-formed.  We do this after calling
-            // completer.complete() so that we don't stall the test in the
-            // event of an error.
-            expect(message, isResultResponse);
           }
+          // Check that the message is well-formed.  We do this after calling
+          // completer.complete() or completer.completeError() so that we don't
+          // stall the test in the event of an error.
+          expect(message, isResponse);
         } else {
           // Message is a notification.  It should have an event and possibly
           // params.
@@ -557,8 +576,11 @@
           expect(message, isNotification);
         }
       });
-      process.stderr.listen((List<int> data) {
-        fail('Unexpected output from stderr');
+      process.stderr.transform((new Utf8Codec()).decoder).transform(
+          new LineSplitter()).listen((String line) {
+        String trimmedLine = line.trim();
+        server._recordStdio('ERR:  $trimmedLine');
+        server._badDataFromServer();
       });
       return server;
     });
@@ -612,6 +634,26 @@
   }
 
   /**
+   * Deal with bad data received from the server.
+   */
+  void _badDataFromServer() {
+    if (_receivedBadDataFromServer) {
+      // We're already dealing with it.
+      return;
+    }
+    _receivedBadDataFromServer = true;
+    debugStdio();
+    // Give the server 1 second to continue outputting bad data before we kill
+    // the test.  This is helpful if the server has had an unhandled exception
+    // and is outputting a stacktrace, because it ensures that we see the
+    // entire stacktrace.  Use expectAsync() to prevent the test from
+    // ending during this 1 second.
+    new Future.delayed(new Duration(seconds: 1), expectAsync(() {
+      fail('Bad data received from server');
+    }));
+  }
+
+  /**
    * Record a message that was exchanged with the server, and print it out if
    * [debugStdio] has been called.
    */
diff --git a/pkg/analysis_server/test/integration/test_all.dart b/pkg/analysis_server/test/integration/test_all.dart
index 093bfed..74d5ee7 100644
--- a/pkg/analysis_server/test/integration/test_all.dart
+++ b/pkg/analysis_server/test/integration/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'analysis_domain_inttest.dart' as analysis_domain_inttest;
 import 'analysis_error_inttest.dart' as analysis_error_inttest;
+import 'completion_domain_inttest.dart' as completion_domain_inttest;
 import 'server_domain_inttest.dart' as server_domain_inttest;
 
 /**
@@ -16,6 +17,7 @@
   group('analysis_server_integration', () {
     analysis_domain_inttest.main();
     analysis_error_inttest.main();
+    completion_domain_inttest.main();
     server_domain_inttest.main();
   });
 }
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 917da7e..5eb4ad5 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -155,13 +155,9 @@
    * Simulate request/response pair.
    */
   Future<Response> sendRequest(Request request) {
-    var id = request.id;
     // Wrap send request in future to simulate websocket
     new Future(() => requestController.add(request));
-    pumpEventQueue().then((_) => responseController.addError(
-        new NoResponseException(request)));
-    return responseController.stream.firstWhere((response) => response.id == id
-        );
+    return waitForResponse(request);
   }
 
   @override
@@ -175,6 +171,16 @@
     expect(responsesReceived, hasLength(responseCount));
     expect(notificationsReceived, hasLength(notificationCount));
   }
+
+  Future<Response> waitForResponse(Request request) {
+    String id = request.id;
+    pumpEventQueue().then((_) {
+      responseController.addError(new NoResponseException(request));
+    });
+    return responseController.stream.firstWhere((response) {
+      return response.id == id;
+    });
+  }
 }
 
 /**
diff --git a/pkg/analysis_server/test/operation/operation_analysis_test.dart b/pkg/analysis_server/test/operation/operation_analysis_test.dart
deleted file mode 100644
index 0619238..0000000
--- a/pkg/analysis_server/test/operation/operation_analysis_test.dart
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2014, 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 test.operation.analysis;
-
-import 'package:analysis_server/src/operation/operation_analysis.dart';
-import 'package:analysis_services/constants.dart';
-import 'package:analysis_testing/mocks.dart';
-import 'package:analysis_testing/reflective_tests.dart';
-import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:typed_mock/typed_mock.dart';
-import 'package:unittest/unittest.dart';
-
-
-main() {
-  groupSep = ' | ';
-
-  group('errorToJson', () {
-    runReflectiveTests(Test_errorToJson);
-  });
-}
-
-
-class AnalysisErrorMock extends TypedMock implements AnalysisError {
-  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-
-@ReflectiveTestCase()
-class Test_errorToJson {
-  Source source = new MockSource();
-  LineInfo lineInfo;
-  AnalysisError analysisError = new AnalysisErrorMock();
-
-  void setUp() {
-    // prepare Source
-    when(source.fullName).thenReturn('foo.dart');
-    // prepare LineInfo
-    lineInfo = new LineInfo([0, 5, 9, 20]);
-    // prepare AnalysisError
-    when(analysisError.source).thenReturn(source);
-    when(analysisError.errorCode).thenReturn(
-        CompileTimeErrorCode.AMBIGUOUS_EXPORT);
-    when(analysisError.message).thenReturn('my message');
-    when(analysisError.offset).thenReturn(10);
-    when(analysisError.length).thenReturn(20);
-  }
-
-  void tearDown() {
-    source = null;
-    analysisError = null;
-  }
-
-  void test_noCorrection() {
-    Map<String, Object> json = errorToJson(lineInfo, analysisError);
-    expect(json, {
-      SEVERITY: 'ERROR',
-      TYPE: 'COMPILE_TIME_ERROR',
-      LOCATION: {
-        FILE: 'foo.dart',
-        OFFSET: 10,
-        LENGTH: 20,
-        START_LINE: 3,
-        START_COLUMN: 2
-      },
-      MESSAGE: 'my message'
-    });
-  }
-
-  void test_noLineInfo() {
-    Map<String, Object> json = errorToJson(null, analysisError);
-    expect(json, {
-      SEVERITY: 'ERROR',
-      TYPE: 'COMPILE_TIME_ERROR',
-      LOCATION: {
-        FILE: 'foo.dart',
-        OFFSET: 10,
-        LENGTH: 20
-      },
-      MESSAGE: 'my message'
-    });
-  }
-
-  void test_withCorrection() {
-    when(analysisError.correction).thenReturn('my correction');
-    Map<String, Object> json = errorToJson(lineInfo, analysisError);
-    expect(json, {
-      SEVERITY: 'ERROR',
-      TYPE: 'COMPILE_TIME_ERROR',
-      LOCATION: {
-        FILE: 'foo.dart',
-        OFFSET: 10,
-        LENGTH: 20,
-        START_LINE: 3,
-        START_COLUMN: 2
-      },
-      MESSAGE: 'my message',
-      CORRECTION: 'my correction'
-    });
-  }
-}
diff --git a/pkg/analysis_server/test/operation/test_all.dart b/pkg/analysis_server/test/operation/test_all.dart
index 4a0d39b..bada1e4 100644
--- a/pkg/analysis_server/test/operation/test_all.dart
+++ b/pkg/analysis_server/test/operation/test_all.dart
@@ -4,7 +4,6 @@
 
 import 'package:unittest/unittest.dart';
 
-import 'operation_analysis_test.dart' as analysis_operation_test;
 import 'operation_queue_test.dart' as operation_queue_test;
 import 'operation_test.dart' as operation_test;
 
@@ -14,7 +13,6 @@
 main() {
   groupSep = ' | ';
   group('operation', () {
-    analysis_operation_test.main();
     operation_queue_test.main();
     operation_test.main();
   });
diff --git a/pkg/analysis_server/test/package_uri_resolver_test.dart b/pkg/analysis_server/test/package_uri_resolver_test.dart
index d3ceebc..47b2f28 100644
--- a/pkg/analysis_server/test/package_uri_resolver_test.dart
+++ b/pkg/analysis_server/test/package_uri_resolver_test.dart
@@ -16,10 +16,7 @@
 
 main() {
   groupSep = ' | ';
-
-  group('PackageMapUriResolver', () {
-    runReflectiveTests(_PackageMapUriResolverTest);
-  });
+  runReflectiveTests(_PackageMapUriResolverTest);
 }
 
 
diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
index 8d69c6d..1e4c4dc 100644
--- a/pkg/analysis_server/test/protocol_test.dart
+++ b/pkg/analysis_server/test/protocol_test.dart
@@ -17,21 +17,11 @@
 
 main() {
   groupSep = ' | ';
-  group('Notification', () {
-    runReflectiveTests(NotificationTest);
-  });
-  group('Request', () {
-    runReflectiveTests(RequestTest);
-  });
-  group('RequestError', () {
-    runReflectiveTests(RequestErrorTest);
-  });
-  group('RequestDatum', () {
-    runReflectiveTests(RequestDatumTest);
-  });
-  group('Response', () {
-    runReflectiveTests(ResponseTest);
-  });
+  runReflectiveTests(NotificationTest);
+  runReflectiveTests(RequestTest);
+  runReflectiveTests(RequestErrorTest);
+  runReflectiveTests(RequestDatumTest);
+  runReflectiveTests(ResponseTest);
 }
 
 
diff --git a/pkg/analysis_server/test/search/element_references_test.dart b/pkg/analysis_server/test/search/element_references_test.dart
index 3d35469..a0902bc 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -19,9 +19,7 @@
 
 main() {
   groupSep = ' | ';
-  group('findElementReferences', () {
-    runReflectiveTests(ElementReferencesTest);
-  });
+  runReflectiveTests(ElementReferencesTest);
 }
 
 
diff --git a/pkg/analysis_server/test/search/member_declarations_test.dart b/pkg/analysis_server/test/search/member_declarations_test.dart
index 9f349a7..3ebda0f 100644
--- a/pkg/analysis_server/test/search/member_declarations_test.dart
+++ b/pkg/analysis_server/test/search/member_declarations_test.dart
@@ -19,9 +19,7 @@
 
 main() {
   groupSep = ' | ';
-  group('findMemberDeclarations', () {
-    runReflectiveTests(MemberDeclarationsTest);
-  });
+  runReflectiveTests(MemberDeclarationsTest);
 }
 
 
diff --git a/pkg/analysis_server/test/search/member_references_test.dart b/pkg/analysis_server/test/search/member_references_test.dart
index e247ad5..1275e99 100644
--- a/pkg/analysis_server/test/search/member_references_test.dart
+++ b/pkg/analysis_server/test/search/member_references_test.dart
@@ -18,9 +18,7 @@
 
 main() {
   groupSep = ' | ';
-  group('MemberReferencesTest', () {
-    runReflectiveTests(MemberReferencesTest);
-  });
+  runReflectiveTests(MemberReferencesTest);
 }
 
 
diff --git a/pkg/analysis_server/test/search/search_result_test.dart b/pkg/analysis_server/test/search/search_result_test.dart
index f8100f1..dc2c4dc 100644
--- a/pkg/analysis_server/test/search/search_result_test.dart
+++ b/pkg/analysis_server/test/search/search_result_test.dart
@@ -14,12 +14,8 @@
 
 main() {
   groupSep = ' | ';
-  group('SearchResult', () {
-    runReflectiveTests(SearchResultTest);
-  });
-  group('SearchResultKind', () {
-    runReflectiveTests(SearchResultKindTest);
-  });
+  runReflectiveTests(SearchResultTest);
+  runReflectiveTests(SearchResultKindTest);
 }
 
 
diff --git a/pkg/analysis_server/test/search/top_level_declarations_test.dart b/pkg/analysis_server/test/search/top_level_declarations_test.dart
index 7931ae1..902fa26 100644
--- a/pkg/analysis_server/test/search/top_level_declarations_test.dart
+++ b/pkg/analysis_server/test/search/top_level_declarations_test.dart
@@ -18,9 +18,7 @@
 
 main() {
   groupSep = ' | ';
-  group('findTopLevelDeclarations', () {
-    runReflectiveTests(TopLevelDeclarationsTest);
-  });
+  runReflectiveTests(TopLevelDeclarationsTest);
 }
 
 
diff --git a/pkg/analysis_services/lib/correction/change.dart b/pkg/analysis_services/lib/correction/change.dart
index a352855..d4073e9 100644
--- a/pkg/analysis_services/lib/correction/change.dart
+++ b/pkg/analysis_services/lib/correction/change.dart
@@ -37,6 +37,11 @@
   final List<LinkedPositionGroup> linkedPositionGroups = <LinkedPositionGroup>[
       ];
 
+  /**
+   * An optional position to move selection to after applying this change.
+   */
+  Position endPosition;
+
   Change(this.message);
 
   /**
@@ -188,10 +193,11 @@
 class LinkedPositionGroup implements HasToJson {
   final String id;
   final List<Position> positions = <Position>[];
+  final List<String> proposals = <String>[];
 
   LinkedPositionGroup(this.id);
 
-  void add(Position position) {
+  void addPosition(Position position) {
     if (positions.isNotEmpty && position.length != positions[0].length) {
       throw new ArgumentError(
           'All positions should have the same length. '
@@ -200,6 +206,10 @@
     positions.add(position);
   }
 
+  void addProposal(String proposal) {
+    proposals.add(proposal);
+  }
+
   @override
   Map<String, Object> toJson() {
     return {
diff --git a/pkg/analysis_services/lib/correction/fix.dart b/pkg/analysis_services/lib/correction/fix.dart
index f165213..eaafa6db 100644
--- a/pkg/analysis_services/lib/correction/fix.dart
+++ b/pkg/analysis_services/lib/correction/fix.dart
@@ -9,6 +9,7 @@
 import 'package:analysis_services/src/correction/fix.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/source.dart';
 
 
 /**
@@ -16,9 +17,11 @@
  *
  * Returns the computed [Fix]s, not `null`.
  */
-List<Fix> computeFixes(SearchEngine searchEngine, String file,
+List<Fix> computeFixes(SearchEngine searchEngine,
     CompilationUnit unit, AnalysisError error) {
-  var processor = new FixProcessor(searchEngine, file, unit, error);
+  Source source = unit.element.source;
+  String file = source.fullName;
+  var processor = new FixProcessor(searchEngine, source, file, unit, error);
   return processor.compute();
 }
 
diff --git a/pkg/analysis_services/lib/search/hierarchy.dart b/pkg/analysis_services/lib/search/hierarchy.dart
index 4b0623f..4fad92b3 100644
--- a/pkg/analysis_services/lib/search/hierarchy.dart
+++ b/pkg/analysis_services/lib/search/hierarchy.dart
@@ -120,6 +120,24 @@
 
 
 /**
+ * Returns non-synthetic members of the given [ClassElement] and its super
+ * classes.
+ *
+ * Includes: fields, accessors and methods.
+ * Excludes: constructors and synthetic elements.
+ */
+List<Element> getMembers(ClassElement clazz) {
+  List<Element> members = <Element>[];
+  members.addAll(getClassMembers(clazz));
+  Set<ClassElement> superClasses = getSuperClasses(clazz);
+  for (ClassElement superClass in superClasses) {
+    members.addAll(getClassMembers(superClass));
+  }
+  return members;
+}
+
+
+/**
  * Returns a [Set] with all direct and indirect subclasses of [seed].
  */
 Future<Set<ClassElement>> getSubClasses(SearchEngine searchEngine,
@@ -181,13 +199,13 @@
 }
 
 
-typedef void ElementProcessor(Element element);
+typedef void _ElementProcessor(Element element);
 
 /**
- * A [GeneralizingElementVisitor] adapter for [ElementProcessor].
+ * A [GeneralizingElementVisitor] adapter for [_ElementProcessor].
  */
 class _ElementVisitorAdapter extends GeneralizingElementVisitor {
-  final ElementProcessor processor;
+  final _ElementProcessor processor;
 
   _ElementVisitorAdapter(this.processor);
 
diff --git a/pkg/analysis_services/lib/src/correction/fix.dart b/pkg/analysis_services/lib/src/correction/fix.dart
index fe24a14..22e331d 100644
--- a/pkg/analysis_services/lib/src/correction/fix.dart
+++ b/pkg/analysis_services/lib/src/correction/fix.dart
@@ -9,32 +9,48 @@
 
 import 'package:analysis_services/correction/change.dart';
 import 'package:analysis_services/correction/fix.dart';
+import 'package:analysis_services/search/hierarchy.dart';
 import 'package:analysis_services/search/search_engine.dart';
+import 'package:analysis_services/src/correction/levenshtein.dart';
 import 'package:analysis_services/src/correction/name_suggestion.dart';
 import 'package:analysis_services/src/correction/source_buffer.dart';
 import 'package:analysis_services/src/correction/source_range.dart' as rf;
+import 'package:analysis_services/src/correction/strings.dart';
 import 'package:analysis_services/src/correction/util.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/parser.dart';
+import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 
 
 /**
+ * A predicate is a one-argument function that returns a boolean value.
+ */
+typedef bool Predicate<E>(E argument);
+
+
+/**
  * The computer for Dart fixes.
  */
 class FixProcessor {
+  static const int MAX_LEVENSHTEIN_DISTANCE = 3;
+
   final SearchEngine searchEngine;
+  final Source source;
   final String file;
   final CompilationUnit unit;
   final AnalysisError error;
+  CompilationUnitElement unitElement;
+  LibraryElement unitLibraryElement;
 
   final List<Edit> edits = <Edit>[];
   final Map<String, LinkedPositionGroup> linkedPositionGroups = <String,
       LinkedPositionGroup>{};
+  Position endPosition = null;
   final List<Fix> fixes = <Fix>[];
 
   CorrectionUtils utils;
@@ -45,7 +61,18 @@
   AstNode coveredNode;
 
 
-  FixProcessor(this.searchEngine, this.file, this.unit, this.error);
+  FixProcessor(this.searchEngine, this.source, this.file, this.unit, this.error)
+      {
+    unitElement = unit.element;
+    unitLibraryElement = unitElement.library;
+  }
+
+  DartType get coreTypeBool => _getCoreType("bool");
+
+  /**
+   * Returns the EOL to use for this [CompilationUnit].
+   */
+  String get eol => utils.endOfLine;
 
   List<Fix> compute() {
     utils = new CorrectionUtils(unit);
@@ -69,11 +96,10 @@
         CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT) {
       _addFix_createConstructorSuperExplicit();
     }
-//    if (identical(
-//        errorCode,
-//        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT)) {
-//      _addFix_createConstructorSuperImplicit();
-//    }
+    if (errorCode ==
+        CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT) {
+      _addFix_createConstructorSuperImplicit();
+    }
     if (errorCode ==
         CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT) {
       _addFix_createConstructorSuperExplicit();
@@ -139,11 +165,11 @@
       _addFix_createClass();
       _addFix_undefinedClass_useSimilar();
     }
-//    if (identical(errorCode, StaticWarningCode.UNDEFINED_IDENTIFIER)) {
-//      _addFix_createFunction_forFunctionType();
-//      _addFix_importLibrary_withType();
-//      _addFix_importLibrary_withTopLevelVariable();
-//    }
+    if (errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER) {
+      _addFix_createFunction_forFunctionType();
+      _addFix_importLibrary_withType();
+      _addFix_importLibrary_withTopLevelVariable();
+    }
     if (errorCode == StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER) {
       _addFix_useStaticAccess_method();
       _addFix_useStaticAccess_property();
@@ -151,20 +177,20 @@
     if (errorCode == StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION) {
       _addFix_removeParentheses_inGetterInvocation();
     }
-//    if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_FUNCTION)) {
-//      _addFix_importLibrary_withFunction();
-//      _addFix_undefinedFunction_useSimilar();
-//      _addFix_undefinedFunction_create();
-//    }
-//    if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_GETTER)) {
-//      _addFix_createFunction_forFunctionType();
-//    }
-//    if (identical(errorCode, HintCode.UNDEFINED_METHOD) ||
-//        identical(errorCode, StaticTypeWarningCode.UNDEFINED_METHOD)) {
-//      _addFix_undefinedMethod_useSimilar();
-//      _addFix_undefinedMethod_create();
-//      _addFix_undefinedFunction_create();
-//    }
+    if (errorCode == StaticTypeWarningCode.UNDEFINED_FUNCTION) {
+      _addFix_importLibrary_withFunction();
+      _addFix_undefinedFunction_useSimilar();
+      _addFix_undefinedFunction_create();
+    }
+    if (errorCode == StaticTypeWarningCode.UNDEFINED_GETTER) {
+      _addFix_createFunction_forFunctionType();
+    }
+    if (errorCode == HintCode.UNDEFINED_METHOD ||
+        errorCode == StaticTypeWarningCode.UNDEFINED_METHOD) {
+      _addFix_undefinedMethod_useSimilar();
+      _addFix_undefinedMethod_create();
+      _addFix_undefinedFunction_create();
+    }
     // done
     return fixes;
   }
@@ -181,11 +207,17 @@
     change.add(fileEdit);
     linkedPositionGroups.values.forEach(
         (group) => change.addLinkedPositionGroup(group));
+    change.endPosition = endPosition;
     // add Fix
     Fix fix = new Fix(kind, change);
     fixes.add(fix);
+    // clear
+    edits.clear();
+    linkedPositionGroups.clear();
+    endPosition = null;
   }
 
+
   void _addFix_addPackageDependency() {
     // TODO(scheglov) implement
 //    if (node is SimpleStringLiteral && node.parent is NamespaceDirective) {
@@ -208,18 +240,17 @@
 //    }
   }
 
+
   void _addFix_boolInsteadOfBoolean() {
     SourceRange range = rf.rangeError(error);
     _addReplaceEdit(range, "bool");
     _addFix(FixKind.REPLACE_BOOLEAN_WITH_BOOL, []);
   }
 
-
   void _addFix_createClass() {
     if (_mayBeTypeIdentifier(node)) {
       String name = (node as SimpleIdentifier).name;
       // prepare environment
-      String eol = utils.endOfLine;
       CompilationUnitMember enclosingMember =
           node.getAncestor((node) => node is CompilationUnitMember);
       int offset = enclosingMember.end;
@@ -250,7 +281,6 @@
     }
   }
 
-
   void _addFix_createConstructorSuperExplicit() {
     ConstructorDeclaration targetConstructor =
         node.parent as ConstructorDeclaration;
@@ -319,79 +349,75 @@
   }
 
   void _addFix_createConstructorSuperImplicit() {
-    // TODO(scheglov) implement
-//    ClassDeclaration targetClassNode = node.parent as ClassDeclaration;
-//    ClassElement targetClassElement = targetClassNode.element;
-//    ClassElement superClassElement = targetClassElement.supertype.element;
-//    String targetClassName = targetClassElement.name;
-//    // add proposals for all super constructors
-//    List<ConstructorElement> superConstructors = superClassElement.constructors;
-//    for (ConstructorElement superConstructor in superConstructors) {
-//      String constructorName = superConstructor.name;
-//      // skip private
-//      if (Identifier.isPrivateName(constructorName)) {
-//        continue;
-//      }
-//      // prepare parameters and arguments
-//      JavaStringBuilder parametersBuffer = new JavaStringBuilder();
-//      JavaStringBuilder argumentsBuffer = new JavaStringBuilder();
-//      bool firstParameter = true;
-//      for (ParameterElement parameter in superConstructor.parameters) {
-//        // skip non-required parameters
-//        if (parameter.parameterKind != ParameterKind.REQUIRED) {
-//          break;
-//        }
-//        // comma
-//        if (firstParameter) {
-//          firstParameter = false;
-//        } else {
-//          parametersBuffer.append(", ");
-//          argumentsBuffer.append(", ");
-//        }
-//        // name
-//        String parameterName = parameter.displayName;
-//        if (parameterName.length > 1 && parameterName.startsWith("_")) {
-//          parameterName = parameterName.substring(1);
-//        }
-//        // parameter & argument
-//        _appendParameterSource(parametersBuffer, parameter.type, parameterName);
-//        argumentsBuffer.append(parameterName);
-//      }
-//      // add proposal
-//      String eol = utils.endOfLine;
-//      QuickFixProcessorImpl_NewConstructorLocation targetLocation =
-//          _prepareNewConstructorLocation(targetClassNode, eol);
-//      SourceBuilder sb = new SourceBuilder.con1(targetLocation._offset);
-//      {
-//        String indent = utils.getIndent(1);
-//        sb.append(targetLocation._prefix);
-//        sb.append(indent);
-//        sb.append(targetClassName);
-//        if (!constructorName.isEmpty) {
-//          sb.startPosition("NAME");
-//          sb.append(".");
-//          sb.append(constructorName);
-//          sb.endPosition();
-//        }
-//        sb.append("(");
-//        sb.append(parametersBuffer.toString());
-//        sb.append(") : super");
-//        if (!constructorName.isEmpty) {
-//          sb.append(".");
-//          sb.append(constructorName);
-//        }
-//        sb.append("(");
-//        sb.append(argumentsBuffer.toString());
-//        sb.append(");");
-//        sb.append(targetLocation._suffix);
-//      }
-//      _addInsertEdit3(sb);
-//      // add proposal
-//      String proposalName = _getConstructorProposalName(superConstructor);
-//      _addFix(
-//          FixKind.CREATE_CONSTRUCTOR_SUPER,
-//          [proposalName]);
-//    }
+    ClassDeclaration targetClassNode = node.parent as ClassDeclaration;
+    ClassElement targetClassElement = targetClassNode.element;
+    ClassElement superClassElement = targetClassElement.supertype.element;
+    String targetClassName = targetClassElement.name;
+    // add proposals for all super constructors
+    List<ConstructorElement> superConstructors = superClassElement.constructors;
+    for (ConstructorElement superConstructor in superConstructors) {
+      String constructorName = superConstructor.name;
+      // skip private
+      if (Identifier.isPrivateName(constructorName)) {
+        continue;
+      }
+      // prepare parameters and arguments
+      SourceBuilder parametersBuffer = new SourceBuilder.buffer();
+      SourceBuilder argumentsBuffer = new SourceBuilder.buffer();
+      bool firstParameter = true;
+      for (ParameterElement parameter in superConstructor.parameters) {
+        // skip non-required parameters
+        if (parameter.parameterKind != ParameterKind.REQUIRED) {
+          break;
+        }
+        // comma
+        if (firstParameter) {
+          firstParameter = false;
+        } else {
+          parametersBuffer.append(', ');
+          argumentsBuffer.append(', ');
+        }
+        // name
+        String parameterName = parameter.displayName;
+        if (parameterName.length > 1 && parameterName.startsWith('_')) {
+          parameterName = parameterName.substring(1);
+        }
+        // parameter & argument
+        _appendParameterSource(parametersBuffer, parameter.type, parameterName);
+        argumentsBuffer.append(parameterName);
+      }
+      // add proposal
+      _ConstructorLocation targetLocation =
+          _prepareNewConstructorLocation(targetClassNode);
+      SourceBuilder sb = new SourceBuilder(file, targetLocation._offset);
+      {
+        String indent = utils.getIndent(1);
+        sb.append(targetLocation._prefix);
+        sb.append(indent);
+        sb.append(targetClassName);
+        if (!constructorName.isEmpty) {
+          sb.startPosition('NAME');
+          sb.append('.');
+          sb.append(constructorName);
+          sb.endPosition();
+        }
+        sb.append("(");
+        sb.append(parametersBuffer.toString());
+        sb.append(') : super');
+        if (!constructorName.isEmpty) {
+          sb.append('.');
+          sb.append(constructorName);
+        }
+        sb.append('(');
+        sb.append(argumentsBuffer.toString());
+        sb.append(');');
+        sb.append(targetLocation._suffix);
+      }
+      _insertBuilder(sb);
+      // add proposal
+      String proposalName = _getConstructorProposalName(superConstructor);
+      _addFix(FixKind.CREATE_CONSTRUCTOR_SUPER, [proposalName]);
+    }
   }
 
   void _addFix_createConstructor_insteadOfSyntheticDefault() {
@@ -428,8 +454,6 @@
     if (instanceCreation == null) {
       return;
     }
-    // prepare environment
-    String eol = utils.endOfLine;
     // prepare target
     DartType targetType = typeName.type;
     if (targetType is! InterfaceType) {
@@ -438,8 +462,8 @@
     ClassElement targetElement = targetType.element as ClassElement;
     String targetFile = targetElement.source.fullName;
     ClassDeclaration targetClass = targetElement.node;
-    QuickFixProcessorImpl_NewConstructorLocation targetLocation =
-        _prepareNewConstructorLocation(targetClass, eol);
+    _ConstructorLocation targetLocation =
+        _prepareNewConstructorLocation(targetClass);
     // build method source
     SourceBuilder sb = new SourceBuilder(targetFile, targetLocation._offset);
     {
@@ -485,8 +509,6 @@
     if (instanceCreation == null) {
       return;
     }
-    // prepare environment
-    String eol = utils.endOfLine;
     // prepare target interface type
     DartType targetType = constructorName.type.type;
     if (targetType is! InterfaceType) {
@@ -495,8 +517,8 @@
     ClassElement targetElement = targetType.element as ClassElement;
     String targetFile = targetElement.source.fullName;
     ClassDeclaration targetClass = targetElement.node;
-    QuickFixProcessorImpl_NewConstructorLocation targetLocation =
-        _prepareNewConstructorLocation(targetClass, eol);
+    _ConstructorLocation targetLocation =
+        _prepareNewConstructorLocation(targetClass);
     // build method source
     SourceBuilder sb = new SourceBuilder(targetFile, targetLocation._offset);
     {
@@ -527,173 +549,155 @@
   }
 
   void _addFix_createFunction_forFunctionType() {
-    // TODO(scheglov) implement
-//    if (node is SimpleIdentifier) {
-//      SimpleIdentifier nameNode = node as SimpleIdentifier;
-//      // prepare argument expression (to get parameter)
-//      ClassElement targetElement;
-//      Expression argument;
-//      {
-//        Expression target = CorrectionUtils.getQualifiedPropertyTarget(node);
-//        if (target != null) {
-//          DartType targetType = target.bestType;
-//          if (targetType != null && targetType.element is ClassElement) {
-//            targetElement = targetType.element as ClassElement;
-//            argument = target.parent as Expression;
-//          } else {
-//            return;
-//          }
-//        } else {
-//          ClassDeclaration enclosingClass =
-//              node.getAncestor((node) => node is ClassDeclaration);
-//          targetElement = enclosingClass != null ?
-//              enclosingClass.element :
-//              null;
-//          argument = nameNode;
-//        }
-//      }
-//      // should be argument of some invocation
-//      ParameterElement parameterElement = argument.bestParameterElement;
-//      if (parameterElement == null) {
-//        return;
-//      }
-//      // should be parameter of function type
-//      DartType parameterType = parameterElement.type;
-//      if (parameterType is! FunctionType) {
-//        return;
-//      }
-//      FunctionType functionType = parameterType as FunctionType;
-//      // add proposal
-//      if (targetElement != null) {
-//        _addProposal_createFunction_method(targetElement, functionType);
-//      } else {
-//        _addProposal_createFunction_function(functionType);
-//      }
-//    }
+    if (node is SimpleIdentifier) {
+      SimpleIdentifier nameNode = node as SimpleIdentifier;
+      // prepare argument expression (to get parameter)
+      ClassElement targetElement;
+      Expression argument;
+      {
+        Expression target = getQualifiedPropertyTarget(node);
+        if (target != null) {
+          DartType targetType = target.bestType;
+          if (targetType != null && targetType.element is ClassElement) {
+            targetElement = targetType.element as ClassElement;
+            argument = target.parent as Expression;
+          } else {
+            return;
+          }
+        } else {
+          ClassDeclaration enclosingClass =
+              node.getAncestor((node) => node is ClassDeclaration);
+          targetElement = enclosingClass != null ?
+              enclosingClass.element :
+              null;
+          argument = nameNode;
+        }
+      }
+      // should be argument of some invocation
+      ParameterElement parameterElement = argument.bestParameterElement;
+      if (parameterElement == null) {
+        return;
+      }
+      // should be parameter of function type
+      DartType parameterType = parameterElement.type;
+      if (parameterType is! FunctionType) {
+        return;
+      }
+      FunctionType functionType = parameterType as FunctionType;
+      // add proposal
+      if (targetElement != null) {
+        _addProposal_createFunction_method(targetElement, functionType);
+      } else {
+        _addProposal_createFunction_function(functionType);
+      }
+    }
   }
 
   void
       _addFix_createMissingOverrides(List<ExecutableElement> missingOverrides) {
-    // TODO(scheglov) implement
-//    // sort by name
-//    missingOverrides.sort(
-//        (Element firstElement, Element secondElement) =>
-//            ObjectUtils.compare(firstElement.displayName, secondElement.displayName));
-//    // add elements
-//    ClassDeclaration targetClass = node.parent as ClassDeclaration;
-//    bool isFirst = true;
-//    for (ExecutableElement missingOverride in missingOverrides) {
-//      _addFix_createMissingOverrides_single(
-//          targetClass,
-//          missingOverride,
-//          isFirst);
-//      isFirst = false;
-//    }
-//    // add proposal
-//    _addFix(
-//        FixKind.CREATE_MISSING_OVERRIDES,
-//        [missingOverrides.length]);
+    // sort by name
+    missingOverrides.sort((Element firstElement, Element secondElement) {
+      return compareStrings(
+          firstElement.displayName,
+          secondElement.displayName);
+    });
+    ClassDeclaration targetClass = node.parent as ClassDeclaration;
+    int insertOffset = targetClass.end - 1;
+    SourceBuilder sb = new SourceBuilder(file, insertOffset);
+    // add elements
+    bool isFirst = true;
+    for (ExecutableElement missingOverride in missingOverrides) {
+      if (!isFirst || !targetClass.members.isEmpty) {
+        sb.append(eol);
+      }
+      _addFix_createMissingOverrides_single(sb, targetClass, missingOverride);
+      isFirst = false;
+    }
+    // add proposal
+    endPosition = new Position(file, insertOffset, 0);
+    _insertBuilder(sb);
+    _addFix(FixKind.CREATE_MISSING_OVERRIDES, [missingOverrides.length]);
   }
 
-  void _addFix_createMissingOverrides_single(ClassDeclaration targetClass,
-      ExecutableElement missingOverride, bool isFirst) {
-    // TODO(scheglov) implement
-//    // prepare environment
-//    String eol = utils.endOfLine;
-//    String prefix = utils.getIndent(1);
-//    String prefix2 = utils.getIndent(2);
-//    int insertOffset = targetClass.end - 1;
-//    // prepare source
-//    JavaStringBuilder sb = new JavaStringBuilder();
-//    // may be empty line
-//    if (!isFirst || !targetClass.members.isEmpty) {
-//      sb.append(eol);
-//    }
-//    // may be property
-//    ElementKind elementKind = missingOverride.kind;
-//    bool isGetter = elementKind == ElementKind.GETTER;
-//    bool isSetter = elementKind == ElementKind.SETTER;
-//    bool isMethod = elementKind == ElementKind.METHOD;
-//    bool isOperator = isMethod && (missingOverride as MethodElement).isOperator;
-//    sb.append(prefix);
-//    if (isGetter) {
-//      sb.append("// TODO: implement ${missingOverride.displayName}");
-//      sb.append(eol);
-//      sb.append(prefix);
-//    }
-//    // @override
-//    {
-//      sb.append("@override");
-//      sb.append(eol);
-//      sb.append(prefix);
-//    }
-//    // return type
-//    _appendType(sb, missingOverride.type.returnType);
-//    if (isGetter) {
-//      sb.append("get ");
-//    } else if (isSetter) {
-//      sb.append("set ");
-//    } else if (isOperator) {
-//      sb.append("operator ");
-//    }
-//    // name
-//    sb.append(missingOverride.displayName);
-//    // parameters + body
-//    if (isGetter) {
-//      sb.append(" => null;");
-//    } else if (isMethod || isSetter) {
-//      List<ParameterElement> parameters = missingOverride.parameters;
-//      _appendParameters(sb, parameters);
-//      sb.append(" {");
-//      // TO-DO
-//      sb.append(eol);
-//      sb.append(prefix2);
-//      if (isMethod) {
-//        sb.append("// TODO: implement ${missingOverride.displayName}");
-//      } else {
-//        sb.append("// TODO: implement ${missingOverride.displayName}");
-//      }
-//      sb.append(eol);
-//      // close method
-//      sb.append(prefix);
-//      sb.append("}");
-//    }
-//    sb.append(eol);
-//    // done
-//    _addInsertEdit(insertOffset, sb.toString());
-//    // maybe set end range
-//    if (_endRange == null) {
-//      _endRange = SourceRangeFactory.rangeStartLength(insertOffset, 0);
-//    }
+  void _addFix_createMissingOverrides_single(SourceBuilder sb,
+      ClassDeclaration targetClass, ExecutableElement missingOverride) {
+    // prepare environment
+    String prefix = utils.getIndent(1);
+    String prefix2 = utils.getIndent(2);
+    // may be property
+    ElementKind elementKind = missingOverride.kind;
+    bool isGetter = elementKind == ElementKind.GETTER;
+    bool isSetter = elementKind == ElementKind.SETTER;
+    bool isMethod = elementKind == ElementKind.METHOD;
+    bool isOperator = isMethod && (missingOverride as MethodElement).isOperator;
+    sb.append(prefix);
+    if (isGetter) {
+      sb.append('// TODO: implement ${missingOverride.displayName}');
+      sb.append(eol);
+      sb.append(prefix);
+    }
+    // @override
+    {
+      sb.append('@override');
+      sb.append(eol);
+      sb.append(prefix);
+    }
+    // return type
+    _appendType(sb, missingOverride.type.returnType);
+    if (isGetter) {
+      sb.append('get ');
+    } else if (isSetter) {
+      sb.append('set ');
+    } else if (isOperator) {
+      sb.append('operator ');
+    }
+    // name
+    sb.append(missingOverride.displayName);
+    // parameters + body
+    if (isGetter) {
+      sb.append(' => null;');
+    } else {
+      List<ParameterElement> parameters = missingOverride.parameters;
+      _appendParameters(sb, parameters, _getDefaultValueMap(parameters));
+      sb.append(' {');
+      // TO-DO
+      sb.append(eol);
+      sb.append(prefix2);
+      sb.append('// TODO: implement ${missingOverride.displayName}');
+      sb.append(eol);
+      // close method
+      sb.append(prefix);
+      sb.append('}');
+    }
+    sb.append(eol);
   }
 
   void _addFix_createNoSuchMethod() {
-    // TODO(scheglov) implement
-//    ClassDeclaration targetClass = node.parent as ClassDeclaration;
-//    // prepare environment
-//    String eol = utils.endOfLine;
-//    String prefix = utils.getIndent(1);
-//    int insertOffset = targetClass.end - 1;
-//    // prepare source
-//    SourceBuilder sb = new SourceBuilder.con1(insertOffset);
-//    {
-//      // insert empty line before existing member
-//      if (!targetClass.members.isEmpty) {
-//        sb.append(eol);
-//      }
-//      // append method
-//      sb.append(prefix);
-//      sb.append(
-//          "noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);");
-//      sb.append(eol);
-//    }
-//    // done
-//    _addInsertEdit3(sb);
-//    _endRange = SourceRangeFactory.rangeStartLength(insertOffset, 0);
-//    // add proposal
-//    _addFix(FixKind.CREATE_NO_SUCH_METHOD, []);
+    ClassDeclaration targetClass = node.parent as ClassDeclaration;
+    // prepare environment
+    String prefix = utils.getIndent(1);
+    int insertOffset = targetClass.end - 1;
+    // prepare source
+    SourceBuilder sb = new SourceBuilder(file, insertOffset);
+    {
+      // insert empty line before existing member
+      if (!targetClass.members.isEmpty) {
+        sb.append(eol);
+      }
+      // append method
+      sb.append(prefix);
+      sb.append(
+          "noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);");
+      sb.append(eol);
+    }
+    // done
+    _insertBuilder(sb);
+    endPosition = new Position(file, insertOffset, 0);
+    // add proposal
+    _addFix(FixKind.CREATE_NO_SUCH_METHOD, []);
   }
 
+
   void _addFix_createPart() {
     // TODO(scheglov) implement
 //    if (node is SimpleStringLiteral && node.parent is PartDirective) {
@@ -712,7 +716,6 @@
 //        // prepare new source
 //        String source;
 //        {
-//          String eol = utils.endOfLine;
 //          String libraryName = _unitLibraryElement.displayName;
 //          source = "part of ${libraryName};${eol}${eol}";
 //        }
@@ -737,7 +740,6 @@
 //    String prefix;
 //    String suffix;
 //    {
-//      String eol = utils.endOfLine;
 //      // if no directives
 //      prefix = "";
 //      suffix = eol;
@@ -1026,338 +1028,187 @@
   }
 
   void _addFix_undefinedClass_useSimilar() {
-    // TODO(scheglov) implement
-//    if (_mayBeTypeIdentifier(node)) {
-//      String name = (node as SimpleIdentifier).name;
-//      QuickFixProcessorImpl_ClosestElementFinder finder =
-//          new QuickFixProcessorImpl_ClosestElementFinder(
-//              name,
-//              new Predicate_QuickFixProcessorImpl_addFix_undefinedClass_useSimilar());
-//      // find closest element
-//      {
-//        // elements of this library
-//        _unitLibraryElement.accept(
-//            new RecursiveElementVisitor_QuickFixProcessorImpl_addFix_undefinedClass_useSimilar(
-//                finder));
-//        // elements from imports
-//        for (ImportElement importElement in _unitLibraryElement.imports) {
-//          if (importElement.prefix == null) {
-//            Map<String, Element> namespace =
-//                CorrectionUtils.getImportNamespace(importElement);
-//            finder._update2(namespace.values);
-//          }
-//        }
-//      }
-//      // if we have close enough element, suggest to use it
-//      if (finder != null && finder._distance < 5) {
-//        String closestName = finder._element.name;
-//        _addReplaceEdit(SourceRangeFactory.rangeNode(node), closestName);
-//        // add proposal
-//        if (closestName != null) {
-//          _addFix(
-//              FixKind.CHANGE_TO,
-//              [closestName]);
-//        }
-//      }
-//    }
+    if (_mayBeTypeIdentifier(node)) {
+      String name = (node as SimpleIdentifier).name;
+      _ClosestElementFinder finder =
+          new _ClosestElementFinder(
+              name,
+              (Element element) => element is ClassElement,
+              MAX_LEVENSHTEIN_DISTANCE);
+      // find closest element
+      {
+        // elements of this library
+        for (CompilationUnitElement unit in unitLibraryElement.units) {
+          finder._updateList(unit.types);
+        }
+        // elements from imports
+        for (ImportElement importElement in unitLibraryElement.imports) {
+          if (importElement.prefix == null) {
+            Map<String, Element> namespace = getImportNamespace(importElement);
+            finder._updateList(namespace.values);
+          }
+        }
+      }
+      // if we have close enough element, suggest to use it
+      if (finder._element != null) {
+        String closestName = finder._element.name;
+        _addReplaceEdit(rf.rangeNode(node), closestName);
+        // add proposal
+        if (closestName != null) {
+          _addFix(FixKind.CHANGE_TO, [closestName]);
+        }
+      }
+    }
   }
 
   void _addFix_undefinedFunction_create() {
-    // TODO(scheglov) implement
-//    // should be the name of the invocation
-//    if (node is SimpleIdentifier && node.parent is MethodInvocation) {
-//    } else {
-//      return;
-//    }
-//    String name = (node as SimpleIdentifier).name;
-//    MethodInvocation invocation = node.parent as MethodInvocation;
-//    // function invocation has no target
-//    Expression target = invocation.realTarget;
-//    if (target != null) {
-//      return;
-//    }
-//    // prepare environment
-//    String eol = utils.endOfLine;
-//    int insertOffset;
-//    String sourcePrefix;
-//    AstNode enclosingMember =
-//        node.getAncestor((node) => node is CompilationUnitMember);
-//    insertOffset = enclosingMember.end;
-//    sourcePrefix = "${eol}${eol}";
-//    // build method source
-//    SourceBuilder sb = new SourceBuilder.con1(insertOffset);
-//    {
-//      sb.append(sourcePrefix);
-//      // may be return type
-//      {
-//        DartType type =
-//            _addFix_undefinedMethod_create_getReturnType(invocation);
-//        if (type != null) {
-//          String typeSource = utils.getTypeSource2(type);
-//          if (typeSource != "dynamic") {
-//            sb.startPosition("RETURN_TYPE");
-//            sb.append(typeSource);
-//            sb.endPosition();
-//            sb.append(" ");
-//          }
-//        }
-//      }
-//      // append name
-//      {
-//        sb.startPosition("NAME");
-//        sb.append(name);
-//        sb.endPosition();
-//      }
-//      _addFix_undefinedMethod_create_parameters(sb, invocation.argumentList);
-//      sb.append(") {${eol}}");
-//    }
-//    // insert source
-//    _addInsertEdit(insertOffset, sb.toString());
-//    // add linked positions
-//    _addLinkedPosition("NAME", sb, SourceRangeFactory.rangeNode(node));
-//    _addLinkedPositions(sb);
-//    // add proposal
-//    _addFix(FixKind.CREATE_FUNCTION, [name]);
+    // should be the name of the invocation
+    if (node is SimpleIdentifier && node.parent is MethodInvocation) {
+    } else {
+      return;
+    }
+    String name = (node as SimpleIdentifier).name;
+    MethodInvocation invocation = node.parent as MethodInvocation;
+    // function invocation has no target
+    Expression target = invocation.realTarget;
+    if (target != null) {
+      return;
+    }
+    // prepare environment
+    int insertOffset;
+    String sourcePrefix;
+    AstNode enclosingMember =
+        node.getAncestor((node) => node is CompilationUnitMember);
+    insertOffset = enclosingMember.end;
+    sourcePrefix = "${eol}${eol}";
+    // build method source
+    SourceBuilder sb = new SourceBuilder(file, insertOffset);
+    {
+      sb.append(sourcePrefix);
+      // append return type
+      {
+        DartType type = _inferReturnType(invocation);
+        _appendType(sb, type, 'RETURN_TYPE');
+      }
+      // append name
+      {
+        sb.startPosition("NAME");
+        sb.append(name);
+        sb.endPosition();
+      }
+      _addFix_undefinedMethod_create_parameters(sb, invocation.argumentList);
+      sb.append(") {${eol}}");
+    }
+    // insert source
+    _insertBuilder(sb);
+    _addLinkedPosition3('NAME', sb, rf.rangeNode(node));
+    // add proposal
+    _addFix(FixKind.CREATE_FUNCTION, [name]);
   }
 
   void _addFix_undefinedFunction_useSimilar() {
-    // TODO(scheglov) implement
-//    if (node is SimpleIdentifier) {
-//      String name = (node as SimpleIdentifier).name;
-//      QuickFixProcessorImpl_ClosestElementFinder finder =
-//          new QuickFixProcessorImpl_ClosestElementFinder(
-//              name,
-//              new Predicate_QuickFixProcessorImpl_addFix_undefinedFunction_useSimilar());
-//      // this library
-//      _unitLibraryElement.accept(
-//          new RecursiveElementVisitor_QuickFixProcessorImpl_addFix_undefinedFunction_useSimilar(
-//              finder));
-//      // imports
-//      for (ImportElement importElement in _unitLibraryElement.imports) {
-//        if (importElement.prefix == null) {
-//          Map<String, Element> namespace =
-//              CorrectionUtils.getImportNamespace(importElement);
-//          finder._update2(namespace.values);
-//        }
-//      }
-//      // if we have close enough element, suggest to use it
-//      String closestName = null;
-//      if (finder != null && finder._distance < 5) {
-//        closestName = finder._element.name;
-//        _addReplaceEdit(SourceRangeFactory.rangeNode(node), closestName);
-//        _addFix(FixKind.CHANGE_TO, [closestName]);
-//      }
-//    }
+    if (node is SimpleIdentifier) {
+      String name = (node as SimpleIdentifier).name;
+      _ClosestElementFinder finder =
+          new _ClosestElementFinder(
+              name,
+              (Element element) => element is FunctionElement,
+              MAX_LEVENSHTEIN_DISTANCE);
+      // this library
+      for (CompilationUnitElement unit in unitLibraryElement.units) {
+        finder._updateList(unit.functions);
+      }
+      // imports
+      for (ImportElement importElement in unitLibraryElement.imports) {
+        if (importElement.prefix == null) {
+          Map<String, Element> namespace = getImportNamespace(importElement);
+          finder._updateList(namespace.values);
+        }
+      }
+      // if we have close enough element, suggest to use it
+      if (finder._element != null) {
+        String closestName = finder._element.name;
+        _addReplaceEdit(rf.rangeNode(node), closestName);
+        _addFix(FixKind.CHANGE_TO, [closestName]);
+      }
+    }
   }
 
   void _addFix_undefinedMethod_create() {
-    // TODO(scheglov) implement
-//    if (node is SimpleIdentifier && node.parent is MethodInvocation) {
-//      String name = (node as SimpleIdentifier).name;
-//      MethodInvocation invocation = node.parent as MethodInvocation;
-//      // prepare environment
-//      String eol = utils.endOfLine;
-//      Source targetSource;
-//      String prefix;
-//      int insertOffset;
-//      String sourcePrefix;
-//      String sourceSuffix;
-//      bool staticModifier = false;
-//      Expression target = invocation.realTarget;
-//      if (target == null) {
-//        targetSource = _source;
-//        ClassMember enclosingMember =
-//            node.getAncestor((node) => node is ClassMember);
-//        staticModifier = _inStaticMemberContext2(enclosingMember);
-//        prefix = utils.getNodePrefix(enclosingMember);
-//        insertOffset = enclosingMember.end;
-//        sourcePrefix = "${eol}${prefix}${eol}";
-//        sourceSuffix = "";
-//      } else {
-//        // prepare target interface type
-//        DartType targetType = target.bestType;
-//        if (targetType is! InterfaceType) {
-//          return;
-//        }
-//        ClassElement targetElement = targetType.element as ClassElement;
-//        targetSource = targetElement.source;
-//        // may be static
-//        if (target is Identifier) {
-//          staticModifier = target.bestElement.kind == ElementKind.CLASS;
-//        }
-//        // prepare insert offset
-//        ClassDeclaration targetClass = targetElement.node;
-//        prefix = "  ";
-//        insertOffset = targetClass.end - 1;
-//        if (targetClass.members.isEmpty) {
-//          sourcePrefix = "";
-//        } else {
-//          sourcePrefix = "${prefix}${eol}";
-//        }
-//        sourceSuffix = eol;
-//      }
-//      // build method source
-//      SourceBuilder sb = new SourceBuilder.con1(insertOffset);
-//      {
-//        sb.append(sourcePrefix);
-//        sb.append(prefix);
-//        // may be "static"
-//        if (staticModifier) {
-//          sb.append("static ");
-//        }
-//        // may be return type
-//        {
-//          DartType type =
-//              _addFix_undefinedMethod_create_getReturnType(invocation);
-//          if (type != null) {
-//            String typeSource = utils.getTypeSource2(type);
-//            if (typeSource != "dynamic") {
-//              sb.startPosition("RETURN_TYPE");
-//              sb.append(typeSource);
-//              sb.endPosition();
-//              sb.append(" ");
-//            }
-//          }
-//        }
-//        // append name
-//        {
-//          sb.startPosition("NAME");
-//          sb.append(name);
-//          sb.endPosition();
-//        }
-//        _addFix_undefinedMethod_create_parameters(sb, invocation.argumentList);
-//        sb.append(") {${eol}${prefix}}");
-//        sb.append(sourceSuffix);
-//      }
-//      // insert source
-//      _addInsertEdit(insertOffset, sb.toString());
-//      // add linked positions
-//      if (targetSource == _source) {
-//        _addLinkedPosition("NAME", sb, SourceRangeFactory.rangeNode(node));
-//      }
-//      _addLinkedPositions(sb);
-//      // add proposal
-//      _addUnitCorrectionProposal2(
-//          targetSource,
-//          FixKind.CREATE_METHOD,
-//          [name]);
-//    }
-  }
-
-  /**
-   * @return the possible return [Type], may be <code>null</code> if can not be identified.
-   */
-  DartType
-      _addFix_undefinedMethod_create_getReturnType(MethodInvocation invocation) {
-    // TODO(scheglov) implement
-//    AstNode parent = invocation.parent;
-//    // myFunction();
-//    if (parent is ExpressionStatement) {
-//      return VoidTypeImpl.instance;
-//    }
-//    // return myFunction();
-//    if (parent is ReturnStatement) {
-//      ExecutableElement executable =
-//          CorrectionUtils.getEnclosingExecutableElement(invocation);
-//      return executable != null ? executable.returnType : null;
-//    }
-//    // int v = myFunction();
-//    if (parent is VariableDeclaration) {
-//      VariableDeclaration variableDeclaration = parent;
-//      if (identical(variableDeclaration.initializer, invocation)) {
-//        VariableElement variableElement = variableDeclaration.element;
-//        if (variableElement != null) {
-//          return variableElement.type;
-//        }
-//      }
-//    }
-//    // v = myFunction();
-//    if (parent is AssignmentExpression) {
-//      AssignmentExpression assignment = parent;
-//      if (identical(assignment.rightHandSide, invocation)) {
-//        if (assignment.operator.type == TokenType.EQ) {
-//          // v = myFunction();
-//          Expression lhs = assignment.leftHandSide;
-//          if (lhs != null) {
-//            return lhs.bestType;
-//          }
-//        } else {
-//          // v += myFunction();
-//          MethodElement method = assignment.bestElement;
-//          if (method != null) {
-//            List<ParameterElement> parameters = method.parameters;
-//            if (parameters.length == 1) {
-//              return parameters[0].type;
-//            }
-//          }
-//        }
-//      }
-//    }
-//    // v + myFunction();
-//    if (parent is BinaryExpression) {
-//      BinaryExpression binary = parent;
-//      MethodElement method = binary.bestElement;
-//      if (method != null) {
-//        if (identical(binary.rightOperand, invocation)) {
-//          List<ParameterElement> parameters = method.parameters;
-//          return parameters.length == 1 ? parameters[0].type : null;
-//        }
-//      }
-//    }
-//    // foo( myFunction() );
-//    if (parent is ArgumentList) {
-//      ParameterElement parameter = invocation.bestParameterElement;
-//      return parameter != null ? parameter.type : null;
-//    }
-//    // bool
-//    {
-//      // assert( myFunction() );
-//      if (parent is AssertStatement) {
-//        AssertStatement statement = parent;
-//        if (identical(statement.condition, invocation)) {
-//          return coreTypeBool;
-//        }
-//      }
-//      // if ( myFunction() ) {}
-//      if (parent is IfStatement) {
-//        IfStatement statement = parent;
-//        if (identical(statement.condition, invocation)) {
-//          return coreTypeBool;
-//        }
-//      }
-//      // while ( myFunction() ) {}
-//      if (parent is WhileStatement) {
-//        WhileStatement statement = parent;
-//        if (identical(statement.condition, invocation)) {
-//          return coreTypeBool;
-//        }
-//      }
-//      // do {} while ( myFunction() );
-//      if (parent is DoStatement) {
-//        DoStatement statement = parent;
-//        if (identical(statement.condition, invocation)) {
-//          return coreTypeBool;
-//        }
-//      }
-//      // !myFunction()
-//      if (parent is PrefixExpression) {
-//        PrefixExpression prefixExpression = parent;
-//        if (prefixExpression.operator.type == TokenType.BANG) {
-//          return coreTypeBool;
-//        }
-//      }
-//      // binary expression '&&' or '||'
-//      if (parent is BinaryExpression) {
-//        BinaryExpression binaryExpression = parent;
-//        TokenType operatorType = binaryExpression.operator.type;
-//        if (operatorType == TokenType.AMPERSAND_AMPERSAND ||
-//            operatorType == TokenType.BAR_BAR) {
-//          return coreTypeBool;
-//        }
-//      }
-//    }
-    // we don't know
-    return null;
+    if (node is SimpleIdentifier && node.parent is MethodInvocation) {
+      String name = (node as SimpleIdentifier).name;
+      MethodInvocation invocation = node.parent as MethodInvocation;
+      // prepare environment
+      Source targetSource;
+      String prefix;
+      int insertOffset;
+      String sourcePrefix;
+      String sourceSuffix;
+      bool staticModifier = false;
+      Expression target = invocation.realTarget;
+      if (target == null) {
+        targetSource = source;
+        ClassMember enclosingMember =
+            node.getAncestor((node) => node is ClassMember);
+        staticModifier = _inStaticContext();
+        prefix = utils.getNodePrefix(enclosingMember);
+        insertOffset = enclosingMember.end;
+        sourcePrefix = "${eol}${eol}";
+        sourceSuffix = "";
+      } else {
+        // prepare target interface type
+        DartType targetType = target.bestType;
+        if (targetType is! InterfaceType) {
+          return;
+        }
+        ClassElement targetElement = targetType.element as ClassElement;
+        targetSource = targetElement.source;
+        // may be static
+        if (target is Identifier) {
+          staticModifier = target.bestElement.kind == ElementKind.CLASS;
+        }
+        // prepare insert offset
+        ClassDeclaration targetClass = targetElement.node;
+        prefix = "  ";
+        insertOffset = targetClass.end - 1;
+        if (targetClass.members.isEmpty) {
+          sourcePrefix = "";
+        } else {
+          sourcePrefix = eol;
+        }
+        sourceSuffix = eol;
+      }
+      String targetFile = targetSource.fullName;
+      // build method source
+      SourceBuilder sb = new SourceBuilder(targetFile, insertOffset);
+      {
+        sb.append(sourcePrefix);
+        sb.append(prefix);
+        // maybe "static"
+        if (staticModifier) {
+          sb.append("static ");
+        }
+        // append return type
+        _appendType(sb, _inferReturnType(invocation), 'RETURN_TYPE');
+        // append name
+        {
+          sb.startPosition("NAME");
+          sb.append(name);
+          sb.endPosition();
+        }
+        _addFix_undefinedMethod_create_parameters(sb, invocation.argumentList);
+        sb.append(") {${eol}${prefix}}");
+        sb.append(sourceSuffix);
+      }
+      // insert source
+      _insertBuilder(sb);
+      // add linked positions
+      if (targetSource == source) {
+        _addLinkedPosition3('NAME', sb, rf.rangeNode(node));
+      }
+      // add proposal
+      _addFix(FixKind.CREATE_METHOD, [name], fixFile: targetFile);
+    }
   }
 
   void _addFix_undefinedMethod_create_parameters(SourceBuilder sb,
@@ -1397,38 +1248,37 @@
   }
 
   void _addFix_undefinedMethod_useSimilar() {
-    // TODO(scheglov) implement
-//    if (node is SimpleIdentifier && node.parent is MethodInvocation) {
-//      MethodInvocation invocation = node.parent as MethodInvocation;
-//      String name = (node as SimpleIdentifier).name;
-//      QuickFixProcessorImpl_ClosestElementFinder finder =
-//          new QuickFixProcessorImpl_ClosestElementFinder(
-//              name,
-//              new Predicate_QuickFixProcessorImpl_addFix_undefinedMethod_useSimilar());
-//      // unqualified invocation
-//      Expression target = invocation.realTarget;
-//      if (target == null) {
-//        ClassDeclaration clazz =
-//            invocation.getAncestor((node) => node is ClassDeclaration);
-//        if (clazz != null) {
-//          ClassElement classElement = clazz.element;
-//          _updateFinderWithClassMembers(finder, classElement);
-//        }
-//      } else {
-//        DartType type = target.bestType;
-//        if (type is InterfaceType) {
-//          ClassElement classElement = type.element;
-//          _updateFinderWithClassMembers(finder, classElement);
-//        }
-//      }
-//      // if we have close enough element, suggest to use it
-//      String closestName = null;
-//      if (finder != null && finder._distance < 5) {
-//        closestName = finder._element.name;
-//        _addReplaceEdit(SourceRangeFactory.rangeNode(node), closestName);
-//        _addFix(FixKind.CHANGE_TO, [closestName]);
-//      }
-//    }
+    if (node is SimpleIdentifier && node.parent is MethodInvocation) {
+      MethodInvocation invocation = node.parent as MethodInvocation;
+      String name = (node as SimpleIdentifier).name;
+      _ClosestElementFinder finder =
+          new _ClosestElementFinder(
+              name,
+              (Element element) => element is MethodElement && !element.isOperator,
+              MAX_LEVENSHTEIN_DISTANCE);
+      // unqualified invocation
+      Expression target = invocation.realTarget;
+      if (target == null) {
+        ClassDeclaration clazz =
+            invocation.getAncestor((node) => node is ClassDeclaration);
+        if (clazz != null) {
+          ClassElement classElement = clazz.element;
+          _updateFinderWithClassMembers(finder, classElement);
+        }
+      } else {
+        DartType type = target.bestType;
+        if (type is InterfaceType) {
+          ClassElement classElement = type.element;
+          _updateFinderWithClassMembers(finder, classElement);
+        }
+      }
+      // if we have close enough element, suggest to use it
+      if (finder._element != null) {
+        String closestName = finder._element.name;
+        _addReplaceEdit(rf.rangeNode(node), closestName);
+        _addFix(FixKind.CHANGE_TO, [closestName]);
+      }
+    }
   }
 
   void _addFix_useEffectiveIntegerDivision() {
@@ -1499,21 +1349,146 @@
    * Adds a single linked position to [groupId].
    */
   void _addLinkedPosition(String groupId, SourceRange range) {
-    _addLinkedPosition2(
-        groupId,
-        new Position(file, range.offset, range.length));
+    Position position = new Position(file, range.offset, range.length);
+    LinkedPositionGroup group = _getLinkedPosition(groupId);
+    group.addPosition(position);
   }
 
   /**
    * Adds a single linked position to [groupId].
    */
-  void _addLinkedPosition2(String groupId, Position position) {
-    LinkedPositionGroup group = linkedPositionGroups[groupId];
-    if (group == null) {
-      group = new LinkedPositionGroup(groupId);
-      linkedPositionGroups[groupId] = group;
+  void _addLinkedPosition3(String groupId, SourceBuilder sb,
+      SourceRange range) {
+    if (sb.offset < range.offset) {
+      int delta = sb.length;
+      range = range.getTranslated(delta);
     }
-    group.add(position);
+    _addLinkedPosition(groupId, range);
+  }
+
+  /**
+   * Prepares proposal for creating function corresponding to the given [FunctionType].
+   */
+  void _addProposal_createFunction(FunctionType functionType, String name,
+      Source targetSource, int insertOffset, bool isStatic, String prefix,
+      String sourcePrefix, String sourceSuffix) {
+    // build method source
+    String targetFile = targetSource.fullName;
+    SourceBuilder sb = new SourceBuilder(targetFile, insertOffset);
+    {
+      sb.append(sourcePrefix);
+      sb.append(prefix);
+      // may be static
+      if (isStatic) {
+        sb.append("static ");
+      }
+      // append return type
+      _appendType(sb, functionType.returnType, 'RETURN_TYPE');
+      // append name
+      {
+        sb.startPosition("NAME");
+        sb.append(name);
+        sb.endPosition();
+      }
+      // append parameters
+      sb.append("(");
+      List<ParameterElement> parameters = functionType.parameters;
+      for (int i = 0; i < parameters.length; i++) {
+        ParameterElement parameter = parameters[i];
+        // append separator
+        if (i != 0) {
+          sb.append(", ");
+        }
+        // append type name
+        DartType type = parameter.type;
+        if (!type.isDynamic) {
+          String typeSource = utils.getTypeSource(type);
+          {
+            sb.startPosition("TYPE${i}");
+            sb.append(typeSource);
+            _addSuperTypeProposals(sb, new Set(), type);
+            sb.endPosition();
+          }
+          sb.append(" ");
+        }
+        // append parameter name
+        {
+          sb.startPosition("ARG${i}");
+          sb.append(parameter.displayName);
+          sb.endPosition();
+        }
+      }
+      sb.append(")");
+      // close method
+      sb.append(" {${eol}${prefix}}");
+      sb.append(sourceSuffix);
+    }
+    // insert source
+    _insertBuilder(sb);
+    // add linked positions
+    if (targetSource == source) {
+      _addLinkedPosition3("NAME", sb, rf.rangeNode(node));
+    }
+  }
+
+  /**
+   * Adds proposal for creating method corresponding to the given [FunctionType] in the given
+   * [ClassElement].
+   */
+  void _addProposal_createFunction_function(FunctionType functionType) {
+    String name = (node as SimpleIdentifier).name;
+    // prepare environment
+    int insertOffset = unit.end;
+    // prepare prefix
+    String prefix = "";
+    String sourcePrefix = "${eol}";
+    String sourceSuffix = eol;
+    _addProposal_createFunction(
+        functionType,
+        name,
+        source,
+        insertOffset,
+        false,
+        prefix,
+        sourcePrefix,
+        sourceSuffix);
+    // add proposal
+    _addFix(FixKind.CREATE_FUNCTION, [name], fixFile: file);
+  }
+
+  /**
+   * Adds proposal for creating method corresponding to the given [FunctionType] in the given
+   * [ClassElement].
+   */
+  void _addProposal_createFunction_method(ClassElement targetClassElement,
+      FunctionType functionType) {
+    String name = (node as SimpleIdentifier).name;
+    // prepare environment
+    Source targetSource = targetClassElement.source;
+    String targetFile = targetSource.fullName;
+    // prepare insert offset
+    ClassDeclaration targetClassNode = targetClassElement.node;
+    int insertOffset = targetClassNode.end - 1;
+    // prepare prefix
+    String prefix = "  ";
+    String sourcePrefix;
+    if (targetClassNode.members.isEmpty) {
+      sourcePrefix = "";
+    } else {
+      sourcePrefix = eol;
+    }
+    String sourceSuffix = eol;
+    _addProposal_createFunction(
+        functionType,
+        name,
+        targetSource,
+        insertOffset,
+        _inStaticContext(),
+        prefix,
+        sourcePrefix,
+        sourceSuffix);
+    // add proposal
+    _addFix(FixKind.CREATE_METHOD, [name], fixFile: targetFile);
   }
 
   /**
@@ -1531,20 +1506,20 @@
     edits.add(edit);
   }
 
-  void _appendParameterSource(StringBuffer sb, DartType type, String name) {
+  void _appendParameterSource(SourceBuilder sb, DartType type, String name) {
     String parameterSource = utils.getParameterSource(type, name);
-    sb.write(parameterSource);
+    sb.append(parameterSource);
   }
 
-  void _appendParameters(StringBuffer sb, List<ParameterElement> parameters,
+  void _appendParameters(SourceBuilder sb, List<ParameterElement> parameters,
       Map<ParameterElement, String> defaultValueMap) {
-    sb.write("(");
+    sb.append("(");
     bool firstParameter = true;
     bool sawNamed = false;
     bool sawPositional = false;
     for (ParameterElement parameter in parameters) {
       if (!firstParameter) {
-        sb.write(", ");
+        sb.append(", ");
       } else {
         firstParameter = false;
       }
@@ -1552,13 +1527,13 @@
       ParameterKind parameterKind = parameter.parameterKind;
       if (parameterKind == ParameterKind.NAMED) {
         if (!sawNamed) {
-          sb.write("{");
+          sb.append("{");
           sawNamed = true;
         }
       }
       if (parameterKind == ParameterKind.POSITIONAL) {
         if (!sawPositional) {
-          sb.write("[");
+          sb.append("[");
           sawPositional = true;
         }
       }
@@ -1569,22 +1544,236 @@
         String defaultSource = defaultValueMap[parameter];
         if (defaultSource != null) {
           if (sawPositional) {
-            sb.write(" = ");
+            sb.append(" = ");
           } else {
-            sb.write(": ");
+            sb.append(": ");
           }
-          sb.write(defaultSource);
+          sb.append(defaultSource);
         }
       }
     }
     // close parameters
     if (sawNamed) {
-      sb.write("}");
+      sb.append("}");
     }
     if (sawPositional) {
-      sb.write("]");
+      sb.append("]");
     }
-    sb.write(")");
+    sb.append(")");
+  }
+
+  void _appendType(SourceBuilder sb, DartType type, [String groupId]) {
+    if (type != null && !type.isDynamic) {
+      String typeSource = utils.getTypeSource(type);
+      if (groupId != null) {
+        sb.startPosition(groupId);
+        sb.append(typeSource);
+        sb.endPosition();
+      } else {
+        sb.append(typeSource);
+      }
+      sb.append(' ');
+    }
+  }
+
+  /**
+   * @return the string to display as the name of the given constructor in a proposal name.
+   */
+  String _getConstructorProposalName(ConstructorElement constructor) {
+    SourceBuilder proposalNameBuffer = new SourceBuilder.buffer();
+    proposalNameBuffer.append("super");
+    // may be named
+    String constructorName = constructor.displayName;
+    if (!constructorName.isEmpty) {
+      proposalNameBuffer.append(".");
+      proposalNameBuffer.append(constructorName);
+    }
+    // parameters
+    _appendParameters(proposalNameBuffer, constructor.parameters, null);
+    // done
+    return proposalNameBuffer.toString();
+  }
+
+  /**
+   * Returns the [Type] with given name from the `dart:core` library.
+   */
+  DartType _getCoreType(String name) {
+    List<LibraryElement> libraries = unitLibraryElement.importedLibraries;
+    for (LibraryElement library in libraries) {
+      if (library.isDartCore) {
+        ClassElement classElement = library.getType(name);
+        if (classElement != null) {
+          return classElement.type;
+        }
+        return null;
+      }
+    }
+    return null;
+  }
+
+  Map<ParameterElement, String>
+      _getDefaultValueMap(List<ParameterElement> parameters) {
+    Map<ParameterElement, String> defaultSourceMap = {};
+    Map<Source, String> sourceContentMap = {};
+    for (ParameterElement parameter in parameters) {
+      SourceRange valueRange = parameter.defaultValueRange;
+      if (valueRange != null) {
+        Source source = parameter.source;
+        String sourceContent = sourceContentMap[source];
+        if (sourceContent == null) {
+          sourceContent = getSourceContent(parameter.context, source);
+          sourceContentMap[source] = sourceContent;
+        }
+        String valueSource =
+            sourceContent.substring(valueRange.offset, valueRange.end);
+        defaultSourceMap[parameter] = valueSource;
+      }
+    }
+    return defaultSourceMap;
+  }
+
+  /**
+   * Returns an existing or just added [LinkedPositionGroup] with [groupId].
+   */
+  LinkedPositionGroup _getLinkedPosition(String groupId) {
+    LinkedPositionGroup group = linkedPositionGroups[groupId];
+    if (group == null) {
+      group = new LinkedPositionGroup(groupId);
+      linkedPositionGroups[groupId] = group;
+    }
+    return group;
+  }
+
+  /**
+   * Returns `true` if [node] is in static context.
+   */
+  bool _inStaticContext() {
+    // constructor initializer cannot reference "this"
+    if (node.getAncestor((node) => node is ConstructorInitializer) != null) {
+      return true;
+    }
+    // field initializer cannot reference "this"
+    if (node.getAncestor((node) => node is FieldDeclaration) != null) {
+      return true;
+    }
+    // static method
+    MethodDeclaration method = node.getAncestor((node) {
+      return node is MethodDeclaration;
+    });
+    return method != null && method.isStatic;
+  }
+
+  /**
+   * Returns a possible return [Type], may be `null` if cannot be inferred.
+   */
+  DartType _inferReturnType(MethodInvocation invocation) {
+    AstNode parent = invocation.parent;
+    // myFunction();
+    if (parent is ExpressionStatement) {
+      return VoidTypeImpl.instance;
+    }
+    // return myFunction();
+    if (parent is ReturnStatement) {
+      ExecutableElement executable = getEnclosingExecutableElement(invocation);
+      return executable != null ? executable.returnType : null;
+    }
+    // int v = myFunction();
+    if (parent is VariableDeclaration) {
+      VariableDeclaration variableDeclaration = parent;
+      if (identical(variableDeclaration.initializer, invocation)) {
+        VariableElement variableElement = variableDeclaration.element;
+        if (variableElement != null) {
+          return variableElement.type;
+        }
+      }
+    }
+    // v = myFunction();
+    if (parent is AssignmentExpression) {
+      AssignmentExpression assignment = parent;
+      if (identical(assignment.rightHandSide, invocation)) {
+        if (assignment.operator.type == TokenType.EQ) {
+          // v = myFunction();
+          Expression lhs = assignment.leftHandSide;
+          if (lhs != null) {
+            return lhs.bestType;
+          }
+        } else {
+          // v += myFunction();
+          MethodElement method = assignment.bestElement;
+          if (method != null) {
+            List<ParameterElement> parameters = method.parameters;
+            if (parameters.length == 1) {
+              return parameters[0].type;
+            }
+          }
+        }
+      }
+    }
+    // v + myFunction();
+    if (parent is BinaryExpression) {
+      BinaryExpression binary = parent;
+      MethodElement method = binary.bestElement;
+      if (method != null) {
+        if (identical(binary.rightOperand, invocation)) {
+          List<ParameterElement> parameters = method.parameters;
+          return parameters.length == 1 ? parameters[0].type : null;
+        }
+      }
+    }
+    // foo( myFunction() );
+    if (parent is ArgumentList) {
+      ParameterElement parameter = invocation.bestParameterElement;
+      return parameter != null ? parameter.type : null;
+    }
+    // bool
+    {
+      // assert( myFunction() );
+      if (parent is AssertStatement) {
+        AssertStatement statement = parent;
+        if (identical(statement.condition, invocation)) {
+          return coreTypeBool;
+        }
+      }
+      // if ( myFunction() ) {}
+      if (parent is IfStatement) {
+        IfStatement statement = parent;
+        if (identical(statement.condition, invocation)) {
+          return coreTypeBool;
+        }
+      }
+      // while ( myFunction() ) {}
+      if (parent is WhileStatement) {
+        WhileStatement statement = parent;
+        if (identical(statement.condition, invocation)) {
+          return coreTypeBool;
+        }
+      }
+      // do {} while ( myFunction() );
+      if (parent is DoStatement) {
+        DoStatement statement = parent;
+        if (identical(statement.condition, invocation)) {
+          return coreTypeBool;
+        }
+      }
+      // !myFunction()
+      if (parent is PrefixExpression) {
+        PrefixExpression prefixExpression = parent;
+        if (prefixExpression.operator.type == TokenType.BANG) {
+          return coreTypeBool;
+        }
+      }
+      // binary expression '&&' or '||'
+      if (parent is BinaryExpression) {
+        BinaryExpression binaryExpression = parent;
+        TokenType operatorType = binaryExpression.operator.type;
+        if (operatorType == TokenType.AMPERSAND_AMPERSAND ||
+            operatorType == TokenType.BAR_BAR) {
+          return coreTypeBool;
+        }
+      }
+    }
+    // we don't know
+    return null;
   }
 
 //  void _addLinkedPositionProposal(String group,
@@ -1597,23 +1786,20 @@
 //    nodeProposals.add(proposal);
 //  }
 
-  /**
-   * @return the string to display as the name of the given constructor in a proposal name.
-   */
-  String _getConstructorProposalName(ConstructorElement constructor) {
-    StringBuffer proposalNameBuffer = new StringBuffer();
-    proposalNameBuffer.write("super");
-    // may be named
-    String constructorName = constructor.displayName;
-    if (!constructorName.isEmpty) {
-      proposalNameBuffer.write(".");
-      proposalNameBuffer.write(constructorName);
-    }
-    // parameters
-    _appendParameters(proposalNameBuffer, constructor.parameters, null);
-    // done
-    return proposalNameBuffer.toString();
-  }
+//  /**
+//   * Returns `true` if the given [ClassMember] is a part of a static method or
+//   * a field initializer.
+//   */
+//  bool _inStaticMemberContext2(ClassMember member) {
+//    if (member is MethodDeclaration) {
+//      return member.isStatic;
+//    }
+//    // field initializer cannot reference "this"
+//    if (member is FieldDeclaration) {
+//      return true;
+//    }
+//    return false;
+//  }
 
   /**
    * Inserts the given [SourceBuilder] at its offset.
@@ -1623,14 +1809,18 @@
     _addInsertEdit(builder.offset, text);
     // add linked positions
     builder.linkedPositionGroups.forEach((LinkedPositionGroup group) {
+      LinkedPositionGroup fixGroup = _getLinkedPosition(group.id);
       group.positions.forEach((Position position) {
-        _addLinkedPosition2(group.id, position);
+        fixGroup.addPosition(position);
+      });
+      group.proposals.forEach((String proposal) {
+        fixGroup.addProposal(proposal);
       });
     });
   }
 
-  QuickFixProcessorImpl_NewConstructorLocation
-      _prepareNewConstructorLocation(ClassDeclaration classDeclaration, String eol) {
+  _ConstructorLocation
+      _prepareNewConstructorLocation(ClassDeclaration classDeclaration) {
     List<ClassMember> members = classDeclaration.members;
     // find the last field/constructor
     ClassMember lastFieldOrConstructor = null;
@@ -1643,14 +1833,14 @@
     }
     // after the field/constructor
     if (lastFieldOrConstructor != null) {
-      return new QuickFixProcessorImpl_NewConstructorLocation(
+      return new _ConstructorLocation(
           "${eol}${eol}",
           lastFieldOrConstructor.end,
           "");
     }
     // at the beginning of the class
     String suffix = members.isEmpty ? "" : eol;
-    return new QuickFixProcessorImpl_NewConstructorLocation(
+    return new _ConstructorLocation(
         eol,
         classDeclaration.leftBracket.end,
         suffix);
@@ -1674,6 +1864,14 @@
     }
   }
 
+  void _updateFinderWithClassMembers(_ClosestElementFinder finder,
+      ClassElement clazz) {
+    if (clazz != null) {
+      List<Element> members = getMembers(clazz);
+      finder._updateList(members);
+    }
+  }
+
   static void _addSuperTypeProposals(SourceBuilder sb,
       Set<DartType> alreadyAdded, DartType type) {
     if (type != null &&
@@ -1722,17 +1920,42 @@
   }
 }
 
+/**
+ * Helper for finding [Element] with name closest to the given.
+ */
+class _ClosestElementFinder {
+  final String _targetName;
+  final Predicate<Element> _predicate;
+
+  Element _element = null;
+  int _distance;
+
+  _ClosestElementFinder(this._targetName, this._predicate, this._distance);
+
+  void _update(Element element) {
+    if (_predicate(element)) {
+      int memberDistance = levenshtein(element.name, _targetName, _distance);
+      if (memberDistance < _distance) {
+        _element = element;
+        _distance = memberDistance;
+      }
+    }
+  }
+
+  void _updateList(Iterable<Element> elements) {
+    for (Element element in elements) {
+      _update(element);
+    }
+  }
+}
 
 /**
  * Describes the location for a newly created [ConstructorDeclaration].
- *
- * TODO(scheglov) rename
  */
-class QuickFixProcessorImpl_NewConstructorLocation {
+class _ConstructorLocation {
   final String _prefix;
   final int _offset;
   final String _suffix;
 
-  QuickFixProcessorImpl_NewConstructorLocation(this._prefix, this._offset,
-      this._suffix);
+  _ConstructorLocation(this._prefix, this._offset, this._suffix);
 }
diff --git a/pkg/analysis_services/lib/src/correction/levenshtein.dart b/pkg/analysis_services/lib/src/correction/levenshtein.dart
new file mode 100644
index 0000000..31f17fd
--- /dev/null
+++ b/pkg/analysis_services/lib/src/correction/levenshtein.dart
@@ -0,0 +1,131 @@
+library levenshtein;
+
+import 'dart:math' as math;
+
+/**
+ * The value returned by [levenshtein] if the distance is determined
+ * to be over the specified threshold.
+ */
+const int LEVENSHTEIN_MAX = 1 << 20;
+
+const int _MAX_VALUE = 1 << 10;
+
+/**
+ * Find the Levenshtein distance between two [String]s if it's less than or
+ * equal to a given threshold.
+ *
+ * This is the number of changes needed to change one String into another,
+ * where each change is a single character modification (deletion, insertion or
+ * substitution).
+ *
+ * This implementation follows from Algorithms on Strings, Trees and Sequences
+ * by Dan Gusfield and Chas Emerick's implementation of the Levenshtein distance
+ * algorithm.
+ */
+int levenshtein(String s, String t, int threshold, {bool caseSensitive: true}) {
+  if (s == null || t == null) {
+    throw new ArgumentError('Strings must not be null');
+  }
+  if (threshold < 0) {
+    throw new ArgumentError('Threshold must not be negative');
+  }
+
+  if (!caseSensitive) {
+    s = s.toLowerCase();
+    t = t.toLowerCase();
+  }
+
+  int s_len = s.length;
+  int t_len = t.length;
+
+  // if one string is empty,
+  // the edit distance is necessarily the length of the other
+  if (s_len == 0) {
+    return t_len <= threshold ? t_len : LEVENSHTEIN_MAX;
+  }
+  if (t_len == 0) {
+    return s_len <= threshold ? s_len : LEVENSHTEIN_MAX;
+  }
+  // the distance can never be less than abs(s_len - t_len)
+  if ((s_len - t_len).abs() > threshold) {
+    return LEVENSHTEIN_MAX;
+  }
+
+  // swap the two strings to consume less memory
+  if (s_len > t_len) {
+    String tmp = s;
+    s = t;
+    t = tmp;
+    s_len = t_len;
+    t_len = t.length;
+  }
+
+  // 'previous' cost array, horizontally
+  List<int> p = new List<int>.filled(s_len + 1, 0);
+  // cost array, horizontally
+  List<int> d = new List<int>.filled(s_len + 1, 0);
+  // placeholder to assist in swapping p and d
+  List<int> _d;
+
+  // fill in starting table values
+  int boundary = math.min(s_len, threshold) + 1;
+  for (int i = 0; i < boundary; i++) {
+    p[i] = i;
+  }
+
+  // these fills ensure that the value above the rightmost entry of our
+  // stripe will be ignored in following loop iterations
+  _setRange(p, boundary, p.length, _MAX_VALUE);
+  _setRange(d, 0, d.length, _MAX_VALUE);
+
+  // iterates through t
+  for (int j = 1; j <= t_len; j++) {
+    // jth character of t
+    int t_j = t.codeUnitAt(j - 1);
+    d[0] = j;
+
+    // compute stripe indices, constrain to array size
+    int min = math.max(1, j - threshold);
+    int max = math.min(s_len, j + threshold);
+
+    // the stripe may lead off of the table if s and t are of different sizes
+    if (min > max) {
+      return LEVENSHTEIN_MAX;
+    }
+
+    // ignore entry left of leftmost
+    if (min > 1) {
+      d[min - 1] = _MAX_VALUE;
+    }
+
+    // iterates through [min, max] in s
+    for (int i = min; i <= max; i++) {
+      if (s.codeUnitAt(i - 1) == t_j) {
+        // diagonally left and up
+        d[i] = p[i - 1];
+      } else {
+        // 1 + minimum of cell to the left, to the top, diagonally left and up
+        d[i] = 1 + math.min(math.min(d[i - 1], p[i]), p[i - 1]);
+      }
+    }
+
+    // copy current distance counts to 'previous row' distance counts
+    _d = p;
+    p = d;
+    d = _d;
+  }
+
+  // if p[n] is greater than the threshold,
+  // there's no guarantee on it being the correct distance
+  if (p[s_len] <= threshold) {
+    return p[s_len];
+  }
+
+  return LEVENSHTEIN_MAX;
+}
+
+void _setRange(List<int> a, int start, int end, int value) {
+  for (int i = start; i < end; i++) {
+    a[i] = value;
+  }
+}
diff --git a/pkg/analysis_services/lib/src/correction/source_buffer.dart b/pkg/analysis_services/lib/src/correction/source_buffer.dart
index fb9e204..48a030d 100644
--- a/pkg/analysis_services/lib/src/correction/source_buffer.dart
+++ b/pkg/analysis_services/lib/src/correction/source_buffer.dart
@@ -26,9 +26,12 @@
 
   SourceBuilder(this.file, this.offset);
 
+  SourceBuilder.buffer() : file = null, offset = 0;
+
+  int get length => _buffer.length;
+
   void addProposal(String proposal) {
-    // TODO(scheglov) implement
-//    _currentPositionGroup.addProposal();
+    _currentLinkedPositionGroup.addProposal(proposal);
   }
 
   void addProposals(List<String> proposals) {
@@ -80,6 +83,6 @@
     int start = offset + _currentPositionStart;
     int end = offset + _buffer.length;
     Position position = new Position(file, start, end - start);
-    _currentLinkedPositionGroup.add(position);
+    _currentLinkedPositionGroup.addPosition(position);
   }
 }
diff --git a/pkg/analysis_services/lib/src/correction/strings.dart b/pkg/analysis_services/lib/src/correction/strings.dart
index 14887cc..02acad6 100644
--- a/pkg/analysis_services/lib/src/correction/strings.dart
+++ b/pkg/analysis_services/lib/src/correction/strings.dart
@@ -58,6 +58,19 @@
   return str;
 }
 
+int compareStrings(String a, String b) {
+  if (a == b) {
+    return 0;
+  }
+  if (a == null) {
+    return 1;
+  }
+  if (b == null) {
+    return -1;
+  }
+  return a.compareTo(b);
+}
+
 String repeat(String s, int n) {
   StringBuffer sb = new StringBuffer();
   for (int i = 0; i < n; i++) {
diff --git a/pkg/analysis_services/lib/src/correction/util.dart b/pkg/analysis_services/lib/src/correction/util.dart
index e868a0f..b8ccbba 100644
--- a/pkg/analysis_services/lib/src/correction/util.dart
+++ b/pkg/analysis_services/lib/src/correction/util.dart
@@ -11,6 +11,7 @@
 import 'package:analysis_services/src/correction/strings.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
 
@@ -37,6 +38,26 @@
 
 
 /**
+ * @return the [ExecutableElement] of the enclosing executable [AstNode].
+ */
+ExecutableElement getEnclosingExecutableElement(AstNode node) {
+  while (node != null) {
+    if (node is FunctionDeclaration) {
+      return node.element;
+    }
+    if (node is ConstructorDeclaration) {
+      return node.element;
+    }
+    if (node is MethodDeclaration) {
+      return node.element;
+    }
+    node = node.parent;
+  }
+  return null;
+}
+
+
+/**
  * Returns [getExpressionPrecedence] for the parent of [node],
  * or `0` if the parent node is [ParenthesizedExpression].
  *
@@ -71,6 +92,34 @@
   return namespace.definedNames;
 }
 
+/**
+ * If given [AstNode] is name of qualified property extraction, returns target from which
+ * this property is extracted. Otherwise `null`.
+ */
+Expression getQualifiedPropertyTarget(AstNode node) {
+  AstNode parent = node.parent;
+  if (parent is PrefixedIdentifier) {
+    PrefixedIdentifier prefixed = parent;
+    if (identical(prefixed.identifier, node)) {
+      return parent.prefix;
+    }
+  }
+  if (parent is PropertyAccess) {
+    PropertyAccess access = parent;
+    if (identical(access.propertyName, node)) {
+      return access.realTarget;
+    }
+  }
+  return null;
+}
+
+
+/**
+ * Returns the [String] content of the given [Source].
+ */
+String getSourceContent(AnalysisContext context, Source source) {
+  return context.getContents(source).data;
+}
 
 class CorrectionUtils {
   final CompilationUnit unit;
@@ -100,6 +149,26 @@
   }
 
   /**
+   * Returns the actual type source of the given [Expression], may be `null`
+   * if can not be resolved, should be treated as the `dynamic` type.
+   */
+  String getExpressionTypeSource(Expression expression) {
+    if (expression == null) {
+      return null;
+    }
+    DartType type = expression.bestType;
+    if (type.isDynamic) {
+      return null;
+    }
+    return getTypeSource(type);
+  }
+
+  /**
+   * Returns the indentation with the given level.
+   */
+  String getIndent(int level) => repeat('  ', level);
+
+  /**
    * Skips whitespace characters and single EOL on the right from [index].
    *
    * If [index] the end of a statement or method, then in the most cases it is
@@ -145,6 +214,40 @@
   }
 
   /**
+   * Returns the whitespace prefix of the line which contains given offset.
+   */
+  String getLinePrefix(int index) {
+    int lineStart = getLineThis(index);
+    int length = _buffer.length;
+    int lineNonWhitespace = lineStart;
+    while (lineNonWhitespace < length) {
+      int c = _buffer.codeUnitAt(lineNonWhitespace);
+      if (c == 0xD || c == 0xA) {
+        break;
+      }
+      if (!isWhitespace(c)) {
+        break;
+      }
+      lineNonWhitespace++;
+    }
+    return getText2(lineStart, lineNonWhitespace - lineStart);
+  }
+
+  /**
+   * Returns the start index of the line which contains given index.
+   */
+  int getLineThis(int index) {
+    while (index > 0) {
+      int c = _buffer.codeUnitAt(index - 1);
+      if (c == 0xD || c == 0xA) {
+        break;
+      }
+      index--;
+    }
+    return index;
+  }
+
+  /**
    * Returns a [SourceRange] that covers [range] and extends (if possible) to
    * cover whole lines.
    */
@@ -160,6 +263,20 @@
   }
 
   /**
+   * Returns the line prefix consisting of spaces and tabs on the left from the given
+   *         [AstNode].
+   */
+  String getNodePrefix(AstNode node) {
+    int offset = node.offset;
+    // function literal is special, it uses offset of enclosing line
+    if (node is FunctionExpression) {
+      return getLinePrefix(offset);
+    }
+    // use just prefix directly before node
+    return getPrefix(offset);
+  }
+
+  /**
    * @return the source for the parameter with the given type and name.
    */
   String getParameterSource(DartType type, String name) {
@@ -198,22 +315,26 @@
   }
 
   /**
-   * Returns the actual type source of the given [Expression], may be `null`
-   * if can not be resolved, should be treated as the `dynamic` type.
+   * Returns the line prefix consisting of spaces and tabs on the left from the
+   * given offset.
    */
-  String getExpressionTypeSource(Expression expression) {
-    if (expression == null) {
-      return null;
-    }
-    DartType type = expression.bestType;
-    String typeSource = getTypeSource(type);
-    if ("dynamic" == typeSource) {
-      return null;
-    }
-    return typeSource;
+  String getPrefix(int endIndex) {
+    int startIndex = getLineContentStart(endIndex);
+    return _buffer.substring(startIndex, endIndex);
   }
 
   /**
+   * Returns the text of the given [AstNode] in the unit.
+   */
+  String getText(AstNode node) => getText2(node.offset, node.length);
+
+  /**
+   * Returns the text of the given range in the unit.
+   */
+  String getText2(int offset, int length) =>
+      _buffer.substring(offset, offset + length);
+
+  /**
    * Returns the source to reference [type] in this [CompilationUnit].
    */
   String getTypeSource(DartType type) {
diff --git a/pkg/analysis_services/test/correction/change_test.dart b/pkg/analysis_services/test/correction/change_test.dart
index d0fd91e..895454b 100644
--- a/pkg/analysis_services/test/correction/change_test.dart
+++ b/pkg/analysis_services/test/correction/change_test.dart
@@ -15,38 +15,16 @@
 
 main() {
   groupSep = ' | ';
-  group('ChangeTest', () {
-    runReflectiveTests(ChangeTest);
-  });
-  group('EditTest', () {
-    runReflectiveTests(EditTest);
-  });
-  group('FileEditTest', () {
-    runReflectiveTests(FileEditTest);
-  });
-  group('LinkedPositionGroupTest', () {
-    runReflectiveTests(LinkedPositionGroupTest);
-  });
-  group('PositionTest', () {
-    runReflectiveTests(PositionTest);
-  });
+  runReflectiveTests(ChangeTest);
+  runReflectiveTests(EditTest);
+  runReflectiveTests(FileEditTest);
+  runReflectiveTests(LinkedPositionGroupTest);
+  runReflectiveTests(PositionTest);
 }
 
 
 @ReflectiveTestCase()
 class ChangeTest {
-//  void test_fromJson() {
-//    var json = {
-//      OFFSET: 1,
-//      LENGTH: 2,
-//      REPLACEMENT: 'foo'
-//    };
-//    Edit edit = Edit.fromJson(json);
-//    expect(edit.offset, 1);
-//    expect(edit.length, 2);
-//    expect(edit.replacement, 'foo');
-//  }
-
   void test_fromJson() {
     var json = {
       MESSAGE: 'msg',
@@ -142,11 +120,11 @@
         ..add(new Edit(21, 22, 'xxx'))
         ..add(new Edit(210, 220, 'yyy')));
     change.addLinkedPositionGroup(new LinkedPositionGroup('id-a')
-        ..add(new Position('/ga.dart', 1, 2))
-        ..add(new Position('/ga.dart', 10, 2)));
+        ..addPosition(new Position('/ga.dart', 1, 2))
+        ..addPosition(new Position('/ga.dart', 10, 2)));
     change.addLinkedPositionGroup(new LinkedPositionGroup('id-b')
-        ..add(new Position('/gb.dart', 10, 5))
-        ..add(new Position('/gb.dart', 100, 5)));
+        ..addPosition(new Position('/gb.dart', 10, 5))
+        ..addPosition(new Position('/gb.dart', 100, 5)));
     expect(
         change.toString(),
         'Change(message=msg, edits=[FileEdit(file=/a.dart, edits=['
@@ -172,11 +150,11 @@
         ..add(new Edit(21, 22, 'xxx'))
         ..add(new Edit(210, 220, 'yyy')));
     change.addLinkedPositionGroup(new LinkedPositionGroup('id-a')
-        ..add(new Position('/ga.dart', 1, 2))
-        ..add(new Position('/ga.dart', 10, 2)));
+        ..addPosition(new Position('/ga.dart', 1, 2))
+        ..addPosition(new Position('/ga.dart', 10, 2)));
     change.addLinkedPositionGroup(new LinkedPositionGroup('id-b')
-        ..add(new Position('/gb.dart', 10, 5))
-        ..add(new Position('/gb.dart', 100, 5)));
+        ..addPosition(new Position('/gb.dart', 10, 5))
+        ..addPosition(new Position('/gb.dart', 100, 5)));
     var expectedJson = {
       MESSAGE: 'msg',
       EDITS: [{
@@ -338,9 +316,9 @@
 class LinkedPositionGroupTest {
   void test_addWrongLength() {
     LinkedPositionGroup group = new LinkedPositionGroup('my-id');
-    group.add(new Position('/a.dart', 1, 2));
+    group.addPosition(new Position('/a.dart', 1, 2));
     expect(() {
-      group.add(new Position('/b.dart', 10, 20));
+      group.addPosition(new Position('/b.dart', 10, 20));
     }, throws);
   }
 
@@ -366,8 +344,8 @@
 
   void test_new() {
     LinkedPositionGroup group = new LinkedPositionGroup('my-id');
-    group.add(new Position('/a.dart', 1, 2));
-    group.add(new Position('/b.dart', 10, 2));
+    group.addPosition(new Position('/a.dart', 1, 2));
+    group.addPosition(new Position('/b.dart', 10, 2));
     expect(
         group.toString(),
         'LinkedPositionGroup(id=my-id, positions=['
@@ -377,8 +355,8 @@
 
   void test_toJson() {
     LinkedPositionGroup group = new LinkedPositionGroup('my-id');
-    group.add(new Position('/a.dart', 1, 2));
-    group.add(new Position('/b.dart', 10, 2));
+    group.addPosition(new Position('/a.dart', 1, 2));
+    group.addPosition(new Position('/b.dart', 10, 2));
     var expectedJson = {
       ID: 'my-id',
       POSITIONS: [{
diff --git a/pkg/analysis_services/test/correction/fix_test.dart b/pkg/analysis_services/test/correction/fix_test.dart
index 31f926a..3d606dc 100644
--- a/pkg/analysis_services/test/correction/fix_test.dart
+++ b/pkg/analysis_services/test/correction/fix_test.dart
@@ -20,9 +20,7 @@
 
 main() {
   groupSep = ' | ';
-  group('FixProcessorTest', () {
-    runReflectiveTests(FixProcessorTest);
-  });
+  runReflectiveTests(FixProcessorTest);
 }
 
 
@@ -61,7 +59,7 @@
 
   void assertNoFix(FixKind kind) {
     AnalysisError error = _findErrorToFix();
-    List<Fix> fixes = computeFixes(searchEngine, testFile, testUnit, error);
+    List<Fix> fixes = computeFixes(searchEngine, testUnit, error);
     for (Fix fix in fixes) {
       if (fix.kind == kind) {
         throw fail('Unexpected fix $kind in\n${fixes.join('\n')}');
@@ -69,6 +67,24 @@
     }
   }
 
+  void assert_undefinedFunction_create_returnType_bool(String lineWithTest) {
+    _indexTestUnit('''
+main() {
+  bool b = true;
+  $lineWithTest
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  bool b = true;
+  $lineWithTest
+}
+
+bool test() {
+}
+''');
+  }
+
   Position expectedPosition(String search) {
     int offset = resultCode.indexOf(search);
     int length = getLeadingIdentifierLength(search);
@@ -244,6 +260,94 @@
     assertNoFix(FixKind.ADD_SUPER_CONSTRUCTOR_INVOCATION);
   }
 
+  void test_createConstructorSuperImplicit() {
+    _indexTestUnit('''
+class A {
+  A(p1, int p2, List<String> p3, [int p4]);
+}
+class B extends A {
+  int existingField;
+
+  void existingMethod() {}
+}
+''');
+    assertHasFix(FixKind.CREATE_CONSTRUCTOR_SUPER, '''
+class A {
+  A(p1, int p2, List<String> p3, [int p4]);
+}
+class B extends A {
+  int existingField;
+
+  B(p1, int p2, List<String> p3) : super(p1, p2, p3);
+
+  void existingMethod() {}
+}
+''');
+  }
+
+  void test_createConstructorSuperImplicit_fieldInitializer() {
+    _indexTestUnit('''
+class A {
+  int _field;
+  A(this._field);
+}
+class B extends A {
+  int existingField;
+
+  void existingMethod() {}
+}
+''');
+    assertHasFix(FixKind.CREATE_CONSTRUCTOR_SUPER, '''
+class A {
+  int _field;
+  A(this._field);
+}
+class B extends A {
+  int existingField;
+
+  B(int field) : super(field);
+
+  void existingMethod() {}
+}
+''');
+  }
+
+  void test_createConstructorSuperImplicit_named() {
+    _indexTestUnit('''
+class A {
+  A.named(p1, int p2);
+}
+class B extends A {
+  int existingField;
+
+  void existingMethod() {}
+}
+''');
+    assertHasFix(FixKind.CREATE_CONSTRUCTOR_SUPER, '''
+class A {
+  A.named(p1, int p2);
+}
+class B extends A {
+  int existingField;
+
+  B.named(p1, int p2) : super.named(p1, p2);
+
+  void existingMethod() {}
+}
+''');
+  }
+
+  void test_createConstructorSuperImplicit_private() {
+    _indexTestUnit('''
+class A {
+  A._named(p);
+}
+class B extends A {
+}
+''');
+    assertNoFix(FixKind.CREATE_CONSTRUCTOR_SUPER);
+  }
+
   void test_createConstructor_insteadOfSyntheticDefault() {
     _indexTestUnit('''
 class A {
@@ -292,6 +396,455 @@
 ''');
   }
 
+  void test_createMissingOverrides_functionType() {
+    _indexTestUnit('''
+abstract class A {
+  forEach(int f(double p1, String p2));
+}
+
+class B extends A {
+}
+''');
+    assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+abstract class A {
+  forEach(int f(double p1, String p2));
+}
+
+class B extends A {
+  @override
+  forEach(int f(double p1, String p2)) {
+    // TODO: implement forEach
+  }
+}
+''');
+  }
+
+  void test_createMissingOverrides_generics() {
+    _indexTestUnit('''
+class Iterator<T> {
+}
+
+abstract class IterableMixin<T> {
+  Iterator<T> get iterator;
+}
+
+class Test extends IterableMixin<int> {
+}
+''');
+    assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+class Iterator<T> {
+}
+
+abstract class IterableMixin<T> {
+  Iterator<T> get iterator;
+}
+
+class Test extends IterableMixin<int> {
+  // TODO: implement iterator
+  @override
+  Iterator<int> get iterator => null;
+}
+''');
+  }
+
+  void test_createMissingOverrides_getter() {
+    _indexTestUnit('''
+abstract class A {
+  get g1;
+  int get g2;
+}
+
+class B extends A {
+}
+''');
+    assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+abstract class A {
+  get g1;
+  int get g2;
+}
+
+class B extends A {
+  // TODO: implement g1
+  @override
+  get g1 => null;
+
+  // TODO: implement g2
+  @override
+  int get g2 => null;
+}
+''');
+  }
+
+  void test_createMissingOverrides_importPrefix() {
+    _indexTestUnit('''
+import 'dart:async' as aaa;
+abstract class A {
+  Map<aaa.Future, List<aaa.Future>> g(aaa.Future p);
+}
+
+class B extends A {
+}
+''');
+    assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+import 'dart:async' as aaa;
+abstract class A {
+  Map<aaa.Future, List<aaa.Future>> g(aaa.Future p);
+}
+
+class B extends A {
+  @override
+  Map<aaa.Future, List<aaa.Future>> g(aaa.Future p) {
+    // TODO: implement g
+  }
+}
+''');
+  }
+
+  void test_createMissingOverrides_method() {
+    _indexTestUnit('''
+abstract class A {
+  m1();
+  int m2();
+  String m3(int p1, double p2, Map<int, List<String>> p3);
+  String m4(p1, p2);
+  String m5(p1, [int p2 = 2, int p3, p4 = 4]);
+  String m6(p1, {int p2: 2, int p3, p4: 4});
+}
+
+class B extends A {
+}
+''');
+    String expectedCode = '''
+abstract class A {
+  m1();
+  int m2();
+  String m3(int p1, double p2, Map<int, List<String>> p3);
+  String m4(p1, p2);
+  String m5(p1, [int p2 = 2, int p3, p4 = 4]);
+  String m6(p1, {int p2: 2, int p3, p4: 4});
+}
+
+class B extends A {
+  @override
+  m1() {
+    // TODO: implement m1
+  }
+
+  @override
+  int m2() {
+    // TODO: implement m2
+  }
+
+  @override
+  String m3(int p1, double p2, Map<int, List<String>> p3) {
+    // TODO: implement m3
+  }
+
+  @override
+  String m4(p1, p2) {
+    // TODO: implement m4
+  }
+
+  @override
+  String m5(p1, [int p2 = 2, int p3, p4 = 4]) {
+    // TODO: implement m5
+  }
+
+  @override
+  String m6(p1, {int p2: 2, int p3, p4: 4}) {
+    // TODO: implement m6
+  }
+}
+''';
+    assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, expectedCode);
+    // end position should be on "m1", not on "m2", "m3", etc
+    {
+      Position endPosition = change.endPosition;
+      expect(endPosition, isNotNull);
+      expect(endPosition.file, testFile);
+      int endOffset = endPosition.offset;
+      String endString = expectedCode.substring(endOffset, endOffset + 25);
+      expect(endString, contains('m1'));
+      expect(endString, isNot(contains('m2')));
+      expect(endString, isNot(contains('m3')));
+      expect(endString, isNot(contains('m4')));
+      expect(endString, isNot(contains('m5')));
+      expect(endString, isNot(contains('m6')));
+    }
+  }
+
+  void test_createMissingOverrides_operator() {
+    _indexTestUnit('''
+abstract class A {
+  int operator [](int index);
+  void operator []=(int index, String value);
+}
+
+class B extends A {
+}
+''');
+    assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+abstract class A {
+  int operator [](int index);
+  void operator []=(int index, String value);
+}
+
+class B extends A {
+  @override
+  int operator [](int index) {
+    // TODO: implement []
+  }
+
+  @override
+  void operator []=(int index, String value) {
+    // TODO: implement []=
+  }
+}
+''');
+  }
+
+  void test_createMissingOverrides_setter() {
+    _indexTestUnit('''
+abstract class A {
+  set s1(x);
+  set s2(int x);
+  void set s3(String x);
+}
+
+class B extends A {
+}
+''');
+    assertHasFix(FixKind.CREATE_MISSING_OVERRIDES, '''
+abstract class A {
+  set s1(x);
+  set s2(int x);
+  void set s3(String x);
+}
+
+class B extends A {
+  @override
+  set s1(x) {
+    // TODO: implement s1
+  }
+
+  @override
+  set s2(int x) {
+    // TODO: implement s2
+  }
+
+  @override
+  void set s3(String x) {
+    // TODO: implement s3
+  }
+}
+''');
+  }
+
+  void test_createNoSuchMethod() {
+    _indexTestUnit('''
+abstract class A {
+  m1();
+  int m2();
+}
+
+class B extends A {
+  existing() {}
+}
+''');
+    assertHasFix(FixKind.CREATE_NO_SUCH_METHOD, '''
+abstract class A {
+  m1();
+  int m2();
+}
+
+class B extends A {
+  existing() {}
+
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
+''');
+  }
+
+  void test_creationFunction_forFunctionType_cascadeSecond() {
+    _indexTestUnit('''
+class A {
+  B ma() => null;
+}
+class B {
+  useFunction(int g(double a, String b)) {}
+}
+
+main() {
+  A a = new A();
+  a..ma().useFunction(test);
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+class A {
+  B ma() => null;
+}
+class B {
+  useFunction(int g(double a, String b)) {}
+}
+
+main() {
+  A a = new A();
+  a..ma().useFunction(test);
+}
+
+int test(double a, String b) {
+}
+''');
+  }
+
+  void test_creationFunction_forFunctionType_dynamicArgument() {
+    _indexTestUnit('''
+main() {
+  useFunction(test);
+}
+useFunction(int g(a, b)) {}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  useFunction(test);
+}
+useFunction(int g(a, b)) {}
+
+int test(a, b) {
+}
+''');
+  }
+
+  void test_creationFunction_forFunctionType_function() {
+    _indexTestUnit('''
+main() {
+  useFunction(test);
+}
+useFunction(int g(double a, String b)) {}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  useFunction(test);
+}
+useFunction(int g(double a, String b)) {}
+
+int test(double a, String b) {
+}
+''');
+  }
+
+  void test_creationFunction_forFunctionType_method_enclosingClass_static() {
+    _indexTestUnit('''
+class A {
+  static foo() {
+    useFunction(test);
+  }
+}
+useFunction(int g(double a, String b)) {}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  static foo() {
+    useFunction(test);
+  }
+
+  static int test(double a, String b) {
+  }
+}
+useFunction(int g(double a, String b)) {}
+''');
+  }
+
+  void test_creationFunction_forFunctionType_method_enclosingClass_static2() {
+    _indexTestUnit('''
+class A {
+  var f;
+  A() : f = useFunction(test);
+}
+useFunction(int g(double a, String b)) {}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  var f;
+  A() : f = useFunction(test);
+
+  static int test(double a, String b) {
+  }
+}
+useFunction(int g(double a, String b)) {}
+''');
+  }
+
+  void test_creationFunction_forFunctionType_method_targetClass() {
+    _indexTestUnit('''
+main(A a) {
+  useFunction(a.test);
+}
+class A {
+}
+useFunction(int g(double a, String b)) {}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+main(A a) {
+  useFunction(a.test);
+}
+class A {
+  int test(double a, String b) {
+  }
+}
+useFunction(int g(double a, String b)) {}
+''');
+  }
+
+  void
+      test_creationFunction_forFunctionType_method_targetClass_hasOtherMember() {
+    _indexTestUnit('''
+main(A a) {
+  useFunction(a.test);
+}
+class A {
+  m() {}
+}
+useFunction(int g(double a, String b)) {}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+main(A a) {
+  useFunction(a.test);
+}
+class A {
+  m() {}
+
+  int test(double a, String b) {
+  }
+}
+useFunction(int g(double a, String b)) {}
+''');
+  }
+
+  void test_creationFunction_forFunctionType_notFunctionType() {
+    _indexTestUnit('''
+main(A a) {
+  useFunction(a.test);
+}
+typedef A();
+useFunction(g) {}
+''');
+    assertNoFix(FixKind.CREATE_METHOD);
+    assertNoFix(FixKind.CREATE_FUNCTION);
+  }
+
+  void test_creationFunction_forFunctionType_unknownTarget() {
+    _indexTestUnit('''
+main(A a) {
+  useFunction(a.test);
+}
+class A {
+}
+useFunction(g) {}
+''');
+    assertNoFix(FixKind.CREATE_METHOD);
+  }
+
   void test_expectedToken_semicolon() {
     _indexTestUnit('''
 main() {
@@ -467,6 +1020,501 @@
 ''');
   }
 
+  void test_undefinedClass_useSimilar_fromImport() {
+    _indexTestUnit('''
+main() {
+  Stirng s = 'abc';
+}
+''');
+    assertHasFix(FixKind.CHANGE_TO, '''
+main() {
+  String s = 'abc';
+}
+''');
+  }
+
+  void test_undefinedClass_useSimilar_fromThisLibrary() {
+    _indexTestUnit('''
+class MyClass {}
+main() {
+  MyCalss v = null;
+}
+''');
+    assertHasFix(FixKind.CHANGE_TO, '''
+class MyClass {}
+main() {
+  MyClass v = null;
+}
+''');
+  }
+
+  void test_undefinedFunction_create_fromFunction() {
+    _indexTestUnit('''
+main() {
+  int v = myUndefinedFunction(1, 2.0, '3');
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  int v = myUndefinedFunction(1, 2.0, '3');
+}
+
+int myUndefinedFunction(int i, double d, String s) {
+}
+''');
+  }
+
+  void test_undefinedFunction_create_fromMethod() {
+    _indexTestUnit('''
+class A {
+  main() {
+    int v = myUndefinedFunction(1, 2.0, '3');
+  }
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+class A {
+  main() {
+    int v = myUndefinedFunction(1, 2.0, '3');
+  }
+}
+
+int myUndefinedFunction(int i, double d, String s) {
+}
+''');
+  }
+
+  void test_undefinedFunction_create_returnType_bool_expressions() {
+    assert_undefinedFunction_create_returnType_bool("!test();");
+    assert_undefinedFunction_create_returnType_bool("b && test();");
+    assert_undefinedFunction_create_returnType_bool("test() && b;");
+    assert_undefinedFunction_create_returnType_bool("b || test();");
+    assert_undefinedFunction_create_returnType_bool("test() || b;");
+  }
+
+  void test_undefinedFunction_create_returnType_bool_statements() {
+    assert_undefinedFunction_create_returnType_bool("assert ( test() );");
+    assert_undefinedFunction_create_returnType_bool("if ( test() ) {}");
+    assert_undefinedFunction_create_returnType_bool("while ( test() ) {}");
+    assert_undefinedFunction_create_returnType_bool("do {} while ( test() );");
+  }
+
+  void test_undefinedFunction_create_returnType_fromAssignment_eq() {
+    _indexTestUnit('''
+main() {
+  int v;
+  v = myUndefinedFunction();
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  int v;
+  v = myUndefinedFunction();
+}
+
+int myUndefinedFunction() {
+}
+''');
+  }
+
+  void test_undefinedFunction_create_returnType_fromAssignment_plusEq() {
+    _indexTestUnit('''
+main() {
+  int v;
+  v += myUndefinedFunction();
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  int v;
+  v += myUndefinedFunction();
+}
+
+num myUndefinedFunction() {
+}
+''');
+  }
+
+  void test_undefinedFunction_create_returnType_fromBinary_right() {
+    _indexTestUnit('''
+main() {
+  0 + myUndefinedFunction();
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  0 + myUndefinedFunction();
+}
+
+num myUndefinedFunction() {
+}
+''');
+  }
+
+  void test_undefinedFunction_create_returnType_fromInitializer() {
+    _indexTestUnit('''
+main() {
+  int v = myUndefinedFunction();
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  int v = myUndefinedFunction();
+}
+
+int myUndefinedFunction() {
+}
+''');
+  }
+
+  void test_undefinedFunction_create_returnType_fromInvocationArgument() {
+    _indexTestUnit('''
+foo(int p) {}
+main() {
+  foo( myUndefinedFunction() );
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+foo(int p) {}
+main() {
+  foo( myUndefinedFunction() );
+}
+
+int myUndefinedFunction() {
+}
+''');
+  }
+
+  void test_undefinedFunction_create_returnType_fromReturn() {
+    _indexTestUnit('''
+int main() {
+  return myUndefinedFunction();
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+int main() {
+  return myUndefinedFunction();
+}
+
+int myUndefinedFunction() {
+}
+''');
+  }
+
+  void test_undefinedFunction_create_returnType_void() {
+    _indexTestUnit('''
+main() {
+  myUndefinedFunction();
+}
+''');
+    assertHasFix(FixKind.CREATE_FUNCTION, '''
+main() {
+  myUndefinedFunction();
+}
+
+void myUndefinedFunction() {
+}
+''');
+  }
+
+  void test_undefinedFunction_useSimilar_fromImport() {
+    _indexTestUnit('''
+main() {
+  pritn(0);
+}
+''');
+    assertHasFix(FixKind.CHANGE_TO, '''
+main() {
+  print(0);
+}
+''');
+  }
+
+  void test_undefinedFunction_useSimilar_thisLibrary() {
+    _indexTestUnit('''
+myFunction() {}
+main() {
+  myFuntcion();
+}
+''');
+    assertHasFix(FixKind.CHANGE_TO, '''
+myFunction() {}
+main() {
+  myFunction();
+}
+''');
+  }
+
+  void test_undefinedMethod_createQualified_fromClass() {
+    _indexTestUnit('''
+class A {
+}
+main() {
+  A.myUndefinedMethod();
+}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  static void myUndefinedMethod() {
+  }
+}
+main() {
+  A.myUndefinedMethod();
+}
+''');
+  }
+
+  void test_undefinedMethod_createQualified_fromClass_hasOtherMember() {
+    _indexTestUnit('''
+class A {
+  foo() {}
+}
+main() {
+  A.myUndefinedMethod();
+}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  foo() {}
+
+  static void myUndefinedMethod() {
+  }
+}
+main() {
+  A.myUndefinedMethod();
+}
+''');
+  }
+
+  void test_undefinedMethod_createQualified_fromInstance() {
+    _indexTestUnit('''
+class A {
+}
+main(A a) {
+  a.myUndefinedMethod();
+}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  void myUndefinedMethod() {
+  }
+}
+main(A a) {
+  a.myUndefinedMethod();
+}
+''');
+  }
+
+  void test_undefinedMethod_createQualified_targetIsFunctionType() {
+    _indexTestUnit('''
+typedef A();
+main() {
+  A.myUndefinedMethod();
+}
+''');
+    assertNoFix(FixKind.CREATE_METHOD);
+  }
+
+  void test_undefinedMethod_createQualified_targetIsUnresolved() {
+    _indexTestUnit('''
+main() {
+  NoSuchClass.myUndefinedMethod();
+}
+''');
+    assertNoFix(FixKind.CREATE_METHOD);
+  }
+
+  void test_undefinedMethod_createUnqualified_parameters() {
+    _indexTestUnit('''
+class A {
+  main() {
+    myUndefinedMethod(0, 1.0, '3');
+  }
+}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  main() {
+    myUndefinedMethod(0, 1.0, '3');
+  }
+
+  void myUndefinedMethod(int i, double d, String s) {
+  }
+}
+''');
+    // linked positions
+    _assertHasLinkedPositions(
+        'NAME',
+        ['myUndefinedMethod(0', 'myUndefinedMethod(int']);
+    _assertHasLinkedPositions('RETURN_TYPE', ['void myUndefinedMethod(']);
+    _assertHasLinkedPositions('TYPE0', ['int i']);
+    _assertHasLinkedPositions('TYPE1', ['double d']);
+    _assertHasLinkedPositions('TYPE2', ['String s']);
+    _assertHasLinkedPositions('ARG0', ['i,']);
+    _assertHasLinkedPositions('ARG1', ['d,']);
+    _assertHasLinkedPositions('ARG2', ['s)']);
+    // linked proposals
+    _assertHasLinkedProposals('TYPE0', ['int', 'num', 'Object', 'Comparable']);
+    _assertHasLinkedProposals(
+        'TYPE1',
+        ['double', 'num', 'Object', 'Comparable']);
+    _assertHasLinkedProposals('TYPE2', ['String', 'Object', 'Comparable']);
+  }
+
+  void test_undefinedMethod_createUnqualified_returnType() {
+    _indexTestUnit('''
+class A {
+  main() {
+    int v = myUndefinedMethod();
+  }
+}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  main() {
+    int v = myUndefinedMethod();
+  }
+
+  int myUndefinedMethod() {
+  }
+}
+''');
+    // linked positions
+    _assertHasLinkedPositions(
+        'NAME',
+        ['myUndefinedMethod();', 'myUndefinedMethod() {']);
+    _assertHasLinkedPositions('RETURN_TYPE', ['int myUndefinedMethod(']);
+  }
+
+  void test_undefinedMethod_createUnqualified_staticFromField() {
+    _indexTestUnit('''
+class A {
+  static var f = myUndefinedMethod();
+}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  static var f = myUndefinedMethod();
+
+  static myUndefinedMethod() {
+  }
+}
+''');
+  }
+
+  void test_undefinedMethod_createUnqualified_staticFromMethod() {
+    _indexTestUnit('''
+class A {
+  static main() {
+    myUndefinedMethod();
+  }
+}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  static main() {
+    myUndefinedMethod();
+  }
+
+  static void myUndefinedMethod() {
+  }
+}
+''');
+  }
+
+  void test_undefinedMethod_hint_createQualified_fromInstance() {
+    _indexTestUnit('''
+class A {
+}
+main() {
+  var a = new A();
+  a.myUndefinedMethod();
+}
+''');
+    assertHasFix(FixKind.CREATE_METHOD, '''
+class A {
+  void myUndefinedMethod() {
+  }
+}
+main() {
+  var a = new A();
+  a.myUndefinedMethod();
+}
+''');
+  }
+
+  void test_undefinedMethod_useSimilar_ignoreOperators() {
+    _indexTestUnit('''
+main(Object object) {
+  object.then();
+}
+''');
+    assertNoFix(FixKind.CHANGE_TO);
+  }
+
+  void test_undefinedMethod_useSimilar_qualified() {
+    _indexTestUnit('''
+class A {
+  myMethod() {}
+}
+main() {
+  A a = new A();
+  a.myMehtod();
+}
+''');
+    assertHasFix(FixKind.CHANGE_TO, '''
+class A {
+  myMethod() {}
+}
+main() {
+  A a = new A();
+  a.myMethod();
+}
+''');
+  }
+
+  void test_undefinedMethod_useSimilar_unqualified_superClass() {
+    _indexTestUnit('''
+class A {
+  myMethod() {}
+}
+class B extends A {
+  main() {
+    myMehtod();
+  }
+}
+''');
+    assertHasFix(FixKind.CHANGE_TO, '''
+class A {
+  myMethod() {}
+}
+class B extends A {
+  main() {
+    myMethod();
+  }
+}
+''');
+  }
+
+  void test_undefinedMethod_useSimilar_unqualified_thisClass() {
+    _indexTestUnit('''
+class A {
+  myMethod() {}
+  main() {
+    myMehtod();
+  }
+}
+''');
+    assertHasFix(FixKind.CHANGE_TO, '''
+class A {
+  myMethod() {}
+  main() {
+    myMethod();
+  }
+}
+''');
+  }
+
   void test_useEffectiveIntegerDivision() {
     _indexTestUnit('''
 main() {
@@ -498,7 +1546,7 @@
    * Computes fixes and verifies that there is a fix of the given kind.
    */
   Fix _assertHasFix(FixKind kind, AnalysisError error) {
-    List<Fix> fixes = computeFixes(searchEngine, testFile, testUnit, error);
+    List<Fix> fixes = computeFixes(searchEngine, testUnit, error);
     for (Fix fix in fixes) {
       if (fix.kind == kind) {
         return fix;
@@ -507,6 +1555,30 @@
     throw fail('Expected to find fix $kind in\n${fixes.join('\n')}');
   }
 
+  void _assertHasLinkedPositions(String groupId, List<String> expectedStrings) {
+    List<Position> expectedPositions = _findResultPositions(expectedStrings);
+    List<LinkedPositionGroup> groups = change.linkedPositionGroups;
+    for (LinkedPositionGroup group in groups) {
+      if (group.id == groupId) {
+        List<Position> actualPositions = group.positions;
+        expect(actualPositions, unorderedEquals(expectedPositions));
+        return;
+      }
+    }
+    fail('No group with ID=$groupId foind in\n${groups.join('\n')}');
+  }
+
+  void _assertHasLinkedProposals(String groupId, List<String> expected) {
+    List<LinkedPositionGroup> groups = change.linkedPositionGroups;
+    for (LinkedPositionGroup group in groups) {
+      if (group.id == groupId) {
+        expect(group.proposals, expected);
+        return;
+      }
+    }
+    fail('No group with ID=$groupId foind in\n${groups.join('\n')}');
+  }
+
   AnalysisError _findErrorToFix() {
     List<AnalysisError> errors = context.computeErrors(testSource);
     expect(
@@ -517,6 +1589,16 @@
     return errors[0];
   }
 
+  List<Position> _findResultPositions(List<String> searchStrings) {
+    List<Position> positions = <Position>[];
+    for (String search in searchStrings) {
+      int offset = resultCode.indexOf(search);
+      int length = getLeadingIdentifierLength(search);
+      positions.add(new Position(testFile, offset, length));
+    }
+    return positions;
+  }
+
   void _indexTestUnit(String code) {
     resolveTestUnit(code);
     index.indexUnit(context, testUnit);
diff --git a/pkg/analysis_services/test/correction/levenshtein_test.dart b/pkg/analysis_services/test/correction/levenshtein_test.dart
new file mode 100644
index 0000000..4b8cde3
--- /dev/null
+++ b/pkg/analysis_services/test/correction/levenshtein_test.dart
@@ -0,0 +1,71 @@
+// Copyright (c) 2014, 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.
+
+// This code was auto-generated, is not intended to be edited, and is subject to
+// significant change. Please see the README file for more information.
+
+library test.services.correction.levenshtein;
+
+import 'package:analysis_services/src/correction/levenshtein.dart';
+import 'package:analysis_testing/reflective_tests.dart';
+import 'package:unittest/unittest.dart';
+
+
+main() {
+  groupSep = ' | ';
+  runReflectiveTests(LevenshteinTest);
+}
+
+@ReflectiveTestCase()
+class LevenshteinTest {
+  void test_different_caseInsensitive() {
+    expect(levenshtein('Saturday', 'sunday', 5, caseSensitive: false), 3);
+    expect(levenshtein('SaturDay', 'sunday', 5, caseSensitive: false), 3);
+  }
+
+  void test_different_onThreshold() {
+    expect(levenshtein('', 'abcde', 5), 5);
+    expect(levenshtein('abcde', '', 5), 5);
+  }
+
+  void test_different_overThreshold() {
+    expect(levenshtein('', 'abcde', 2), LEVENSHTEIN_MAX);
+    expect(levenshtein('abcde', '', 2), LEVENSHTEIN_MAX);
+  }
+
+  void test_different_overThreshold_length() {
+    expect(levenshtein('a', 'abcdefgh', 5), LEVENSHTEIN_MAX);
+    expect(levenshtein('abcdefgh', 'a', 5), LEVENSHTEIN_MAX);
+  }
+
+  void test_different_underThreshold() {
+    expect(levenshtein('String', 'Stirng', 5), 2);
+    expect(levenshtein('kitten', 'sitting', 5), 3);
+    expect(levenshtein('Saturday', 'Sunday', 5), 3);
+  }
+
+  void test_negativeThreshold() {
+    expect(() {
+      levenshtein('', '', -5);
+    }, throws);
+  }
+
+  void test_null() {
+    expect(() {
+      levenshtein('', null, 5);
+    }, throws);
+    expect(() {
+      levenshtein(null, '', 5);
+    }, throws);
+  }
+
+  void test_same() {
+    expect(levenshtein('', '', 5), 0);
+    expect(levenshtein('test', 'test', 5), 0);
+  }
+
+  void test_same_caseInsensitive() {
+    expect(levenshtein('test', 'Test', 5, caseSensitive: false), 0);
+  }
+}
\ No newline at end of file
diff --git a/pkg/analysis_services/test/correction/name_suggestion_test.dart b/pkg/analysis_services/test/correction/name_suggestion_test.dart
index c3fb487..7444910 100644
--- a/pkg/analysis_services/test/correction/name_suggestion_test.dart
+++ b/pkg/analysis_services/test/correction/name_suggestion_test.dart
@@ -17,9 +17,7 @@
 
 main() {
   groupSep = ' | ';
-  group('source_range', () {
-    runReflectiveTests(VariableNameSuggestionTest);
-  });
+  runReflectiveTests(VariableNameSuggestionTest);
 }
 
 
diff --git a/pkg/analysis_services/test/correction/source_range_test.dart b/pkg/analysis_services/test/correction/source_range_test.dart
index 419d523..710d3e6 100644
--- a/pkg/analysis_services/test/correction/source_range_test.dart
+++ b/pkg/analysis_services/test/correction/source_range_test.dart
@@ -20,9 +20,7 @@
 
 main() {
   groupSep = ' | ';
-  group('source_range', () {
-    runReflectiveTests(SourceRangesTest);
-  });
+  runReflectiveTests(SourceRangesTest);
 }
 
 
diff --git a/pkg/analysis_services/test/correction/strings_test.dart b/pkg/analysis_services/test/correction/strings_test.dart
index a02f164..47fbfa6 100644
--- a/pkg/analysis_services/test/correction/strings_test.dart
+++ b/pkg/analysis_services/test/correction/strings_test.dart
@@ -15,9 +15,7 @@
 
 main() {
   groupSep = ' | ';
-  group('strings', () {
-    runReflectiveTests(StringsTest);
-  });
+  runReflectiveTests(StringsTest);
 }
 
 
diff --git a/pkg/analysis_services/test/correction/test_all.dart b/pkg/analysis_services/test/correction/test_all.dart
index a092de11..7daed8bb 100644
--- a/pkg/analysis_services/test/correction/test_all.dart
+++ b/pkg/analysis_services/test/correction/test_all.dart
@@ -8,6 +8,7 @@
 
 import 'change_test.dart' as change_test;
 import 'fix_test.dart' as fix_test;
+import 'levenshtein_test.dart' as levenshtein_test;
 import 'name_suggestion_test.dart' as name_suggestion_test;
 import 'source_range_test.dart' as source_range_test;
 import 'strings_test.dart' as strings_test;
@@ -18,6 +19,7 @@
   group('correction', () {
     change_test.main();
     fix_test.main();
+    levenshtein_test.main();
     name_suggestion_test.main();
     source_range_test.main();
     strings_test.main();
diff --git a/pkg/analysis_services/test/index/dart_index_contributor_test.dart b/pkg/analysis_services/test/index/dart_index_contributor_test.dart
index f6d7e20..d5e23e6 100644
--- a/pkg/analysis_services/test/index/dart_index_contributor_test.dart
+++ b/pkg/analysis_services/test/index/dart_index_contributor_test.dart
@@ -18,9 +18,7 @@
 
 main() {
   groupSep = ' | ';
-  group('DartUnitContributor', () {
-    runReflectiveTests(DartUnitContributorTest);
-  });
+  runReflectiveTests(DartUnitContributorTest);
 }
 
 
diff --git a/pkg/analysis_services/test/index/local_index_test.dart b/pkg/analysis_services/test/index/local_index_test.dart
index d6e4b77..30076e9 100644
--- a/pkg/analysis_services/test/index/local_index_test.dart
+++ b/pkg/analysis_services/test/index/local_index_test.dart
@@ -21,9 +21,7 @@
 
 main() {
   groupSep = ' | ';
-  group('LocalIndex', () {
-    runReflectiveTests(LocalIndexTest);
-  });
+  runReflectiveTests(LocalIndexTest);
 }
 
 
diff --git a/pkg/analysis_services/test/index/store/codec_test.dart b/pkg/analysis_services/test/index/store/codec_test.dart
index 141c1cb..f62b9457 100644
--- a/pkg/analysis_services/test/index/store/codec_test.dart
+++ b/pkg/analysis_services/test/index/store/codec_test.dart
@@ -16,18 +16,10 @@
 
 main() {
   groupSep = ' | ';
-  group('ContextCodec', () {
-    runReflectiveTests(_ContextCodecTest);
-  });
-  group('ElementCodec', () {
-    runReflectiveTests(_ElementCodecTest);
-  });
-  group('RelationshipCodec', () {
-    runReflectiveTests(_RelationshipCodecTest);
-  });
-  group('StringCodec', () {
-    runReflectiveTests(_StringCodecTest);
-  });
+  runReflectiveTests(_ContextCodecTest);
+  runReflectiveTests(_ElementCodecTest);
+  runReflectiveTests(_RelationshipCodecTest);
+  runReflectiveTests(_StringCodecTest);
 }
 
 
diff --git a/pkg/analysis_services/test/index/store/collection_test.dart b/pkg/analysis_services/test/index/store/collection_test.dart
index 5868886..0872624 100644
--- a/pkg/analysis_services/test/index/store/collection_test.dart
+++ b/pkg/analysis_services/test/index/store/collection_test.dart
@@ -11,12 +11,8 @@
 
 main() {
   groupSep = ' | ';
-  group('IntArrayToIntMap', () {
-    runReflectiveTests(_IntArrayToIntMapTest);
-  });
-  group('IntToIntSetMap', () {
-    runReflectiveTests(_IntToIntSetMapTest);
-  });
+  runReflectiveTests(_IntArrayToIntMapTest);
+  runReflectiveTests(_IntToIntSetMapTest);
 }
 
 
diff --git a/pkg/analysis_services/test/index/store/separate_file_manager_test.dart b/pkg/analysis_services/test/index/store/separate_file_manager_test.dart
index a42a1dc..223fe2c 100644
--- a/pkg/analysis_services/test/index/store/separate_file_manager_test.dart
+++ b/pkg/analysis_services/test/index/store/separate_file_manager_test.dart
@@ -14,9 +14,7 @@
 
 main() {
   groupSep = ' | ';
-  group('SeparateFileManager', () {
-    runReflectiveTests(_SeparateFileManagerTest);
-  });
+  runReflectiveTests(_SeparateFileManagerTest);
 }
 
 
diff --git a/pkg/analysis_services/test/index/store/split_store_test.dart b/pkg/analysis_services/test/index/store/split_store_test.dart
index b0bdfd1..d4fd5a94 100644
--- a/pkg/analysis_services/test/index/store/split_store_test.dart
+++ b/pkg/analysis_services/test/index/store/split_store_test.dart
@@ -24,21 +24,11 @@
 
 main() {
   groupSep = ' | ';
-  group('FileNodeManager', () {
-    runReflectiveTests(_FileNodeManagerTest);
-  });
-  group('IndexNode', () {
-    runReflectiveTests(_IndexNodeTest);
-  });
-  group('LocationData', () {
-    runReflectiveTests(_LocationDataTest);
-  });
-  group('RelationKeyData', () {
-    runReflectiveTests(_RelationKeyDataTest);
-  });
-  group('SplitIndexStore', () {
-    runReflectiveTests(_SplitIndexStoreTest);
-  });
+  runReflectiveTests(_FileNodeManagerTest);
+  runReflectiveTests(_IndexNodeTest);
+  runReflectiveTests(_LocationDataTest);
+  runReflectiveTests(_RelationKeyDataTest);
+  runReflectiveTests(_SplitIndexStoreTest);
 }
 
 
diff --git a/pkg/analysis_services/test/search/hierarchy_test.dart b/pkg/analysis_services/test/search/hierarchy_test.dart
index c9a0c1d..da7d085 100644
--- a/pkg/analysis_services/test/search/hierarchy_test.dart
+++ b/pkg/analysis_services/test/search/hierarchy_test.dart
@@ -21,9 +21,7 @@
 
 main() {
   groupSep = ' | ';
-  group('HierarchyTest', () {
-    runReflectiveTests(HierarchyTest);
-  });
+  runReflectiveTests(HierarchyTest);
 }
 
 
@@ -38,7 +36,7 @@
     searchEngine = new SearchEngineImpl(index);
   }
 
-  void test_getDirectMembers() {
+  void test_getClassMembers() {
     _indexTestUnit('''
 class A {
   A() {}
@@ -208,6 +206,34 @@
     return Future.wait([futureA, futureB, futureD]);
   }
 
+  void test_getMembers() {
+    _indexTestUnit('''
+class A {
+  A() {}
+  var ma1;
+  ma2() {}
+}
+class B extends A {
+  B() {}
+  B.named() {}
+  var mb1;
+  mb2() {}
+}
+''');
+    {
+      ClassElement classA = findElement('A');
+      List<Element> members = getMembers(classA);
+      expect(members.map((e) => e.name), unorderedEquals(['ma1', 'ma2']));
+    }
+    {
+      ClassElement classB = findElement('B');
+      List<Element> members = getMembers(classB);
+      expect(
+          members.map((e) => e.name),
+          unorderedEquals(['mb1', 'mb2', 'ma1', 'ma2']));
+    }
+  }
+
   Future test_getSubClasses() {
     _indexTestUnit('''
 class A {}
diff --git a/pkg/analysis_services/test/search/search_engine_test.dart b/pkg/analysis_services/test/search/search_engine_test.dart
index 0445c24..73b5ab0 100644
--- a/pkg/analysis_services/test/search/search_engine_test.dart
+++ b/pkg/analysis_services/test/search/search_engine_test.dart
@@ -24,9 +24,7 @@
 
 main() {
   groupSep = ' | ';
-  group('SearchEngineImplTest', () {
-    runReflectiveTests(SearchEngineImplTest);
-  });
+  runReflectiveTests(SearchEngineImplTest);
 }
 
 class ExpectedMatch {
diff --git a/pkg/analysis_testing/lib/mock_sdk.dart b/pkg/analysis_testing/lib/mock_sdk.dart
index 99cf23c..224d438 100644
--- a/pkg/analysis_testing/lib/mock_sdk.dart
+++ b/pkg/analysis_testing/lib/mock_sdk.dart
@@ -26,9 +26,15 @@
           class Symbol {}
           class Type {}
 
-          class String extends Object {}
+          abstract class Comparable<T> {
+            int compareTo(T other);
+          }
+
+          class String implements Comparable<String> {
+          }
+
           class bool extends Object {}
-          abstract class num extends Object {
+          abstract class num implements Comparable<num> {
             num operator +(num other);
             num operator -(num other);
             num operator *(num other);
diff --git a/pkg/analysis_testing/lib/reflective_tests.dart b/pkg/analysis_testing/lib/reflective_tests.dart
index 2c737f7..202a0be 100644
--- a/pkg/analysis_testing/lib/reflective_tests.dart
+++ b/pkg/analysis_testing/lib/reflective_tests.dart
@@ -39,27 +39,30 @@
  */
 void runReflectiveTests(Type type) {
   ClassMirror classMirror = reflectClass(type);
-  classMirror.instanceMembers.forEach((symbol, memberMirror) {
-    // we need only methods
-    if (memberMirror is! MethodMirror || !memberMirror.isRegularMethod) {
-      return;
-    }
-    String memberName = MirrorSystem.getName(symbol);
-    // test_
-    if (memberName.startsWith('test_')) {
-      String testName = memberName.substring('test_'.length);
-      test(testName, () {
-        return _runTest(classMirror, symbol);
-      });
-      return;
-    }
-    // solo_test_
-    if (memberName.startsWith('solo_test_')) {
-      String testName = memberName.substring('solo_test_'.length);
-      solo_test(testName, () {
-        return _runTest(classMirror, symbol);
-      });
-    }
+  String className = MirrorSystem.getName(classMirror.simpleName);
+  group(className, () {
+    classMirror.instanceMembers.forEach((symbol, memberMirror) {
+      // we need only methods
+      if (memberMirror is! MethodMirror || !memberMirror.isRegularMethod) {
+        return;
+      }
+      String memberName = MirrorSystem.getName(symbol);
+      // test_
+      if (memberName.startsWith('test_')) {
+        String testName = memberName.substring('test_'.length);
+        test(testName, () {
+          return _runTest(classMirror, symbol);
+        });
+        return;
+      }
+      // solo_test_
+      if (memberName.startsWith('solo_test_')) {
+        String testName = memberName.substring('solo_test_'.length);
+        solo_test(testName, () {
+          return _runTest(classMirror, symbol);
+        });
+      }
+    });
   });
 }
 
diff --git a/pkg/args/CHANGELOG.md b/pkg/args/CHANGELOG.md
index 36b8208..ffe2109 100644
--- a/pkg/args/CHANGELOG.md
+++ b/pkg/args/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.12.0+1
+
+* Remove the documentation link from the pubspec so this is linked to
+  pub.dartlang.org by default.
+
 ## 0.12.0
 
 * Removed public constructors for `ArgResults` and `Option`.
diff --git a/pkg/args/pubspec.yaml b/pkg/args/pubspec.yaml
index 32e84edc..0f62010 100644
--- a/pkg/args/pubspec.yaml
+++ b/pkg/args/pubspec.yaml
@@ -1,8 +1,7 @@
 name: args
-version: 0.12.0
+version: 0.12.0+1
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
-documentation: http://api.dartlang.org/docs/pkg/args
 description: >
  Library for defining parsers for parsing raw command-line arguments into
  a set of options and values using GNU and POSIX style options.
diff --git a/pkg/barback/CHANGELOG.md b/pkg/barback/CHANGELOG.md
index deed1bc..6edf327 100644
--- a/pkg/barback/CHANGELOG.md
+++ b/pkg/barback/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.14.1+3
+
+* Add a dependency on the `pool` package.
+
 ## 0.14.1+2
 
 * Automatically log how long it takes long-running transforms to run.
diff --git a/pkg/barback/lib/src/utils/file_pool.dart b/pkg/barback/lib/src/utils/file_pool.dart
index 6bea4a4..6a23337 100644
--- a/pkg/barback/lib/src/utils/file_pool.dart
+++ b/pkg/barback/lib/src/utils/file_pool.dart
@@ -8,10 +8,10 @@
 import 'dart:convert';
 import 'dart:io';
 
+import 'package:pool/pool.dart';
 import 'package:stack_trace/stack_trace.dart';
 
 import '../utils.dart';
-import 'pool.dart';
 
 /// Manages a pool of files that are opened for reading to cope with maximum
 /// file descriptor limits.
diff --git a/pkg/barback/pubspec.yaml b/pkg/barback/pubspec.yaml
index cc7f5df..9d6fec3 100644
--- a/pkg/barback/pubspec.yaml
+++ b/pkg/barback/pubspec.yaml
@@ -7,7 +7,7 @@
 #
 # When the minor or patch version of this is upgraded, you *must* update that
 # version constraint in pub to stay in sync with this.
-version: 0.14.1+3
+version: 0.14.1+4
 
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
@@ -23,6 +23,7 @@
   responsiveness.
 dependencies:
   path: ">=0.9.0 <2.0.0"
+  pool: ">=1.0.0 <2.0.0"
   source_maps: ">=0.9.0 <0.10.0"
   stack_trace: ">=0.9.1 <2.0.0"
   collection: ">=0.9.1 <0.10.0"
diff --git a/pkg/crypto/pubspec.yaml b/pkg/crypto/pubspec.yaml
index ff692ac..c07af24 100644
--- a/pkg/crypto/pubspec.yaml
+++ b/pkg/crypto/pubspec.yaml
@@ -5,6 +5,5 @@
 homepage: http://www.dartlang.org
 environment:
   sdk: '>=0.8.10+6 <2.0.0'
-documentation: http://api.dartlang.org/docs/pkg/crypto
 dev_dependencies:
   unittest: '>=0.10.0 <0.11.0'
diff --git a/pkg/docgen/pubspec.yaml b/pkg/docgen/pubspec.yaml
index 9ff4057..dc3eb59 100644
--- a/pkg/docgen/pubspec.yaml
+++ b/pkg/docgen/pubspec.yaml
@@ -7,7 +7,7 @@
   logging: '>=0.9.0 <0.10.0'
   markdown: 0.7.0
   path: '>=0.9.0 <2.0.0'
-  yaml: '>=0.9.0 <2.0.0'
+  yaml: '>=0.9.0 <3.0.0'
 dev_dependencies:
   scheduled_test: '>=0.10.0 <0.12.0'
   unittest: '>=0.9.0 <0.11.0'
diff --git a/pkg/http_multi_server/CHANGELOG.md b/pkg/http_multi_server/CHANGELOG.md
new file mode 100644
index 0000000..ac00908
--- /dev/null
+++ b/pkg/http_multi_server/CHANGELOG.md
@@ -0,0 +1,7 @@
+## 1.0.1
+
+* Ignore errors from one of the servers if others are still bound. In
+  particular, this works around [issue 19815][] on some Windows machines where
+  IPv6 failure isn't discovered until we try to connect to the socket.
+
+[issue 19815]: http://code.google.com/p/dart/issues/detail?id=19815
diff --git a/pkg/http_multi_server/lib/http_multi_server.dart b/pkg/http_multi_server/lib/http_multi_server.dart
index c055367..da12888 100644
--- a/pkg/http_multi_server/lib/http_multi_server.dart
+++ b/pkg/http_multi_server/lib/http_multi_server.dart
@@ -99,20 +99,15 @@
   /// [HttpServer.bindSecure].
   static Future<HttpServer> _loopback(int port,
       Future<HttpServer> bind(InternetAddress address, int port)) {
-    return Future.wait([
-      supportsIpV6,
-      bind(InternetAddress.LOOPBACK_IP_V4, port)
-    ]).then((results) {
-      var supportsIpV6 = results[0];
-      var v4Server = results[1];
-
-      if (!supportsIpV6) return v4Server;
-
+    return bind(InternetAddress.LOOPBACK_IP_V4, port).then((v4Server) {
       // Reuse the IPv4 server's port so that if [port] is 0, both servers use
       // the same ephemeral port.
       return bind(InternetAddress.LOOPBACK_IP_V6, v4Server.port)
-          .then((v6Server) {
-        return new HttpMultiServer([v4Server, v6Server]);
+          .then((v6Server) => new HttpMultiServer([v4Server, v6Server]))
+          .catchError((error) {
+        // If we fail to bind to IPv6, just use IPv4.
+        if (error is SocketException) return v4Server;
+        throw error;
       });
     });
   }
diff --git a/pkg/http_multi_server/lib/src/utils.dart b/pkg/http_multi_server/lib/src/utils.dart
index 9e95aba..d615975 100644
--- a/pkg/http_multi_server/lib/src/utils.dart
+++ b/pkg/http_multi_server/lib/src/utils.dart
@@ -7,6 +7,8 @@
 import 'dart:async';
 import 'dart:io';
 
+// TODO(nweiz): Revert this to the version of [mergeStreams] found elsewhere in
+// the repo once issue 19815 is fixed in dart:io.
 /// Merges all streams in [streams] into a single stream that emits all of their
 /// values.
 ///
@@ -18,9 +20,17 @@
   controller = new StreamController(onListen: () {
     for (var stream in streams) {
       var subscription;
-      subscription = stream.listen(controller.add,
-          onError: controller.addError,
-          onDone: () {
+      subscription = stream.listen(controller.add, onError: (error, trace) {
+        if (subscriptions.length == 1) {
+          // If the last subscription errored, pass it on.
+          controller.addError(error, trace);
+        } else {
+          // If only one of the subscriptions has an error (usually IPv6 failing
+          // late), then just remove that subscription and ignore the error.
+          subscriptions.remove(subscription);
+          subscription.cancel();
+        }
+      }, onDone: () {
         subscriptions.remove(subscription);
         if (subscriptions.isEmpty) controller.close();
       });
@@ -42,21 +52,3 @@
 
   return controller.stream;
 }
-
-/// A cache for [supportsIpV6].
-bool _supportsIpV6;
-
-/// Returns whether this computer supports binding to IPv6 addresses.
-Future<bool> get supportsIpV6 {
-  if (_supportsIpV6 != null) return new Future.value(_supportsIpV6);
-
-  return ServerSocket.bind(InternetAddress.LOOPBACK_IP_V6, 0).then((socket) {
-    _supportsIpV6 = true;
-    socket.close();
-    return true;
-  }).catchError((error) {
-    if (error is! SocketException) throw error;
-    _supportsIpV6 = false;
-    return false;
-  });
-}
diff --git a/pkg/http_multi_server/pubspec.yaml b/pkg/http_multi_server/pubspec.yaml
index 4199c58..2bdb4a2 100644
--- a/pkg/http_multi_server/pubspec.yaml
+++ b/pkg/http_multi_server/pubspec.yaml
@@ -1,5 +1,5 @@
 name: http_multi_server
-version: 1.0.0
+version: 1.0.1
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
 description:
diff --git a/pkg/http_multi_server/test/http_multi_server_test.dart b/pkg/http_multi_server/test/http_multi_server_test.dart
index a3d9062..0140ee7 100644
--- a/pkg/http_multi_server/test/http_multi_server_test.dart
+++ b/pkg/http_multi_server/test/http_multi_server_test.dart
@@ -108,7 +108,7 @@
       expect(http.read("http://127.0.0.1:${server.port}/"),
           completion(equals("got request")));
 
-      return supportsIpV6.then((supportsIpV6) {
+      return _supportsIpV6.then((supportsIpV6) {
         if (!supportsIpV6) return;
         expect(http.read("http://[::1]:${server.port}/"),
             completion(equals("got request")));
@@ -117,6 +117,26 @@
   });
 }
 
+/// A cache for [supportsIpV6].
+bool _supportsIpV6Cache;
+
+// TODO(nweiz): This is known to be inaccurate on Windows machines with IPv6
+// disabled (issue 19815). Tests will fail on such machines.
+/// Returns whether this computer supports binding to IPv6 addresses.
+Future<bool> get _supportsIpV6 {
+  if (_supportsIpV6Cache != null) return new Future.value(_supportsIpV6Cache);
+
+  return ServerSocket.bind(InternetAddress.LOOPBACK_IP_V6, 0).then((socket) {
+    _supportsIpV6Cache = true;
+    socket.close();
+    return true;
+  }).catchError((error) {
+    if (error is! SocketException) throw error;
+    _supportsIpV6Cache = false;
+    return false;
+  });
+}
+
 /// Makes a GET request to the root of [server] and returns the response.
 Future<http.Response> _get(HttpServer server) => http.get(_urlFor(server));
 
diff --git a/pkg/http_parser/CHANGELOG.md b/pkg/http_parser/CHANGELOG.md
index 328e779..72f0218 100644
--- a/pkg/http_parser/CHANGELOG.md
+++ b/pkg/http_parser/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.0.2+4
+
+* Widen the `string_scanner` version constraint.
+
 ## 0.0.2+3
 
 * Fix a library name conflict.
diff --git a/pkg/http_parser/pubspec.yaml b/pkg/http_parser/pubspec.yaml
index af1a192..fd279ce 100644
--- a/pkg/http_parser/pubspec.yaml
+++ b/pkg/http_parser/pubspec.yaml
@@ -1,5 +1,5 @@
 name: http_parser
-version: 0.0.2+3
+version: 0.0.2+4
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
 description: >
@@ -7,7 +7,7 @@
 dependencies:
   crypto: ">=0.9.0 <0.10.0"
   collection: ">=0.9.1 <0.10.0"
-  string_scanner: ">=0.0.0 <0.1.0"
+  string_scanner: ">=0.0.0 <0.2.0"
 dev_dependencies:
   unittest: ">=0.10.0 <0.11.0"
 environment:
diff --git a/pkg/http_server/pubspec.yaml b/pkg/http_server/pubspec.yaml
index c59bb7f..fcdec00 100644
--- a/pkg/http_server/pubspec.yaml
+++ b/pkg/http_server/pubspec.yaml
@@ -1,9 +1,8 @@
 name: http_server
-version: 0.9.2+2
+version: 0.9.2+3
 author: Dart Team <misc@dartlang.org>
 description: Library of HTTP server classes.
 homepage: http://www.dartlang.org
-documentation: http://api.dartlang.org/docs/pkg/http_server
 dependencies:
   mime: ">=0.9.0 <0.10.0"
   path: ">=0.9.0 <2.0.0"
diff --git a/pkg/http_throttle/LICENSE b/pkg/http_throttle/LICENSE
new file mode 100644
index 0000000..5c60afe
--- /dev/null
+++ b/pkg/http_throttle/LICENSE
@@ -0,0 +1,26 @@
+Copyright 2014, the Dart project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/http_throttle/README.md b/pkg/http_throttle/README.md
new file mode 100644
index 0000000..fcbacdb
--- /dev/null
+++ b/pkg/http_throttle/README.md
@@ -0,0 +1,18 @@
+`http_throttle` is middleware for the [http package][] that throttles the number
+of concurrent requests that an HTTP client can make.
+
+```dart
+// This client allows 32 concurrent requests.
+final client = new ThrottleClient(32);
+
+Future<List<String>> readAllUrls(Iterable<Uri> urls) {
+  return Future.wait(urls.map((url) {
+    // You can safely call as many client methods as you want concurrently, and
+    // ThrottleClient will ensure that only 32 underlying HTTP requests will be
+    // open at once.
+    return client.read(url);
+  }));
+}
+```
+
+[http package]: pub.dartlang.org/packages/http
diff --git a/pkg/http_throttle/lib/http_throttle.dart b/pkg/http_throttle/lib/http_throttle.dart
new file mode 100644
index 0000000..7cd95a6
--- /dev/null
+++ b/pkg/http_throttle/lib/http_throttle.dart
@@ -0,0 +1,50 @@
+// Copyright (c) 2014, 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 http_throttle;
+
+import 'dart:async';
+
+import 'package:http/http.dart';
+import 'package:pool/pool.dart';
+
+/// A middleware client that throttles the number of concurrent requests.
+///
+/// As long as the number of requests is within the limit, this works just like
+/// a normal client. If a request is made beyond the limit, the underlying HTTP
+/// request won't be sent until other requests have completed.
+class ThrottleClient extends BaseClient {
+  final Pool _pool;
+  final Client _inner;
+
+  /// Creates a new client that allows no more than [maxActiveRequests]
+  /// concurrent requests.
+  ///
+  /// If [inner] is passed, it's used as the inner client for sending HTTP
+  /// requests. It defaults to `new http.Client()`.
+  ThrottleClient(int maxActiveRequests, [Client inner])
+      : _pool = new Pool(maxActiveRequests),
+        _inner = inner == null ? new Client() : inner;
+
+  Future<StreamedResponse> send(BaseRequest request) {
+    return _pool.request().then((resource) {
+      return _inner.send(request).then((response) {
+        var stream = response.stream.transform(
+            new StreamTransformer.fromHandlers(handleDone: (sink) {
+          resource.release();
+          sink.close();
+        }));
+        return new StreamedResponse(stream, response.statusCode,
+            contentLength: response.contentLength,
+            request: response.request,
+            headers: response.headers,
+            isRedirect: response.isRedirect,
+            persistentConnection: response.persistentConnection,
+            reasonPhrase: response.reasonPhrase);
+      });
+    });
+  }
+
+  void close() => _inner.close();
+}
diff --git a/pkg/http_throttle/pubspec.yaml b/pkg/http_throttle/pubspec.yaml
new file mode 100644
index 0000000..f7cc6b9
--- /dev/null
+++ b/pkg/http_throttle/pubspec.yaml
@@ -0,0 +1,8 @@
+name: http_throttle
+version: 1.0.0
+description: HTTP client middleware that throttles requests.
+dependencies:
+  http: ">=0.9.0 <0.12.0"
+  pool: ">=1.0.0 <2.0.0"
+dev_dependencies:
+  unittest: ">=0.11.0 <0.12.0"
diff --git a/pkg/http_throttle/test/http_throttle_test.dart b/pkg/http_throttle/test/http_throttle_test.dart
new file mode 100644
index 0000000..13fe058
--- /dev/null
+++ b/pkg/http_throttle/test/http_throttle_test.dart
@@ -0,0 +1,69 @@
+// Copyright (c) 2014, 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:async';
+
+import 'package:http/http.dart' as http;
+import 'package:http/testing.dart';
+import 'package:http_throttle/http_throttle.dart';
+import 'package:unittest/unittest.dart';
+
+void main() {
+  test("makes requests until the limit is hit", () {
+    var pendingResponses = [];
+    var client = new ThrottleClient(10, new MockClient((request) {
+      var completer = new Completer();
+      pendingResponses.add(completer);
+      return completer.future.then((response) {
+        pendingResponses.remove(completer);
+        return response;
+      });
+    }));
+
+    // Make the first batch of requests. All of these should be sent
+    // immediately.
+    for (var i = 0; i < 10; i++) {
+      client.get('/');
+    }
+
+    return pumpEventQueue().then((_) {
+      // All ten of the requests should have responses pending.
+      expect(pendingResponses, hasLength(10));
+
+      // Make the second batch of requests. None of these should be sent
+      // until the previous batch has finished.
+      for (var i = 0; i < 5; i++) {
+        client.get('/');
+      }
+
+      return pumpEventQueue();
+    }).then((_) {
+      // Only the original ten requests should have responses pending.
+      expect(pendingResponses, hasLength(10));
+
+      // Send the first ten responses, allowing the next batch of requests to
+      // fire.
+      for (var completer in pendingResponses) {
+        completer.complete(new http.Response("done", 200));
+      }
+
+      return pumpEventQueue();
+    }).then((_) {
+      // Now the second batch of responses should be pending.
+      expect(pendingResponses, hasLength(5));
+    });
+  });
+}
+
+/// Returns a [Future] that completes after pumping the event queue [times]
+/// times. By default, this should pump the event queue enough times to allow
+/// any code to run, as long as it's not waiting on some external event.
+Future pumpEventQueue([int times = 20]) {
+  if (times == 0) return new Future.value();
+  // We use a delayed future to allow microtask events to finish. The
+  // Future.value or Future() constructors use scheduleMicrotask themselves and
+  // would therefore not wait for microtask callbacks that are scheduled after
+  // invoking this method.
+  return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
+}
diff --git a/pkg/intl/CHANGELOG.md b/pkg/intl/CHANGELOG.md
index 1085a24..1b1d25d 100644
--- a/pkg/intl/CHANGELOG.md
+++ b/pkg/intl/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.11.3
+
+ * Add a --[no]-use-deferred-loading flag to generate_from_arb.dart and 
+   generally make the deferred loading of message libraries optional.
+
 ## 0.11.2
 
  * Missed canonicalization of locales in one place in message library generation.
diff --git a/pkg/intl/bin/generate_from_arb.dart b/pkg/intl/bin/generate_from_arb.dart
index 6830fc5..ec4bc0f 100644
--- a/pkg/intl/bin/generate_from_arb.dart
+++ b/pkg/intl/bin/generate_from_arb.dart
@@ -40,11 +40,14 @@
       callback: (x) => targetDir = x);
   parser.addOption("generated-file-prefix", defaultsTo: '',
       callback: (x) => generatedFilePrefix = x);
+  parser.addFlag("use-deferred-loading", defaultsTo: true,
+      callback: (x) => useDeferredLoading = x);
   parser.parse(args);
   var dartFiles = args.where((x) => x.endsWith("dart")).toList();
   var jsonFiles = args.where((x) => x.endsWith(".arb")).toList();
   if (dartFiles.length == 0 || jsonFiles.length == 0) {
     print('Usage: generate_from_arb [--output-dir=<dir>]'
+        ' [--[no-]use-deferred-loading]'
         ' [--generated-file-prefix=<prefix>] file1.dart file2.dart ...'
         ' translation1_<languageTag>.arb translation2.arb ...');
     exit(0);
diff --git a/pkg/intl/lib/generate_localized.dart b/pkg/intl/lib/generate_localized.dart
index 0003331..78baaf3 100644
--- a/pkg/intl/lib/generate_localized.dart
+++ b/pkg/intl/lib/generate_localized.dart
@@ -53,6 +53,11 @@
 String generatedFilePrefix = '';
 
 /**
+ * Should we use deferred loading for the generated libraries.
+ */
+bool useDeferredLoading = true;
+
+/**
  * This represents a message and its translation. We assume that the translation
  * has some identifier that allows us to figure out the original message it
  * corresponds to, and that it may want to transform the translated text in
@@ -179,13 +184,18 @@
   for (var locale in allLocales) {
     var baseFile = '${generatedFilePrefix}messages_$locale.dart';
     var file = importForGeneratedFile(baseFile);
-    output.write("import '$file' deferred as ${_libraryName(locale)};\n");
+    output.write("import '$file' ");
+    if (useDeferredLoading) output.write("deferred ");
+    output.write("as ${_libraryName(locale)};\n");
   }
   output.write("\n");
   output.write("\nMap<String, Function> _deferredLibraries = {\n");
   for (var rawLocale in allLocales) {
     var locale = Intl.canonicalizedLocale(rawLocale);
-    output.write("  '$locale' : () => ${_libraryName(locale)}.loadLibrary(),\n");
+    var loadOperation = (useDeferredLoading) 
+        ? "  '$locale' : () => ${_libraryName(locale)}.loadLibrary(),\n"
+        : "  '$locale' : () => new Future.value(null),\n";
+    output.write(loadOperation);
   }
   output.write("};\n");
   output.write(
diff --git a/pkg/intl/pubspec.yaml b/pkg/intl/pubspec.yaml
index a38f52c..f8e4b38 100644
--- a/pkg/intl/pubspec.yaml
+++ b/pkg/intl/pubspec.yaml
@@ -1,5 +1,5 @@
 name: intl
-version: 0.11.2
+version: 0.11.3
 author: Dart Team <misc@dartlang.org>
 description: Contains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.
 homepage: http://www.dartlang.org
diff --git a/pkg/intl/test/message_extraction/message_extraction_no_deferred_test.dart b/pkg/intl/test/message_extraction/message_extraction_no_deferred_test.dart
new file mode 100644
index 0000000..a46ea72
--- /dev/null
+++ b/pkg/intl/test/message_extraction/message_extraction_no_deferred_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/** 
+ * A test for message extraction and code generation not using deferred 
+ * loading for the generated code.
+ */
+library message_extraction_no_deferred_test;
+
+import 'message_extraction_test.dart' as mainTest;
+
+main(arguments) {
+  mainTest.useDeferredLoading = false;
+  mainTest.main(arguments);
+}
\ No newline at end of file
diff --git a/pkg/intl/test/message_extraction/message_extraction_test.dart b/pkg/intl/test/message_extraction/message_extraction_test.dart
index 56d2fa3..744e107 100644
--- a/pkg/intl/test/message_extraction/message_extraction_test.dart
+++ b/pkg/intl/test/message_extraction/message_extraction_test.dart
@@ -13,6 +13,13 @@
 
 final dart = Platform.executable;
 
+/** Should we use deferred loading. */
+bool useDeferredLoading = true;
+
+String get _deferredLoadPrefix => useDeferredLoading ? '' : 'no-';
+
+String get deferredLoadArg => '--${_deferredLoadPrefix}use-deferred-loading';
+
 /** The VM arguments we were given, most important package-root. */
 final vmArgs = Platform.executableArguments;
 
@@ -145,9 +152,9 @@
 
 Future<ProcessResult> generateCodeFromTranslation(ProcessResult previousResult)
     => run(previousResult, [asTestDirPath('../../bin/generate_from_arb.dart'),
-    '--generated-file-prefix=foo_', 'sample_with_messages.dart',
-    'part_of_sample_with_messages.dart', 'translation_fr.arb',
-    'translation_de_DE.arb']);
+    deferredLoadArg, '--generated-file-prefix=foo_', 
+    'sample_with_messages.dart', 'part_of_sample_with_messages.dart',
+    'translation_fr.arb', 'translation_de_DE.arb']);
 
 Future<ProcessResult> runAndVerify(ProcessResult previousResult) => run(
     previousResult, [asTempDirPath('run_and_verify.dart')]);
diff --git a/pkg/intl/test/message_extraction/sample_with_messages.dart b/pkg/intl/test/message_extraction/sample_with_messages.dart
index 64bff65..47cfc18 100644
--- a/pkg/intl/test/message_extraction/sample_with_messages.dart
+++ b/pkg/intl/test/message_extraction/sample_with_messages.dart
@@ -227,8 +227,7 @@
 
   // Verify that a translated message isn't initially present.
   var messageInGerman = Intl.withLocale('de_DE', message1);
-  test("Locales don't work before they're initialized", ()
-      => expect(messageInGerman, "This is a message"));
+  expect(messageInGerman, "This is a message");
 
   var f1 = initializeMessages(fr.locale)
       // Since English has the one message which is always translated, we
diff --git a/pkg/json_rpc_2/pubspec.yaml b/pkg/json_rpc_2/pubspec.yaml
index e0fca72..287bba7 100644
--- a/pkg/json_rpc_2/pubspec.yaml
+++ b/pkg/json_rpc_2/pubspec.yaml
@@ -3,7 +3,6 @@
 author: Dart Team <misc@dartlang.org>
 description: An implementation of the JSON-RPC 2.0 spec.
 homepage: http://www.dartlang.org
-documentation: http://api.dartlang.org/docs/pkg/json_rpc_2
 dependencies:
   stack_trace: '>=0.9.1 <2.0.0'
 dev_dependencies:
diff --git a/pkg/logging/README.md b/pkg/logging/README.md
new file mode 100644
index 0000000..f4781a7
--- /dev/null
+++ b/pkg/logging/README.md
@@ -0,0 +1,49 @@
+## Initializing
+
+By default, the logging package does not do anything useful with the
+log messages. You must configure the logging level and add a handler
+for the log messages.
+
+Here is a simple logging configuration that logs all messages
+via `print`.
+
+```dart
+Logger.root.level = Level.ALL;
+Logger.root.onRecord.listen((LogRecord rec) {
+  print('${rec.level.name}: ${rec.time}: ${rec.message}');
+});
+```
+
+First, set the root [Level]. All messages at or above the level are
+sent to the [onRecord] stream.
+
+Then, listen on the [onRecord] stream for [LogRecord] events. The
+[LogRecord] class has various properties for the message, error,
+logger name, and more.
+
+## Logging messages
+
+Create a [Logger] with a unique name to easily identify the source
+of the log messages.
+
+```dart
+final Logger log = new Logger('MyClassName');
+```
+
+Here is an example of logging a debug message and an error:
+
+```dart
+var future = doSomethingAsync().then((result) {
+  log.fine('Got the result: $result');
+  processResult(result);
+}).catchError((e, stackTrace) => log.severe('Oh noes!', e, stackTrace));
+```
+
+When logging more complex messages, you can pass a closure instead
+that will be evaluated only if the message is actually logged:
+
+```dart
+  log.fine(() => [1, 2, 3, 4, 5].map((e) => e * 4).join("-"));
+```
+
+See the [Logger] class for the different logging methods.
diff --git a/pkg/logging/lib/logging.dart b/pkg/logging/lib/logging.dart
index ba342f7..5f4bc2b 100644
--- a/pkg/logging/lib/logging.dart
+++ b/pkg/logging/lib/logging.dart
@@ -3,55 +3,11 @@
 // BSD-style license that can be found in the LICENSE file.
 
 /**
- * Support for logging.
- *
- * For information on installing and importing this library, see the
- * [logging package on pub.dartlang.org]
- * (http://pub.dartlang.org/packages/logging).
- *
- * ## Initializing
- *
- * By default, the logging package does not do anything useful with the
- * log messages. You must configure the logging level and add a handler
- * for the log messages.
- *
- * Here is a simple logging configuration that logs all messages
- * via `print`.
- *
- *     Logger.root.level = Level.ALL;
- *     Logger.root.onRecord.listen((LogRecord rec) {
- *       print('${rec.level.name}: ${rec.time}: ${rec.message}');
- *     });
- *
- * First, set the root [Level]. All messages at or above the level are
- * sent to the [onRecord] stream.
- *
- * Then, listen on the [onRecord] stream for [LogRecord] events. The
- * [LogRecord] class has various properties for the message, error,
- * logger name, and more.
- *
- * ## Logging messages
- *
- * Create a [Logger] with a unique name to easily identify the source
- * of the log messages.
- *
- *     final Logger log = new Logger('MyClassName');
- *
- * Here is an example of logging a debug message and an error:
- *
- *     Future future = doSomethingAsync();
- *     future.then((result) {
- *       log.fine('Got the result: $result');
- *       processResult(result);
- *     })
- *     .catchError((e, stackTrace) => log.severe('Oh noes!', e, stackTrace));
- *
- * See the [Logger] class for the different logging methods.
  */
 library logging;
 
 import 'dart:async';
-import 'package:collection/wrappers.dart';
+import 'dart:collection';
 
 /**
  * Whether to allow fine-grain logging and configuration of loggers in a
@@ -178,10 +134,18 @@
    * Use this method to create log entries for user-defined levels. To record a
    * message at a predefined level (e.g. [Level.INFO], [Level.WARNING], etc) you
    * can use their specialized methods instead (e.g. [info], [warning], etc).
+   *
+   * If [message] is a [Function], it will be lazy evaluated. Additionally, if
+   * [message] or its evaluated value is not a [String], then 'toString()' will
+   * be called on it and the result will be logged.
    */
-  void log(Level logLevel, String message, [Object error,
-                                            StackTrace stackTrace]) {
+  void log(Level logLevel, message, [Object error, StackTrace stackTrace]) {
     if (isLoggable(logLevel)) {
+      // If message is a Function, evaluate it.
+      if (message is Function) message = message();
+      // If message is still not a String, call toString().
+      if (message is! String) message = message.toString();
+
       var record = new LogRecord(logLevel, message, fullName, error,
           stackTrace);
 
@@ -198,35 +162,35 @@
   }
 
   /** Log message at level [Level.FINEST]. */
-  void finest(String message, [Object error, StackTrace stackTrace]) =>
+  void finest(message, [Object error, StackTrace stackTrace]) =>
       log(Level.FINEST, message, error, stackTrace);
 
   /** Log message at level [Level.FINER]. */
-  void finer(String message, [Object error, StackTrace stackTrace]) =>
+  void finer(message, [Object error, StackTrace stackTrace]) =>
       log(Level.FINER, message, error, stackTrace);
 
   /** Log message at level [Level.FINE]. */
-  void fine(String message, [Object error, StackTrace stackTrace]) =>
+  void fine(message, [Object error, StackTrace stackTrace]) =>
       log(Level.FINE, message, error, stackTrace);
 
   /** Log message at level [Level.CONFIG]. */
-  void config(String message, [Object error, StackTrace stackTrace]) =>
+  void config(message, [Object error, StackTrace stackTrace]) =>
       log(Level.CONFIG, message, error, stackTrace);
 
   /** Log message at level [Level.INFO]. */
-  void info(String message, [Object error, StackTrace stackTrace]) =>
+  void info(message, [Object error, StackTrace stackTrace]) =>
       log(Level.INFO, message, error, stackTrace);
 
   /** Log message at level [Level.WARNING]. */
-  void warning(String message, [Object error, StackTrace stackTrace]) =>
+  void warning(message, [Object error, StackTrace stackTrace]) =>
       log(Level.WARNING, message, error, stackTrace);
 
   /** Log message at level [Level.SEVERE]. */
-  void severe(String message, [Object error, StackTrace stackTrace]) =>
+  void severe(message, [Object error, StackTrace stackTrace]) =>
       log(Level.SEVERE, message, error, stackTrace);
 
   /** Log message at level [Level.SHOUT]. */
-  void shout(String message, [Object error, StackTrace stackTrace]) =>
+  void shout(message, [Object error, StackTrace stackTrace]) =>
       log(Level.SHOUT, message, error, stackTrace);
 
   Stream<LogRecord> _getStream() {
diff --git a/pkg/logging/pubspec.yaml b/pkg/logging/pubspec.yaml
index 199f653..dd7ba7c 100644
--- a/pkg/logging/pubspec.yaml
+++ b/pkg/logging/pubspec.yaml
@@ -1,15 +1,12 @@
 name: logging
-version: 0.9.1+1
+version: 0.9.2
 author: Dart Team <misc@dartlang.org>
 description: >
   Provides APIs for debugging and error logging. This library introduces
   abstractions similar to those used in other languages, such as the Closure
   JS Logger and java.util.logging.Logger.
-homepage: http://www.dartlang.org
-documentation: http://api.dartlang.org/docs/pkg/logging
+homepage: https://pub.dartlang.org/packages/logging
 environment:
-  sdk: '>=1.0.0 <2.0.0'
-dependencies:
-  collection: '>=0.9.0 <0.10.0'
+  sdk: '>=1.5.0 <2.0.0'
 dev_dependencies:
-  unittest: '>=0.9.0 <0.10.0'
+  unittest: '>=0.9.0 <0.12.0'
diff --git a/pkg/logging/test/logging_test.dart b/pkg/logging/test/logging_test.dart
index 82ef3e1..223498f 100644
--- a/pkg/logging/test/logging_test.dart
+++ b/pkg/logging/test/logging_test.dart
@@ -418,5 +418,43 @@
             'WARNING: 9',
             'SHOUT: 10']));
     });
+
+    test('message logging - lazy functions', () {
+      root.level = Level.INFO;
+      var messages = [];
+      root.onRecord.listen((record) {
+        messages.add('${record.level}: ${record.message}');
+      });
+
+      var callCount = 0;
+      var myClosure = () => "${++callCount}";
+
+      root.info(myClosure);
+      root.finer(myClosure);  // Should not get evaluated.
+      root.warning(myClosure);
+
+      expect(messages, equals([
+          'INFO: 1',
+          'WARNING: 2',]));
+    });
+
+    test('message logging - calls toString', () {
+      root.level = Level.INFO;
+      var messages = [];
+      root.onRecord.listen((record) {
+        messages.add('${record.level}: ${record.message}');
+      });
+
+      root.info(5);
+      root.info(false);
+      root.info([1, 2, 3]);
+      root.info(() => 10);
+
+      expect(messages, equals([
+          'INFO: 5',
+          'INFO: false',
+          'INFO: [1, 2, 3]',
+          'INFO: 10',]));
+    });
   });
 }
diff --git a/pkg/mock/CHANGELOG.md b/pkg/mock/CHANGELOG.md
index 6fa4e03..3fb0aa8 100644
--- a/pkg/mock/CHANGELOG.md
+++ b/pkg/mock/CHANGELOG.md
@@ -1,4 +1,13 @@
-##0.11.0
+## 0.11.0+2
+
+* Updated documentation link.
+
+## 0.11.0+1
+
+* Updated unittest dependency.
+
+## 0.11.0
 
  * Removed deprecated `sharedLog`
+
  * Improved support for calling arbitrary methods via a proxy
diff --git a/pkg/mock/pubspec.yaml b/pkg/mock/pubspec.yaml
index 99eb895..6599be6 100644
--- a/pkg/mock/pubspec.yaml
+++ b/pkg/mock/pubspec.yaml
@@ -1,12 +1,11 @@
 name: mock
-version: 0.11.0+1
+version: 0.11.0+2
 author: Dart Team <misc@dartlang.org>
 description: A library for mocking classes
-homepage: http://www.dartlang.org
+homepage: https://pub.dartlang.org/packages/mock
 environment:
   sdk: '>=1.0.0 <2.0.0'
-documentation: http://api.dartlang.org/docs/pkg/mock
 dependencies:
-  matcher: '>=0.10.0 <0.11.0'
+  matcher: '>=0.10.0 <0.12.0'
 dev_dependencies:
   unittest: '>=0.10.0 <0.12.0'
diff --git a/pkg/mutation_observer/pubspec.yaml b/pkg/mutation_observer/pubspec.yaml
index fb49473..c7b1079 100644
--- a/pkg/mutation_observer/pubspec.yaml
+++ b/pkg/mutation_observer/pubspec.yaml
@@ -1,8 +1,7 @@
 name: mutation_observer
-version: 0.9.0+1
+version: 0.9.0+2
 author: "Polymer.dart Team <web-ui-dev@dartlang.org>"
 homepage: https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/pkg/mutation_observer/
-documentation: https://api.dartlang.org/docs/releases/latest/dart_html/MutationObserver.html
 description: >
   *Deprecated* newer version is in web_components package.
 dev_dependencies:
diff --git a/pkg/path/CHANGELOG.md b/pkg/path/CHANGELOG.md
index f1d2485..5331635 100644
--- a/pkg/path/CHANGELOG.md
+++ b/pkg/path/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 1.2.2
+
+* Remove the documentation link from the pubspec so this is linked to
+  pub.dartlang.org by default.
+
 # 1.2.1
 
 * Many members on `Style` that provided access to patterns and functions used
diff --git a/pkg/path/pubspec.yaml b/pkg/path/pubspec.yaml
index 7bc83bff..e9948de 100644
--- a/pkg/path/pubspec.yaml
+++ b/pkg/path/pubspec.yaml
@@ -1,12 +1,11 @@
 name: path
-version: 1.2.1
+version: 1.2.2
 author: Dart Team <misc@dartlang.org>
 description: >
  A string-based path manipulation library. All of the path operations you know
  and love, with solid support on both Windows and POSIX (Linux and Mac OS X)
  machines.
 homepage: http://www.dartlang.org
-documentation: http://api.dartlang.org/docs/pkg/path
 dev_dependencies:
   unittest: ">=0.9.0 <0.12.0"
 environment:
diff --git a/pkg/pkg.status b/pkg/pkg.status
index fff2bfb..a94c31a 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -99,7 +99,13 @@
 http/test/html/client_test: Fail # Issue 19750
 scheduled_test/test/scheduled_stream/scheduled_stream_test: Fail # Issue 19750
 json_rpc_2/test/server/server_test: Fail # Issue 19750
+shelf/test/log_middleware_test: Fail # Issue 19750
+
+[ $runtime == ff ]
 stack_trace/test/trace_test: Fail # Issue 19750
+http/test/html/client_test: Fail # Issue 19750
+scheduled_test/test/scheduled_stream/scheduled_stream_test: Fail # Issue 19750
+json_rpc_2/test/server/server_test: Fail # Issue 19750
 shelf/test/log_middleware_test: Fail # Issue 19750
 
 [ $compiler == dart2js && $runtime == drt ]
@@ -307,6 +313,7 @@
 intl/test/message_extraction/examples_parsing_test: Fail, OK # Users dart:io
 intl/test/message_extraction/failed_extraction_test: Fail, OK # Users dart:io
 intl/test/message_extraction/message_extraction_test: Fail, OK # Uses dart:io.
+intl/test/message_extraction/message_extraction_no_deferred_test: Fail, OK # Uses dart:io.
 intl/test/message_extraction/really_fail_extraction_test: Fail, OK # Users dart:io
 observe/test/transformer_test: Fail, OK # Uses dart:io.
 path/test/io_test: Fail, OK # Uses dart:io.
@@ -415,7 +422,6 @@
 source_maps/test/parser_test: Pass, Timeout # Issue 13719: Please triage this failure.
 
 [ $compiler == dartanalyzer || $compiler == dart2analyzer ]
-matcher/test/deprecated_matchers_test: StaticWarning # testing error creating abstract class
 third_party/angular_tests/vm_test: StaticWarning # Uses removed APIs. See issue 18733.
 
 [ $runtime == vm && ($system == windows || $system == macos) ]
diff --git a/pkg/pkgbuild.status b/pkg/pkgbuild.status
index 83daf7f..89acad4 100644
--- a/pkg/pkgbuild.status
+++ b/pkg/pkgbuild.status
@@ -17,6 +17,7 @@
 
 [ $use_public_packages ]
 samples/third_party/angular_todo: Pass, Slow
+pkg/polymer: PubGetError # smoke 0.2.0 has not been published
 
 [ $use_public_packages && $builder_tag == russian ]
 samples/third_party/todomvc: Fail # Issue 18104
diff --git a/pkg/polymer/lib/src/build/script_compactor.dart b/pkg/polymer/lib/src/build/script_compactor.dart
index 91c50ca..1f76ae9 100644
--- a/pkg/polymer/lib/src/build/script_compactor.dart
+++ b/pkg/polymer/lib/src/build/script_compactor.dart
@@ -398,7 +398,9 @@
     generator.writeImports(code);
     generator.writeTopLevelDeclarations(code);
     code.writeln('\nvoid main() {');
-    generator.writeInitCall(code);
+    code.write('  useGeneratedCode(');
+    generator.writeStaticConfiguration(code);
+    code.writeln(');');
     if (experimentalBootstrap) {
       code.write('  startPolymer([');
     } else {
diff --git a/pkg/polymer/pubspec.yaml b/pkg/polymer/pubspec.yaml
index 726b488..c09c9a1 100644
--- a/pkg/polymer/pubspec.yaml
+++ b/pkg/polymer/pubspec.yaml
@@ -1,5 +1,5 @@
 name: polymer
-version: 0.12.0-dev
+version: 0.12.1-dev
 author: Polymer.dart Authors <web-ui-dev@dartlang.org>
 description: >
   Polymer.dart is a new type of library for the web, built on top of Web
@@ -17,11 +17,11 @@
   observe: '>=0.11.0-dev <0.12.0'
   path: '>=0.9.0 <2.0.0'
   polymer_expressions: '>=0.12.0-dev <0.13.0'
-  smoke: '>=0.1.0 <0.2.0'
+  smoke: '>=0.2.0-dev <0.3.0'
   source_maps: '>=0.9.0 <0.10.0'
   template_binding: '>=0.12.0-dev <0.13.0'
   web_components: '>=0.4.0 <0.5.0'
-  yaml: '>=0.9.0 <2.0.0'
+  yaml: '>=0.9.0 <3.0.0'
 dev_dependencies:
   unittest: '>=0.10.0 <0.11.0'
 transformers:
diff --git a/pkg/polymer/test/build/all_phases_test.dart b/pkg/polymer/test/build/all_phases_test.dart
index 26a3f42..869a98f 100644
--- a/pkg/polymer/test/build/all_phases_test.dart
+++ b/pkg/polymer/test/build/all_phases_test.dart
@@ -62,7 +62,7 @@
                   smoke_0.XA: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XA: const {},
+                  smoke_0.XA: {},
                 }));
             configureForDeployment([
                 i0.m_foo,
@@ -102,7 +102,7 @@
                   smoke_0.XB: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XB: const {},
+                  smoke_0.XB: {},
                 }));
             configureForDeployment([
                 i0.m_bar,
@@ -156,9 +156,9 @@
                   smoke_3.XC: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XA: const {},
-                  smoke_2.XB: const {},
-                  smoke_3.XC: const {},
+                  smoke_0.XA: {},
+                  smoke_2.XB: {},
+                  smoke_3.XC: {},
                 }));
             configureForDeployment([
                 i0.m_foo,
@@ -221,8 +221,8 @@
                   smoke_0.XA: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_2.XB: const {},
-                  smoke_0.XA: const {},
+                  smoke_2.XB: {},
+                  smoke_0.XA: {},
                 }));
             configureForDeployment([
                 i0.m_foo,
@@ -280,8 +280,8 @@
                   smoke_2.XB: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XA: const {},
-                  smoke_2.XB: const {},
+                  smoke_0.XA: {},
+                  smoke_2.XB: {},
                 }));
             startPolymer([
                 i0.m_foo,
diff --git a/pkg/polymer/test/build/script_compactor_test.dart b/pkg/polymer/test/build/script_compactor_test.dart
index 48952bb..727018f 100644
--- a/pkg/polymer/test/build/script_compactor_test.dart
+++ b/pkg/polymer/test/build/script_compactor_test.dart
@@ -99,7 +99,7 @@
                   smoke_0.XFoo: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XFoo: const {},
+                  smoke_0.XFoo: {},
                 }));
             configureForDeployment([
                 () => Polymer.register(\'x-foo\', i0.XFoo),
@@ -143,7 +143,7 @@
                   smoke_0.XFoo: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XFoo: const {},
+                  smoke_0.XFoo: {},
                 }));
             configureForDeployment([
                 () => Polymer.register(\'x-foo2\', i0.XFoo),
@@ -179,7 +179,7 @@
                   smoke_0.XFoo: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XFoo: const {},
+                  smoke_0.XFoo: {},
                 }));
             configureForDeployment([]);
             i0.main();
@@ -307,12 +307,12 @@
                   smoke_4.XH1: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_5.XC1: const {},
-                  smoke_5.XC2: const {},
-                  smoke_0.XE: const {},
-                  smoke_2.XF1: const {},
-                  smoke_3.XG2: const {},
-                  smoke_4.XH1: const {},
+                  smoke_5.XC1: {},
+                  smoke_5.XC2: {},
+                  smoke_0.XE: {},
+                  smoke_2.XF1: {},
+                  smoke_3.XG2: {},
+                  smoke_4.XH1: {},
                 }));
             configureForDeployment([
                 i0.mA,
@@ -412,7 +412,7 @@
                   smoke_0.XFoo: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XFoo: const {},
+                  smoke_0.XFoo: {},
                 }));
             startPolymer([
                 i0.main,
@@ -456,7 +456,7 @@
                   smoke_0.XFoo: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XFoo: const {},
+                  smoke_0.XFoo: {},
                 }));
             startPolymer([
                 () => Polymer.register(\'x-foo2\', i0.XFoo),
@@ -491,7 +491,7 @@
                   smoke_0.XFoo: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_0.XFoo: const {},
+                  smoke_0.XFoo: {},
                 }));
             startPolymer([]);
           }
@@ -620,12 +620,12 @@
                   smoke_4.XH1: smoke_1.PolymerElement,
                 },
                 declarations: {
-                  smoke_5.XC1: const {},
-                  smoke_5.XC2: const {},
-                  smoke_0.XE: const {},
-                  smoke_2.XF1: const {},
-                  smoke_3.XG2: const {},
-                  smoke_4.XH1: const {},
+                  smoke_5.XC1: {},
+                  smoke_5.XC2: {},
+                  smoke_0.XE: {},
+                  smoke_2.XF1: {},
+                  smoke_3.XG2: {},
+                  smoke_4.XH1: {},
                 }));
             startPolymer([
                 i0.mA,
diff --git a/pkg/polymer_expressions/example/example.dart b/pkg/polymer_expressions/example/example.dart
index 22e7e8a..79c9a35 100644
--- a/pkg/polymer_expressions/example/example.dart
+++ b/pkg/polymer_expressions/example/example.dart
@@ -7,9 +7,19 @@
 import 'package:polymer_expressions/polymer_expressions.dart';
 import 'package:template_binding/template_binding.dart' show templateBind;
 
+// We use mirrors for illustration purposes, but ideally we would generate a
+// static configuration with smoke/static.dart.
+import 'package:smoke/mirrors.dart';
+
+// Since we use smoke/mirrors, we need to preserve symbols used in the template.
+// This includes String.startsWith, List.take, and Person.
+@MirrorsUsed(targets: const [String, List, Person])
+import 'dart:mirrors';
+
 import 'person.dart';
 
 main() {
+  useMirrors();
   var john = new Person('John', 'Messerly', ['A', 'B', 'C']);
   var justin = new Person('Justin', 'Fagnani', ['D', 'E', 'F']);
   var globals = {
diff --git a/pkg/polymer_expressions/pubspec.yaml b/pkg/polymer_expressions/pubspec.yaml
index fe7c41c..22adf00 100644
--- a/pkg/polymer_expressions/pubspec.yaml
+++ b/pkg/polymer_expressions/pubspec.yaml
@@ -1,5 +1,5 @@
 name: polymer_expressions
-version: 0.12.0-dev
+version: 0.12.0-pre.1.dev
 author: Polymer.dart Authors <web-ui-dev@dartlang.org>
 description: An expressive custom binding syntax for HTML templates
 homepage: http://www.dartlang.org/polymer-dart/
diff --git a/pkg/pool/LICENSE b/pkg/pool/LICENSE
new file mode 100644
index 0000000..5c60afe
--- /dev/null
+++ b/pkg/pool/LICENSE
@@ -0,0 +1,26 @@
+Copyright 2014, the Dart project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/pool/README.md b/pkg/pool/README.md
new file mode 100644
index 0000000..8987288
--- /dev/null
+++ b/pkg/pool/README.md
@@ -0,0 +1,53 @@
+The pool package exposes a `Pool` class which makes it easy to manage a limited
+pool of resources.
+
+The easiest way to use a pool is by calling `withResource`. This runs a callback
+and returns its result, but only once there aren't too many other callbacks
+currently running.
+
+```dart
+// Create a Pool that will only allocate 10 resources at once. After 30 seconds
+// of inactivity with all resources checked out, the pool will throw an error.
+final pool = new Pool(10, timeout: new Duration(seconds: 30));
+
+Future<String> readFile(String path) {
+  // Since the call to [File.readAsString] is within [withResource], no more
+  // than ten files will be open at once.
+  return pool.withResource(() => return new File(path).readAsString());
+}
+```
+
+For more fine-grained control, the user can also explicitly request generic
+`PoolResource` objects that can later be released back into the pool. This is
+what `withResource` does under the covers: requests a resource, then releases it
+once the callback completes.
+
+`Pool` ensures that only a limited number of resources are allocated at once.
+It's the caller's responsibility to ensure that the corresponding physical
+resource is only consumed when a `PoolResource` is allocated.
+
+```dart
+class PooledFile implements RandomAccessFile {
+  final RandomAccessFile _file;
+  final PoolResource _resource;
+
+  static Future<PooledFile> open(String path) {
+    return pool.request().then((resource) {
+      return new File(path).open().then((file) {
+        return new PooledFile._(file, resource);
+      });
+    });
+  }
+
+  PooledFile(this._file, this._resource);
+
+  // ...
+
+  Future<RandomAccessFile> close() {
+    return _file.close.then((_) {
+      _resource.release();
+      return this;
+    });
+  }
+}
+```
diff --git a/pkg/barback/lib/src/utils/pool.dart b/pkg/pool/lib/pool.dart
similarity index 94%
rename from pkg/barback/lib/src/utils/pool.dart
rename to pkg/pool/lib/pool.dart
index c1c76bc..36a29c8 100644
--- a/pkg/barback/lib/src/utils/pool.dart
+++ b/pkg/pool/lib/pool.dart
@@ -1,17 +1,14 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// Copyright (c) 2014, 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 barback.utils.pool;
+library pool;
 
 import 'dart:async';
 import 'dart:collection';
 
 import 'package:stack_trace/stack_trace.dart';
 
-import '../utils.dart';
-
-// TODO(nweiz): put this somewhere that it can be shared between packages.
 /// Manages an abstract pool of resources with a limit on how many may be in use
 /// at once.
 ///
@@ -76,7 +73,7 @@
   /// The return value of [callback] is piped to the returned Future.
   Future withResource(callback()) {
     return request().then((resource) =>
-        syncFuture(callback).whenComplete(resource.release));
+        Chain.track(new Future.sync(callback)).whenComplete(resource.release));
   }
 
   /// If there are any pending requests, this will fire the oldest one.
@@ -139,3 +136,4 @@
     _pool._onResourceReleased();
   }
 }
+
diff --git a/pkg/pool/pubspec.yaml b/pkg/pool/pubspec.yaml
new file mode 100644
index 0000000..c1d543f
--- /dev/null
+++ b/pkg/pool/pubspec.yaml
@@ -0,0 +1,9 @@
+name: pool
+version: 1.0.0
+author: Dart Team <misc@dartlang.org>
+description: A class for managing a finite pool of resources.
+homepage: http://www.dartlang.org
+dependencies:
+  stack_trace: ">=0.9.2 <2.0.0"
+dev_dependencies:
+  unittest: ">=0.11.0 <0.12.0"
diff --git a/pkg/pool/test/pool_test.dart b/pkg/pool/test/pool_test.dart
new file mode 100644
index 0000000..bfeb876
--- /dev/null
+++ b/pkg/pool/test/pool_test.dart
@@ -0,0 +1,138 @@
+// Copyright (c) 2014, 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:async';
+
+import 'package:pool/pool.dart';
+import 'package:stack_trace/stack_trace.dart';
+import 'package:unittest/unittest.dart';
+
+void main() {
+  group("request()", () {
+    test("resources can be requested freely up to the limit", () {
+      var pool = new Pool(50);
+      var requests = [];
+      for (var i = 0; i < 50; i++) {
+        expect(pool.request(), completes);
+      }
+    });
+
+    test("resources block past the limit", () {
+      var pool = new Pool(50);
+      var requests = [];
+      for (var i = 0; i < 50; i++) {
+        expect(pool.request(), completes);
+      }
+      expect(pool.request(), doesNotComplete);
+    });
+
+    test("a blocked resource is allocated when another is released", () {
+      var pool = new Pool(50);
+      var requests = [];
+      for (var i = 0; i < 49; i++) {
+        expect(pool.request(), completes);
+      }
+
+      return pool.request().then((lastAllocatedResource) {
+        var blockedResource = pool.request();
+
+        return pumpEventQueue().then((_) {
+          lastAllocatedResource.release();
+          return pumpEventQueue();
+        }).then((_) {
+          expect(blockedResource, completes);
+        });
+      });
+    });
+  });
+
+  group("withResource()", () {
+    test("can be called freely up to the limit", () {
+      var pool = new Pool(50);
+      var requests = [];
+      for (var i = 0; i < 50; i++) {
+        pool.withResource(expectAsync(() => new Completer().future));
+      }
+    });
+
+    test("blocks the callback past the limit", () {
+      var pool = new Pool(50);
+      var requests = [];
+      for (var i = 0; i < 50; i++) {
+        pool.withResource(expectAsync(() => new Completer().future));
+      }
+      pool.withResource(expectNoAsync());
+    });
+
+    test("a blocked resource is allocated when another is released", () {
+      var pool = new Pool(50);
+      var requests = [];
+      for (var i = 0; i < 49; i++) {
+        pool.withResource(expectAsync(() => new Completer().future));
+      }
+
+      var completer = new Completer();
+      var lastAllocatedResource = pool.withResource(() => completer.future);
+      var blockedResourceAllocated = false;
+      var blockedResource = pool.withResource(() {
+        blockedResourceAllocated = true;
+      });
+
+      return pumpEventQueue().then((_) {
+        expect(blockedResourceAllocated, isFalse);
+        completer.complete();
+        return pumpEventQueue();
+      }).then((_) {
+        expect(blockedResourceAllocated, isTrue);
+      });
+    });
+  });
+
+  // TODO(nweiz): Test timeouts when it's easier to use third-party packages.
+  // See r38552.
+}
+
+/// Returns a [Future] that completes after pumping the event queue [times]
+/// times. By default, this should pump the event queue enough times to allow
+/// any code to run, as long as it's not waiting on some external event.
+Future pumpEventQueue([int times = 20]) {
+  if (times == 0) return new Future.value();
+  // We use a delayed future to allow microtask events to finish. The
+  // Future.value or Future() constructors use scheduleMicrotask themselves and
+  // would therefore not wait for microtask callbacks that are scheduled after
+  // invoking this method.
+  return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
+}
+
+/// Returns a function that will cause the test to fail if it's called.
+///
+/// This won't let the test complete until it's confident that the function
+/// won't be called.
+Function expectNoAsync() {
+  // Make sure the test lasts long enough for the function to get called if it's
+  // going to get called.
+  expect(pumpEventQueue(), completes);
+
+  var stack = new Trace.current(1);
+  return () => handleExternalError(
+      new TestFailure("Expected function not to be called."), "",
+      stack);
+}
+
+/// A matcher for Futures that asserts that they don't complete.
+///
+/// This won't let the test complete until it's confident that the function
+/// won't be called.
+Matcher get doesNotComplete => predicate((future) {
+  expect(future, new isInstanceOf<Future>('Future'));
+  // Make sure the test lasts long enough for the function to get called if it's
+  // going to get called.
+  expect(pumpEventQueue(), completes);
+
+  var stack = new Trace.current(1);
+  future.then((_) => handleExternalError(
+      new TestFailure("Expected future not to complete."), "",
+      stack));
+  return true;
+});
diff --git a/pkg/smoke/CHANGELOG.md b/pkg/smoke/CHANGELOG.md
index 287fcc2..f593356 100644
--- a/pkg/smoke/CHANGELOG.md
+++ b/pkg/smoke/CHANGELOG.md
@@ -2,6 +2,12 @@
 
 This file contains highlights of what changes on each version of this package.
 
+#### Pub version 0.2.0-dev
+  * Static configuration can be modified, so code generators can split the
+    static configuration in pieces.
+  * **breaking change**: for codegen call `writeStaticConfiguration` instead of
+    `writeInitCall`.
+
 #### Pub version 0.1.0
   * Initial release: introduces the smoke API, a mirror based implementation, a
     statically configured implementation that can be declared by hand or be
diff --git a/pkg/smoke/lib/codegen/generator.dart b/pkg/smoke/lib/codegen/generator.dart
index a313e5d..417e9e7 100644
--- a/pkg/smoke/lib/codegen/generator.dart
+++ b/pkg/smoke/lib/codegen/generator.dart
@@ -22,8 +22,8 @@
 ///   * [writeImports] writes a list of imports directives,
 ///   * [writeTopLevelDeclarations] writes additional declarations used to
 ///     represent mixin classes by name in the generated code.
-///   * [writeInitCall] writes the actual code that allocates the static
-///     configuration.
+///   * [writeStaticConfiguration] writes the actual code that allocates the
+///     static configuration.
 ///
 /// You'd need to include all three in your generated code, since the
 /// initialization code refers to symbols that are only available from the
@@ -133,7 +133,8 @@
   }
 
   /// Writes to [buffer] a line for each import that is needed by the generated
-  /// code. The code added by [writeInitCall] depends on these imports.
+  /// code. The code added by [writeStaticConfiguration] depends on these
+  /// imports.
   void writeImports(StringBuffer buffer) {
     DEFAULT_IMPORTS.forEach((i) => buffer.writeln(i));
     _libraryPrefix.forEach((url, prefix) {
@@ -142,8 +143,9 @@
   }
 
   /// Writes to [buffer] top-level declarations that are used by the code
-  /// generated in [writeInitCall]. These are typically declarations of empty
-  /// classes that are then used as placeholders for mixin superclasses.
+  /// generated in [writeStaticConfiguration]. These are typically declarations
+  /// of empty classes that are then used as placeholders for mixin
+  /// superclasses.
   void writeTopLevelDeclarations(StringBuffer buffer) {
     var types = new Set()
         ..addAll(_parents.keys)
@@ -159,16 +161,19 @@
     }
   }
 
-  /// Appends to [buffer] code that will initialize smoke's static
-  /// configuration. For example, the code might be of the form:
+  /// Appends to [buffer] code that will create smoke's static configuration.
+  /// For example, the code might be of the form:
   ///
-  ///    useGeneratedCode(new StaticConfiguration(
+  ///    new StaticConfiguration(
   ///      getters: {
   ///         #i: (o) => o.i,
   ///         ...
   ///      names: {
   ///         #i: "i",
-  ///      }));
+  ///      })
+  ///
+  /// Callers of this code can assign this expression to a variable, and should
+  /// generate code that invokes `useGeneratedCode`.
   ///
   /// The optional [indent] argument is used for formatting purposes. All
   /// entries in each map (getters, setters, names, declarations, parents) are
@@ -177,8 +182,8 @@
   /// **Note**: this code assumes that imports from [writeImports] and top-level
   /// declarations from [writeTopLevelDeclarations] are included in the same
   /// library where this code will live.
-  void writeInitCall(StringBuffer buffer, [int indent = 2]) {
-    final spaces = new List.filled(indent, ' ').join('');
+  void writeStaticConfiguration(StringBuffer buffer, [int indent = 2]) {
+    final spaces = ' ' * (indent + 4);
     var args = {};
 
     if (_getters.isNotEmpty) {
@@ -206,14 +211,14 @@
             ..write(type.asCode(_libraryPrefix))
             ..write(': ');
         if (members.isEmpty) {
-          sb.write('const {}');
+          sb.write('{}');
         } else {
           sb.write('{\n');
           members.forEach((name, decl) {
             var decl = members[name].asCode(_libraryPrefix);
-            sb.write('$spaces        ${_symbol(name)}: $decl,\n');
+            sb.write('${spaces}    ${_symbol(name)}: $decl,\n');
           });
-          sb.write('$spaces      }');
+          sb.write('${spaces}  }');
         }
         declarations.add(sb.toString());
       });
@@ -228,13 +233,13 @@
             ..write(className)
             ..write(': ');
         if (members.isEmpty) {
-          sb.write('const {}');
+          sb.write('{}');
         } else {
           sb.write('{\n');
           for (var name in members) {
-            sb.write('$spaces        ${_symbol(name)}: $className.$name,\n');
+            sb.write('${spaces}    ${_symbol(name)}: $className.$name,\n');
           }
-          sb.write('$spaces      }');
+          sb.write('${spaces}  }');
         }
         methods.add(sb.toString());
       });
@@ -245,20 +250,19 @@
       args['names'] = _names.map((n) => "${_symbol(n)}: r'$n'");
     }
 
-    buffer..write(spaces)
-        ..writeln('useGeneratedCode(new StaticConfiguration(')
-        ..write('$spaces    checkedMode: false');
+    buffer..writeln('new StaticConfiguration(')
+        ..write('${spaces}checkedMode: false');
 
     args.forEach((name, mapContents) {
       buffer.writeln(',');
       // TODO(sigmund): use const map when Type can be keys (dartbug.com/17123)
-      buffer.writeln('$spaces    $name: {');
+      buffer.writeln('${spaces}$name: {');
       for (var entry in mapContents) {
-        buffer.writeln('$spaces      $entry,');
+        buffer.writeln('${spaces}  $entry,');
       }
-      buffer.write('$spaces    }');
+      buffer.write('${spaces}}');
     });
-    buffer.writeln('));');
+    buffer.write(')');
   }
 
   /// Adds a library that needs to be imported.
diff --git a/pkg/smoke/lib/codegen/recorder.dart b/pkg/smoke/lib/codegen/recorder.dart
index 645d3ac..4815920 100644
--- a/pkg/smoke/lib/codegen/recorder.dart
+++ b/pkg/smoke/lib/codegen/recorder.dart
@@ -69,9 +69,10 @@
 
   /// Adds any declaration and superclass information that is needed to answer a
   /// query on [type] that matches [options]. Also adds symbols, getters, and
-  /// setters if [includeAccessors] is true.
+  /// setters if [includeAccessors] is true. If [results] is not null, it will
+  /// be filled up with the members that match the query.
   void runQuery(ClassElement type, QueryOptions options,
-      {bool includeAccessors: true}) {
+      {bool includeAccessors: true, List results}) {
     if (type.type.isObject) return; // We don't include Object in query results.
     var id = _typeFor(type);
     var parent = type.supertype != null ? type.supertype.element : null;
@@ -83,11 +84,12 @@
       for (var m in type.mixins) {
         var mixinClass = m.element;
         var mixinId = _mixins[parentId][mixinClass];
-        _runQueryInternal(mixinClass, mixinId, options, includeAccessors);
+        _runQueryInternal(
+            mixinClass, mixinId, options, includeAccessors, results);
         parentId = mixinId;
       }
     }
-    _runQueryInternal(type, id, options, includeAccessors);
+    _runQueryInternal(type, id, options, includeAccessors, results);
   }
 
   /// Helper for [runQuery]. This runs the query only on a specific [type],
@@ -96,7 +98,7 @@
   // we should consider to include the mixin declaration information directly,
   // and remove the duplication we have for mixins today.
   void _runQueryInternal(ClassElement type, TypeIdentifier id,
-      QueryOptions options, bool includeAccessors) {
+      QueryOptions options, bool includeAccessors, List results) {
 
     skipBecauseOfAnnotations(Element e) {
       if (options.withAnnotations == null) return false;
@@ -111,6 +113,7 @@
         var name = f.displayName;
         if (options.matches != null && !options.matches(name)) continue;
         if (skipBecauseOfAnnotations(f)) continue;
+        if (results != null) results.add(f);
         generator.addDeclaration(id, name, _typeFor(f.type.element),
             isField: true, isFinal: f.isFinal,
             annotations: _copyAnnotations(f));
@@ -128,6 +131,7 @@
         var name = v.displayName;
         if (options.matches != null && !options.matches(name)) continue;
         if (skipBecauseOfAnnotations(a)) continue;
+        if (results != null) results.add(a);
         generator.addDeclaration(id, name, _typeFor(a.type.returnType.element),
             isProperty: true, isFinal: v.isFinal,
             annotations: _copyAnnotations(a));
@@ -141,6 +145,7 @@
         var name = m.displayName;
         if (options.matches != null && !options.matches(name)) continue;
         if (skipBecauseOfAnnotations(m)) continue;
+        if (results != null) results.add(m);
         generator.addDeclaration(id, name,
             new TypeIdentifier('dart:core', 'Function'), isMethod: true,
             annotations: _copyAnnotations(m));
diff --git a/pkg/smoke/lib/src/common.dart b/pkg/smoke/lib/src/common.dart
index 1d73e4f..71a72f0 100644
--- a/pkg/smoke/lib/src/common.dart
+++ b/pkg/smoke/lib/src/common.dart
@@ -84,10 +84,22 @@
   if (a != null && b == null) return false;
   if (a.length != b.length) return false;
   if (unordered) {
-    var bSet = new Set()..addAll(b);
-    for (int i = 0; i < a.length; i++) {
-      if (!bSet.contains(a[i])) return false;
+    var countMap = {};
+    for (var x in b) {
+      var count = countMap[x];
+      if (count == null) count = 0;
+      countMap[x] = count + 1;
     }
+    for (var x in a) {
+      var count = countMap[x];
+      if (count == null) return false;
+      if (count == 1) {
+        countMap.remove(x);
+      } else {
+        countMap[x] = count - 1;
+      }
+    }
+    return countMap.isEmpty;
   } else {
     for (int i = 0; i < a.length; i++) {
       if (a[i] != b[i]) return false;
diff --git a/pkg/smoke/lib/static.dart b/pkg/smoke/lib/static.dart
index a5ccf13..f7f7428 100644
--- a/pkg/smoke/lib/static.dart
+++ b/pkg/smoke/lib/static.dart
@@ -37,14 +37,47 @@
   /// A map from symbol to strings.
   final Map<Symbol, String> names;
 
+  /// A map from strings to symbols (the reverse of [names]).
+  final Map<String, Symbol> _symbols = {};
+
+
   /// Whether to check for missing declarations, otherwise, return default
   /// values (for example a missing parent class can be treated as Object)
   final bool checkedMode;
 
   StaticConfiguration({
-      this.getters: const {}, this.setters: const {}, this.parents: const {},
-      this.declarations: const {}, this.staticMethods: const {},
-      this.names: const {}, this.checkedMode: true});
+      Map<Symbol, Getter> getters,
+      Map<Symbol, Setter> setters,
+      Map<Type, Type> parents,
+      Map<Type, Map<Symbol, Declaration>> declarations,
+      Map<Type, Map<Symbol, Function>> staticMethods,
+      Map<Symbol, String> names,
+      this.checkedMode: true})
+      : getters = getters != null ? getters : {},
+        setters = setters != null ? setters : {},
+        parents = parents != null ? parents : {},
+        declarations = declarations != null ? declarations : {},
+        staticMethods = staticMethods != null ? staticMethods : {},
+        names = names != null ? names : {} {
+    this.names.forEach((k, v) { _symbols[v] = k; });
+  }
+
+  void addAll(StaticConfiguration other) {
+    getters.addAll(other.getters);
+    setters.addAll(other.setters);
+    parents.addAll(other.parents);
+    _nestedAddAll(declarations, other.declarations);
+    _nestedAddAll(staticMethods, other.staticMethods);
+    names.addAll(other.names);
+    other.names.forEach((k, v) { _symbols[v] = k; });
+  }
+
+  static _nestedAddAll(Map a, Map b) {
+    for (var key in b.keys) {
+      a.putIfAbsent(key, () => {});
+      a[key].addAll(b[key]);
+    }
+  }
 }
 
 /// Set up the smoke package to use a static implementation based on the given
@@ -57,14 +90,13 @@
 
 /// Implements [ObjectAccessorService] using a static configuration.
 class GeneratedObjectAccessorService implements ObjectAccessorService {
-  final Map<Symbol, Getter> _getters;
-  final Map<Symbol, Setter> _setters;
-  final Map<Type, Map<Symbol, Function>> _staticMethods;
+  final StaticConfiguration _configuration;
+  Map<Symbol, Getter> get _getters => _configuration.getters;
+  Map<Symbol, Setter> get _setters => _configuration.setters;
+  Map<Type, Map<Symbol, Function>> get _staticMethods =>
+      _configuration.staticMethods;
 
-  GeneratedObjectAccessorService(StaticConfiguration configuration)
-      : _getters = configuration.getters,
-        _setters = configuration.setters,
-        _staticMethods = configuration.staticMethods;
+  GeneratedObjectAccessorService(this._configuration);
 
   read(Object object, Symbol name) {
     var getter = _getters[name];
@@ -127,14 +159,15 @@
 
 /// Implements [TypeInspectorService] using a static configuration.
 class GeneratedTypeInspectorService implements TypeInspectorService {
-  final Map<Type, Type> _parents;
-  final Map<Type, Map<Symbol, Declaration>> _declarations;
-  final bool _checkedMode;
+  final StaticConfiguration _configuration;
 
-  GeneratedTypeInspectorService(StaticConfiguration configuration)
-      : _parents = configuration.parents,
-        _declarations = configuration.declarations,
-        _checkedMode = configuration.checkedMode;
+  Map<Type, Type> get _parents => _configuration.parents;
+  Map<Type, Map<Symbol, Declaration>> get _declarations =>
+      _configuration.declarations;
+  bool get _checkedMode => _configuration.checkedMode;
+
+  GeneratedTypeInspectorService(this._configuration);
+
   bool isSubclassOf(Type type, Type supertype) {
     if (type == supertype || supertype == Object) return true;
     while (type != Object) {
@@ -237,16 +270,11 @@
 
 /// Implements [SymbolConverterService] using a static configuration.
 class GeneratedSymbolConverterService implements SymbolConverterService {
-  Map<Symbol, String> _names;
+  final StaticConfiguration _configuration;
+  Map<Symbol, String> get _names => _configuration.names;
+  Map<String, Symbol> get _symbols => _configuration._symbols;
 
-  /// A map from strings to symbols (the reverse of [names]).
-  final Map<String, Symbol> _symbols;
-
-  GeneratedSymbolConverterService(StaticConfiguration configuration)
-      : _names = configuration.names,
-        _symbols = {} {
-    _names.forEach((k, v) { _symbols[v] = k; });
-  }
+  GeneratedSymbolConverterService(this._configuration);
 
   String symbolToName(Symbol symbol) => _names[symbol];
   Symbol nameToSymbol(String name) => _symbols[name];
diff --git a/pkg/smoke/pubspec.yaml b/pkg/smoke/pubspec.yaml
index 16d816a..afe5211 100644
--- a/pkg/smoke/pubspec.yaml
+++ b/pkg/smoke/pubspec.yaml
@@ -1,5 +1,5 @@
 name: smoke
-version: 0.1.0+1
+version: 0.2.0-dev
 author: Polymer.dart Authors <web-ui-dev@dartlang.org>
 homepage: "https://api.dartlang.org/apidocs/channels/be/#smoke"
 description: >
diff --git a/pkg/smoke/test/codegen/common.dart b/pkg/smoke/test/codegen/common.dart
index a7a4c4c..3afe2e4 100644
--- a/pkg/smoke/test/codegen/common.dart
+++ b/pkg/smoke/test/codegen/common.dart
@@ -20,6 +20,8 @@
 
   var indentedCode = initCall.replaceAll("\n", "\n  ").trim();
   var genInitCall = new StringBuffer();
-  generator.writeInitCall(genInitCall);
+  genInitCall.write('  useGeneratedCode(');
+  generator.writeStaticConfiguration(genInitCall);
+  genInitCall.writeln(');');
   expect(genInitCall.toString(), '  $indentedCode\n');
 }
diff --git a/pkg/smoke/test/codegen/end_to_end_test.dart b/pkg/smoke/test/codegen/end_to_end_test.dart
index 0413274..ad47215 100644
--- a/pkg/smoke/test/codegen/end_to_end_test.dart
+++ b/pkg/smoke/test/codegen/end_to_end_test.dart
@@ -136,12 +136,12 @@
   generator.writeImports(sb);
   sb.writeln("import 'common.dart' as common show main;\n");
   generator.writeTopLevelDeclarations(sb);
-  sb.writeln('\n_configure() {');
-  generator.writeInitCall(sb);
+  sb.write('\nfinal configuration = ');
+  generator.writeStaticConfiguration(sb, 0);
 
-  sb..writeln('}\n')
+  sb..writeln(';\n')
       ..writeln('main() {')
-      ..writeln('  setUp(_configure);')
+      ..writeln('  setUp(() => useGeneratedCode(configuration));')
       ..writeln('  common.main();')
       ..writeln('}');
   return sb.toString();
diff --git a/pkg/smoke/test/codegen/generator_test.dart b/pkg/smoke/test/codegen/generator_test.dart
index a115ed9..8c401fc 100644
--- a/pkg/smoke/test/codegen/generator_test.dart
+++ b/pkg/smoke/test/codegen/generator_test.dart
@@ -78,14 +78,16 @@
       var generator = new SmokeCodeGenerator();
       generator.addSymbol('a.');
       var sb = new StringBuffer();
-      expect(() => generator.writeInitCall(sb), throwsA(invalidError));
+      expect(() => generator.writeStaticConfiguration(sb),
+          throwsA(invalidError));
     });
 
     test('operator in the middle', () {
       var generator = new SmokeCodeGenerator();
       generator.addSymbol('a.[].b');
       var sb = new StringBuffer();
-      expect(() => generator.writeInitCall(sb), throwsA(invalidError));
+      expect(() => generator.writeStaticConfiguration(sb),
+          throwsA(invalidError));
     });
   });
 
diff --git a/pkg/smoke/test/codegen/recorder_test.dart b/pkg/smoke/test/codegen/recorder_test.dart
index 14f8d81..2392116 100644
--- a/pkg/smoke/test/codegen/recorder_test.dart
+++ b/pkg/smoke/test/codegen/recorder_test.dart
@@ -155,7 +155,7 @@
             'useGeneratedCode(new StaticConfiguration(\n'
             '    checkedMode: false,\n'
             '    declarations: {\n'
-            '      smoke_0.A: const {},\n'
+            '      smoke_0.A: {},\n'
             '    }));\n');
     });
 
@@ -302,7 +302,7 @@
             'useGeneratedCode(new StaticConfiguration(\n'
             '    checkedMode: false,\n'
             '    declarations: {\n'
-            '      smoke_0.D: const {},\n'
+            '      smoke_0.D: {},\n'
             '    }));\n');
     });
 
@@ -322,7 +322,7 @@
             '      _M0: smoke_0.C,\n'
             '    },\n'
             '    declarations: {\n'
-            '      smoke_0.D: const {},\n'
+            '      smoke_0.D: {},\n'
             '      _M0: {\n'
             '        #i: const Declaration(#i, int),\n'
             '      },\n'
@@ -347,8 +347,8 @@
             '      smoke_0.J1: {\n'
             '        #i: const Declaration(#i, int),\n'
             '      },\n'
-            '      smoke_0.J2: const {},\n'
-            '      smoke_0.J3: const {},\n'
+            '      smoke_0.J2: {},\n'
+            '      smoke_0.J3: {},\n'
             '    }));\n');
     });
 
@@ -367,8 +367,8 @@
             '      smoke_0.J3: smoke_0.J2,\n'
             '    },\n'
             '    declarations: {\n'
-            '      smoke_0.J2: const {},\n'
-            '      smoke_0.J3: const {},\n'
+            '      smoke_0.J2: {},\n'
+            '      smoke_0.J3: {},\n'
             '    }));\n');
     });
   });
diff --git a/pkg/smoke/test/common_utils_test.dart b/pkg/smoke/test/common_utils_test.dart
new file mode 100644
index 0000000..10e7494
--- /dev/null
+++ b/pkg/smoke/test/common_utils_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2014, 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 smoke.test.common_utils;
+
+import 'package:smoke/src/common.dart';
+import 'package:unittest/unittest.dart';
+
+main() {
+  test('adjustList', () {
+    expect(adjustList([1, 2, 3], 1, 2), [1, 2]);
+    expect(adjustList([1, 2, 3], 1, 3), [1, 2, 3]);
+    expect(adjustList([1, 2, 3], 1, 4), [1, 2, 3]);
+    expect(adjustList([1, 2, 3], 4, 4), [1, 2, 3, null]);
+    expect(adjustList([], 1, 4), [null]);
+  });
+
+  test('compareLists ordered', () {
+    expect(compareLists([1, 1, 1], [1, 2, 3]), isFalse);
+    expect(compareLists([2, 3, 1], [1, 2, 3]), isFalse);
+    expect(compareLists([1, 2, 3], [1, 2, 3]), isTrue);
+  });
+
+  test('compareLists unordered', () {
+    expect(compareLists([1, 1, 1], [1, 2, 3], unordered: true), isFalse);
+    expect(compareLists([2, 3, 1], [1, 2, 3], unordered: true), isTrue);
+    expect(compareLists([1, 1, 2, 3, 4, 2], [2, 2, 1, 1, 3, 4],
+        unordered: true), isTrue);
+    expect(compareLists([1, 4, 2, 3, 1, 2], [2, 2, 1, 1, 3, 4],
+        unordered: true), isTrue);
+    expect(compareLists([1, 1, 2, 3, 4, 1], [2, 2, 1, 1, 3, 4],
+        unordered: true), isFalse);
+  });
+}
diff --git a/pkg/smoke/test/piece1.dart b/pkg/smoke/test/piece1.dart
new file mode 100644
index 0000000..d70a5df
--- /dev/null
+++ b/pkg/smoke/test/piece1.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2014, 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 the static_in_pieces_test
+library smoke.test.piece1;
+
+import 'package:smoke/smoke.dart' show Declaration, PROPERTY, METHOD;
+import 'package:smoke/static.dart' show useGeneratedCode, StaticConfiguration;
+import 'common.dart' as smoke_0;
+
+final configuration = new StaticConfiguration(
+    checkedMode: false,
+    getters: {
+      #j: (o) => o.j,
+      #j2: (o) => o.j2,
+    },
+    setters: {},
+    parents: {
+      smoke_0.H: smoke_0.G,
+    },
+    declarations: {
+      smoke_0.H: {
+        #f: const Declaration(#f, int, annotations: const [smoke_0.a1]),
+        #g: const Declaration(#g, int, annotations: const [smoke_0.a1]),
+        #h: const Declaration(#h, int, annotations: const [smoke_0.a2]),
+        #i: const Declaration(#i, int, annotations: const [smoke_0.a3]),
+      },
+    },
+    staticMethods: {
+      smoke_0.A: {
+        #staticInc: smoke_0.A.staticInc,
+      },
+    },
+    names: {});
diff --git a/pkg/smoke/test/piece2.dart b/pkg/smoke/test/piece2.dart
new file mode 100644
index 0000000..a474fca
--- /dev/null
+++ b/pkg/smoke/test/piece2.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2014, 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 the static_in_pieces_test
+library smoke.test.piece2;
+
+import 'package:smoke/smoke.dart' show Declaration, PROPERTY, METHOD;
+import 'package:smoke/static.dart' show useGeneratedCode, StaticConfiguration;
+import 'common.dart' as smoke_0;
+
+final configuration = new StaticConfiguration(
+    checkedMode: false,
+    getters: {
+      #j2: (o) => o.j2,
+    },
+    setters: {
+      #j2: (o, v) { o.j2 = v; },
+    },
+    parents: {},
+    declarations: {
+      smoke_0.A: {},
+      smoke_0.B: {
+        #a: const Declaration(#a, smoke_0.A),
+      },
+      smoke_0.K: {
+        #k: const Declaration(#k, int, annotations: const [const smoke_0.AnnotC(named: true)]),
+        #k2: const Declaration(#k2, int, annotations: const [const smoke_0.AnnotC()]),
+      },
+    },
+    staticMethods: {
+      smoke_0.A: {
+        #staticInc: smoke_0.A.staticInc,
+      },
+    },
+    names: {
+      #i: r'i',
+    });
diff --git a/pkg/smoke/test/static_in_pieces_test.dart b/pkg/smoke/test/static_in_pieces_test.dart
new file mode 100644
index 0000000..17c0629
--- /dev/null
+++ b/pkg/smoke/test/static_in_pieces_test.dart
@@ -0,0 +1,98 @@
+// Copyright (c) 2014, 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.
+
+/// Tests that a static configuration can be loaded in pieces, even with
+/// deferred imports.
+library smoke.test.static_in_pieces_test;
+
+import 'package:unittest/unittest.dart';
+import 'package:smoke/smoke.dart' show Declaration, PROPERTY, METHOD;
+import 'package:smoke/static.dart' show useGeneratedCode, StaticConfiguration;
+import 'piece1.dart' as p1;
+import 'piece2.dart' deferred as p2;
+import 'common.dart' as smoke_0;
+import 'common.dart' as common show main;
+
+abstract class _M0 {} // C & A
+
+final configuration = new StaticConfiguration(
+    checkedMode: false,
+    getters: {
+      #i: (o) => o.i,
+      #inc0: (o) => o.inc0,
+      #inc1: (o) => o.inc1,
+      #inc2: (o) => o.inc2,
+    },
+    setters: {
+      #i: (o, v) { o.i = v; },
+    },
+    parents: {
+      smoke_0.AnnotB: smoke_0.Annot,
+      smoke_0.D: _M0,
+      smoke_0.E2: smoke_0.E,
+      smoke_0.F2: smoke_0.F,
+      _M0: smoke_0.C,
+    },
+    declarations: {
+      smoke_0.A: {
+        #i: const Declaration(#i, int),
+        #inc0: const Declaration(#inc0, Function, kind: METHOD),
+        #inc1: const Declaration(#inc1, Function, kind: METHOD),
+        #inc2: const Declaration(#inc2, Function, kind: METHOD),
+        #j: const Declaration(#j, int),
+        #j2: const Declaration(#j2, int, kind: PROPERTY),
+      },
+      smoke_0.B: {
+        #f: const Declaration(#f, int, isFinal: true),
+        #w: const Declaration(#w, int, kind: PROPERTY),
+      },
+      smoke_0.C: {
+        #b: const Declaration(#b, smoke_0.B),
+        #inc: const Declaration(#inc, Function, kind: METHOD),
+        #x: const Declaration(#x, int),
+        #y: const Declaration(#y, String),
+      },
+      smoke_0.D: {
+        #i2: const Declaration(#i2, int, kind: PROPERTY, isFinal: true),
+        #x2: const Declaration(#x2, int, kind: PROPERTY, isFinal: true),
+      },
+      smoke_0.E: {
+        #noSuchMethod: const Declaration(#noSuchMethod, Function, kind: METHOD),
+        #y: const Declaration(#y, int, kind: PROPERTY, isFinal: true),
+      },
+      smoke_0.E2: {},
+      smoke_0.F: {
+        #staticMethod: const Declaration(#staticMethod, Function, kind: METHOD, isStatic: true),
+      },
+      smoke_0.F2: {},
+      smoke_0.G: {
+        #b: const Declaration(#b, int, annotations: const [smoke_0.a1]),
+        #d: const Declaration(#d, int, annotations: const [smoke_0.a2]),
+      },
+      _M0: {
+        #i: const Declaration(#i, int),
+        #inc: const Declaration(#inc, Function, kind: METHOD),
+        #inc0: const Declaration(#inc0, Function, kind: METHOD),
+        #j: const Declaration(#j, int),
+        #j2: const Declaration(#j2, int, kind: PROPERTY),
+      },
+    },
+    staticMethods: {},
+    names: {});
+
+main() {
+  useGeneratedCode(configuration);
+
+  expect(configuration.getters[#j], isNull);
+
+  configuration.addAll(p1.configuration);
+  expect(configuration.getters[#j], isNotNull);
+
+  p2.loadLibrary().then((_) {
+    expect(configuration.names[#i], isNull);
+    configuration.addAll(p2.configuration);
+    expect(configuration.names[#i], 'i');
+    common.main();
+  });
+}
diff --git a/pkg/smoke/test/static_test.dart b/pkg/smoke/test/static_test.dart
index 3fb7582..ed4e436 100644
--- a/pkg/smoke/test/static_test.dart
+++ b/pkg/smoke/test/static_test.dart
@@ -13,95 +13,93 @@
 
 abstract class _M0 {} // C & A
 
-_configure() {
-  useGeneratedCode(new StaticConfiguration(
-      checkedMode: false,
-      getters: {
-        #i: (o) => o.i,
-        #inc0: (o) => o.inc0,
-        #inc1: (o) => o.inc1,
-        #inc2: (o) => o.inc2,
-        #j: (o) => o.j,
-        #j2: (o) => o.j2,
+final configuration = new StaticConfiguration(
+    checkedMode: false,
+    getters: {
+      #i: (o) => o.i,
+      #inc0: (o) => o.inc0,
+      #inc1: (o) => o.inc1,
+      #inc2: (o) => o.inc2,
+      #j: (o) => o.j,
+      #j2: (o) => o.j2,
+    },
+    setters: {
+      #i: (o, v) { o.i = v; },
+      #j2: (o, v) { o.j2 = v; },
+    },
+    parents: {
+      smoke_0.AnnotB: smoke_0.Annot,
+      smoke_0.D: _M0,
+      smoke_0.E2: smoke_0.E,
+      smoke_0.F2: smoke_0.F,
+      smoke_0.H: smoke_0.G,
+      _M0: smoke_0.C,
+    },
+    declarations: {
+      smoke_0.A: {
+        #i: const Declaration(#i, int),
+        #inc0: const Declaration(#inc0, Function, kind: METHOD),
+        #inc1: const Declaration(#inc1, Function, kind: METHOD),
+        #inc2: const Declaration(#inc2, Function, kind: METHOD),
+        #j: const Declaration(#j, int),
+        #j2: const Declaration(#j2, int, kind: PROPERTY),
       },
-      setters: {
-        #i: (o, v) { o.i = v; },
-        #j2: (o, v) { o.j2 = v; },
+      smoke_0.B: {
+        #a: const Declaration(#a, smoke_0.A),
+        #f: const Declaration(#f, int, isFinal: true),
+        #w: const Declaration(#w, int, kind: PROPERTY),
       },
-      parents: {
-        smoke_0.AnnotB: smoke_0.Annot,
-        smoke_0.D: _M0,
-        smoke_0.E2: smoke_0.E,
-        smoke_0.F2: smoke_0.F,
-        smoke_0.H: smoke_0.G,
-        _M0: smoke_0.C,
+      smoke_0.C: {
+        #b: const Declaration(#b, smoke_0.B),
+        #inc: const Declaration(#inc, Function, kind: METHOD),
+        #x: const Declaration(#x, int),
+        #y: const Declaration(#y, String),
       },
-      declarations: {
-        smoke_0.A: {
-          #i: const Declaration(#i, int),
-          #inc0: const Declaration(#inc0, Function, kind: METHOD),
-          #inc1: const Declaration(#inc1, Function, kind: METHOD),
-          #inc2: const Declaration(#inc2, Function, kind: METHOD),
-          #j: const Declaration(#j, int),
-          #j2: const Declaration(#j2, int, kind: PROPERTY),
-        },
-        smoke_0.B: {
-          #a: const Declaration(#a, smoke_0.A),
-          #f: const Declaration(#f, int, isFinal: true),
-          #w: const Declaration(#w, int, kind: PROPERTY),
-        },
-        smoke_0.C: {
-          #b: const Declaration(#b, smoke_0.B),
-          #inc: const Declaration(#inc, Function, kind: METHOD),
-          #x: const Declaration(#x, int),
-          #y: const Declaration(#y, String),
-        },
-        smoke_0.D: {
-          #i2: const Declaration(#i2, int, kind: PROPERTY, isFinal: true),
-          #x2: const Declaration(#x2, int, kind: PROPERTY, isFinal: true),
-        },
-        smoke_0.E: {
-          #noSuchMethod: const Declaration(#noSuchMethod, Function, kind: METHOD),
-          #y: const Declaration(#y, int, kind: PROPERTY, isFinal: true),
-        },
-        smoke_0.E2: const {},
-        smoke_0.F: {
-          #staticMethod: const Declaration(#staticMethod, Function, kind: METHOD, isStatic: true),
-        },
-        smoke_0.F2: const {},
-        smoke_0.G: {
-          #b: const Declaration(#b, int, annotations: const [smoke_0.a1]),
-          #d: const Declaration(#d, int, annotations: const [smoke_0.a2]),
-        },
-        smoke_0.H: {
-          #f: const Declaration(#f, int, annotations: const [smoke_0.a1]),
-          #g: const Declaration(#g, int, annotations: const [smoke_0.a1]),
-          #h: const Declaration(#h, int, annotations: const [smoke_0.a2]),
-          #i: const Declaration(#i, int, annotations: const [smoke_0.a3]),
-        },
-        smoke_0.K: {
-          #k: const Declaration(#k, int, annotations: const [const smoke_0.AnnotC(named: true)]),
-          #k2: const Declaration(#k2, int, annotations: const [const smoke_0.AnnotC()]),
-        },
-        _M0: {
-          #i: const Declaration(#i, int),
-          #inc: const Declaration(#inc, Function, kind: METHOD),
-          #inc0: const Declaration(#inc0, Function, kind: METHOD),
-          #j: const Declaration(#j, int),
-          #j2: const Declaration(#j2, int, kind: PROPERTY),
-        },
+      smoke_0.D: {
+        #i2: const Declaration(#i2, int, kind: PROPERTY, isFinal: true),
+        #x2: const Declaration(#x2, int, kind: PROPERTY, isFinal: true),
       },
-      staticMethods: {
-        smoke_0.A: {
-          #staticInc: smoke_0.A.staticInc,
-        },
+      smoke_0.E: {
+        #noSuchMethod: const Declaration(#noSuchMethod, Function, kind: METHOD),
+        #y: const Declaration(#y, int, kind: PROPERTY, isFinal: true),
       },
-      names: {
-        #i: r'i',
-      }));
-}
+      smoke_0.E2: {},
+      smoke_0.F: {
+        #staticMethod: const Declaration(#staticMethod, Function, kind: METHOD, isStatic: true),
+      },
+      smoke_0.F2: {},
+      smoke_0.G: {
+        #b: const Declaration(#b, int, annotations: const [smoke_0.a1]),
+        #d: const Declaration(#d, int, annotations: const [smoke_0.a2]),
+      },
+      smoke_0.H: {
+        #f: const Declaration(#f, int, annotations: const [smoke_0.a1]),
+        #g: const Declaration(#g, int, annotations: const [smoke_0.a1]),
+        #h: const Declaration(#h, int, annotations: const [smoke_0.a2]),
+        #i: const Declaration(#i, int, annotations: const [smoke_0.a3]),
+      },
+      smoke_0.K: {
+        #k: const Declaration(#k, int, annotations: const [const smoke_0.AnnotC(named: true)]),
+        #k2: const Declaration(#k2, int, annotations: const [const smoke_0.AnnotC()]),
+      },
+      _M0: {
+        #i: const Declaration(#i, int),
+        #inc: const Declaration(#inc, Function, kind: METHOD),
+        #inc0: const Declaration(#inc0, Function, kind: METHOD),
+        #j: const Declaration(#j, int),
+        #j2: const Declaration(#j2, int, kind: PROPERTY),
+      },
+    },
+    staticMethods: {
+      smoke_0.A: {
+        #staticInc: smoke_0.A.staticInc,
+      },
+    },
+    names: {
+      #i: r'i',
+    });
 
 main() {
-  setUp(_configure);
+  setUp(() => useGeneratedCode(configuration));
   common.main();
 }
diff --git a/pkg/source_maps/CHANGELOG.md b/pkg/source_maps/CHANGELOG.md
index c52d585..6d371c9 100644
--- a/pkg/source_maps/CHANGELOG.md
+++ b/pkg/source_maps/CHANGELOG.md
@@ -2,6 +2,10 @@
 
 * Update `SpanFormatException` with `source` and `offset`.
 
+* All methods that take `Span`s, `Location`s, and `SourceFile`s as inputs now
+  also accept the corresponding `source_span` classes as well. Using the old
+  classes is now deprecated and will be unsupported in version 0.10.0.
+
 ## 0.9.3
 
 * Support writing SingleMapping objects to source map version 3 format.
diff --git a/pkg/source_maps/lib/builder.dart b/pkg/source_maps/lib/builder.dart
index cd30ccb..494a6b6 100644
--- a/pkg/source_maps/lib/builder.dart
+++ b/pkg/source_maps/lib/builder.dart
@@ -11,6 +11,7 @@
 
 import 'parser.dart';
 import 'span.dart';
+import 'src/span_wrapper.dart';
 
 /// Builds a source map given a set of mappings.
 class SourceMapBuilder {
@@ -18,8 +19,10 @@
   final List<Entry> _entries = <Entry>[];
 
   /// Adds an entry mapping the [targetOffset] to [source].
-  void addFromOffset(Location source,
-      SourceFile targetFile, int targetOffset, String identifier) {
+  ///
+  /// [source] can be either a [Location] or a [SourceLocation]. Using a
+  /// [Location] is deprecated and will be unsupported in version 0.10.0.
+  void addFromOffset(source, targetFile, int targetOffset, String identifier) {
     if (targetFile == null) {
       throw new ArgumentError('targetFile cannot be null');
     }
@@ -28,12 +31,27 @@
   }
 
   /// Adds an entry mapping [target] to [source].
-  void addSpan(Span source, Span target) {
-    var name = source.isIdentifier ? source.text : null;
+  ///
+  /// [source] and [target] can be either a [Span] or a [SourceSpan]. Using a
+  /// [Span] is deprecated and will be unsupported in version 0.10.0.
+  ///
+  /// If [isIdentifier] is true, this entry is considered to represent an
+  /// identifier whose value will be stored in the source map.
+  void addSpan(source, target, {bool isIdentifier}) {
+    source = SpanWrapper.wrap(source);
+    target = SpanWrapper.wrap(target);
+    if (isIdentifier == null) isIdentifier = source.isIdentifier;
+
+    var name = isIdentifier ? source.text : null;
     _entries.add(new Entry(source.start, target.start, name));
   }
 
-  void addLocation(Location source, Location target, String identifier) {
+  /// Adds an entry mapping [target] to [source].
+  ///
+  /// [source] and [target] can be either a [Location] or a [SourceLocation].
+  /// Using a [Location] is deprecated and will be unsupported in version
+  /// 0.10.0.
+  void addLocation(source, target, String identifier) {
     _entries.add(new Entry(source, target, identifier));
   }
 
@@ -57,7 +75,14 @@
   /// An identifier name, when this location is the start of an identifier.
   final String identifierName;
 
-  Entry(this.source, this.target, this.identifierName);
+  /// Creates a new [Entry] mapping [target] to [source].
+  ///
+  /// [source] and [target] can be either a [Location] or a [SourceLocation].
+  /// Using a [Location] is deprecated and will be unsupported in version
+  /// 0.10.0.
+  Entry(source, target, this.identifierName)
+      : source = LocationWrapper.wrap(source),
+        target = LocationWrapper.wrap(target);
 
   /// Implements [Comparable] to ensure that entries are ordered by their
   /// location in the target file. We sort primarily by the target offset
diff --git a/pkg/source_maps/lib/parser.dart b/pkg/source_maps/lib/parser.dart
index 3fd0d14..c18a1d6 100644
--- a/pkg/source_maps/lib/parser.dart
+++ b/pkg/source_maps/lib/parser.dart
@@ -10,6 +10,7 @@
 
 import 'builder.dart' as builder;
 import 'span.dart';
+import 'src/span_wrapper.dart';
 import 'src/utils.dart';
 import 'src/vlq.dart';
 
@@ -47,10 +48,21 @@
 
 /// A mapping parsed out of a source map.
 abstract class Mapping {
-  Span spanFor(int line, int column, {Map<String, SourceFile> files});
+  /// Returns the span associated with [line] and [column].
+  ///
+  /// The values of [files] can be either `source_map` [SourceFile]s or
+  /// `source_span` `SourceFile`s. Using `source_map` [SourceFile]s is
+  /// deprecated and will be unsupported in version 0.10.0.
+  Span spanFor(int line, int column, {Map<String, dynamic> files});
 
-  Span spanForLocation(Location loc, {Map<String, SourceFile> files}) {
-    return spanFor(loc.line, loc.column, files: files);
+  /// Returns the span associated with [location].
+  ///
+  /// The values of [files] may be either `source_map` [SourceFile]s or
+  /// `source_span` `SourceFile`s. Using `source_map` [SourceFile]s is
+  /// deprecated and will be unsupported in version 0.10.0.
+  Span spanForLocation(location, {Map<String, dynamic> files}) {
+    location = LocationWrapper.wrap(location);
+    return spanFor(location.line, location.column, files: files);
   }
 }
 
@@ -112,7 +124,7 @@
     return _lineStart.length - 1;
   }
 
-  Span spanFor(int line, int column, {Map<String, SourceFile> files}) {
+  Span spanFor(int line, int column, {Map<String, dynamic> files}) {
     int index = _indexFor(line, column);
     return _maps[index].spanFor(
         line - _lineStart[index], column - _columnStart[index], files: files);
@@ -351,7 +363,7 @@
     return (index <= 0) ? null : entries[index - 1];
   }
 
-  Span spanFor(int line, int column, {Map<String, SourceFile> files}) {
+  Span spanFor(int line, int column, {Map<String, dynamic> files}) {
     var entry = _findColumn(line, column, _findLine(line));
     if (entry == null || entry.sourceUrlId == null) return null;
     var url = urls[entry.sourceUrlId];
@@ -359,7 +371,7 @@
       url = '${sourceRoot}${url}';
     }
     if (files != null && files[url] != null) {
-      var file = files[url];
+      var file = SourceFileWrapper.wrap(files[url]);
       var start = file.getOffset(entry.sourceLine, entry.sourceColumn);
       if (entry.sourceNameId != null) {
         var text = names[entry.sourceNameId];
diff --git a/pkg/source_maps/lib/printer.dart b/pkg/source_maps/lib/printer.dart
index 0898017..aa18bd7 100644
--- a/pkg/source_maps/lib/printer.dart
+++ b/pkg/source_maps/lib/printer.dart
@@ -5,8 +5,11 @@
 /// Contains a code printer that generates code by recording the source maps.
 library source_maps.printer;
 
+import 'package:source_span/source_span.dart' as source_span;
+
 import 'builder.dart';
 import 'span.dart';
+import 'src/span_wrapper.dart';
 
 const int _LF = 10;
 const int _CR = 13;
@@ -75,9 +78,10 @@
   void mark(mark) {
     var loc;
     var identifier = null;
-    if (mark is Location) {
-      loc = mark;
-    } else if (mark is Span) {
+    if (mark is Location || mark is source_span.SourceLocation) {
+      loc = LocationWrapper.wrap(mark);
+    } else if (mark is Span || mark is source_span.SourceSpan) {
+      mark = SpanWrapper.wrap(mark);
       loc = mark.start;
       if (mark.isIdentifier) identifier = mark.text;
     }
@@ -124,15 +128,19 @@
   /// location of [object] in the original input. Only one, [location] or
   /// [span], should be provided at a time.
   ///
+  /// [location] can be either a [Location] or a [SourceLocation]. [span] can be
+  /// either a [Span] or a [SourceSpan]. Using a [Location] or a [Span] is
+  /// deprecated and will be unsupported in version 0.10.0.
+  ///
   /// Indicate [isOriginal] when [object] is copied directly from the user code.
   /// Setting [isOriginal] will make this printer propagate source map locations
   /// on every line-break.
-  void add(object, {Location location, Span span, bool isOriginal: false}) {
+  void add(object, {location, span, bool isOriginal: false}) {
     if (object is! String || location != null || span != null || isOriginal) {
       _flush();
       assert(location == null || span == null);
-      if (location != null) _items.add(location);
-      if (span != null) _items.add(span);
+      if (location != null) _items.add(LocationWrapper.wrap(location));
+      if (span != null) _items.add(SpanWrapper.wrap(span));
       if (isOriginal) _items.add(_ORIGINAL);
     }
 
@@ -156,12 +164,16 @@
   /// The [location] and [span] parameters indicate the corresponding source map
   /// location of [object] in the original input. Only one, [location] or
   /// [span], should be provided at a time.
-  void addLine(String line, {Location location, Span span}) {
+  ///
+  /// [location] can be either a [Location] or a [SourceLocation]. [span] can be
+  /// either a [Span] or a [SourceSpan]. Using a [Location] or a [Span] is
+  /// deprecated and will be unsupported in version 0.10.0.
+  void addLine(String line, {location, span}) {
     if (location != null || span != null) {
       _flush();
       assert(location == null || span == null);
-      if (location != null) _items.add(location);
-      if (span != null) _items.add(span);
+      if (location != null) _items.add(LocationWrapper.wrap(location));
+      if (span != null) _items.add(SpanWrapper.wrap(span));
     }
     if (line == null) return;
     if (line != '') {
diff --git a/pkg/source_maps/lib/refactor.dart b/pkg/source_maps/lib/refactor.dart
index 45fb069..47ce2ed9 100644
--- a/pkg/source_maps/lib/refactor.dart
+++ b/pkg/source_maps/lib/refactor.dart
@@ -10,6 +10,7 @@
 
 import 'span.dart';
 import 'printer.dart';
+import 'src/span_wrapper.dart';
 
 /// Editable text transaction.
 ///
@@ -20,7 +21,13 @@
   final String original;
   final _edits = <_TextEdit>[];
 
-  TextEditTransaction(this.original, this.file);
+  /// Creates a new transaction.
+  ///
+  /// [file] can be either a `source_map` [SourceFile] or a `source_span`
+  /// `SourceFile`. Using a `source_map` [SourceFile] is deprecated and will be
+  /// unsupported in version 0.10.0.
+  TextEditTransaction(this.original, file)
+      : file = SourceFileWrapper.wrap(file);
 
   bool get hasEdits => _edits.length > 0;
 
diff --git a/pkg/source_maps/lib/span.dart b/pkg/source_maps/lib/span.dart
index b546a97..a21e893 100644
--- a/pkg/source_maps/lib/span.dart
+++ b/pkg/source_maps/lib/span.dart
@@ -12,6 +12,7 @@
 import 'src/utils.dart';
 
 /// A simple class that describe a segment of source text.
+@Deprecated("Use the source_span package instead.")
 abstract class Span implements Comparable {
   /// The start location of this span.
   final Location start;
@@ -79,6 +80,7 @@
 }
 
 /// A location in the source text
+@Deprecated("Use the source_span package instead.")
 abstract class Location implements Comparable {
   /// Url of the source containing this span.
   String get sourceUrl;
@@ -113,6 +115,7 @@
 }
 
 /// Implementation of [Location] with fixed values given at allocation time.
+@Deprecated("Use the source_span package instead.")
 class FixedLocation extends Location {
   final String sourceUrl;
   final int line;
@@ -123,6 +126,7 @@
 }
 
 /// Implementation of [Span] where all the values are given at allocation time.
+@Deprecated("Use the source_span package instead.")
 class FixedSpan extends Span {
   /// The source text for this span, if available.
   final String text;
@@ -137,6 +141,7 @@
 }
 
 /// [Location] with values computed from an underling [SourceFile].
+@Deprecated("Use the source_span package instead.")
 class FileLocation extends Location {
   /// The source file containing this location.
   final SourceFile file;
@@ -149,6 +154,7 @@
 }
 
 /// [Span] where values are computed from an underling [SourceFile].
+@Deprecated("Use the source_span package instead.")
 class FileSpan extends Span {
   /// The source file containing this span.
   final SourceFile file;
@@ -195,6 +201,7 @@
 /// Stores information about a source file, to permit computation of the line
 /// and column. Also contains a nice default error message highlighting the code
 /// location.
+@Deprecated("Use the source_span package instead.")
 class SourceFile {
   /// Url where the source file is located.
   final String url;
@@ -306,6 +313,7 @@
 /// allows you to set source-map locations based on the locations relative to
 /// the start of the segment, but that get translated to absolute locations in
 /// the original source file.
+@Deprecated("Use the source_span package instead.")
 class SourceFileSegment extends SourceFile {
   final int _baseOffset;
   final int _baseLine;
@@ -365,6 +373,7 @@
 }
 
 /// A class for exceptions that have source span information attached.
+@Deprecated("Use the source_span package instead.")
 class SpanException implements Exception {
   /// A message describing the exception.
   final String message;
@@ -384,6 +393,7 @@
 }
 
 /// A [SpanException] that's also a [FormatException].
+@Deprecated("Use the source_span package instead.")
 class SpanFormatException extends SpanException implements FormatException {
   final source;
 
diff --git a/pkg/source_maps/lib/src/span_wrapper.dart b/pkg/source_maps/lib/src/span_wrapper.dart
new file mode 100644
index 0000000..e0c107b
--- /dev/null
+++ b/pkg/source_maps/lib/src/span_wrapper.dart
@@ -0,0 +1,85 @@
+// Copyright (c) 2014, 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 source_maps.span_wrapper;
+
+import 'package:source_span/source_span.dart' as source_span;
+
+import '../span.dart';
+
+/// A wrapper that exposes a [source_span.SourceSpan] as a [Span].
+class SpanWrapper extends Span {
+  final source_span.SourceSpan _inner;
+
+  String get text => _inner.text;
+
+  SpanWrapper(source_span.SourceSpan inner, bool isIdentifier)
+      : _inner = inner,
+        super(
+            new LocationWrapper(inner.start),
+            new LocationWrapper(inner.end),
+            isIdentifier);
+
+  static Span wrap(span, [bool isIdentifier = false]) {
+    if (span is Span) return span;
+    return new SpanWrapper(span, isIdentifier);
+  }
+}
+
+/// A wrapper that exposes a [source_span.SourceLocation] as a [Location].
+class LocationWrapper extends Location {
+  final source_span.SourceLocation _inner;
+
+  String get sourceUrl => _inner.sourceUrl.toString();
+  int get line => _inner.line;
+  int get column => _inner.column;
+
+  LocationWrapper(source_span.SourceLocation inner)
+      : _inner = inner,
+        super(inner.offset);
+
+  static Location wrap(location) {
+    if (location is Location) return location;
+    return new LocationWrapper(location);
+  }
+}
+
+/// A wrapper that exposes a [source_span.SourceFile] as a [SourceFile].
+class SourceFileWrapper implements SourceFile {
+  final source_span.SourceFile _inner;
+
+  // These are necessary to avoid analyzer warnings;
+  final _lineStarts = null;
+  final _decodedChars = null;
+
+  String get url => _inner.url.toString();
+
+  SourceFileWrapper(this._inner);
+
+  static SourceFile wrap(sourceFile) {
+    if (sourceFile is SourceFile) return sourceFile;
+    return new SourceFileWrapper(sourceFile);
+  }
+
+  Span span(int start, [int end, bool isIdentifier = false]) {
+    if (end == null) end = start;
+    return new SpanWrapper(_inner.span(start, end), isIdentifier);
+  }
+
+  Location location(int offset) => new LocationWrapper(_inner.location(offset));
+
+  int getLine(int offset) => _inner.getLine(offset);
+
+  int getColumn(int line, int offset) => _inner.getColumn(offset, line: line);
+
+  int getOffset(int line, int column) => _inner.getOffset(line, column);
+
+  String getText(int start, [int end]) => _inner.getText(start, end);
+
+  String getLocationMessage(String message, int start, int end,
+      {bool useColors: false, String color}) {
+    return span(start, end).getLocationMessage(message,
+        useColors: useColors, color: color);
+  }
+}
diff --git a/pkg/source_maps/pubspec.yaml b/pkg/source_maps/pubspec.yaml
index c5029e2..0548215 100644
--- a/pkg/source_maps/pubspec.yaml
+++ b/pkg/source_maps/pubspec.yaml
@@ -7,12 +7,13 @@
 #
 # When the minor version is upgraded, you *must* update that version constraint
 # in pub to stay in sync with this.
-version: 0.9.4
+version: 0.9.4-dev
 author: Dart Team <misc@dartlang.org>
 description: Library to programmatically manipulate source map files.
 homepage: http://www.dartlang.org
 dependencies:
   path: '>=1.2.0 <2.0.0'
+  source_span: '>=1.0.0 <2.0.0'
 environment:
   sdk: '>=0.8.10+6 <2.0.0'
 dev_dependencies:
diff --git a/pkg/string_scanner/CHANGELOG.md b/pkg/string_scanner/CHANGELOG.md
index a5d5518..f1d8763 100644
--- a/pkg/string_scanner/CHANGELOG.md
+++ b/pkg/string_scanner/CHANGELOG.md
@@ -1,3 +1,16 @@
+## 0.1.0
+
+* Switch from `source_maps`' `Span` class to `source_span`'s `SourceSpan` class.
+
+* `new StringScanner()`'s `sourceUrl` parameter is now named to make it clear
+  that it can be safely `null`.
+
+* `new StringScannerException()` takes different arguments in a different order
+  to match `SpanFormatException`.
+
+* `StringScannerException.string` has been renamed to
+  `StringScannerException.source` to match the `FormatException` interface.
+
 ## 0.0.3
 
 * Make `StringScannerException` inherit from source_map's
diff --git a/pkg/string_scanner/lib/src/exception.dart b/pkg/string_scanner/lib/src/exception.dart
index 44ec9a3..50177d6 100644
--- a/pkg/string_scanner/lib/src/exception.dart
+++ b/pkg/string_scanner/lib/src/exception.dart
@@ -4,18 +4,17 @@
 
 library string_scanner.exception;
 
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 /// An exception thrown by a [StringScanner] that failed to parse a string.
-class StringScannerException extends SpanFormatException {
-  /// The source string being parsed.
-  final String string;
+class StringScannerException extends SourceSpanFormatException {
+  String get source => super.source;
 
   /// The URL of the source file being parsed.
   ///
   /// This may be `null`, indicating that the source URL is unknown.
-  final Uri sourceUrl;
+  Uri get sourceUrl => span.sourceUrl;
 
-  StringScannerException(String message, this.string, this.sourceUrl, Span span)
-      : super(message, span);
+  StringScannerException(String message, SourceSpan span, String source)
+      : super(message, span, source);
 }
diff --git a/pkg/string_scanner/lib/src/span_scanner.dart b/pkg/string_scanner/lib/src/span_scanner.dart
index 9060e62..d8dc230 100644
--- a/pkg/string_scanner/lib/src/span_scanner.dart
+++ b/pkg/string_scanner/lib/src/span_scanner.dart
@@ -4,7 +4,7 @@
 
 library string_scanner.span_scanner;
 
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 import 'exception.dart';
 import 'line_scanner.dart';
@@ -20,7 +20,7 @@
   final SourceFile _sourceFile;
 
   int get line => _sourceFile.getLine(position);
-  int get column => _sourceFile.getColumn(line, position);
+  int get column => _sourceFile.getColumn(position);
 
   LineScannerState get state => new _SpanScannerState(this, position);
 
@@ -34,28 +34,28 @@
     this.position = state.position;
   }
 
-  /// The [Span] for [lastMatch].
+  /// The [SourceSpan] for [lastMatch].
   ///
   /// This is the span for the entire match. There's no way to get spans for
   /// subgroups since [Match] exposes no information about their positions.
-  Span get lastSpan => _lastSpan;
-  Span _lastSpan;
+  SourceSpan get lastSpan => _lastSpan;
+  SourceSpan _lastSpan;
 
   /// Returns an empty span at the current location.
-  Span get emptySpan => _sourceFile.span(position);
+  SourceSpan get emptySpan => _sourceFile.location(position).pointSpan();
 
   /// Creates a new [SpanScanner] that starts scanning from [position].
   ///
-  /// [sourceUrl] is used as [Location.sourceUrl] for the returned [Span]s as
-  /// well as for error reporting.
-  SpanScanner(String string, sourceUrl, {int position})
-      : _sourceFile = new SourceFile.text(
-            sourceUrl is Uri ? sourceUrl.toString() : sourceUrl, string),
+  /// [sourceUrl] is used as [SourceLocation.sourceUrl] for the returned
+  /// [SourceSpan]s as well as for error reporting. It can be a [String], a
+  /// [Uri], or `null`.
+  SpanScanner(String string, {sourceUrl, int position})
+      : _sourceFile = new SourceFile(string, url: sourceUrl),
         super(string, sourceUrl: sourceUrl, position: position);
 
-  /// Creates a [Span] representing the source range between [startState] and
-  /// the current position.
-  Span spanFrom(LineScannerState startState) =>
+  /// Creates a [SourceSpan] representing the source range between [startState]
+  /// and the current position.
+  SourceSpan spanFrom(LineScannerState startState) =>
       _sourceFile.span(startState.position, position);
 
   bool matches(Pattern pattern) {
@@ -78,7 +78,7 @@
     if (length == null) length = match == null ? 1 : match.end - match.start;
 
     var span = _sourceFile.span(position, position + length);
-    throw new StringScannerException(message, string, sourceUrl, span);
+    throw new StringScannerException(message, span, string);
   }
 }
 
@@ -89,7 +89,7 @@
 
   final int position;
   int get line => _scanner._sourceFile.getLine(position);
-  int get column => _scanner._sourceFile.getColumn(line, position);
+  int get column => _scanner._sourceFile.getColumn(position);
 
   _SpanScannerState(this._scanner, this.position);
 }
diff --git a/pkg/string_scanner/lib/src/string_scanner.dart b/pkg/string_scanner/lib/src/string_scanner.dart
index c9e7459..44d5d2d 100644
--- a/pkg/string_scanner/lib/src/string_scanner.dart
+++ b/pkg/string_scanner/lib/src/string_scanner.dart
@@ -4,7 +4,7 @@
 
 library string_scanner.string_scanner;
 
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 import 'exception.dart';
 import 'utils.dart';
@@ -52,7 +52,7 @@
   ///
   /// [position] defaults to 0, the beginning of the string. [sourceUrl] is the
   /// URL of the source of the string being scanned, if available. It can be
-  /// either a [String] or a [Uri].
+  /// a [String], a [Uri], or `null`.
   StringScanner(this.string, {sourceUrl, int position})
       : sourceUrl = sourceUrl is String ? Uri.parse(sourceUrl) : sourceUrl {
     if (position != null) this.position = position;
@@ -153,10 +153,9 @@
     }
     if (length == null) length = match == null ? 1 : match.end - match.start;
 
-    var url = sourceUrl == null ? null : sourceUrl.toString();
-    var sourceFile = new SourceFile.text(url, string);
+    var sourceFile = new SourceFile(string, url: sourceUrl);
     var span = sourceFile.span(position, position + length);
-    throw new StringScannerException(message, string, sourceUrl, span);
+    throw new StringScannerException(message, span, string);
   }
 
   // TODO(nweiz): Make this handle long lines more gracefully.
diff --git a/pkg/string_scanner/pubspec.yaml b/pkg/string_scanner/pubspec.yaml
index f6d7ab9..1451fc5 100644
--- a/pkg/string_scanner/pubspec.yaml
+++ b/pkg/string_scanner/pubspec.yaml
@@ -1,12 +1,12 @@
 name: string_scanner
-version: 0.0.3
+version: 0.1.0
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
 description: >
   A class for parsing strings using a sequence of patterns.
 dependencies:
   path: ">=1.2.0 <2.0.0"
-  source_maps: ">=0.9.2 <0.10.0"
+  source_span: ">=1.0.0 <2.0.0"
 dev_dependencies:
   unittest: ">=0.10.0 <0.11.0"
 environment:
diff --git a/pkg/string_scanner/test/span_scanner_test.dart b/pkg/string_scanner/test/span_scanner_test.dart
index 93ba0b6..796df29 100644
--- a/pkg/string_scanner/test/span_scanner_test.dart
+++ b/pkg/string_scanner/test/span_scanner_test.dart
@@ -10,7 +10,7 @@
 void main() {
   var scanner;
   setUp(() {
-    scanner = new SpanScanner('foo\nbar\nbaz', 'source');
+    scanner = new SpanScanner('foo\nbar\nbaz', sourceUrl: 'source');
   });
 
   test("tracks the span for the last match", () {
@@ -21,12 +21,12 @@
     expect(span.start.offset, equals(2));
     expect(span.start.line, equals(0));
     expect(span.start.column, equals(2));
-    expect(span.start.sourceUrl, equals('source'));
+    expect(span.start.sourceUrl, equals(Uri.parse('source')));
 
     expect(span.end.offset, equals(6));
     expect(span.end.line, equals(1));
     expect(span.end.column, equals(2));
-    expect(span.start.sourceUrl, equals('source'));
+    expect(span.start.sourceUrl, equals(Uri.parse('source')));
 
     expect(span.text, equals('o\nba'));
   });
@@ -48,12 +48,12 @@
     expect(span.start.offset, equals(6));
     expect(span.start.line, equals(1));
     expect(span.start.column, equals(2));
-    expect(span.start.sourceUrl, equals('source'));
+    expect(span.start.sourceUrl, equals(Uri.parse('source')));
 
     expect(span.end.offset, equals(6));
     expect(span.end.line, equals(1));
     expect(span.end.column, equals(2));
-    expect(span.start.sourceUrl, equals('source'));
+    expect(span.start.sourceUrl, equals(Uri.parse('source')));
 
     expect(span.text, equals(''));
   });
diff --git a/pkg/utf/lib/constants.dart b/pkg/utf/lib/src/constants.dart
similarity index 97%
rename from pkg/utf/lib/constants.dart
rename to pkg/utf/lib/src/constants.dart
index 11d0cc2..3dfea39 100644
--- a/pkg/utf/lib/constants.dart
+++ b/pkg/utf/lib/src/constants.dart
@@ -2,7 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of utf;
+library utf.constants;
 
 /**
  * Invalid codepoints or encodings may be substituted with the value U+fffd.
diff --git a/pkg/utf/lib/list_range.dart b/pkg/utf/lib/src/list_range.dart
similarity index 83%
rename from pkg/utf/lib/list_range.dart
rename to pkg/utf/lib/src/list_range.dart
index 06adb76..7889796 100644
--- a/pkg/utf/lib/list_range.dart
+++ b/pkg/utf/lib/src/list_range.dart
@@ -2,7 +2,9 @@
 // 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 utf;
+library utf.list_range;
+
+import 'dart:collection';
 
 /**
  * _ListRange in an internal type used to create a lightweight Interable on a
@@ -11,12 +13,12 @@
  */
 // TODO(floitsch): Consider removing the extend and switch to implements since
 // that's cheaper to allocate.
-class _ListRange extends IterableBase {
+class ListRange extends IterableBase {
   final List _source;
   final int _offset;
   final int _length;
 
-  _ListRange(source, [offset = 0, length]) :
+  ListRange(source, [offset = 0, length]) :
       this._source = source,
       this._offset = offset,
       this._length = (length == null ? source.length - offset : length) {
@@ -31,18 +33,18 @@
     }
   }
 
-  _ListRangeIterator get iterator =>
+  ListRangeIterator get iterator =>
       new _ListRangeIteratorImpl(_source, _offset, _offset + _length);
 
   int get length => _length;
 }
 
 /**
- * The _ListRangeIterator provides more capabilities than a standard iterator,
+ * The ListRangeIterator provides more capabilities than a standard iterator,
  * including the ability to get the current position, count remaining items,
  * and move forward/backward within the iterator.
  */
-abstract class _ListRangeIterator implements Iterator<int> {
+abstract class ListRangeIterator implements Iterator<int> {
   bool moveNext();
   int get current;
   int get position;
@@ -51,7 +53,7 @@
   void skip([count]);
 }
 
-class _ListRangeIteratorImpl implements _ListRangeIterator {
+class _ListRangeIteratorImpl implements ListRangeIterator {
   final List<int> _source;
   int _offset;
   final int _end;
@@ -75,4 +77,3 @@
     _offset += count;
   }
 }
-
diff --git a/pkg/utf/lib/utf16.dart b/pkg/utf/lib/src/utf/utf16.dart
similarity index 69%
rename from pkg/utf/lib/utf16.dart
rename to pkg/utf/lib/src/utf/utf16.dart
index 438c678..8ddd4dd 100644
--- a/pkg/utf/lib/utf16.dart
+++ b/pkg/utf/lib/src/utf/utf16.dart
@@ -11,7 +11,7 @@
 List<int> stringToCodepoints(String str) {
   // Note: str.codeUnits gives us 16-bit code units on all Dart implementations.
   // So we need to convert.
-  return _utf16CodeUnitsToCodepoints(str.codeUnits);
+  return utf16CodeUnitsToCodepoints(str.codeUnits);
 }
 
 /**
@@ -19,152 +19,10 @@
  *
  * *Deprecated* Use [String.fromCharCodes] instead.
  */
+@deprecated
 String codepointsToString(List<int> codepoints) {
   return new String.fromCharCodes(codepoints);
 }
-
-/**
- * An Iterator<int> of codepoints built on an Iterator of UTF-16 code units.
- * The parameters can override the default Unicode replacement character. Set
- * the replacementCharacter to null to throw an ArgumentError
- * rather than replace the bad value.
- */
-class Utf16CodeUnitDecoder implements Iterator<int> {
-  final _ListRangeIterator utf16CodeUnitIterator;
-  final int replacementCodepoint;
-  int _current = null;
-
-  Utf16CodeUnitDecoder(List<int> utf16CodeUnits, [int offset = 0, int length,
-      int this.replacementCodepoint =
-      UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
-      utf16CodeUnitIterator =
-          (new _ListRange(utf16CodeUnits, offset, length)).iterator;
-
-  Utf16CodeUnitDecoder.fromListRangeIterator(
-      _ListRangeIterator this.utf16CodeUnitIterator,
-      int this.replacementCodepoint);
-
-  Iterator<int> get iterator => this;
-
-  int get current => _current;
-
-  bool moveNext() {
-    _current = null;
-    if (!utf16CodeUnitIterator.moveNext()) return false;
-
-    int value = utf16CodeUnitIterator.current;
-    if (value < 0) {
-      if (replacementCodepoint != null) {
-        _current = replacementCodepoint;
-      } else {
-        throw new ArgumentError(
-            "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
-      }
-    } else if (value < UNICODE_UTF16_RESERVED_LO ||
-        (value > UNICODE_UTF16_RESERVED_HI && value <= UNICODE_PLANE_ONE_MAX)) {
-      // transfer directly
-      _current = value;
-    } else if (value < UNICODE_UTF16_SURROGATE_UNIT_1_BASE &&
-        utf16CodeUnitIterator.moveNext()) {
-      // merge surrogate pair
-      int nextValue = utf16CodeUnitIterator.current;
-      if (nextValue >= UNICODE_UTF16_SURROGATE_UNIT_1_BASE &&
-          nextValue <= UNICODE_UTF16_RESERVED_HI) {
-        value = (value - UNICODE_UTF16_SURROGATE_UNIT_0_BASE) << 10;
-        value += UNICODE_UTF16_OFFSET +
-            (nextValue - UNICODE_UTF16_SURROGATE_UNIT_1_BASE);
-        _current = value;
-      } else {
-        if (nextValue >= UNICODE_UTF16_SURROGATE_UNIT_0_BASE &&
-           nextValue < UNICODE_UTF16_SURROGATE_UNIT_1_BASE) {
-          utf16CodeUnitIterator.backup();
-        }
-        if (replacementCodepoint != null) {
-          _current = replacementCodepoint;
-        } else {
-          throw new ArgumentError(
-              "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
-        }
-      }
-    } else if (replacementCodepoint != null) {
-      _current = replacementCodepoint;
-    } else {
-      throw new ArgumentError(
-          "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
-    }
-    return true;
-  }
-}
-
-/**
- * Encode code points as UTF16 code units.
- */
-List<int> _codepointsToUtf16CodeUnits(
-    List<int> codepoints,
-    [int offset = 0,
-     int length,
-     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-
-  _ListRange listRange = new _ListRange(codepoints, offset, length);
-  int encodedLength = 0;
-  for (int value in listRange) {
-    if ((value >= 0 && value < UNICODE_UTF16_RESERVED_LO) ||
-        (value > UNICODE_UTF16_RESERVED_HI && value <= UNICODE_PLANE_ONE_MAX)) {
-      encodedLength++;
-    } else if (value > UNICODE_PLANE_ONE_MAX &&
-        value <= UNICODE_VALID_RANGE_MAX) {
-      encodedLength += 2;
-    } else {
-      encodedLength++;
-    }
-  }
-
-  List<int> codeUnitsBuffer = new List<int>(encodedLength);
-  int j = 0;
-  for (int value in listRange) {
-    if ((value >= 0 && value < UNICODE_UTF16_RESERVED_LO) ||
-        (value > UNICODE_UTF16_RESERVED_HI && value <= UNICODE_PLANE_ONE_MAX)) {
-      codeUnitsBuffer[j++] = value;
-    } else if (value > UNICODE_PLANE_ONE_MAX &&
-        value <= UNICODE_VALID_RANGE_MAX) {
-      int base = value - UNICODE_UTF16_OFFSET;
-      codeUnitsBuffer[j++] = UNICODE_UTF16_SURROGATE_UNIT_0_BASE +
-          ((base & UNICODE_UTF16_HI_MASK) >> 10);
-      codeUnitsBuffer[j++] = UNICODE_UTF16_SURROGATE_UNIT_1_BASE +
-          (base & UNICODE_UTF16_LO_MASK);
-    } else if (replacementCodepoint != null) {
-      codeUnitsBuffer[j++] = replacementCodepoint;
-    } else {
-      throw new ArgumentError("Invalid encoding");
-    }
-  }
-  return codeUnitsBuffer;
-}
-
-/**
- * Decodes the utf16 codeunits to codepoints.
- */
-List<int> _utf16CodeUnitsToCodepoints(
-    List<int> utf16CodeUnits, [int offset = 0, int length,
-    int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  _ListRangeIterator source =
-      (new _ListRange(utf16CodeUnits, offset, length)).iterator;
-  Utf16CodeUnitDecoder decoder = new Utf16CodeUnitDecoder
-      .fromListRangeIterator(source, replacementCodepoint);
-  List<int> codepoints = new List<int>(source.remaining);
-  int i = 0;
-  while (decoder.moveNext()) {
-    codepoints[i++] = decoder.current;
-  }
-  if (i == codepoints.length) {
-    return codepoints;
-  } else {
-    List<int> codepointTrunc = new List<int>(i);
-    codepointTrunc.setRange(0, i, codepoints);
-    return codepointTrunc;
-  }
-}
-
 /**
  * Decodes the UTF-16 bytes as an iterable. Thus, the consumer can only convert
  * as much of the input as needed. Determines the byte order from the BOM,
@@ -225,7 +83,7 @@
       offset, length, replacementCodepoint);
   List<int> codeunits = decoder.decodeRest();
   return new String.fromCharCodes(
-      _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
+      utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
 }
 
 /**
@@ -241,7 +99,7 @@
   List<int> codeunits = (new Utf16beBytesToCodeUnitsDecoder(bytes, offset,
       length, stripBom, replacementCodepoint)).decodeRest();
   return new String.fromCharCodes(
-      _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
+      utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
 }
 
 /**
@@ -257,7 +115,7 @@
   List<int> codeunits = (new Utf16leBytesToCodeUnitsDecoder(bytes, offset,
       length, stripBom, replacementCodepoint)).decodeRest();
   return new String.fromCharCodes(
-      _utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
+      utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
 }
 
 /**
@@ -339,10 +197,10 @@
 }
 
 List<int> _stringToUtf16CodeUnits(String str) {
-  return _codepointsToUtf16CodeUnits(str.codeUnits);
+  return codepointsToUtf16CodeUnits(str.codeUnits);
 }
 
-typedef _ListRangeIterator _CodeUnitsProvider();
+typedef ListRangeIterator _CodeUnitsProvider();
 
 /**
  * Return type of [decodeUtf16AsIterable] and variants. The Iterable type
@@ -367,8 +225,9 @@
  * to produce the code unit (0-(2^16)-1). Relies on BOM to determine
  * endian-ness, and defaults to BE.
  */
-abstract class Utf16BytesToCodeUnitsDecoder implements _ListRangeIterator {
-  final _ListRangeIterator utf16EncodedBytesIterator;
+abstract class Utf16BytesToCodeUnitsDecoder implements ListRangeIterator {
+  // TODO(kevmoo): should this field be private?
+  final ListRangeIterator utf16EncodedBytesIterator;
   final int replacementCodepoint;
   int _current = null;
 
@@ -460,7 +319,7 @@
       int offset = 0, int length, bool stripBom = true,
       int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
       super._fromListRangeIterator(
-          (new _ListRange(utf16EncodedBytes, offset, length)).iterator,
+          (new ListRange(utf16EncodedBytes, offset, length)).iterator,
           replacementCodepoint) {
     if (stripBom && hasUtf16beBom(utf16EncodedBytes, offset, length)) {
       skip();
@@ -485,7 +344,7 @@
       int offset = 0, int length, bool stripBom = true,
       int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
       super._fromListRangeIterator(
-          (new _ListRange(utf16EncodedBytes, offset, length)).iterator,
+          (new ListRange(utf16EncodedBytes, offset, length)).iterator,
           replacementCodepoint) {
     if (stripBom && hasUtf16leBom(utf16EncodedBytes, offset, length)) {
       skip();
diff --git a/pkg/utf/lib/utf32.dart b/pkg/utf/lib/src/utf/utf32.dart
similarity index 97%
rename from pkg/utf/lib/utf32.dart
rename to pkg/utf/lib/src/utf/utf32.dart
index c481c81..e51009d 100644
--- a/pkg/utf/lib/utf32.dart
+++ b/pkg/utf/lib/src/utf/utf32.dart
@@ -195,8 +195,9 @@
 /**
  * Abstrace parent class converts encoded bytes to codepoints.
  */
-abstract class Utf32BytesDecoder implements _ListRangeIterator {
-  final _ListRangeIterator utf32EncodedBytesIterator;
+abstract class Utf32BytesDecoder implements ListRangeIterator {
+  // TODO(kevmoo): should this field be private?
+  final ListRangeIterator utf32EncodedBytesIterator;
   final int replacementCodepoint;
   int _current = null;
 
@@ -286,7 +287,7 @@
       int length, bool stripBom = true,
       int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
       super._fromListRangeIterator(
-          (new _ListRange(utf32EncodedBytes, offset, length)).iterator,
+          (new ListRange(utf32EncodedBytes, offset, length)).iterator,
           replacementCodepoint) {
     if (stripBom && hasUtf32beBom(utf32EncodedBytes, offset, length)) {
       skip();
@@ -315,7 +316,7 @@
       int length, bool stripBom = true,
       int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
       super._fromListRangeIterator(
-          (new _ListRange(utf32EncodedBytes, offset, length)).iterator,
+          (new ListRange(utf32EncodedBytes, offset, length)).iterator,
           replacementCodepoint) {
     if (stripBom && hasUtf32leBom(utf32EncodedBytes, offset, length)) {
       skip();
diff --git a/pkg/utf/lib/utf8.dart b/pkg/utf/lib/src/utf/utf8.dart
similarity index 96%
rename from pkg/utf/lib/utf8.dart
rename to pkg/utf/lib/src/utf/utf8.dart
index 36288d9..ff1b1ed 100644
--- a/pkg/utf/lib/utf8.dart
+++ b/pkg/utf/lib/src/utf/utf8.dart
@@ -69,7 +69,7 @@
  */
 List<int> codepointsToUtf8(
     List<int> codepoints, [int offset = 0, int length]) {
-  _ListRange source = new _ListRange(codepoints, offset, length);
+  ListRange source = new ListRange(codepoints, offset, length);
 
   int encodedLength = 0;
   for (int value in source) {
@@ -153,7 +153,8 @@
  * from this method can be used as an Iterable (e.g. in a for-loop).
  */
 class Utf8Decoder implements Iterator<int> {
-  final _ListRangeIterator utf8EncodedBytesIterator;
+  // TODO(kevmoo): should this field be private?
+  final ListRangeIterator utf8EncodedBytesIterator;
   final int replacementCodepoint;
   int _current = null;
 
@@ -161,10 +162,10 @@
       this.replacementCodepoint =
       UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
       utf8EncodedBytesIterator =
-          (new _ListRange(utf8EncodedBytes, offset, length)).iterator;
+          (new ListRange(utf8EncodedBytes, offset, length)).iterator;
 
 
-  Utf8Decoder._fromListRangeIterator(_ListRange source, [
+  Utf8Decoder._fromListRangeIterator(ListRange source, [
       this.replacementCodepoint =
       UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
       utf8EncodedBytesIterator = source.iterator;
diff --git a/pkg/utf/lib/utf_stream.dart b/pkg/utf/lib/src/utf/utf_stream.dart
similarity index 98%
rename from pkg/utf/lib/utf_stream.dart
rename to pkg/utf/lib/src/utf/utf_stream.dart
index bb36dca..2b460d0 100644
--- a/pkg/utf/lib/utf_stream.dart
+++ b/pkg/utf/lib/src/utf/utf_stream.dart
@@ -205,7 +205,7 @@
   List<int> _processString(String string) {
     var bytes = [];
     int pos = 0;
-    List<int> codepoints = _utf16CodeUnitsToCodepoints(string.codeUnits);
+    List<int> codepoints = utf16CodeUnitsToCodepoints(string.codeUnits);
     int length = codepoints.length;
     for (int i = 0; i < length; i++) {
       int additionalBytes;
diff --git a/pkg/utf/lib/src/utf_16_code_unit_decoder.dart b/pkg/utf/lib/src/utf_16_code_unit_decoder.dart
new file mode 100644
index 0000000..a0a4b3c
--- /dev/null
+++ b/pkg/utf/lib/src/utf_16_code_unit_decoder.dart
@@ -0,0 +1,83 @@
+// 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 utf.utf_16_code_unit_decoder;
+
+import 'constants.dart';
+import 'list_range.dart';
+
+/**
+ * An Iterator<int> of codepoints built on an Iterator of UTF-16 code units.
+ * The parameters can override the default Unicode replacement character. Set
+ * the replacementCharacter to null to throw an ArgumentError
+ * rather than replace the bad value.
+ */
+class Utf16CodeUnitDecoder implements Iterator<int> {
+  // TODO(kevmoo): should this field be private?
+  final ListRangeIterator utf16CodeUnitIterator;
+  final int replacementCodepoint;
+  int _current = null;
+
+  Utf16CodeUnitDecoder(List<int> utf16CodeUnits, [int offset = 0, int length,
+      int this.replacementCodepoint =
+      UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) :
+      utf16CodeUnitIterator =
+          (new ListRange(utf16CodeUnits, offset, length)).iterator;
+
+  Utf16CodeUnitDecoder.fromListRangeIterator(
+      ListRangeIterator this.utf16CodeUnitIterator,
+      int this.replacementCodepoint);
+
+  Iterator<int> get iterator => this;
+
+  int get current => _current;
+
+  bool moveNext() {
+    _current = null;
+    if (!utf16CodeUnitIterator.moveNext()) return false;
+
+    int value = utf16CodeUnitIterator.current;
+    if (value < 0) {
+      if (replacementCodepoint != null) {
+        _current = replacementCodepoint;
+      } else {
+        throw new ArgumentError(
+            "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
+      }
+    } else if (value < UNICODE_UTF16_RESERVED_LO ||
+        (value > UNICODE_UTF16_RESERVED_HI && value <= UNICODE_PLANE_ONE_MAX)) {
+      // transfer directly
+      _current = value;
+    } else if (value < UNICODE_UTF16_SURROGATE_UNIT_1_BASE &&
+        utf16CodeUnitIterator.moveNext()) {
+      // merge surrogate pair
+      int nextValue = utf16CodeUnitIterator.current;
+      if (nextValue >= UNICODE_UTF16_SURROGATE_UNIT_1_BASE &&
+          nextValue <= UNICODE_UTF16_RESERVED_HI) {
+        value = (value - UNICODE_UTF16_SURROGATE_UNIT_0_BASE) << 10;
+        value += UNICODE_UTF16_OFFSET +
+            (nextValue - UNICODE_UTF16_SURROGATE_UNIT_1_BASE);
+        _current = value;
+      } else {
+        if (nextValue >= UNICODE_UTF16_SURROGATE_UNIT_0_BASE &&
+           nextValue < UNICODE_UTF16_SURROGATE_UNIT_1_BASE) {
+          utf16CodeUnitIterator.backup();
+        }
+        if (replacementCodepoint != null) {
+          _current = replacementCodepoint;
+        } else {
+          throw new ArgumentError(
+              "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
+        }
+      }
+    } else if (replacementCodepoint != null) {
+      _current = replacementCodepoint;
+    } else {
+      throw new ArgumentError(
+          "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
+    }
+    return true;
+  }
+}
+
diff --git a/pkg/utf/lib/src/util.dart b/pkg/utf/lib/src/util.dart
new file mode 100644
index 0000000..17427d5
--- /dev/null
+++ b/pkg/utf/lib/src/util.dart
@@ -0,0 +1,78 @@
+// 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 utf.util;
+
+import 'constants.dart';
+import 'list_range.dart';
+import 'utf_16_code_unit_decoder.dart';
+
+/**
+ * Decodes the utf16 codeunits to codepoints.
+ */
+List<int> utf16CodeUnitsToCodepoints(
+    List<int> utf16CodeUnits, [int offset = 0, int length,
+    int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
+  ListRangeIterator source =
+      (new ListRange(utf16CodeUnits, offset, length)).iterator;
+  Utf16CodeUnitDecoder decoder = new Utf16CodeUnitDecoder
+      .fromListRangeIterator(source, replacementCodepoint);
+  List<int> codepoints = new List<int>(source.remaining);
+  int i = 0;
+  while (decoder.moveNext()) {
+    codepoints[i++] = decoder.current;
+  }
+  if (i == codepoints.length) {
+    return codepoints;
+  } else {
+    List<int> codepointTrunc = new List<int>(i);
+    codepointTrunc.setRange(0, i, codepoints);
+    return codepointTrunc;
+  }
+}
+
+/**
+ * Encode code points as UTF16 code units.
+ */
+List<int> codepointsToUtf16CodeUnits(
+    List<int> codepoints,
+    [int offset = 0,
+     int length,
+     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
+
+  ListRange listRange = new ListRange(codepoints, offset, length);
+  int encodedLength = 0;
+  for (int value in listRange) {
+    if ((value >= 0 && value < UNICODE_UTF16_RESERVED_LO) ||
+        (value > UNICODE_UTF16_RESERVED_HI && value <= UNICODE_PLANE_ONE_MAX)) {
+      encodedLength++;
+    } else if (value > UNICODE_PLANE_ONE_MAX &&
+        value <= UNICODE_VALID_RANGE_MAX) {
+      encodedLength += 2;
+    } else {
+      encodedLength++;
+    }
+  }
+
+  List<int> codeUnitsBuffer = new List<int>(encodedLength);
+  int j = 0;
+  for (int value in listRange) {
+    if ((value >= 0 && value < UNICODE_UTF16_RESERVED_LO) ||
+        (value > UNICODE_UTF16_RESERVED_HI && value <= UNICODE_PLANE_ONE_MAX)) {
+      codeUnitsBuffer[j++] = value;
+    } else if (value > UNICODE_PLANE_ONE_MAX &&
+        value <= UNICODE_VALID_RANGE_MAX) {
+      int base = value - UNICODE_UTF16_OFFSET;
+      codeUnitsBuffer[j++] = UNICODE_UTF16_SURROGATE_UNIT_0_BASE +
+          ((base & UNICODE_UTF16_HI_MASK) >> 10);
+      codeUnitsBuffer[j++] = UNICODE_UTF16_SURROGATE_UNIT_1_BASE +
+          (base & UNICODE_UTF16_LO_MASK);
+    } else if (replacementCodepoint != null) {
+      codeUnitsBuffer[j++] = replacementCodepoint;
+    } else {
+      throw new ArgumentError("Invalid encoding");
+    }
+  }
+  return codeUnitsBuffer;
+}
diff --git a/pkg/utf/lib/utf.dart b/pkg/utf/lib/utf.dart
index 1028990..30d5db5 100644
--- a/pkg/utf/lib/utf.dart
+++ b/pkg/utf/lib/utf.dart
@@ -11,9 +11,15 @@
 import "dart:async";
 import "dart:collection";
 
-part "constants.dart";
-part "list_range.dart";
-part "utf_stream.dart";
-part "utf8.dart";
-part "utf16.dart";
-part "utf32.dart";
+import "src/constants.dart";
+import 'src/utf_16_code_unit_decoder.dart';
+import 'src/list_range.dart';
+import 'src/util.dart';
+
+export 'src/constants.dart';
+export 'src/utf_16_code_unit_decoder.dart';
+
+part "src/utf/utf_stream.dart";
+part "src/utf/utf8.dart";
+part "src/utf/utf16.dart";
+part "src/utf/utf32.dart";
diff --git a/pkg/utf/pubspec.yaml b/pkg/utf/pubspec.yaml
index e997dac..a3fd334 100644
--- a/pkg/utf/pubspec.yaml
+++ b/pkg/utf/pubspec.yaml
@@ -1,12 +1,9 @@
 name: utf
-version: 0.9.0
+version: 0.9.0+1
 author: Dart Team <misc@dartlang.org>
 description: >
  A Unicode library. Intended for advanced use where the built-in facilities
  are too limiting.
-homepage: http://www.dartlang.org
-documentation: http://api.dartlang.org/docs/pkg/utf
-dev_dependencies:
-  unittest: ">=0.9.0 <0.10.0"
+homepage: https://pub.dartlang.org/packages/utf
 environment:
-  sdk: ">=0.8.10+6 <2.0.0"
+  sdk: '>=1.0.0 <2.0.0'
diff --git a/pkg/utf/test/unicode_core_test.dart b/pkg/utf/test/unicode_core_test.dart
index 129273b..6e13e96 100755
--- a/pkg/utf/test/unicode_core_test.dart
+++ b/pkg/utf/test/unicode_core_test.dart
@@ -2,91 +2,90 @@
 // 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 utf;
+library utf.unicode_core_test;
+
 import 'package:expect/expect.dart';
-import 'dart:collection';
 
-part '../lib/constants.dart';
-part '../lib/list_range.dart';
-part '../lib/utf16.dart';
+import 'package:utf/utf.dart';
+import 'package:utf/src/util.dart';
 
-main() {
+void main() {
   testCodepointsToUtf16CodeUnits();
   testUtf16bytesToCodepoints();
 }
 
 void testCodepointsToUtf16CodeUnits() {
   // boundary conditions
-  Expect.listEquals([], _codepointsToUtf16CodeUnits([]), "no input");
-  Expect.listEquals([0x0], _codepointsToUtf16CodeUnits([0x0]), "0");
+  Expect.listEquals([], codepointsToUtf16CodeUnits([]), "no input");
+  Expect.listEquals([0x0], codepointsToUtf16CodeUnits([0x0]), "0");
   Expect.listEquals([0xd800, 0xdc00],
-      _codepointsToUtf16CodeUnits([0x10000]), "10000");
+      codepointsToUtf16CodeUnits([0x10000]), "10000");
 
   Expect.listEquals([0xffff],
-      _codepointsToUtf16CodeUnits([0xffff]), "ffff");
+      codepointsToUtf16CodeUnits([0xffff]), "ffff");
   Expect.listEquals([0xdbff, 0xdfff],
-      _codepointsToUtf16CodeUnits([0x10ffff]), "10ffff");
+      codepointsToUtf16CodeUnits([0x10ffff]), "10ffff");
 
   Expect.listEquals([0xd7ff],
-      _codepointsToUtf16CodeUnits([0xd7ff]), "d7ff");
+      codepointsToUtf16CodeUnits([0xd7ff]), "d7ff");
   Expect.listEquals([0xe000],
-      _codepointsToUtf16CodeUnits([0xe000]), "e000");
+      codepointsToUtf16CodeUnits([0xe000]), "e000");
 
   Expect.listEquals([UNICODE_REPLACEMENT_CHARACTER_CODEPOINT],
-      _codepointsToUtf16CodeUnits([0xd800]), "d800");
+      codepointsToUtf16CodeUnits([0xd800]), "d800");
   Expect.listEquals([UNICODE_REPLACEMENT_CHARACTER_CODEPOINT],
-      _codepointsToUtf16CodeUnits([0xdfff]), "dfff");
+      codepointsToUtf16CodeUnits([0xdfff]), "dfff");
 }
 
 void testUtf16bytesToCodepoints() {
   // boundary conditions: First possible values
-  Expect.listEquals([], _utf16CodeUnitsToCodepoints([]), "no input");
-  Expect.listEquals([0x0], _utf16CodeUnitsToCodepoints([0x0]), "0");
+  Expect.listEquals([], utf16CodeUnitsToCodepoints([]), "no input");
+  Expect.listEquals([0x0], utf16CodeUnitsToCodepoints([0x0]), "0");
   Expect.listEquals([0x10000],
-      _utf16CodeUnitsToCodepoints([0xd800, 0xdc00]), "10000");
+      utf16CodeUnitsToCodepoints([0xd800, 0xdc00]), "10000");
 
   // boundary conditions: Last possible sequence of a certain length
   Expect.listEquals([0xffff],
-      _utf16CodeUnitsToCodepoints([0xffff]), "ffff");
+      utf16CodeUnitsToCodepoints([0xffff]), "ffff");
   Expect.listEquals([0x10ffff],
-      _utf16CodeUnitsToCodepoints([0xdbff, 0xdfff]), "10ffff");
+      utf16CodeUnitsToCodepoints([0xdbff, 0xdfff]), "10ffff");
 
   // other boundary conditions
   Expect.listEquals([0xd7ff],
-      _utf16CodeUnitsToCodepoints([0xd7ff]), "d7ff");
+      utf16CodeUnitsToCodepoints([0xd7ff]), "d7ff");
   Expect.listEquals([0xe000],
-      _utf16CodeUnitsToCodepoints([0xe000]), "e000");
+      utf16CodeUnitsToCodepoints([0xe000]), "e000");
 
   // unexpected continuation bytes
   Expect.listEquals([0xfffd],
-      _utf16CodeUnitsToCodepoints([0xdc00]),
+      utf16CodeUnitsToCodepoints([0xdc00]),
       "dc00 first unexpected continuation byte");
   Expect.listEquals([0xfffd],
-      _utf16CodeUnitsToCodepoints([0xdfff]),
+      utf16CodeUnitsToCodepoints([0xdfff]),
       "dfff last unexpected continuation byte");
   Expect.listEquals([0xfffd],
-      _utf16CodeUnitsToCodepoints([0xdc00]),
+      utf16CodeUnitsToCodepoints([0xdc00]),
       "1 unexpected continuation bytes");
   Expect.listEquals([0xfffd, 0xfffd],
-      _utf16CodeUnitsToCodepoints([0xdc00, 0xdc00]),
+      utf16CodeUnitsToCodepoints([0xdc00, 0xdc00]),
       "2 unexpected continuation bytes");
   Expect.listEquals([0xfffd, 0xfffd ,0xfffd],
-      _utf16CodeUnitsToCodepoints([0xdc00, 0xdc00, 0xdc00]),
+      utf16CodeUnitsToCodepoints([0xdc00, 0xdc00, 0xdc00]),
       "3 unexpected continuation bytes");
 
   // incomplete sequences
-  Expect.listEquals([0xfffd], _utf16CodeUnitsToCodepoints([0xd800]),
+  Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0xd800]),
       "d800 last byte missing");
-  Expect.listEquals([0xfffd], _utf16CodeUnitsToCodepoints([0xdbff]),
+  Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0xdbff]),
       "dbff last byte missing");
 
   // concatenation of incomplete sequences
   Expect.listEquals([0xfffd, 0xfffd],
-      _utf16CodeUnitsToCodepoints([0xd800, 0xdbff]),
+      utf16CodeUnitsToCodepoints([0xd800, 0xdbff]),
       "d800 dbff last byte missing");
 
   // impossible bytes
-  Expect.listEquals([0xfffd], _utf16CodeUnitsToCodepoints([0x110000]),
+  Expect.listEquals([0xfffd], utf16CodeUnitsToCodepoints([0x110000]),
       "110000 out of bounds");
 
   // overlong sequences not possible in utf16 (nothing < x10000)
diff --git a/pkg/utf/test/utf16_test.dart b/pkg/utf/test/utf16_test.dart
index 6af766f..43971ca 100755
--- a/pkg/utf/test/utf16_test.dart
+++ b/pkg/utf/test/utf16_test.dart
@@ -2,7 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library utf16_tests;
+library utf.utf16_test;
+
 import 'package:expect/expect.dart';
 import 'package:utf/utf.dart';
 
diff --git a/pkg/utf/test/utf32_test.dart b/pkg/utf/test/utf32_test.dart
index 4fcdf29..1a60a6f 100755
--- a/pkg/utf/test/utf32_test.dart
+++ b/pkg/utf/test/utf32_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+library utf.utf32_test;
+
 import 'package:expect/expect.dart';
 import 'package:utf/utf.dart';
 
diff --git a/pkg/utf/test/utf82_test.dart b/pkg/utf/test/utf82_test.dart
index f8d585c..7f8cec4 100755
--- a/pkg/utf/test/utf82_test.dart
+++ b/pkg/utf/test/utf82_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+library utf.utf82_test;
+
 import 'package:expect/expect.dart';
 import 'package:utf/utf.dart';
 
diff --git a/pkg/utf/test/utf8_test.dart b/pkg/utf/test/utf8_test.dart
index af46557..3e8c87e 100644
--- a/pkg/utf/test/utf8_test.dart
+++ b/pkg/utf/test/utf8_test.dart
@@ -2,7 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library utf8_test;
+library utf.utf8_test;
+
 import "package:expect/expect.dart";
 import "package:utf/utf.dart";
 
diff --git a/pkg/utf/test/utf_test.dart b/pkg/utf/test/utf_test.dart
index c4a1e94..86d08e4d 100644
--- a/pkg/utf/test/utf_test.dart
+++ b/pkg/utf/test/utf_test.dart
@@ -2,7 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-library utf_test;
+library utf.utf_test;
+
 import "package:expect/expect.dart";
 import "package:utf/utf.dart";
 
diff --git a/pkg/yaml/CHANGELOG.md b/pkg/yaml/CHANGELOG.md
index e4f532c..94c8807 100644
--- a/pkg/yaml/CHANGELOG.md
+++ b/pkg/yaml/CHANGELOG.md
@@ -1,3 +1,11 @@
+## 2.0.0
+
+* Switch from `source_maps`' `Span` class to `source_span`'s `SourceSpan` class.
+
+* For consistency with `source_span` and `string_scanner`, all `sourceName`
+  parameters have been renamed to `sourceUrl`. They now accept Urls as well as
+  Strings.
+
 ## 1.1.1
 
 * Fix broken type arguments that caused breakage on dart2js.
diff --git a/pkg/yaml/lib/src/model.dart b/pkg/yaml/lib/src/model.dart
index 0973769..93cb49c 100644
--- a/pkg/yaml/lib/src/model.dart
+++ b/pkg/yaml/lib/src/model.dart
@@ -7,7 +7,7 @@
 /// representation graph.
 library yaml.model;
 
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 import 'equality.dart';
 import 'parser.dart';
@@ -83,7 +83,7 @@
   String anchor;
 
   /// The source span for this node.
-  Span span;
+  SourceSpan span;
 
   Node(this.tag, this.span, [this.anchor]);
 
@@ -102,7 +102,7 @@
   /// The nodes in the sequence.
   List<Node> content;
 
-  SequenceNode(String tagName, this.content, Span span)
+  SequenceNode(String tagName, this.content, SourceSpan span)
     : super(new Tag.sequence(tagName), span);
 
   /// Two sequences are equal if their tags and contents are equal.
@@ -125,7 +125,7 @@
 
 /// An alias node is a reference to an anchor.
 class AliasNode extends Node {
-  AliasNode(String anchor, Span span)
+  AliasNode(String anchor, SourceSpan span)
       : super(new Tag.scalar(Tag.yaml("str")), span, anchor);
 
   visit(Visitor v) => v.visitAlias(this);
@@ -145,7 +145,7 @@
   /// be specified for a newly-parsed scalar that hasn't yet been composed.
   /// Value should be specified for a composed scalar, although `null` is a
   /// valid value.
-  ScalarNode(String tagName, Span span, {String content, this.value})
+  ScalarNode(String tagName, SourceSpan span, {String content, this.value})
    : _content = content,
      super(new Tag.scalar(tagName), span);
 
@@ -231,7 +231,7 @@
   /// The node map.
   Map<Node, Node> content;
 
-  MappingNode(String tagName, this.content, Span span)
+  MappingNode(String tagName, this.content, SourceSpan span)
     : super(new Tag.mapping(tagName), span);
 
   /// Two mappings are equal if their tags and contents are equal.
diff --git a/pkg/yaml/lib/src/null_span.dart b/pkg/yaml/lib/src/null_span.dart
index b3e3254..1054df1 100644
--- a/pkg/yaml/lib/src/null_span.dart
+++ b/pkg/yaml/lib/src/null_span.dart
@@ -4,44 +4,18 @@
 
 library yaml.null_span;
 
-import 'package:path/path.dart' as p;
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 /// A [Span] with no location information.
 ///
 /// This is used with [YamlMap.wrap] and [YamlList.wrap] to provide means of
 /// accessing a non-YAML map that behaves transparently like a map parsed from
 /// YAML.
-class NullSpan extends Span {
-  Location get end => start;
+class NullSpan extends SourceSpanMixin {
+  final SourceLocation start;
+  SourceLocation get end => start;
   final text = "";
 
-  NullSpan(String sourceUrl)
-      : this._(new NullLocation(sourceUrl));
-
-  NullSpan._(Location location)
-      : super(location, location, false);
-
-  String formatLocationMessage(String message, {bool useColors: false,
-      String color}) {
-    var locationMessage = sourceUrl == null ? "in an unknown location" :
-        "in ${p.prettyUri(sourceUrl)}";
-    return "$locationMessage: $message";
-  }
-}
-
-/// A [Location] with no location information.
-///
-/// This is used with [YamlMap.wrap] and [YamlList.wrap] to provide means of
-/// accessing a non-YAML map that behaves transparently like a map parsed from
-/// YAML.
-class NullLocation extends Location {
-  final String sourceUrl;
-  final line = 0;
-  final column = 0;
-
-  String get formatString => sourceUrl == null ? "unknown location" : sourceUrl;
-
-  NullLocation(this.sourceUrl)
-      : super(0);
+  NullSpan(sourceUrl)
+      : start = new SourceLocation(0, sourceUrl: sourceUrl);
 }
diff --git a/pkg/yaml/lib/src/parser.dart b/pkg/yaml/lib/src/parser.dart
index b42638f..94f551f 100644
--- a/pkg/yaml/lib/src/parser.dart
+++ b/pkg/yaml/lib/src/parser.dart
@@ -6,7 +6,7 @@
 
 import 'dart:collection';
 
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 import 'package:string_scanner/string_scanner.dart';
 
 import 'equality.dart';
@@ -151,8 +151,8 @@
   /// Whether the current string capture is being overridden.
   bool _capturingAs = false;
 
-  Parser(String yaml, String sourceName)
-      : _scanner = new SpanScanner(yaml, sourceName) {
+  Parser(String yaml, sourceUrl)
+      : _scanner = new SpanScanner(yaml, sourceUrl: sourceUrl) {
     _farthestState = _scanner.state;
   }
 
@@ -326,7 +326,7 @@
   }
 
   /// Creates a MappingNode from [pairs].
-  MappingNode map(List<Pair<Node, Node>> pairs, Span span) {
+  MappingNode map(List<Pair<Node, Node>> pairs, SourceSpan span) {
     var content = new Map<Node, Node>();
     pairs.forEach((pair) => content[pair.first] = pair.last);
     return new MappingNode("?", content, span);
@@ -1822,7 +1822,7 @@
     or([l_directiveDocument, l_explicitDocument, l_bareDocument]);
 
   // 211
-  Pair<List<Node>, Span> l_yamlStream() {
+  Pair<List<Node>, SourceSpan> l_yamlStream() {
     var start = _scanner.state;
     var docs = [];
     zeroOrMore(l_documentPrefix);
diff --git a/pkg/yaml/lib/src/yaml_exception.dart b/pkg/yaml/lib/src/yaml_exception.dart
index 9d43717..86899531 100644
--- a/pkg/yaml/lib/src/yaml_exception.dart
+++ b/pkg/yaml/lib/src/yaml_exception.dart
@@ -4,11 +4,11 @@
 
 library yaml.exception;
 
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 /// An error thrown by the YAML processor.
-class YamlException extends SpanFormatException {
-  YamlException(String message, Span span)
+class YamlException extends SourceSpanFormatException {
+  YamlException(String message, SourceSpan span)
       : super(message, span);
 }
 
diff --git a/pkg/yaml/lib/src/yaml_node.dart b/pkg/yaml/lib/src/yaml_node.dart
index 1aded2b..4f77060 100644
--- a/pkg/yaml/lib/src/yaml_node.dart
+++ b/pkg/yaml/lib/src/yaml_node.dart
@@ -7,7 +7,7 @@
 import 'dart:collection' as collection;
 
 import 'package:collection/collection.dart';
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 import 'null_span.dart';
 import 'yaml_node_wrapper.dart';
@@ -24,9 +24,9 @@
 abstract class YamlNode {
   /// The source span for this node.
   ///
-  /// [Span.getLocationMessage] can be used to produce a human-friendly message
-  /// about this node.
-  Span get span;
+  /// [SourceSpan.message] can be used to produce a human-friendly message about
+  /// this node.
+  SourceSpan get span;
 
   /// The inner value of this node.
   ///
@@ -38,7 +38,7 @@
 
 /// A read-only [Map] parsed from YAML.
 class YamlMap extends YamlNode with collection.MapMixin, UnmodifiableMapMixin  {
-  final Span span;
+  final SourceSpan span;
 
   /// A view of [this] where the keys and values are guaranteed to be
   /// [YamlNode]s.
@@ -57,20 +57,24 @@
   /// Creates an empty YamlMap.
   ///
   /// This map's [span] won't have useful location information. However, it will
-  /// have a reasonable implementation of [Span.getLocationMessage]. If
-  /// [sourceName] is passed, it's used as the [Span.sourceUrl].
-  factory YamlMap({String sourceName}) =>
-      new YamlMapWrapper(const {}, sourceName);
+  /// have a reasonable implementation of [SourceSpan.message]. If [sourceUrl]
+  /// is passed, it's used as the [SourceSpan.sourceUrl].
+  ///
+  /// [sourceUrl] may be either a [String], a [Uri], or `null`.
+  factory YamlMap({sourceUrl}) =>
+      new YamlMapWrapper(const {}, sourceUrl);
 
   /// Wraps a Dart map so that it can be accessed (recursively) like a
   /// [YamlMap].
   ///
-  /// Any [Span]s returned by this map or its children will be dummies without
-  /// useful location information. However, they will have a reasonable
-  /// implementation of [Span.getLocationMessage]. If [sourceName] is passed,
-  /// it's used as the [Span.sourceUrl].
-  factory YamlMap.wrap(Map dartMap, {String sourceName}) =>
-      new YamlMapWrapper(dartMap, sourceName);
+  /// Any [SourceSpan]s returned by this map or its children will be dummies
+  /// without useful location information. However, they will have a reasonable
+  /// implementation of [SourceSpan.getLocationMessage]. If [sourceUrl] is
+  /// passed, it's used as the [SourceSpan.sourceUrl].
+  ///
+  /// [sourceUrl] may be either a [String], a [Uri], or `null`.
+  factory YamlMap.wrap(Map dartMap, {sourceUrl}) =>
+      new YamlMapWrapper(dartMap, sourceUrl);
 
   /// Users of the library should not use this constructor.
   YamlMap.internal(Map<dynamic, YamlNode> nodes, this.span)
@@ -85,7 +89,7 @@
 // TODO(nweiz): Use UnmodifiableListMixin when issue 18970 is fixed.
 /// A read-only [List] parsed from YAML.
 class YamlList extends YamlNode with collection.ListMixin {
-  final Span span;
+  final SourceSpan span;
 
   final List<YamlNode> nodes;
 
@@ -100,20 +104,24 @@
   /// Creates an empty YamlList.
   ///
   /// This list's [span] won't have useful location information. However, it
-  /// will have a reasonable implementation of [Span.getLocationMessage]. If
-  /// [sourceName] is passed, it's used as the [Span.sourceUrl].
-  factory YamlList({String sourceName}) =>
-      new YamlListWrapper(const [], sourceName);
+  /// will have a reasonable implementation of [SourceSpan.message]. If
+  /// [sourceUrl] is passed, it's used as the [SourceSpan.sourceUrl].
+  ///
+  /// [sourceUrl] may be either a [String], a [Uri], or `null`.
+  factory YamlList({sourceUrl}) =>
+      new YamlListWrapper(const [], sourceUrl);
 
   /// Wraps a Dart list so that it can be accessed (recursively) like a
   /// [YamlList].
   ///
-  /// Any [Span]s returned by this list or its children will be dummies without
-  /// useful location information. However, they will have a reasonable
-  /// implementation of [Span.getLocationMessage]. If [sourceName] is passed,
-  /// it's used as the [Span.sourceUrl].
-  factory YamlList.wrap(List dartList, {String sourceName}) =>
-      new YamlListWrapper(dartList, sourceName);
+  /// Any [SourceSpan]s returned by this list or its children will be dummies
+  /// without useful location information. However, they will have a reasonable
+  /// implementation of [SourceSpan.getLocationMessage]. If [sourceUrl] is
+  /// passed, it's used as the [Span.sourceUrl].
+  ///
+  /// [sourceUrl] may be either a [String], a [Uri], or `null`.
+  factory YamlList.wrap(List dartList, {sourceUrl}) =>
+      new YamlListWrapper(dartList, sourceUrl);
 
   /// Users of the library should not use this constructor.
   YamlList.internal(List<YamlNode> nodes, this.span)
@@ -128,17 +136,19 @@
 
 /// A wrapped scalar value parsed from YAML.
 class YamlScalar extends YamlNode {
-  final Span span;
+  final SourceSpan span;
 
   final value;
 
   /// Wraps a Dart value in a [YamlScalar].
   ///
   /// This scalar's [span] won't have useful location information. However, it
-  /// will have a reasonable implementation of [Span.getLocationMessage]. If
-  /// [sourceName] is passed, it's used as the [Span.sourceUrl].
-  YamlScalar.wrap(this.value, {String sourceName})
-      : span = new NullSpan(sourceName);
+  /// will have a reasonable implementation of [SourceSpan.message]. If
+  /// [sourceUrl] is passed, it's used as the [Span.sourceUrl].
+  ///
+  /// [sourceUrl] may be either a [String], a [Uri], or `null`.
+  YamlScalar.wrap(this.value, {sourceUrl})
+      : span = new NullSpan(sourceUrl);
 
   /// Users of the library should not use this constructor.
   YamlScalar.internal(this.value, this.span);
diff --git a/pkg/yaml/lib/src/yaml_node_wrapper.dart b/pkg/yaml/lib/src/yaml_node_wrapper.dart
index 2dcaa23..d000dcb 100644
--- a/pkg/yaml/lib/src/yaml_node_wrapper.dart
+++ b/pkg/yaml/lib/src/yaml_node_wrapper.dart
@@ -7,7 +7,7 @@
 import 'dart:collection';
 
 import 'package:collection/collection.dart' as pkg_collection;
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 import 'null_span.dart';
 import 'yaml_node.dart';
@@ -18,7 +18,7 @@
     implements YamlMap {
   final Map _dartMap;
 
-  final Span span;
+  final SourceSpan span;
 
   final Map<dynamic, YamlNode> nodes;
 
@@ -26,10 +26,10 @@
 
   Iterable get keys => _dartMap.keys;
 
-  YamlMapWrapper(Map dartMap, String sourceName)
-      : this._(dartMap, new NullSpan(sourceName));
+  YamlMapWrapper(Map dartMap, sourceUrl)
+      : this._(dartMap, new NullSpan(sourceUrl));
 
-  YamlMapWrapper._(Map dartMap, Span span)
+  YamlMapWrapper._(Map dartMap, SourceSpan span)
       : _dartMap = dartMap,
         span = span,
         nodes = new _YamlMapNodes(dartMap, span);
@@ -53,7 +53,7 @@
     with pkg_collection.UnmodifiableMapMixin<dynamic, YamlNode> {
   final Map _dartMap;
 
-  final Span _span;
+  final SourceSpan _span;
 
   Iterable get keys =>
       _dartMap.keys.map((key) => new YamlScalar.internal(key, _span));
@@ -78,7 +78,7 @@
 class YamlListWrapper extends ListBase implements YamlList {
   final List _dartList;
 
-  final Span span;
+  final SourceSpan span;
 
   final List<YamlNode> nodes;
 
@@ -90,10 +90,10 @@
     throw new UnsupportedError("Cannot modify an unmodifiable List.");
   }
 
-  YamlListWrapper(List dartList, String sourceName)
-      : this._(dartList, new NullSpan(sourceName));
+  YamlListWrapper(List dartList, sourceUrl)
+      : this._(dartList, new NullSpan(sourceUrl));
 
-  YamlListWrapper._(List dartList, Span span)
+  YamlListWrapper._(List dartList, SourceSpan span)
       : _dartList = dartList,
         span = span,
         nodes = new _YamlListNodes(dartList, span);
@@ -121,7 +121,7 @@
 class _YamlListNodes extends ListBase<YamlNode> {
   final List _dartList;
 
-  final Span _span;
+  final SourceSpan _span;
 
   int get length => _dartList.length;
 
@@ -143,7 +143,7 @@
       other is _YamlListNodes && other._dartList == _dartList;
 }
 
-YamlNode _nodeForValue(value, Span span) {
+YamlNode _nodeForValue(value, SourceSpan span) {
   if (value is Map) return new YamlMapWrapper._(value, span);
   if (value is List) return new YamlListWrapper._(value, span);
   return new YamlScalar.internal(value, span);
diff --git a/pkg/yaml/lib/yaml.dart b/pkg/yaml/lib/yaml.dart
index 0afc2cc..e45dd6e 100644
--- a/pkg/yaml/lib/yaml.dart
+++ b/pkg/yaml/lib/yaml.dart
@@ -29,18 +29,18 @@
 /// In future versions, maps will instead be [HashMap]s with a custom equality
 /// operation.
 ///
-/// If [sourceName] is passed, it's used as the name of the file or URL from
-/// which the YAML originated for error reporting.
-loadYaml(String yaml, {String sourceName}) =>
-    loadYamlNode(yaml, sourceName: sourceName).value;
+/// If [sourceUrl] is passed, it's used as the URL from which the YAML
+/// originated for error reporting. It can be a [String], a [Uri], or `null`.
+loadYaml(String yaml, {sourceUrl}) =>
+    loadYamlNode(yaml, sourceUrl: sourceUrl).value;
 
 /// Loads a single document from a YAML string as a [YamlNode].
 ///
 /// This is just like [loadYaml], except that where [loadYaml] would return a
 /// normal Dart value this returns a [YamlNode] instead. This allows the caller
 /// to be confident that the return value will always be a [YamlNode].
-YamlNode loadYamlNode(String yaml, {String sourceName}) {
-  var stream = loadYamlStream(yaml, sourceName: sourceName);
+YamlNode loadYamlNode(String yaml, {sourceUrl}) {
+  var stream = loadYamlStream(yaml, sourceUrl: sourceUrl);
   if (stream.length != 1) {
     throw new YamlException("Expected 1 document, were ${stream.length}.",
         stream.span);
@@ -59,12 +59,12 @@
 /// In future versions, maps will instead be [HashMap]s with a custom equality
 /// operation.
 ///
-/// If [sourceName] is passed, it's used as the name of the file or URL from
-/// which the YAML originated for error reporting.
-YamlList loadYamlStream(String yaml, {String sourceName}) {
+/// If [sourceUrl] is passed, it's used as the URL from which the YAML
+/// originated for error reporting. It can be a [String], a [Uri], or `null`.
+YamlList loadYamlStream(String yaml, {sourceUrl}) {
   var pair;
   try {
-    pair = new Parser(yaml, sourceName).l_yamlStream();
+    pair = new Parser(yaml, sourceUrl).l_yamlStream();
   } on StringScannerException catch (error) {
     throw new YamlException(error.message, error.span);
   }
diff --git a/pkg/yaml/pubspec.yaml b/pkg/yaml/pubspec.yaml
index c160482..470bc2f 100644
--- a/pkg/yaml/pubspec.yaml
+++ b/pkg/yaml/pubspec.yaml
@@ -1,13 +1,13 @@
 name: yaml
-version: 1.1.1
+version: 2.0.0
 author: "Dart Team <misc@dartlang.org>"
 homepage: http://www.dartlang.org
 description: A parser for YAML.
 dependencies:
   collection: ">=0.9.2 <0.10.0"
   path: ">=1.2.0 <2.0.0"
-  string_scanner: ">=0.0.2 <0.1.0"
-  source_maps: ">=0.9.2 <0.10.0"
+  string_scanner: ">=0.1.0 <0.2.0"
+  source_span: ">=1.0.0 <2.0.0"
 dev_dependencies:
   unittest: ">=0.9.0 <0.12.0"
 environment:
diff --git a/pkg/yaml/test/yaml_node_wrapper_test.dart b/pkg/yaml/test/yaml_node_wrapper_test.dart
index 8bf4761..7d4faa6 100644
--- a/pkg/yaml/test/yaml_node_wrapper_test.dart
+++ b/pkg/yaml/test/yaml_node_wrapper_test.dart
@@ -9,31 +9,31 @@
 import 'package:yaml/yaml.dart';
 
 main() {
-  test("YamlMap() with no sourceName", () {
+  test("YamlMap() with no sourceUrl", () {
     var map = new YamlMap();
     expect(map, isEmpty);
     expect(map.nodes, isEmpty);
     expect(map.span, isNullSpan(isNull));
   });
 
-  test("YamlMap() with a sourceName", () {
-    var map = new YamlMap(sourceName: "source");
+  test("YamlMap() with a sourceUrl", () {
+    var map = new YamlMap(sourceUrl: "source");
     expect(map.span, isNullSpan("source"));
   });
 
-  test("YamlList() with no sourceName", () {
+  test("YamlList() with no sourceUrl", () {
     var list = new YamlList();
     expect(list, isEmpty);
     expect(list.nodes, isEmpty);
     expect(list.span, isNullSpan(isNull));
   });
 
-  test("YamlList() with a sourceName", () {
-    var list = new YamlList(sourceName: "source");
+  test("YamlList() with a sourceUrl", () {
+    var list = new YamlList(sourceUrl: "source");
     expect(list.span, isNullSpan("source"));
   });
 
-  test("YamlMap.wrap() with no sourceName", () {
+  test("YamlMap.wrap() with no sourceUrl", () {
     var map = new YamlMap.wrap({
       "list": [1, 2, 3],
       "map": {
@@ -69,7 +69,7 @@
     expect(map.nodes[new YamlScalar.wrap("list")], equals([1, 2, 3]));
   });
 
-  test("YamlMap.wrap() with a sourceName", () {
+  test("YamlMap.wrap() with a sourceUrl", () {
     var map = new YamlMap.wrap({
       "list": [1, 2, 3],
       "map": {
@@ -77,7 +77,7 @@
         "nested": [4, 5, 6]
       },
       "scalar": "value"
-    }, sourceName: "source");
+    }, sourceUrl: "source");
 
     expect(map.span, isNullSpan("source"));
     expect(map["list"].span, isNullSpan("source"));
@@ -85,7 +85,7 @@
     expect(map.nodes["scalar"].span, isNullSpan("source"));
   });
 
-  test("YamlList.wrap() with no sourceName", () {
+  test("YamlList.wrap() with no sourceUrl", () {
     var list = new YamlList.wrap([
       [1, 2, 3],
       {
@@ -118,7 +118,7 @@
     expect(list[2], "value");
   });
 
-  test("YamlList.wrap() with a sourceName", () {
+  test("YamlList.wrap() with a sourceUrl", () {
     var list = new YamlList.wrap([
       [1, 2, 3],
       {
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 5582f35..3755dbc 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -781,20 +781,8 @@
 
 Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
                                                Dart_Handle builtin_lib) {
-  // Setup the internal library's 'internalPrint' function.
-  Dart_Handle print = Dart_Invoke(
-      builtin_lib, NewString("_getPrintClosure"), 0, NULL);
-  Dart_Handle url = NewString(kInternalLibURL);
-  DART_CHECK_VALID(url);
-  Dart_Handle internal_lib = Dart_LookupLibrary(url);
-  DART_CHECK_VALID(internal_lib);
-  Dart_Handle result = Dart_SetField(internal_lib,
-                                     NewString("_printClosure"),
-                                     print);
-  DART_CHECK_VALID(result);
-
-  // Setup the 'timer' factory.
-  url = NewString(kAsyncLibURL);
+  // First ensure all required libraries are available.
+  Dart_Handle url = NewString(kAsyncLibURL);
   DART_CHECK_VALID(url);
   Dart_Handle async_lib = Dart_LookupLibrary(url);
   DART_CHECK_VALID(async_lib);
@@ -802,9 +790,22 @@
 
   // We need to ensure that all the scripts loaded so far are finalized
   // as we are about to invoke some Dart code below to setup closures.
-  result = Dart_FinalizeLoading(false);
+  Dart_Handle result = Dart_FinalizeLoading(false);
   DART_CHECK_VALID(result);
 
+  // Setup the internal library's 'internalPrint' function.
+  Dart_Handle print = Dart_Invoke(
+      builtin_lib, NewString("_getPrintClosure"), 0, NULL);
+  url = NewString(kInternalLibURL);
+  DART_CHECK_VALID(url);
+  Dart_Handle internal_lib = Dart_LookupLibrary(url);
+  DART_CHECK_VALID(internal_lib);
+  result = Dart_SetField(internal_lib,
+                         NewString("_printClosure"),
+                         print);
+  DART_CHECK_VALID(result);
+
+  // Setup the 'timer' factory.
   Dart_Handle timer_closure =
       Dart_Invoke(io_lib, NewString("_getTimerFactoryClosure"), 0, NULL);
   Dart_Handle args[1];
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index a67e249..cc42e62 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -578,10 +578,8 @@
   if (accepted_head_ == NULL) accepted_tail_ = NULL;
   result->set_next(NULL);
   if (!IsClosing()) {
-    while (pending_accept_count() < 5) {
-      if (!IssueAccept()) {
-        HandleError(this);
-      }
+    if (!IssueAccept()) {
+      HandleError(this);
     }
   }
   return result;
@@ -1040,14 +1038,6 @@
           handle->set_mask(handle->mask() & ~event_mask);
           DartUtils::PostInt32(handle->port(), event_mask);
         }
-        // Always keep 5 outstanding accepts going, to enhance performance.
-        while (listen_socket->pending_accept_count() < 5) {
-          bool accept_success = listen_socket->IssueAccept();
-          if (!accept_success) {
-            HandleError(listen_socket);
-            break;
-          }
-        }
       }
     } else {
       handle->EnsureInitialized(this);
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 2c0047a..abcb484 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -1008,6 +1008,9 @@
     exit(kErrorExitCode);
   }
 
+  // Start event handler.
+  EventHandler::Start();
+
   // Start the debugger wire protocol handler if necessary.
   if (start_debugger) {
     ASSERT(debug_port >= 0);
@@ -1018,9 +1021,6 @@
     }
   }
 
-  // Start event handler.
-  EventHandler::Start();
-
   ASSERT(Dart_CurrentIsolate() == NULL);
   // Start the VM service isolate, if necessary.
   if (start_vm_service) {
diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc
index 213d446..187d60e 100644
--- a/runtime/bin/run_vm_tests.cc
+++ b/runtime/bin/run_vm_tests.cc
@@ -47,7 +47,7 @@
   if ((run_filter == kAllBenchmarks) ||
       (strcmp(run_filter, this->name()) == 0)) {
     this->Run();
-    OS::Print("%s(%s): %" Pd "\n",
+    OS::Print("%s(%s): %" Pd64 "\n",
               this->name(), this->score_kind(), this->score());
     run_matches++;
   } else if (run_filter == kList) {
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index 1b61951..a22930e 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -378,7 +378,7 @@
   intptr_t socket = ServerSocket::CreateBindListen(
       addr, port, backlog, v6_only);
   OSError error;
-  if (socket >= 0) {
+  if (socket >= 0 && ServerSocket::StartAccept(socket)) {
     Socket::SetSocketIdNativeField(Dart_GetNativeArgument(args, 0), socket);
     Dart_SetReturnValue(args, Dart_True());
   } else {
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index 9471c5a..1d09ba8 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -303,6 +303,10 @@
                                    intptr_t backlog,
                                    bool v6_only = false);
 
+  // Start accepting on a newly created listening socket. If it was unable to
+  // start accepting incoming sockets, the fd is invalidated.
+  static bool StartAccept(intptr_t fd);
+
  private:
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(ServerSocket);
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index 96175cf..365e548 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -380,6 +380,12 @@
 }
 
 
+bool ServerSocket::StartAccept(intptr_t fd) {
+  USE(fd);
+  return true;
+}
+
+
 static bool IsTemporaryAcceptError(int error) {
   // On Android a number of protocol errors should be treated as EAGAIN.
   // These are the ones for TCP/IP.
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index 6e8b4aa..c883202 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -406,6 +406,12 @@
 }
 
 
+bool ServerSocket::StartAccept(intptr_t fd) {
+  USE(fd);
+  return true;
+}
+
+
 static bool IsTemporaryAcceptError(int error) {
   // On Linux a number of protocol errors should be treated as EAGAIN.
   // These are the ones for TCP/IP.
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index db39707..d064356 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -413,6 +413,12 @@
 }
 
 
+bool ServerSocket::StartAccept(intptr_t fd) {
+  USE(fd);
+  return true;
+}
+
+
 intptr_t ServerSocket::Accept(intptr_t fd) {
   intptr_t socket;
   struct sockaddr clientaddr;
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index 18156e6..4a9e280 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -525,6 +525,27 @@
 }
 
 
+bool ServerSocket::StartAccept(intptr_t fd) {
+  ListenSocket* listen_socket = reinterpret_cast<ListenSocket*>(fd);
+  listen_socket->EnsureInitialized(EventHandler::delegate());
+  // Always keep 5 outstanding accepts going, to enhance performance.
+  for (int i = 0; i < 5; i++) {
+    if (!listen_socket->IssueAccept()) {
+      DWORD rc = WSAGetLastError();
+      listen_socket->Close();
+      if (!listen_socket->HasPendingAccept()) {
+        // Delete socket now, if there are no pending accepts. Otherwise,
+        // the event-handler will take care of deleting it.
+        delete listen_socket;
+      }
+      SetLastError(rc);
+      return false;
+    }
+  }
+  return true;
+}
+
+
 void Socket::Close(intptr_t fd) {
   ClientSocket* client_socket = reinterpret_cast<ClientSocket*>(fd);
   client_socket->Close();
diff --git a/runtime/lib/collection_patch.dart b/runtime/lib/collection_patch.dart
index 6946681..f2689ba 100644
--- a/runtime/lib/collection_patch.dart
+++ b/runtime/lib/collection_patch.dart
@@ -906,7 +906,11 @@
     if (isValidKey == null) {
       if (hashCode == null) {
         if (equals == null) {
-          return new _LinkedHashMap<K, V>();
+          if (_useInternalCached) {
+            return new _InternalLinkedHashMap<K, V>();
+          } else {
+            return new _LinkedHashMap<K, V>();
+          }
         }
         hashCode = _defaultHashCode;
       } else {
@@ -930,6 +934,9 @@
   }
 
   /* patch */ factory LinkedHashMap.identity() = _LinkedIdentityHashMap<K, V>;
+
+  static final bool _useInternalCached = _useInternal;
+  static bool get _useInternal native "LinkedHashMap_useInternal";
 }
 
 // Methods that are exactly the same in all three linked hash map variants.
diff --git a/runtime/lib/collection_sources.gypi b/runtime/lib/collection_sources.gypi
index 0783b7d..0e9eb4d 100644
--- a/runtime/lib/collection_sources.gypi
+++ b/runtime/lib/collection_sources.gypi
@@ -5,5 +5,7 @@
 {
   'sources': [
     'collection_patch.dart',
+    'linked_hash_map.cc',
+    'linked_hash_map.dart',
   ],
 }
diff --git a/runtime/lib/linked_hash_map.cc b/runtime/lib/linked_hash_map.cc
new file mode 100644
index 0000000..d8a5a89
--- /dev/null
+++ b/runtime/lib/linked_hash_map.cc
@@ -0,0 +1,96 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/assert.h"
+
+#include "vm/assembler.h"
+#include "vm/bootstrap_natives.h"
+#include "vm/exceptions.h"
+#include "vm/flags.h"
+#include "vm/native_entry.h"
+#include "vm/object.h"
+
+namespace dart {
+
+DEFINE_FLAG(bool, use_internal_hash_map, false, "Use internal hash map.");
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_allocate, 1) {
+  const TypeArguments& type_arguments =
+      TypeArguments::CheckedHandle(arguments->NativeArgAt(0));
+  const LinkedHashMap& map =
+    LinkedHashMap::Handle(LinkedHashMap::New());
+  map.SetTypeArguments(type_arguments);
+  return map.raw();
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_getLength, 1) {
+  const LinkedHashMap& map =
+      LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
+  return Smi::New(map.Length());
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_lookUp, 2) {
+  const LinkedHashMap& map =
+      LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, key, arguments->NativeArgAt(1));
+  return map.LookUp(key);
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_containsKey, 2) {
+  const LinkedHashMap& map =
+      LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, key, arguments->NativeArgAt(1));
+  return Bool::Get(map.Contains(key)).raw();
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_insertOrUpdate, 3) {
+  LinkedHashMap& map =
+      LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, key, arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, value, arguments->NativeArgAt(2));
+  map.InsertOrUpdate(key, value);
+  return Object::null();
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_remove, 2) {
+  const LinkedHashMap& map =
+      LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, key, arguments->NativeArgAt(1));
+  return map.Remove(key);
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_clear, 1) {
+  const LinkedHashMap& map =
+      LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
+  map.Clear();
+  return Object::null();
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_toArray, 1) {
+  const LinkedHashMap& map =
+      LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
+  return map.ToArray();
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_getModMark, 2) {
+  const LinkedHashMap& map =
+      LinkedHashMap::CheckedHandle(arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Bool, create, arguments->NativeArgAt(1));
+  return map.GetModificationMark(create.value());
+}
+
+
+DEFINE_NATIVE_ENTRY(LinkedHashMap_useInternal, 0) {
+  return Bool::Get(FLAG_use_internal_hash_map).raw();
+}
+
+}  // namespace dart
diff --git a/runtime/lib/linked_hash_map.dart b/runtime/lib/linked_hash_map.dart
new file mode 100644
index 0000000..54dc897
--- /dev/null
+++ b/runtime/lib/linked_hash_map.dart
@@ -0,0 +1,118 @@
+// Copyright (c) 2014, 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.
+
+// VM-internalized implementation of a default-constructed LinkedHashMap.
+// Currently calls the runtime for most operations.
+class _InternalLinkedHashMap<K, V> implements HashMap<K, V>,
+                                              LinkedHashMap<K, V> {
+  factory _InternalLinkedHashMap() native "LinkedHashMap_allocate";
+  int get length native "LinkedHashMap_getLength";
+  V operator [](K key) native "LinkedHashMap_lookUp";
+  void operator []=(K key, V value) native "LinkedHashMap_insertOrUpdate";
+  V remove(K key) native "LinkedHashMap_remove";
+  void clear() native "LinkedHashMap_clear";
+  bool containsKey(K key) native "LinkedHashMap_containsKey";
+
+  bool get isEmpty => length == 0;
+  bool get isNotEmpty => !isEmpty;
+
+  List _toArray() native "LinkedHashMap_toArray";
+
+  // "Modificaton marks" are tokens used to detect concurrent modification.
+  // Considering only modifications (M) and iterator creation (I) events, e.g.:
+  //   M, M, M, I, I, M, I, M, M, I, I, I, M ...
+  // a new mark is allocated at the start of each run of I's and cleared from
+  // the map at the start of each run of M's. Iterators' moveNext check whether
+  // the map's mark was changed or cleared since the iterator was created.
+  // TODO(koda): Consider a counter instead.
+  Object _getModMark(bool create) native "LinkedHashMap_getModMark";
+
+  void addAll(Map<K, V> other) {
+    other.forEach((K key, V value) {
+      this[key] = value;
+    });
+  }
+
+  V putIfAbsent(K key, Function ifAbsent) {
+    if (containsKey(key)) {
+      return this[key];
+    } else {
+      V value = ifAbsent();
+      this[key] = value;
+      return value;
+    }
+  }
+
+  bool containsValue(V value) {
+    for (V v in values) {
+      if (v == value) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  void forEach(Function f) {
+    for (K key in keys) {
+      f(key, this[key]);
+    }
+  }
+
+  // The even-indexed entries of toArray are the keys.
+  Iterable<K> get keys =>
+      new _ListStepIterable<K>(this, _getModMark(true), _toArray(), -2, 2);
+
+  // The odd-indexed entries of toArray are the values.
+  Iterable<V> get values =>
+      new _ListStepIterable<V>(this, _getModMark(true), _toArray(), -1, 2);
+
+  String toString() => Maps.mapToString(this);
+}
+
+// Iterates over a list from a given offset and step size.
+class _ListStepIterable<E> extends IterableBase<E> {
+  _InternalLinkedHashMap _map;
+  Object _modMark;
+  List _list;
+  int _offset;
+  int _step;
+
+  _ListStepIterable(this._map, this._modMark,
+                    this._list, this._offset, this._step);
+
+  Iterator<E> get iterator =>
+      new _ListStepIterator(_map, _modMark, _list, _offset, _step);
+
+  // TODO(koda): Should this check for concurrent modification?
+  int get length => _map.length;
+  bool get isEmpty => length == 0;
+  bool get isNotEmpty => !isEmpty;
+}
+
+class _ListStepIterator<E> implements Iterator<E> {
+  _InternalLinkedHashMap _map;
+  Object _modMark;
+  List _list;
+  int _offset;
+  int _step;
+
+  _ListStepIterator(this._map, this._modMark,
+                    this._list, this._offset, this._step);
+
+  bool moveNext() {
+    if (_map._getModMark(false) != _modMark) {
+      throw new ConcurrentModificationError(_map);
+    }
+    _offset += _step;
+    return _offset < _list.length;
+  }
+
+  E get current {
+    if (_offset < 0 || _offset >= _list.length) {
+      return null;
+    }
+    return _list[_offset];
+  }
+}
+
diff --git a/runtime/platform/thread_macos.cc b/runtime/platform/thread_macos.cc
index a113abc..aa8a6e0 100644
--- a/runtime/platform/thread_macos.cc
+++ b/runtime/platform/thread_macos.cc
@@ -297,10 +297,14 @@
   } else {
     struct timespec ts;
     int64_t secs = micros / kMicrosecondsPerSecond;
+    if (secs > kMaxInt32) {
+      // Avoid truncation of overly large timeout values.
+      secs = kMaxInt32;
+    }
     int64_t nanos =
         (micros - (secs * kMicrosecondsPerSecond)) * kNanosecondsPerMicrosecond;
-    ts.tv_sec = secs;
-    ts.tv_nsec = nanos;
+    ts.tv_sec = static_cast<int32_t>(secs);
+    ts.tv_nsec = static_cast<long>(nanos);  // NOLINT (long used in timespec).
     int result = pthread_cond_timedwait_relative_np(data_.cond(),
                                                     data_.mutex(),
                                                     &ts);
diff --git a/runtime/platform/utils.cc b/runtime/platform/utils.cc
index f48824b..894635c 100644
--- a/runtime/platform/utils.cc
+++ b/runtime/platform/utils.cc
@@ -92,7 +92,7 @@
 }
 
 
-uint32_t Utils::WordHash(word key) {
+uint32_t Utils::WordHash(intptr_t key) {
   // TODO(iposva): Need to check hash spreading.
   // This example is from http://www.concentric.net/~Ttwang/tech/inthash.htm
   uword a = static_cast<uword>(key);
diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h
index 52e30aa..913f521 100644
--- a/runtime/platform/utils.h
+++ b/runtime/platform/utils.h
@@ -87,7 +87,7 @@
   static uint32_t StringHash(const char* data, int length);
 
   // Computes a hash value for the given word.
-  static uint32_t WordHash(word key);
+  static uint32_t WordHash(intptr_t key);
 
   // Check whether an N-bit two's-complement representation can hold value.
   template<typename T>
diff --git a/runtime/vm/assembler.cc b/runtime/vm/assembler.cc
index 65e5627..f259071 100644
--- a/runtime/vm/assembler.cc
+++ b/runtime/vm/assembler.cc
@@ -210,7 +210,7 @@
 
 
 void Assembler::Comment(const char* format, ...) {
-  if (FLAG_code_comments || FLAG_disassemble || FLAG_disassemble_optimized) {
+  if (EmittingComments()) {
     char buffer[1024];
 
     va_list args;
@@ -225,6 +225,11 @@
 }
 
 
+bool Assembler::EmittingComments() {
+  return FLAG_code_comments || FLAG_disassemble || FLAG_disassemble_optimized;
+}
+
+
 const Code::Comments& Assembler::GetCodeComments() const {
   Code::Comments& comments = Code::Comments::New(comments_.length());
 
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index 2ddf07c..6ae73b1 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -3146,23 +3146,24 @@
                             Register temp_reg) {
   ASSERT(failure != NULL);
   if (FLAG_inline_alloc) {
-    Heap* heap = Isolate::Current()->heap();
+    ASSERT(instance_reg != temp_reg);
+    ASSERT(temp_reg != IP);
     const intptr_t instance_size = cls.instance_size();
-    LoadImmediate(instance_reg, heap->TopAddress());
-    ldr(instance_reg, Address(instance_reg, 0));
+
+    LoadImmediate(temp_reg, Isolate::Current()->heap()->NewSpaceAddress());
+
+    ldr(instance_reg, Address(temp_reg, Scavenger::top_offset()));
     AddImmediate(instance_reg, instance_size);
 
     // instance_reg: potential next object start.
-    LoadImmediate(IP, heap->EndAddress());
-    ldr(IP, Address(IP, 0));
+    ldr(IP, Address(temp_reg, Scavenger::end_offset()));
     cmp(IP, Operand(instance_reg));
     // fail if heap end unsigned less than or equal to instance_reg.
     b(failure, LS);
 
     // Successfully allocated the object, now update top to point to
     // next object start and store the class in the class field of object.
-    LoadImmediate(IP, heap->TopAddress());
-    str(instance_reg, Address(IP, 0));
+    str(instance_reg, Address(temp_reg, Scavenger::top_offset()));
 
     ASSERT(instance_size >= kHeapObjectTag);
     AddImmediate(instance_reg, -instance_size + kHeapObjectTag);
diff --git a/runtime/vm/assembler_arm.h b/runtime/vm/assembler_arm.h
index a09145a..fc66dec 100644
--- a/runtime/vm/assembler_arm.h
+++ b/runtime/vm/assembler_arm.h
@@ -337,6 +337,7 @@
   static void InitializeMemoryWithBreakpoints(uword data, intptr_t length);
 
   void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+  static bool EmittingComments();
 
   const Code::Comments& GetCodeComments() const;
 
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 6da9770..7911896 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -1376,26 +1376,25 @@
 void Assembler::TryAllocate(const Class& cls,
                             Label* failure,
                             Register instance_reg,
+                            Register temp_reg,
                             Register pp) {
   ASSERT(failure != NULL);
   if (FLAG_inline_alloc) {
     Heap* heap = Isolate::Current()->heap();
     const intptr_t instance_size = cls.instance_size();
-    LoadImmediate(instance_reg, heap->TopAddress(), pp);
-    ldr(instance_reg, Address(instance_reg));
+    LoadImmediate(temp_reg, heap->NewSpaceAddress(), pp);
+    ldr(instance_reg, Address(temp_reg, Scavenger::top_offset()));
     AddImmediate(instance_reg, instance_reg, instance_size, pp);
 
     // instance_reg: potential next object start.
-    LoadImmediate(TMP, heap->EndAddress(), pp);
-    ldr(TMP, Address(TMP));
+    ldr(TMP, Address(temp_reg, Scavenger::end_offset()));
     CompareRegisters(TMP, instance_reg);
     // fail if heap end unsigned less than or equal to instance_reg.
     b(failure, LS);
 
     // Successfully allocated the object, now update top to point to
     // next object start and store the class in the class field of object.
-    LoadImmediate(TMP, heap->TopAddress(), pp);
-    str(instance_reg, Address(TMP));
+    str(instance_reg, Address(temp_reg, Scavenger::top_offset()));
 
     ASSERT(instance_size >= kHeapObjectTag);
     AddImmediate(
diff --git a/runtime/vm/assembler_arm64.h b/runtime/vm/assembler_arm64.h
index 03224f6..ac082d1 100644
--- a/runtime/vm/assembler_arm64.h
+++ b/runtime/vm/assembler_arm64.h
@@ -431,6 +431,7 @@
   static void InitializeMemoryWithBreakpoints(uword data, intptr_t length);
 
   void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+  static bool EmittingComments();
 
   const Code::Comments& GetCodeComments() const;
 
@@ -1217,6 +1218,7 @@
   void TryAllocate(const Class& cls,
                    Label* failure,
                    Register instance_reg,
+                   Register temp_reg,
                    Register pp);
 
   Address ElementAddressForIntIndex(bool is_external,
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index bd11704..8ec66e1 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -821,6 +821,8 @@
   static void InitializeMemoryWithBreakpoints(uword data, intptr_t length);
 
   void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+  static bool EmittingComments();
+
   const Code::Comments& GetCodeComments() const;
 
   static const char* RegisterName(Register reg);
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index 3cfcdea..802dd49 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -858,20 +858,19 @@
   if (FLAG_inline_alloc) {
     Heap* heap = Isolate::Current()->heap();
     const intptr_t instance_size = cls.instance_size();
-    LoadImmediate(instance_reg, heap->TopAddress());
-    lw(instance_reg, Address(instance_reg, 0));
+
+    LoadImmediate(temp_reg, heap->NewSpaceAddress());
+    lw(instance_reg, Address(temp_reg, Scavenger::top_offset()));
     AddImmediate(instance_reg, instance_size);
 
     // instance_reg: potential next object start.
-    LoadImmediate(TMP, heap->EndAddress());
-    lw(TMP, Address(TMP, 0));
+    lw(TMP, Address(temp_reg, Scavenger::end_offset()));
     // Fail if heap end unsigned less than or equal to instance_reg.
     BranchUnsignedLessEqual(TMP, instance_reg, failure);
 
     // Successfully allocated the object, now update top to point to
     // next object start and store the class in the class field of object.
-    LoadImmediate(TMP, heap->TopAddress());
-    sw(instance_reg, Address(TMP, 0));
+    sw(instance_reg, Address(temp_reg, Scavenger::top_offset()));
 
     ASSERT(instance_size >= kHeapObjectTag);
     AddImmediate(instance_reg, -instance_size + kHeapObjectTag);
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index d5ee12e..f5199b8 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -227,6 +227,7 @@
   static void InitializeMemoryWithBreakpoints(uword data, intptr_t length);
 
   void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+  static bool EmittingComments();
 
   const Code::Comments& GetCodeComments() const;
 
diff --git a/runtime/vm/assembler_x64.h b/runtime/vm/assembler_x64.h
index 6644ae1..e589dfe 100644
--- a/runtime/vm/assembler_x64.h
+++ b/runtime/vm/assembler_x64.h
@@ -770,6 +770,8 @@
   void Bind(Label* label);
 
   void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+  static bool EmittingComments();
+
   const Code::Comments& GetCodeComments() const;
 
   intptr_t CodeSize() const { return buffer_.Size(); }
diff --git a/runtime/vm/benchmark_test.h b/runtime/vm/benchmark_test.h
index 2537151..a74f092 100644
--- a/runtime/vm/benchmark_test.h
+++ b/runtime/vm/benchmark_test.h
@@ -71,8 +71,8 @@
   // Accessors.
   const char* name() const { return name_; }
   const char* score_kind() const { return score_kind_; }
-  void set_score(intptr_t value) { score_ = value; }
-  intptr_t score() const { return score_; }
+  void set_score(int64_t value) { score_ = value; }
+  int64_t score() const { return score_; }
   Isolate* isolate() const { return reinterpret_cast<Isolate*>(isolate_); }
 
   Dart_Isolate CreateIsolate(const uint8_t* buffer) {
@@ -98,7 +98,7 @@
   RunEntry* const run_;
   const char* name_;
   const char* score_kind_;
-  intptr_t score_;
+  int64_t score_;
   Dart_Isolate isolate_;
   Benchmark* next_;
 
diff --git a/runtime/vm/bootstrap_natives.cc b/runtime/vm/bootstrap_natives.cc
index 44faf75..7167252 100644
--- a/runtime/vm/bootstrap_natives.cc
+++ b/runtime/vm/bootstrap_natives.cc
@@ -80,6 +80,11 @@
   library.set_native_entry_resolver(resolver);
   library.set_native_entry_symbol_resolver(symbol_resolver);
 
+  library = Library::CollectionLibrary();
+  ASSERT(!library.IsNull());
+  library.set_native_entry_resolver(resolver);
+  library.set_native_entry_symbol_resolver(symbol_resolver);
+
   library = Library::ConvertLibrary();
   ASSERT(!library.IsNull());
   library.set_native_entry_resolver(resolver);
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index a69539a..1577700 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -346,6 +346,16 @@
   V(GrowableList_setLength, 2)                                                 \
   V(GrowableList_setData, 2)                                                   \
   V(Internal_makeListFixedLength, 1)                                           \
+  V(LinkedHashMap_allocate, 1)                                                 \
+  V(LinkedHashMap_getLength, 1)                                                \
+  V(LinkedHashMap_insertOrUpdate, 3)                                           \
+  V(LinkedHashMap_lookUp, 2)                                                   \
+  V(LinkedHashMap_containsKey, 2)                                              \
+  V(LinkedHashMap_remove, 2)                                                   \
+  V(LinkedHashMap_clear, 1)                                                    \
+  V(LinkedHashMap_toArray, 1)                                                  \
+  V(LinkedHashMap_getModMark, 2)                                               \
+  V(LinkedHashMap_useInternal, 0)                                              \
   V(WeakProperty_new, 2)                                                       \
   V(WeakProperty_getKey, 1)                                                    \
   V(WeakProperty_getValue, 1)                                                  \
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 616db40..d5a1740 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -232,9 +232,14 @@
 
     // TODO(turnidge): Remove once length is not part of the snapshot.
     const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer);
+    if (snapshot == NULL) {
+      const String& message = String::Handle(
+          String::New("Invalid snapshot."));
+      return ApiError::New(message);
+    }
     ASSERT(snapshot->kind() == Snapshot::kFull);
     if (FLAG_trace_isolates) {
-      OS::Print("Size of isolate snapshot = %" Pd64 "\n", snapshot->length());
+      OS::Print("Size of isolate snapshot = %" Pd "\n", snapshot->length());
     }
     SnapshotReader reader(snapshot->content(), snapshot->length(),
                           Snapshot::kFull, isolate);
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 3570912..0c7b007 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -4743,7 +4743,7 @@
   NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
   ASSERT(arguments->isolate() == Isolate::Current());
   if (Smi::IsValid(retval)) {
-    Api::SetSmiReturnValue(arguments, retval);
+    Api::SetSmiReturnValue(arguments, static_cast<intptr_t>(retval));
   } else {
     // Slow path for Mints and Bigints.
     ASSERT_CALLBACK_STATE(arguments->isolate());
@@ -4862,7 +4862,7 @@
                          " snapshot.", CURRENT_FUNC);
   }
   if (snapshot->length() != buffer_len) {
-    return Api::NewError("%s: 'buffer_len' of %" Pd " is not equal to %" Pd64
+    return Api::NewError("%s: 'buffer_len' of %" Pd " is not equal to %" Pd
                          " which is the expected length in the snapshot.",
                          CURRENT_FUNC, buffer_len, snapshot->length());
   }
diff --git a/runtime/vm/disassembler_ia32.cc b/runtime/vm/disassembler_ia32.cc
index 05fdfab..cae5801 100644
--- a/runtime/vm/disassembler_ia32.cc
+++ b/runtime/vm/disassembler_ia32.cc
@@ -786,7 +786,7 @@
 int X86Decoder::JumpConditionalShort(uint8_t* data, const char* comment) {
   uint8_t cond = *data & 0x0F;
   uint8_t b = *(data+1);
-  word dest = reinterpret_cast<uword>(data) + static_cast<int8_t>(b) + 2;
+  uword dest = reinterpret_cast<uword>(data) + static_cast<int8_t>(b) + 2;
   const char* mnem = jump_conditional_mnem[cond];
   Print(mnem);
   Print(" ");
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 467567b..b5dba4e 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -3758,8 +3758,7 @@
                                          *method_arguments,
                                          temp,
                                          is_super_invocation);
-  const Function& no_such_method_func = Function::ZoneHandle(
-      I,
+  const Function& no_such_method_func = Function::ZoneHandle(I,
       Resolver::ResolveDynamicAnyArgs(target_class, Symbols::NoSuchMethod()));
   // We are guaranteed to find noSuchMethod of class Object.
   ASSERT(!no_such_method_func.IsNull());
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 0de5492..de1786b 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -94,6 +94,8 @@
       may_reoptimize_(false),
       double_class_(Class::ZoneHandle(
           isolate_->object_store()->double_class())),
+      mint_class_(Class::ZoneHandle(
+          isolate_->object_store()->mint_class())),
       float32x4_class_(Class::ZoneHandle(
           isolate_->object_store()->float32x4_class())),
       float64x2_class_(Class::ZoneHandle(
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index b7b0cb6..efb8804 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -445,6 +445,7 @@
   void FinalizeStaticCallTargetsTable(const Code& code);
 
   const Class& double_class() const { return double_class_; }
+  const Class& mint_class() const { return mint_class_; }
   const Class& float32x4_class() const { return float32x4_class_; }
   const Class& float64x2_class() const { return float64x2_class_; }
   const Class& int32x4_class() const { return int32x4_class_; }
@@ -611,6 +612,7 @@
   bool may_reoptimize_;
 
   const Class& double_class_;
+  const Class& mint_class_;
   const Class& float32x4_class_;
   const Class& float64x2_class_;
   const Class& int32x4_class_;
diff --git a/runtime/vm/hash_table.h b/runtime/vm/hash_table.h
index b810b47..903ea29 100644
--- a/runtime/vm/hash_table.h
+++ b/runtime/vm/hash_table.h
@@ -383,9 +383,10 @@
  public:
   // Allocates and initializes a table.
   template<typename Table>
-  static RawArray* New(intptr_t initial_capacity) {
+  static RawArray* New(intptr_t initial_capacity,
+                       Heap::Space space = Heap::kNew) {
     Table table(Array::Handle(Array::New(
-        Table::ArrayLengthForNumOccupied(initial_capacity))));
+        Table::ArrayLengthForNumOccupied(initial_capacity), space)));
     table.Initialize();
     return table.Release();
   }
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index 71354e3..7de2daf 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -164,6 +164,7 @@
   uword TopAddress();
   uword EndAddress();
   static intptr_t new_space_offset() { return OFFSET_OF(Heap, new_space_); }
+  uword NewSpaceAddress() const { return reinterpret_cast<uword>(new_space_); }
 
   // Initialize the heap and register it with the isolate.
   static void Init(Isolate* isolate,
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 6bb00cf..4d9092c 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -2729,11 +2729,11 @@
   ASSERT(value_boundary.IsConstant());
   ASSERT(shift_count >= 0);
   int64_t limit = 64 - shift_count;
-  int64_t value = static_cast<int64_t>(value_boundary.ConstantValue());
+  int64_t value = value_boundary.ConstantValue();
 
   if ((value == 0) ||
       (shift_count == 0) ||
-      ((limit > 0) && (Utils::IsInt(limit, value)))) {
+      ((limit > 0) && Utils::IsInt(static_cast<int>(limit), value))) {
     // Result stays in 64 bit range.
     int64_t result = value << shift_count;
     return RangeBoundary(result);
@@ -3696,10 +3696,10 @@
     // Product of left and right max values stays in 64 bit range.
     const int64_t mul_max = left_max * right_max;
     if (Smi::IsValid(mul_max) && Smi::IsValid(-mul_max)) {
-      const intptr_t r_min =
+      const int64_t r_min =
           OnlyPositiveOrZero(*left_range, *right_range) ? 0 : -mul_max;
       *result_min = RangeBoundary::FromConstant(r_min);
-      const intptr_t r_max =
+      const int64_t r_max =
           OnlyNegativeOrZero(*left_range, *right_range) ? 0 : mul_max;
       *result_max = RangeBoundary::FromConstant(r_max);
       return true;
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 1e59e79..8886c1c 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -2750,7 +2750,7 @@
                            const RangeBoundary& overflow);
 
   static RangeBoundary Shr(const RangeBoundary& value_boundary,
-                           intptr_t shift_count) {
+                           int64_t shift_count) {
     ASSERT(value_boundary.IsConstant());
     ASSERT(shift_count >= 0);
     int64_t value = static_cast<int64_t>(value_boundary.ConstantValue());
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index 81cbe5f..c619a17 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -1827,17 +1827,24 @@
 }
 
 
-class StoreInstanceFieldSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public SlowPathCode {
  public:
-  StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction,
-                             const Class& cls)
-      : instruction_(instruction), cls_(cls) { }
+  BoxAllocationSlowPath(Instruction* instruction,
+                        const Class& cls,
+                        Register result)
+      : instruction_(instruction),
+        cls_(cls),
+        result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     Isolate* isolate = compiler->isolate();
     StubCode* stub_code = isolate->stub_code();
 
-    __ Comment("StoreInstanceFieldSlowPath");
+    if (Assembler::EmittingComments()) {
+      __ Comment("%s slow path allocation of %s",
+                 instruction_->DebugName(),
+                 String::Handle(cls_.PrettyName()).ToCString());
+    }
     __ Bind(entry_label());
 
     const Code& stub =
@@ -1845,22 +1852,40 @@
     const ExternalLabel label(stub.EntryPoint());
 
     LocationSummary* locs = instruction_->locs();
-    locs->live_registers()->Remove(locs->temp(0));
+
+    locs->live_registers()->Remove(Location::RegisterLocation(result_));
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
                            &label,
                            RawPcDescriptors::kOther,
                            locs);
-    __ MoveRegister(locs->temp(0).reg(), R0);
+    __ MoveRegister(result_, R0);
     compiler->RestoreLiveRegisters(locs);
 
     __ b(exit_label());
   }
 
+  static void Allocate(FlowGraphCompiler* compiler,
+                       Instruction* instruction,
+                       const Class& cls,
+                       Register result,
+                       Register temp) {
+    BoxAllocationSlowPath* slow_path =
+        new BoxAllocationSlowPath(instruction, cls, result);
+    compiler->AddSlowPathCode(slow_path);
+
+    __ TryAllocate(cls,
+                   slow_path->entry_label(),
+                   result,
+                   temp);
+    __ Bind(slow_path->exit_label());
+  }
+
  private:
-  StoreInstanceFieldInstr* instruction_;
+  Instruction* instruction_;
   const Class& cls_;
+  Register result_;
 };
 
 
@@ -1899,6 +1924,28 @@
 }
 
 
+static void EnsureMutableBox(FlowGraphCompiler* compiler,
+                             StoreInstanceFieldInstr* instruction,
+                             Register box_reg,
+                             const Class& cls,
+                             Register instance_reg,
+                             intptr_t offset,
+                             Register temp) {
+  Label done;
+  __ ldr(box_reg, FieldAddress(instance_reg, offset));
+  __ CompareImmediate(box_reg,
+                      reinterpret_cast<intptr_t>(Object::null()));
+  __ b(&done, NE);
+
+  BoxAllocationSlowPath::Allocate(
+      compiler, instruction, cls, box_reg, temp);
+
+  __ MoveRegister(temp, box_reg);
+  __ StoreIntoObjectOffset(instance_reg, offset, temp);
+  __ Bind(&done);
+}
+
+
 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label skip_store;
 
@@ -1926,15 +1973,8 @@
           UNREACHABLE();
       }
 
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, *cls);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(*cls,
-                     slow_path->entry_label(),
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, *cls, temp, temp2);
       __ MoveRegister(temp2, temp);
       __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
     } else {
@@ -2005,72 +2045,39 @@
 
     {
       __ Bind(&store_double);
-      Label copy_double;
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->double_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ CompareImmediate(temp,
-                          reinterpret_cast<intptr_t>(Object::null()));
-      __ b(&copy_double, NE);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
-      __ MoveRegister(temp2, temp);
-      __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
-      __ Bind(&copy_double);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->double_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ CopyDoubleField(temp, value_reg, TMP, temp2, fpu_temp);
       __ b(&skip_store);
     }
 
     {
       __ Bind(&store_float32x4);
-      Label copy_float32x4;
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->float32x4_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ CompareImmediate(temp,
-                          reinterpret_cast<intptr_t>(Object::null()));
-      __ b(&copy_float32x4, NE);
-
-      __ TryAllocate(compiler->float32x4_class(),
-                     slow_path->entry_label(),
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
-      __ MoveRegister(temp2, temp);
-      __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
-      __ Bind(&copy_float32x4);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->float32x4_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ CopyFloat32x4Field(temp, value_reg, TMP, temp2, fpu_temp);
       __ b(&skip_store);
     }
 
     {
       __ Bind(&store_float64x2);
-      Label copy_float64x2;
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->float64x2_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ CompareImmediate(temp,
-                          reinterpret_cast<intptr_t>(Object::null()));
-      __ b(&copy_float64x2, NE);
-
-      __ TryAllocate(compiler->float64x2_class(),
-                     slow_path->entry_label(),
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
-      __ MoveRegister(temp2, temp);
-      __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
-      __ Bind(&copy_float64x2);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->float64x2_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ CopyFloat64x2Field(temp, value_reg, TMP, temp2, fpu_temp);
       __ b(&skip_store);
     }
@@ -2306,111 +2313,6 @@
 }
 
 
-class BoxDoubleSlowPath : public SlowPathCode {
- public:
-  explicit BoxDoubleSlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxDoubleSlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& double_class = compiler->double_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(double_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), R0);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
-class BoxFloat32x4SlowPath : public SlowPathCode {
- public:
-  explicit BoxFloat32x4SlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxFloat32x4SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& float32x4_class = compiler->float32x4_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(float32x4_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ mov(locs->out(0).reg(), Operand(R0));
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
-class BoxFloat64x2SlowPath : public SlowPathCode {
- public:
-  explicit BoxFloat64x2SlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxFloat64x2SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& float64x2_class = compiler->float64x2_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(float64x2_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ mov(locs->out(0).reg(), Operand(R0));
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate,
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
@@ -2511,14 +2413,12 @@
 
     {
       __ Bind(&load_double);
-      BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     result_reg,
-                     temp);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler,
+          this,
+          compiler->double_class(),
+          result_reg,
+          temp);
       __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ CopyDoubleField(result_reg, temp, TMP, temp2, value);
       __ b(&done);
@@ -2526,14 +2426,12 @@
 
     {
       __ Bind(&load_float32x4);
-      BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->float32x4_class(),
-                     slow_path->entry_label(),
-                     result_reg,
-                     temp);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler,
+          this,
+          compiler->float32x4_class(),
+          result_reg,
+          temp);
       __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ CopyFloat32x4Field(result_reg, temp, TMP, temp2, value);
       __ b(&done);
@@ -2541,14 +2439,12 @@
 
     {
       __ Bind(&load_float64x2);
-      BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->float64x2_class(),
-                     slow_path->entry_label(),
-                     result_reg,
-                     temp);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler,
+          this,
+          compiler->float64x2_class(),
+          result_reg,
+          temp);
       __ ldr(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ CopyFloat64x2Field(result_reg, temp, TMP, temp2, value);
       __ b(&done);
@@ -3387,17 +3283,15 @@
 
 
 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   const Register out_reg = locs()->out(0).reg();
   const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg());
 
-  __ TryAllocate(compiler->double_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 locs()->temp(0).reg());
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler,
+      this,
+      compiler->double_class(),
+      out_reg,
+      locs()->temp(0).reg());
   __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag);
 }
 
@@ -3475,19 +3369,16 @@
 
 
 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   const Register out_reg = locs()->out(0).reg();
   const QRegister value = locs()->in(0).fpu_reg();
   const DRegister dvalue0 = EvenDRegisterOf(value);
 
-  __ TryAllocate(compiler->float32x4_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 locs()->temp(0).reg());
-  __ Bind(slow_path->exit_label());
-
+  BoxAllocationSlowPath::Allocate(
+      compiler,
+      this,
+      compiler->float32x4_class(),
+      out_reg,
+      locs()->temp(0).reg());
   __ StoreMultipleDToOffset(dvalue0, 2, out_reg,
       Float32x4::value_offset() - kHeapObjectTag);
 }
@@ -3546,19 +3437,16 @@
 
 
 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   const Register out_reg = locs()->out(0).reg();
   const QRegister value = locs()->in(0).fpu_reg();
   const DRegister dvalue0 = EvenDRegisterOf(value);
 
-  __ TryAllocate(compiler->float64x2_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 locs()->temp(0).reg());
-  __ Bind(slow_path->exit_label());
-
+  BoxAllocationSlowPath::Allocate(
+      compiler,
+      this,
+      compiler->float64x2_class(),
+      out_reg,
+      locs()->temp(0).reg());
   __ StoreMultipleDToOffset(dvalue0, 2, out_reg,
       Float64x2::value_offset() - kHeapObjectTag);
 }
@@ -3616,54 +3504,17 @@
 }
 
 
-class BoxInt32x4SlowPath : public SlowPathCode {
- public:
-  explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxInt32x4SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& int32x4_class = compiler->int32x4_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(int32x4_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ mov(locs->out(0).reg(), Operand(R0));
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  BoxInt32x4Instr* instruction_;
-};
-
-
 void BoxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   const Register out_reg = locs()->out(0).reg();
   const QRegister value = locs()->in(0).fpu_reg();
   const DRegister dvalue0 = EvenDRegisterOf(value);
 
-  __ TryAllocate(compiler->int32x4_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 locs()->temp(0).reg());
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler,
+      this,
+      compiler->int32x4_class(),
+      out_reg,
+      locs()->temp(0).reg());
   __ StoreMultipleDToOffset(dvalue0, 2, out_reg,
       Int32x4::value_offset() - kHeapObjectTag);
 }
@@ -5880,41 +5731,6 @@
 }
 
 
-class BoxIntegerSlowPath : public SlowPathCode {
- public:
-  explicit BoxIntegerSlowPath(Definition* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxIntegerSlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& mint_class =
-        Class::ZoneHandle(isolate->object_store()->mint_class());
-    const Code& stub =
-        Code::Handle(isolate, stub_code->GetAllocationStubForClass(mint_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ mov(locs->out(0).reg(), Operand(R0));
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  Definition* instruction_;
-};
-
-
 void BoxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   if (is_smi()) {
     PairLocation* value_pair = locs()->in(0).AsPairLocation();
@@ -5925,8 +5741,6 @@
     return;
   }
 
-  BoxIntegerSlowPath* slow_path = new BoxIntegerSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
   PairLocation* value_pair = locs()->in(0).AsPairLocation();
   Register value_lo = value_pair->At(0).reg();
   Register value_hi = value_pair->At(1).reg();
@@ -5964,12 +5778,12 @@
 
   // Not a smi. Box it.
   __ Bind(&not_smi);
-  __ TryAllocate(
-      Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()),
-      slow_path->entry_label(),
+  BoxAllocationSlowPath::Allocate(
+      compiler,
+      this,
+      compiler->mint_class(),
       out_reg,
       tmp);
-  __ Bind(slow_path->exit_label());
   __ StoreToOffset(kWord,
                    value_lo,
                    out_reg,
@@ -6447,8 +6261,6 @@
 
 
 void BoxUint32Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxIntegerSlowPath* slow_path = new BoxIntegerSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
   Register value = locs()->in(0).reg();
   Register out = locs()->out(0).reg();
   Register temp = locs()->temp(0).reg();
@@ -6467,12 +6279,12 @@
   __ b(&done);
   __ Bind(&not_smi);
   // Allocate a mint.
-  __ TryAllocate(
-    Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()),
-      slow_path->entry_label(),
+  BoxAllocationSlowPath::Allocate(
+      compiler,
+      this,
+      compiler->mint_class(),
       out,
       temp);
-  __ Bind(slow_path->exit_label());
   // Copy low word into mint.
   __ StoreToOffset(kWord,
                    value,
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index 16a4162..33b9dec 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -1564,17 +1564,24 @@
 }
 
 
-class StoreInstanceFieldSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public SlowPathCode {
  public:
-  StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction,
-                             const Class& cls)
-      : instruction_(instruction), cls_(cls) { }
+  BoxAllocationSlowPath(Instruction* instruction,
+                        const Class& cls,
+                        Register result)
+      : instruction_(instruction),
+        cls_(cls),
+        result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     Isolate* isolate = compiler->isolate();
     StubCode* stub_code = isolate->stub_code();
 
-    __ Comment("StoreInstanceFieldSlowPath");
+    if (Assembler::EmittingComments()) {
+      __ Comment("%s slow path allocation of %s",
+                 instruction_->DebugName(),
+                 String::Handle(cls_.PrettyName()).ToCString());
+    }
     __ Bind(entry_label());
 
     const Code& stub =
@@ -1582,25 +1589,63 @@
     const ExternalLabel label(stub.EntryPoint());
 
     LocationSummary* locs = instruction_->locs();
-    locs->live_registers()->Remove(locs->temp(0));
+
+    locs->live_registers()->Remove(Location::RegisterLocation(result_));
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
                            &label,
                            RawPcDescriptors::kOther,
                            locs);
-    __ mov(locs->temp(0).reg(), R0);
+    __ mov(result_, R0);
     compiler->RestoreLiveRegisters(locs);
 
     __ b(exit_label());
   }
 
+  static void Allocate(FlowGraphCompiler* compiler,
+                       Instruction* instruction,
+                       const Class& cls,
+                       Register result,
+                       Register temp) {
+    BoxAllocationSlowPath* slow_path =
+        new BoxAllocationSlowPath(instruction, cls, result);
+    compiler->AddSlowPathCode(slow_path);
+
+    __ TryAllocate(cls,
+                   slow_path->entry_label(),
+                   result,
+                   temp,
+                   PP);
+    __ Bind(slow_path->exit_label());
+  }
+
  private:
-  StoreInstanceFieldInstr* instruction_;
+  Instruction* instruction_;
   const Class& cls_;
+  Register result_;
 };
 
 
+static void EnsureMutableBox(FlowGraphCompiler* compiler,
+                             StoreInstanceFieldInstr* instruction,
+                             Register box_reg,
+                             const Class& cls,
+                             Register instance_reg,
+                             intptr_t offset,
+                             Register temp) {
+  Label done;
+  __ LoadFieldFromOffset(box_reg, instance_reg, offset, PP);
+  __ CompareObject(box_reg, Object::null_object(), PP);
+  __ b(&done, NE);
+  BoxAllocationSlowPath::Allocate(
+      compiler, instruction, cls, box_reg, temp);
+  __ mov(temp, box_reg);
+  __ StoreIntoObjectOffset(instance_reg, offset, temp, PP);
+  __ Bind(&done);
+}
+
+
 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Isolate* isolate,
                                                               bool opt) const {
   const intptr_t kNumInputs = 2;
@@ -1661,15 +1706,7 @@
           UNREACHABLE();
       }
 
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, *cls);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(*cls,
-                     slow_path->entry_label(),
-                     temp,
-                     PP);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(compiler, this, *cls, temp, temp2);
       __ mov(temp2, temp);
       __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2, PP);
     } else {
@@ -1739,23 +1776,13 @@
 
     {
       __ Bind(&store_double);
-      Label copy_double;
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->double_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes_, PP);
-      __ CompareObject(temp, Object::null_object(), PP);
-      __ b(&copy_double, NE);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     temp,
-                     PP);
-      __ Bind(slow_path->exit_label());
-      __ mov(temp2, temp);
-      __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2, PP);
-      __ Bind(&copy_double);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->double_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ LoadDFieldFromOffset(VTMP, value_reg, Double::value_offset(), PP);
       __ StoreDFieldToOffset(VTMP, temp, Double::value_offset(), PP);
       __ b(&skip_store);
@@ -1763,23 +1790,13 @@
 
     {
       __ Bind(&store_float32x4);
-      Label copy_float32x4;
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->float32x4_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes_, PP);
-      __ CompareObject(temp, Object::null_object(), PP);
-      __ b(&copy_float32x4, NE);
-
-      __ TryAllocate(compiler->float32x4_class(),
-                     slow_path->entry_label(),
-                     temp,
-                     PP);
-      __ Bind(slow_path->exit_label());
-      __ mov(temp2, temp);
-      __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2, PP);
-      __ Bind(&copy_float32x4);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->float32x4_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ LoadQFieldFromOffset(VTMP, value_reg, Float32x4::value_offset(), PP);
       __ StoreQFieldToOffset(VTMP, temp, Float32x4::value_offset(), PP);
       __ b(&skip_store);
@@ -1787,23 +1804,13 @@
 
     {
       __ Bind(&store_float64x2);
-      Label copy_float64x2;
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->float64x2_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes_, PP);
-      __ CompareObject(temp, Object::null_object(), PP);
-      __ b(&copy_float64x2, NE);
-
-      __ TryAllocate(compiler->float64x2_class(),
-                     slow_path->entry_label(),
-                     temp,
-                     PP);
-      __ Bind(slow_path->exit_label());
-      __ mov(temp2, temp);
-      __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2, PP);
-      __ Bind(&copy_float64x2);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->float64x2_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ LoadQFieldFromOffset(VTMP, value_reg, Float64x2::value_offset(), PP);
       __ StoreQFieldToOffset(VTMP, temp, Float64x2::value_offset(), PP);
       __ b(&skip_store);
@@ -1939,111 +1946,6 @@
 }
 
 
-class BoxDoubleSlowPath : public SlowPathCode {
- public:
-  explicit BoxDoubleSlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxDoubleSlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& double_class = compiler->double_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(double_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ mov(locs->out(0).reg(), R0);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
-class BoxFloat32x4SlowPath : public SlowPathCode {
- public:
-  explicit BoxFloat32x4SlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxFloat32x4SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& float32x4_class = compiler->float32x4_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(float32x4_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ mov(locs->out(0).reg(), R0);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
-class BoxFloat64x2SlowPath : public SlowPathCode {
- public:
-  explicit BoxFloat64x2SlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxFloat64x2SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& float64x2_class = compiler->float64x2_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(float64x2_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ mov(locs->out(0).reg(), R0);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate,
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
@@ -2134,14 +2036,11 @@
 
     {
       __ Bind(&load_double);
-      BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     result_reg,
-                     PP);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(compiler,
+                                      this,
+                                      compiler->double_class(),
+                                      result_reg,
+                                      temp);
       __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes(), PP);
       __ LoadDFieldFromOffset(VTMP, temp, Double::value_offset(), PP);
       __ StoreDFieldToOffset(VTMP, result_reg, Double::value_offset(), PP);
@@ -2150,14 +2049,11 @@
 
     {
       __ Bind(&load_float32x4);
-      BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->float32x4_class(),
-                     slow_path->entry_label(),
-                     result_reg,
-                     PP);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(compiler,
+                                      this,
+                                      compiler->float32x4_class(),
+                                      result_reg,
+                                      temp);
       __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes(), PP);
       __ LoadQFieldFromOffset(VTMP, temp, Float32x4::value_offset(), PP);
       __ StoreQFieldToOffset(VTMP, result_reg, Float32x4::value_offset(), PP);
@@ -2166,14 +2062,11 @@
 
     {
       __ Bind(&load_float64x2);
-      BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->float64x2_class(),
-                     slow_path->entry_label(),
-                     result_reg,
-                     PP);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(compiler,
+                                      this,
+                                      compiler->float64x2_class(),
+                                      result_reg,
+                                      temp);
       __ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes(), PP);
       __ LoadQFieldFromOffset(VTMP, temp, Float64x2::value_offset(), PP);
       __ StoreQFieldToOffset(VTMP, result_reg, Float64x2::value_offset(), PP);
@@ -2966,27 +2859,23 @@
 LocationSummary* BoxDoubleInstr::MakeLocationSummary(Isolate* isolate,
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 0;
+  const intptr_t kNumTemps = 1;
   LocationSummary* summary = new(isolate) LocationSummary(
       isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_temp(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
 }
 
 
 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   const Register out_reg = locs()->out(0).reg();
+  const Register temp_reg = locs()->temp(0).reg();
   const VRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->double_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 PP);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->double_class(), out_reg, temp_reg);
   __ StoreDFieldToOffset(value, out_reg, Double::value_offset(), PP);
 }
 
@@ -3043,28 +2932,23 @@
 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(Isolate* isolate,
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 0;
+  const intptr_t kNumTemps = 1;
   LocationSummary* summary = new(isolate) LocationSummary(
       isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_temp(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
 }
 
 
 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   const Register out_reg = locs()->out(0).reg();
+  const Register temp_reg = locs()->temp(0).reg();
   const VRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->float32x4_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 PP);
-  __ Bind(slow_path->exit_label());
-
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->float32x4_class(), out_reg, temp_reg);
   __ StoreQFieldToOffset(value, out_reg, Float32x4::value_offset(), PP);
 }
 
@@ -3101,28 +2985,23 @@
 LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(Isolate* isolate,
                                                         bool opt) const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 0;
+  const intptr_t kNumTemps = 1;
   LocationSummary* summary = new(isolate) LocationSummary(
       isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_temp(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
 }
 
 
 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   const Register out_reg = locs()->out(0).reg();
+  const Register temp_reg = locs()->temp(0).reg();
   const VRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->float64x2_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 PP);
-  __ Bind(slow_path->exit_label());
-
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->float64x2_class(), out_reg, temp_reg);
   __ StoreQFieldToOffset(value, out_reg, Float64x2::value_offset(), PP);
 }
 
@@ -3159,63 +3038,22 @@
 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(Isolate* isolate,
                                                       bool opt) const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 0;
+  const intptr_t kNumTemps = 1;
   LocationSummary* summary = new(isolate) LocationSummary(
       isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
   summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_temp(0, Location::RequiresRegister());
   summary->set_out(0, Location::RequiresRegister());
   return summary;
 }
 
 
-class BoxInt32x4SlowPath : public SlowPathCode {
- public:
-  explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxInt32x4SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& int32x4_class = compiler->int32x4_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(int32x4_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ mov(locs->out(0).reg(), R0);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  BoxInt32x4Instr* instruction_;
-};
-
-
 void BoxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   const Register out_reg = locs()->out(0).reg();
+  const Register temp_reg = locs()->temp(0).reg();
   const VRegister value = locs()->in(0).fpu_reg();
-
-  __ TryAllocate(compiler->int32x4_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 PP);
-  __ Bind(slow_path->exit_label());
-
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->int32x4_class(), out_reg, temp_reg);
   __ StoreQFieldToOffset(value, out_reg, Int32x4::value_offset(), PP);
 }
 
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 03d75b2..7b276af 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -1665,37 +1665,65 @@
 }
 
 
-class StoreInstanceFieldSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public SlowPathCode {
  public:
-  StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction,
-                             const Class& cls)
-      : instruction_(instruction), cls_(cls) { }
+  BoxAllocationSlowPath(Instruction* instruction,
+                        const Class& cls,
+                        Register result)
+      : instruction_(instruction),
+        cls_(cls),
+        result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("StoreInstanceFieldSlowPath");
-    __ Bind(entry_label());
     Isolate* isolate = compiler->isolate();
+    StubCode* stub_code = isolate->stub_code();
+
+    if (Assembler::EmittingComments()) {
+      __ Comment("%s slow path allocation of %s",
+                 instruction_->DebugName(),
+                 String::Handle(cls_.PrettyName()).ToCString());
+    }
+    __ Bind(entry_label());
+
     const Code& stub =
-        Code::Handle(isolate,
-                     isolate->stub_code()->GetAllocationStubForClass(cls_));
+        Code::Handle(isolate, stub_code->GetAllocationStubForClass(cls_));
     const ExternalLabel label(stub.EntryPoint());
 
     LocationSummary* locs = instruction_->locs();
-    locs->live_registers()->Remove(locs->temp(0));
+
+    locs->live_registers()->Remove(Location::RegisterLocation(result_));
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
                            &label,
                            RawPcDescriptors::kOther,
                            locs);
-    __ MoveRegister(locs->temp(0).reg(), EAX);
+    __ MoveRegister(result_, EAX);
     compiler->RestoreLiveRegisters(locs);
     __ jmp(exit_label());
   }
 
+  static void Allocate(FlowGraphCompiler* compiler,
+                       Instruction* instruction,
+                       const Class& cls,
+                       Register result,
+                       Register temp) {
+    BoxAllocationSlowPath* slow_path =
+        new BoxAllocationSlowPath(instruction, cls, result);
+    compiler->AddSlowPathCode(slow_path);
+
+    __ TryAllocate(cls,
+                   slow_path->entry_label(),
+                   Assembler::kFarJump,
+                   result,
+                   temp);
+    __ Bind(slow_path->exit_label());
+  }
+
  private:
-  StoreInstanceFieldInstr* instruction_;
+  Instruction* instruction_;
   const Class& cls_;
+  Register result_;
 };
 
 
@@ -1734,6 +1762,29 @@
 }
 
 
+static void EnsureMutableBox(FlowGraphCompiler* compiler,
+                             StoreInstanceFieldInstr* instruction,
+                             Register box_reg,
+                             const Class& cls,
+                             Register instance_reg,
+                             intptr_t offset,
+                             Register temp) {
+  Label done;
+  const Immediate& raw_null =
+      Immediate(reinterpret_cast<intptr_t>(Object::null()));
+  __ movl(box_reg, FieldAddress(instance_reg, offset));
+  __ cmpl(box_reg, raw_null);
+  __ j(NOT_EQUAL, &done);
+  BoxAllocationSlowPath::Allocate(compiler, instruction, cls, box_reg, temp);
+  __ movl(temp, box_reg);
+  __ StoreIntoObject(instance_reg,
+                     FieldAddress(instance_reg, offset),
+                     temp);
+
+  __ Bind(&done);
+}
+
+
 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label skip_store;
 
@@ -1761,16 +1812,7 @@
           UNREACHABLE();
       }
 
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, *cls);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(*cls,
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(compiler, this, *cls, temp, temp2);
       __ movl(temp2, temp);
       __ StoreIntoObject(instance_reg,
                          FieldAddress(instance_reg, offset_in_bytes_),
@@ -1842,30 +1884,13 @@
 
     {
       __ Bind(&store_double);
-      Label copy_double;
-
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->double_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      const Immediate& raw_null =
-          Immediate(reinterpret_cast<intptr_t>(Object::null()));
-      __ movl(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ cmpl(temp, raw_null);
-      __ j(NOT_EQUAL, &copy_double);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
-      __ movl(temp2, temp);
-      __ StoreIntoObject(instance_reg,
-                         FieldAddress(instance_reg, offset_in_bytes_),
-                         temp2);
-
-      __ Bind(&copy_double);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->double_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ movsd(fpu_temp, FieldAddress(value_reg, Double::value_offset()));
       __ movsd(FieldAddress(temp, Double::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1873,30 +1898,13 @@
 
     {
       __ Bind(&store_float32x4);
-      Label copy_float32x4;
-
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->float32x4_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      const Immediate& raw_null =
-          Immediate(reinterpret_cast<intptr_t>(Object::null()));
-      __ movl(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ cmpl(temp, raw_null);
-      __ j(NOT_EQUAL, &copy_float32x4);
-
-      __ TryAllocate(compiler->float32x4_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
-      __ movl(temp2, temp);
-      __ StoreIntoObject(instance_reg,
-                         FieldAddress(instance_reg, offset_in_bytes_),
-                         temp2);
-
-      __ Bind(&copy_float32x4);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->float32x4_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ movups(fpu_temp, FieldAddress(value_reg, Float32x4::value_offset()));
       __ movups(FieldAddress(temp, Float32x4::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1904,30 +1912,13 @@
 
     {
       __ Bind(&store_float64x2);
-      Label copy_float64x2;
-
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->float64x2_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      const Immediate& raw_null =
-          Immediate(reinterpret_cast<intptr_t>(Object::null()));
-      __ movl(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ cmpl(temp, raw_null);
-      __ j(NOT_EQUAL, &copy_float64x2);
-
-      __ TryAllocate(compiler->float64x2_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
-      __ movl(temp2, temp);
-      __ StoreIntoObject(instance_reg,
-                         FieldAddress(instance_reg, offset_in_bytes_),
-                         temp2);
-
-      __ Bind(&copy_float64x2);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->float64x2_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ movups(fpu_temp, FieldAddress(value_reg, Float64x2::value_offset()));
       __ movups(FieldAddress(temp, Float64x2::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -2161,110 +2152,6 @@
 }
 
 
-class BoxDoubleSlowPath : public SlowPathCode {
- public:
-  explicit BoxDoubleSlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxDoubleSlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& double_class = compiler->double_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(double_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), EAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
-class BoxFloat32x4SlowPath : public SlowPathCode {
- public:
-  explicit BoxFloat32x4SlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxFloat32x4SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& float32x4_class = compiler->float32x4_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(float32x4_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), EAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
-class BoxFloat64x2SlowPath : public SlowPathCode {
- public:
-  explicit BoxFloat64x2SlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxFloat64x2SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& float64x2_class = compiler->float64x2_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(float64x2_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), EAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate,
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
@@ -2356,15 +2243,8 @@
 
     {
       __ Bind(&load_double);
-      BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     result,
-                     temp);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->double_class(), result, temp);
       __ movl(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ movsd(value, FieldAddress(temp, Double::value_offset()));
       __ movsd(FieldAddress(result, Double::value_offset()), value);
@@ -2373,16 +2253,8 @@
 
     {
       __ Bind(&load_float32x4);
-
-      BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->float32x4_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     result,
-                     temp);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->float32x4_class(), result, temp);
       __ movl(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ movups(value, FieldAddress(temp, Float32x4::value_offset()));
       __ movups(FieldAddress(result, Float32x4::value_offset()), value);
@@ -2391,16 +2263,8 @@
 
     {
       __ Bind(&load_float64x2);
-
-      BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->float64x2_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     result,
-                     temp);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->float64x2_class(), result, temp);
       __ movl(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ movups(value, FieldAddress(temp, Float64x2::value_offset()));
       __ movups(FieldAddress(result, Float64x2::value_offset()), value);
@@ -3359,18 +3223,10 @@
 
 
 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
-
-  __ TryAllocate(compiler->double_class(),
-                 slow_path->entry_label(),
-                 Assembler::kFarJump,
-                 out_reg,
-                 kNoRegister);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->double_class(), out_reg, kNoRegister);
   __ movsd(FieldAddress(out_reg, Double::value_offset()), value);
 }
 
@@ -3449,18 +3305,11 @@
 
 
 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->float32x4_class(),
-                 slow_path->entry_label(),
-                 Assembler::kFarJump,
-                 out_reg,
-                 kNoRegister);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->float32x4_class(), out_reg, kNoRegister);
   __ movups(FieldAddress(out_reg, Float32x4::value_offset()), value);
 }
 
@@ -3514,18 +3363,11 @@
 
 
 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->float64x2_class(),
-                 slow_path->entry_label(),
-                 Assembler::kFarJump,
-                 out_reg,
-                 kNoRegister);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->float64x2_class(), out_reg, kNoRegister);
   __ movups(FieldAddress(out_reg, Float64x2::value_offset()), value);
 }
 
@@ -3578,54 +3420,12 @@
 }
 
 
-class BoxInt32x4SlowPath : public SlowPathCode {
- public:
-  explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxInt32x4SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& int32x4_class = compiler->int32x4_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(int32x4_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), EAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  BoxInt32x4Instr* instruction_;
-};
-
-
 void BoxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->int32x4_class(),
-                 slow_path->entry_label(),
-                 Assembler::kFarJump,
-                 out_reg,
-                 kNoRegister);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->int32x4_class(), out_reg, kNoRegister);
   __ movups(FieldAddress(out_reg, Int32x4::value_offset()), value);
 }
 
@@ -5703,41 +5503,6 @@
 }
 
 
-class BoxIntegerSlowPath : public SlowPathCode {
- public:
-  explicit BoxIntegerSlowPath(Definition* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxIntegerSlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& mint_class =
-        Class::ZoneHandle(isolate, isolate->object_store()->mint_class());
-    const Code& stub =
-        Code::Handle(isolate, stub_code->GetAllocationStubForClass(mint_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), EAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  Definition* instruction_;
-};
-
-
 void BoxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   if (is_smi()) {
     PairLocation* value_pair = locs()->in(0).AsPairLocation();
@@ -5748,8 +5513,6 @@
     return;
   }
 
-  BoxIntegerSlowPath* slow_path = new BoxIntegerSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
   PairLocation* value_pair = locs()->in(0).AsPairLocation();
   Register value_lo = value_pair->At(0).reg();
   Register value_hi = value_pair->At(1).reg();
@@ -5777,15 +5540,11 @@
   __ SmiTag(out_reg);
   __ jmp(&done);
   __ Bind(&not_smi);
-  __ TryAllocate(
-      Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()),
-      slow_path->entry_label(),
-      Assembler::kFarJump,
-      out_reg,
-      kNoRegister);
-  __ Bind(slow_path->exit_label());
   // 3. Restore lower half of input before using it.
   __ subl(value_lo, Immediate(0x40000000));
+
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->mint_class(), out_reg, kNoRegister);
   __ movl(FieldAddress(out_reg, Mint::value_offset()), value_lo);
   __ movl(FieldAddress(out_reg, Mint::value_offset() + kWordSize), value_hi);
   __ Bind(&done);
@@ -6338,8 +6097,6 @@
 
 
 void BoxUint32Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxIntegerSlowPath* slow_path = new BoxIntegerSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
   Register value = locs()->in(0).reg();
   Register out = locs()->out(0).reg();
   ASSERT(value != out);
@@ -6356,13 +6113,8 @@
   __ jmp(&done);
   __ Bind(&not_smi);
   // Allocate a mint.
-  __ TryAllocate(
-      Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()),
-      slow_path->entry_label(),
-      Assembler::kFarJump,
-      out,
-      kNoRegister);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->mint_class(), out, kNoRegister);
   // Copy low word into mint.
   __ movl(FieldAddress(out, Mint::value_offset()), value);
   // Zero high word.
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index ebf3a54..a5d77da 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -1674,39 +1674,65 @@
 }
 
 
-class StoreInstanceFieldSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public SlowPathCode {
  public:
-  StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction,
-                             const Class& cls)
-      : instruction_(instruction), cls_(cls) { }
+  BoxAllocationSlowPath(Instruction* instruction,
+                        const Class& cls,
+                        Register result)
+      : instruction_(instruction),
+        cls_(cls),
+        result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
     Isolate* isolate = compiler->isolate();
     StubCode* stub_code = isolate->stub_code();
 
-    __ Comment("StoreInstanceFieldSlowPath");
+    if (Assembler::EmittingComments()) {
+      __ Comment("%s slow path allocation of %s",
+                 instruction_->DebugName(),
+                 String::Handle(cls_.PrettyName()).ToCString());
+    }
     __ Bind(entry_label());
     const Code& stub =
         Code::Handle(isolate, stub_code->GetAllocationStubForClass(cls_));
     const ExternalLabel label(stub.EntryPoint());
 
     LocationSummary* locs = instruction_->locs();
-    locs->live_registers()->Remove(locs->temp(0));
+    locs->live_registers()->Remove(Location::RegisterLocation(result_));
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
                            &label,
                            RawPcDescriptors::kOther,
                            locs);
-    __ mov(locs->temp(0).reg(), V0);
+    if (result_ != V0) {
+      __ mov(result_, V0);
+    }
     compiler->RestoreLiveRegisters(locs);
 
     __ b(exit_label());
   }
 
+  static void Allocate(FlowGraphCompiler* compiler,
+                       Instruction* instruction,
+                       const Class& cls,
+                       Register result,
+                       Register temp) {
+    BoxAllocationSlowPath* slow_path =
+        new BoxAllocationSlowPath(instruction, cls, result);
+    compiler->AddSlowPathCode(slow_path);
+
+    __ TryAllocate(cls,
+                   slow_path->entry_label(),
+                   result,
+                   temp);
+    __ Bind(slow_path->exit_label());
+  }
+
  private:
-  StoreInstanceFieldInstr* instruction_;
+  Instruction* instruction_;
   const Class& cls_;
+  Register result_;
 };
 
 
@@ -1745,6 +1771,24 @@
 }
 
 
+static void EnsureMutableBox(FlowGraphCompiler* compiler,
+                             StoreInstanceFieldInstr* instruction,
+                             Register box_reg,
+                             const Class& cls,
+                             Register instance_reg,
+                             intptr_t offset,
+                             Register temp) {
+  Label done;
+  __ lw(box_reg, FieldAddress(instance_reg, offset));
+  __ BranchNotEqual(box_reg, reinterpret_cast<int32_t>(Object::null()),
+                    &done);
+  BoxAllocationSlowPath::Allocate(compiler, instruction, cls, box_reg, temp);
+  __ mov(temp, box_reg);
+  __ StoreIntoObjectOffset(instance_reg, offset, temp);
+  __ Bind(&done);
+}
+
+
 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label skip_store;
 
@@ -1766,15 +1810,7 @@
           UNREACHABLE();
       }
 
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, *cls);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(*cls,
-                     slow_path->entry_label(),
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(compiler, this, *cls, temp, temp2);
       __ mov(temp2, temp);
       __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
     } else {
@@ -1821,25 +1857,13 @@
 
     {
       __ Bind(&store_double);
-      Label copy_double;
-
-      __ lw(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ BranchNotEqual(temp, reinterpret_cast<int32_t>(Object::null()),
-                        &copy_double);
-
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->double_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
-      __ mov(temp2, temp);
-      __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, temp2);
-
-      __ Bind(&copy_double);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->double_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ LoadDFromOffset(fpu_temp,
                          value_reg,
                          Double::value_offset() - kHeapObjectTag);
@@ -2083,43 +2107,6 @@
 }
 
 
-class BoxDoubleSlowPath : public SlowPathCode {
- public:
-  explicit BoxDoubleSlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxDoubleSlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& double_class = compiler->double_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(double_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    if (locs->out(0).reg() != V0) {
-      __ mov(locs->out(0).reg(), V0);
-    }
-    compiler->RestoreLiveRegisters(locs);
-
-    __ b(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate,
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
@@ -2194,14 +2181,8 @@
 
     {
       __ Bind(&load_double);
-      BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     result_reg,
-                     temp);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->double_class(), result_reg, temp);
       __ lw(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag);
       __ StoreDToOffset(value,
@@ -3046,17 +3027,11 @@
 
 
 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   DRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->double_class(),
-                 slow_path->entry_label(),
-                 out_reg,
-                 locs()->temp(0).reg());
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->double_class(), out_reg, locs()->temp(0).reg());
   __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag);
 }
 
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 19bf864..e6d3910 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -1506,38 +1506,64 @@
 }
 
 
-class StoreInstanceFieldSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public SlowPathCode {
  public:
-  StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction,
-                             const Class& cls)
-      : instruction_(instruction), cls_(cls) { }
+  BoxAllocationSlowPath(Instruction* instruction,
+                        const Class& cls,
+                        Register result)
+      : instruction_(instruction),
+        cls_(cls),
+        result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("StoreInstanceFieldSlowPath");
-    __ Bind(entry_label());
     Isolate* isolate = compiler->isolate();
     StubCode* stub_code = isolate->stub_code();
-    const Code& stub = Code::Handle(isolate,
-                                    stub_code->GetAllocationStubForClass(cls_));
+
+    if (Assembler::EmittingComments()) {
+      __ Comment("%s slow path allocation of %s",
+                 instruction_->DebugName(),
+                 String::Handle(cls_.PrettyName()).ToCString());
+    }
+    __ Bind(entry_label());
+
+    const Code& stub =
+        Code::Handle(isolate, stub_code->GetAllocationStubForClass(cls_));
     const ExternalLabel label(stub.EntryPoint());
 
     LocationSummary* locs = instruction_->locs();
-    locs->live_registers()->Remove(locs->temp(0));
+
+    locs->live_registers()->Remove(Location::RegisterLocation(result_));
 
     compiler->SaveLiveRegisters(locs);
     compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
                            &label,
                            RawPcDescriptors::kOther,
                            locs);
-    __ MoveRegister(locs->temp(0).reg(), RAX);
+    __ MoveRegister(result_, RAX);
     compiler->RestoreLiveRegisters(locs);
-
     __ jmp(exit_label());
   }
 
+  static void Allocate(FlowGraphCompiler* compiler,
+                       Instruction* instruction,
+                       const Class& cls,
+                       Register result) {
+    BoxAllocationSlowPath* slow_path =
+        new BoxAllocationSlowPath(instruction, cls, result);
+    compiler->AddSlowPathCode(slow_path);
+
+    __ TryAllocate(cls,
+                   slow_path->entry_label(),
+                   Assembler::kFarJump,
+                   result,
+                   PP);
+    __ Bind(slow_path->exit_label());
+  }
+
  private:
-  StoreInstanceFieldInstr* instruction_;
+  Instruction* instruction_;
   const Class& cls_;
+  Register result_;
 };
 
 
@@ -1576,6 +1602,27 @@
 }
 
 
+static void EnsureMutableBox(FlowGraphCompiler* compiler,
+                             StoreInstanceFieldInstr* instruction,
+                             Register box_reg,
+                             const Class& cls,
+                             Register instance_reg,
+                             intptr_t offset,
+                             Register temp) {
+  Label done;
+  __ movq(box_reg, FieldAddress(instance_reg, offset));
+  __ CompareObject(box_reg, Object::null_object(), PP);
+  __ j(NOT_EQUAL, &done);
+  BoxAllocationSlowPath::Allocate(compiler, instruction, cls, box_reg);
+  __ movq(temp, box_reg);
+  __ StoreIntoObject(instance_reg,
+                     FieldAddress(instance_reg, offset),
+                     temp);
+
+  __ Bind(&done);
+}
+
+
 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Label skip_store;
 
@@ -1603,16 +1650,7 @@
           UNREACHABLE();
       }
 
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, *cls);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(*cls,
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     temp,
-                     PP);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(compiler, this, *cls, temp);
       __ movq(temp2, temp);
       __ StoreIntoObject(instance_reg,
                          FieldAddress(instance_reg, offset_in_bytes_),
@@ -1682,27 +1720,13 @@
 
     {
       __ Bind(&store_double);
-      Label copy_double;
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->double_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ movq(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ CompareObject(temp, Object::null_object(), PP);
-      __ j(NOT_EQUAL, &copy_double);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     temp,
-                     PP);
-      __ Bind(slow_path->exit_label());
-      __ movq(temp2, temp);
-      __ StoreIntoObject(instance_reg,
-                         FieldAddress(instance_reg, offset_in_bytes_),
-                         temp2);
-
-      __ Bind(&copy_double);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->double_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ movsd(fpu_temp, FieldAddress(value_reg, Double::value_offset()));
       __ movsd(FieldAddress(temp, Double::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1710,27 +1734,13 @@
 
     {
       __ Bind(&store_float32x4);
-      Label copy_float32x4;
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->float32x4_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ movq(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ CompareObject(temp, Object::null_object(), PP);
-      __ j(NOT_EQUAL, &copy_float32x4);
-
-      __ TryAllocate(compiler->float32x4_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     temp,
-                     PP);
-      __ Bind(slow_path->exit_label());
-      __ movq(temp2, temp);
-      __ StoreIntoObject(instance_reg,
-                         FieldAddress(instance_reg, offset_in_bytes_),
-                         temp2);
-
-      __ Bind(&copy_float32x4);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->float32x4_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ movups(fpu_temp, FieldAddress(value_reg, Float32x4::value_offset()));
       __ movups(FieldAddress(temp, Float32x4::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1738,28 +1748,13 @@
 
     {
       __ Bind(&store_float64x2);
-      Label copy_float64x2;
-
-      StoreInstanceFieldSlowPath* slow_path =
-          new StoreInstanceFieldSlowPath(this, compiler->float64x2_class());
-      compiler->AddSlowPathCode(slow_path);
-
-      __ movq(temp, FieldAddress(instance_reg, offset_in_bytes_));
-      __ CompareObject(temp, Object::null_object(), PP);
-      __ j(NOT_EQUAL, &copy_float64x2);
-
-      __ TryAllocate(compiler->float64x2_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     temp,
-                     temp2);
-      __ Bind(slow_path->exit_label());
-      __ movq(temp2, temp);
-      __ StoreIntoObject(instance_reg,
-                         FieldAddress(instance_reg, offset_in_bytes_),
-                         temp2);
-
-      __ Bind(&copy_float64x2);
+      EnsureMutableBox(compiler,
+                       this,
+                       temp,
+                       compiler->float64x2_class(),
+                       instance_reg,
+                       offset_in_bytes_,
+                       temp2);
       __ movups(fpu_temp, FieldAddress(value_reg, Float64x2::value_offset()));
       __ movups(FieldAddress(temp, Float64x2::value_offset()), fpu_temp);
       __ jmp(&skip_store);
@@ -1994,111 +1989,6 @@
 }
 
 
-class BoxDoubleSlowPath : public SlowPathCode {
- public:
-  explicit BoxDoubleSlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxDoubleSlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& double_class = compiler->double_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(double_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), RAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
-class BoxFloat32x4SlowPath : public SlowPathCode {
- public:
-  explicit BoxFloat32x4SlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxFloat32x4SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& float32x4_class = compiler->float32x4_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(float32x4_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), RAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
-class BoxFloat64x2SlowPath : public SlowPathCode {
- public:
-  explicit BoxFloat64x2SlowPath(Instruction* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxFloat64x2SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& float64x2_class = compiler->float64x2_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(float64x2_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), RAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  Instruction* instruction_;
-};
-
-
 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate,
                                                      bool opt) const {
   const intptr_t kNumInputs = 1;
@@ -2189,15 +2079,8 @@
 
     {
       __ Bind(&load_double);
-      BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->double_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     result,
-                     PP);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->double_class(), result);
       __ movq(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ movsd(value, FieldAddress(temp, Double::value_offset()));
       __ movsd(FieldAddress(result, Double::value_offset()), value);
@@ -2206,15 +2089,8 @@
 
     {
       __ Bind(&load_float32x4);
-      BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->float32x4_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     result,
-                     PP);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->float32x4_class(), result);
       __ movq(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ movups(value, FieldAddress(temp, Float32x4::value_offset()));
       __ movups(FieldAddress(result, Float32x4::value_offset()), value);
@@ -2223,15 +2099,8 @@
 
     {
       __ Bind(&load_float64x2);
-      BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this);
-      compiler->AddSlowPathCode(slow_path);
-
-      __ TryAllocate(compiler->float64x2_class(),
-                     slow_path->entry_label(),
-                     Assembler::kFarJump,
-                     result,
-                     temp);
-      __ Bind(slow_path->exit_label());
+      BoxAllocationSlowPath::Allocate(
+          compiler, this, compiler->float64x2_class(), result);
       __ movq(temp, FieldAddress(instance_reg, offset_in_bytes()));
       __ movups(value, FieldAddress(temp, Float64x2::value_offset()));
       __ movups(FieldAddress(result, Float64x2::value_offset()), value);
@@ -3197,18 +3066,11 @@
 
 
 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->double_class(),
-                 slow_path->entry_label(),
-                 Assembler::kFarJump,
-                 out_reg,
-                 PP);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->double_class(), out_reg);
   __ movsd(FieldAddress(out_reg, Double::value_offset()), value);
 }
 
@@ -3282,18 +3144,11 @@
 
 
 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->float32x4_class(),
-                 slow_path->entry_label(),
-                 Assembler::kFarJump,
-                 out_reg,
-                 PP);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->float32x4_class(), out_reg);
   __ movups(FieldAddress(out_reg, Float32x4::value_offset()), value);
 }
 
@@ -3339,18 +3194,11 @@
 
 
 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->float64x2_class(),
-                 slow_path->entry_label(),
-                 Assembler::kFarJump,
-                 out_reg,
-                 kNoRegister);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->float64x2_class(), out_reg);
   __ movups(FieldAddress(out_reg, Float64x2::value_offset()), value);
 }
 
@@ -3398,54 +3246,12 @@
 }
 
 
-class BoxInt32x4SlowPath : public SlowPathCode {
- public:
-  explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction)
-      : instruction_(instruction) { }
-
-  virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    __ Comment("BoxInt32x4SlowPath");
-    __ Bind(entry_label());
-    Isolate* isolate = compiler->isolate();
-    StubCode* stub_code = isolate->stub_code();
-    const Class& int32x4_class = compiler->int32x4_class();
-    const Code& stub =
-        Code::Handle(isolate,
-                     stub_code->GetAllocationStubForClass(int32x4_class));
-    const ExternalLabel label(stub.EntryPoint());
-
-    LocationSummary* locs = instruction_->locs();
-    ASSERT(!locs->live_registers()->Contains(locs->out(0)));
-
-    compiler->SaveLiveRegisters(locs);
-    compiler->GenerateCall(Scanner::kNoSourcePos,  // No token position.
-                           &label,
-                           RawPcDescriptors::kOther,
-                           locs);
-    __ MoveRegister(locs->out(0).reg(), RAX);
-    compiler->RestoreLiveRegisters(locs);
-
-    __ jmp(exit_label());
-  }
-
- private:
-  BoxInt32x4Instr* instruction_;
-};
-
-
 void BoxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  BoxInt32x4SlowPath* slow_path = new BoxInt32x4SlowPath(this);
-  compiler->AddSlowPathCode(slow_path);
-
   Register out_reg = locs()->out(0).reg();
   XmmRegister value = locs()->in(0).fpu_reg();
 
-  __ TryAllocate(compiler->int32x4_class(),
-                 slow_path->entry_label(),
-                 Assembler::kFarJump,
-                 out_reg,
-                 PP);
-  __ Bind(slow_path->exit_label());
+  BoxAllocationSlowPath::Allocate(
+      compiler, this, compiler->int32x4_class(), out_reg);
   __ movups(FieldAddress(out_reg, Int32x4::value_offset()), value);
 }
 
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index 6e26b2e..ef10775 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -427,6 +427,7 @@
   __ TryAllocate(double_class,
                  &fall_through,
                  R0,  // Result register.
+                 R1,  // Temp register.
                  kNoPP);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset(), kNoPP);
   __ ret();
@@ -1074,7 +1075,7 @@
   }
   const Class& double_class = Class::Handle(
       Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class, &fall_through, R0, kNoPP);
+  __ TryAllocate(double_class, &fall_through, R0, R1, kNoPP);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset(), kNoPP);
   __ ret();
   __ Bind(&fall_through);
@@ -1116,7 +1117,7 @@
   __ fmuld(V0, V0, V1);
   const Class& double_class = Class::Handle(
       Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class, &fall_through, R0, kNoPP);
+  __ TryAllocate(double_class, &fall_through, R0, R1, kNoPP);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset(), kNoPP);
   __ ret();
   __ Bind(&fall_through);
@@ -1134,7 +1135,7 @@
   __ scvtfd(V0, R0);
   const Class& double_class = Class::Handle(
       Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class, &fall_through, R0, kNoPP);
+  __ TryAllocate(double_class, &fall_through, R0, R1, kNoPP);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset(), kNoPP);
   __ ret();
   __ Bind(&fall_through);
@@ -1214,7 +1215,7 @@
   __ fsqrtd(V0, V1);
   const Class& double_class = Class::Handle(
       Isolate::Current()->object_store()->double_class());
-  __ TryAllocate(double_class, &fall_through, R0, kNoPP);
+  __ TryAllocate(double_class, &fall_through, R0, R1, kNoPP);
   __ StoreDFieldToOffset(V0, R0, Double::value_offset(), kNoPP);
   __ ret();
   __ Bind(&is_smi);
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 1d4d290..aa88d36 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -1155,6 +1155,27 @@
   cls = Class::New<MirrorReference>();
   RegisterPrivateClass(cls, Symbols::_MirrorReference(), lib);
 
+  // Pre-register the collection library so we can place the vm class
+  // LinkedHashMap there rather than the core library.
+  lib = Library::LookupLibrary(Symbols::DartCollection());
+  if (lib.IsNull()) {
+    lib = Library::NewLibraryHelper(Symbols::DartCollection(), true);
+    lib.SetLoadRequested();
+    lib.Register();
+    isolate->object_store()->set_bootstrap_library(ObjectStore::kCollection,
+                                                   lib);
+  }
+  ASSERT(!lib.IsNull());
+  ASSERT(lib.raw() == Library::CollectionLibrary());
+
+  cls = Class::New<LinkedHashMap>();
+  object_store->set_linked_hash_map_class(cls);
+  cls.set_type_arguments_field_offset(LinkedHashMap::type_arguments_offset());
+  cls.set_num_type_arguments(2);
+  cls.set_num_own_type_arguments(2);
+  RegisterPrivateClass(cls, Symbols::_LinkedHashMap(), lib);
+  pending_classes.Add(cls);
+
   // Pre-register the profiler library so we can place the vm class
   // UserTag there rather than the core library.
   lib = Library::LookupLibrary(Symbols::DartProfiler());
@@ -1433,6 +1454,9 @@
   cls = Class::New<GrowableObjectArray>();
   object_store->set_growable_object_array_class(cls);
 
+  cls = Class::New<LinkedHashMap>();
+  object_store->set_linked_hash_map_class(cls);
+
   cls = Class::New<Float32x4>();
   object_store->set_float32x4_class(cls);
 
@@ -13189,8 +13213,7 @@
 
 
 bool Instance::IsClosure() const {
-  const Class& cls = Class::Handle(clazz());
-  return cls.IsSignatureClass();
+  return Class::IsSignatureClass(clazz());
 }
 
 
@@ -15213,8 +15236,8 @@
     ASSERT(!BigintOperations::FitsIntoInt64(big));
     return big.raw();
   }
-  if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) {
-    return Smi::New(value);
+  if (Smi::IsValid(value)) {
+    return Smi::New(static_cast<intptr_t>(value));
   }
   return Mint::NewCanonical(value);
 }
@@ -15228,16 +15251,17 @@
 
 
 RawInteger* Integer::New(int64_t value, Heap::Space space, const bool silent) {
-  const bool is_smi = (value <= Smi::kMaxValue) && (value >= Smi::kMinValue);
+  const bool is_smi = Smi::IsValid(value);
   if (!silent &&
       FLAG_throw_on_javascript_int_overflow &&
       !IsJavascriptInt(value)) {
-    const Integer& i = is_smi ? Integer::Handle(Smi::New(value))
-                              : Integer::Handle(Mint::New(value));
+    const Integer& i = is_smi ?
+        Integer::Handle(Smi::New(static_cast<intptr_t>(value))) :
+        Integer::Handle(Mint::New(value));
     ThrowJavascriptIntegerOverflow(i);
   }
   if (is_smi) {
-    return Smi::New(value);
+    return Smi::New(static_cast<intptr_t>(value));
   }
   return Mint::New(value, space);
 }
@@ -15314,7 +15338,7 @@
     Mint& mint = Mint::Handle();
     mint ^= raw();
     if (Smi::IsValid(mint.value())) {
-      return Smi::New(mint.value());
+      return Smi::New(static_cast<intptr_t>(mint.value()));
     } else {
       return raw();
     }
@@ -18099,6 +18123,170 @@
 }
 
 
+// Equivalent to Dart's operator "==" and hashCode.
+class DefaultHashTraits {
+ public:
+  static bool IsMatch(const Object& a, const Object& b) {
+    if (a.IsNull() || b.IsNull()) {
+      return (a.IsNull() && b.IsNull());
+    } else {
+      return Instance::Cast(a).OperatorEquals(Instance::Cast(b));
+    }
+  }
+  static uword Hash(const Object& obj) {
+    if (obj.IsNull()) {
+      return 0;
+    }
+    // TODO(koda): Ensure VM classes only produce Smi hash codes, and remove
+    // non-Smi cases once Dart-side implementation is complete.
+    Isolate* isolate = Isolate::Current();
+    REUSABLE_INSTANCE_HANDLESCOPE(isolate);
+    Instance& hash_code = isolate->InstanceHandle();
+    hash_code ^= Instance::Cast(obj).HashCode();
+    if (hash_code.IsSmi()) {
+      // May waste some bits on 64-bit, to ensure consistency with non-Smi case.
+      return static_cast<uword>(Smi::Cast(hash_code).Value() & 0xFFFFFFFF);
+    } else if (hash_code.IsInteger()) {
+      return static_cast<uword>(
+          Integer::Cast(hash_code).AsTruncatedUint32Value());
+    } else {
+      return 0;
+    }
+  }
+};
+typedef EnumIndexHashMap<DefaultHashTraits> EnumIndexDefaultMap;
+
+
+intptr_t LinkedHashMap::Length() const {
+  EnumIndexDefaultMap map(Array::Handle(data()));
+  intptr_t result = map.NumOccupied();
+  {
+    RawArray* array = map.Release();
+    ASSERT(array == data());
+  }
+  return result;
+}
+
+
+void LinkedHashMap::InsertOrUpdate(const Object& key,
+                                     const Object& value) const {
+  ASSERT(!IsNull());
+  EnumIndexDefaultMap map(Array::Handle(data()));
+  if (!map.UpdateOrInsert(key, value)) {
+    SetModified();
+  }
+  StorePointer(&raw_ptr()->data_, map.Release());
+}
+
+
+RawObject* LinkedHashMap::LookUp(const Object& key) const {
+  ASSERT(!IsNull());
+  EnumIndexDefaultMap map(Array::Handle(data()));
+  const Object& result = Object::Handle(map.GetOrNull(key));
+  {
+    RawArray* array = map.Release();
+    ASSERT(array == data());
+  }
+  return result.raw();
+}
+
+
+bool LinkedHashMap::Contains(const Object& key) const {
+  ASSERT(!IsNull());
+  EnumIndexDefaultMap map(Array::Handle(data()));
+  bool result = map.ContainsKey(key);
+  {
+    RawArray* array = map.Release();
+    ASSERT(array == data());
+  }
+  return result;
+}
+
+
+RawObject* LinkedHashMap::Remove(const Object& key) const {
+  ASSERT(!IsNull());
+  EnumIndexDefaultMap map(Array::Handle(data()));
+  // TODO(koda): Make 'Remove' also return the old value.
+  const Object& result = Object::Handle(map.GetOrNull(key));
+  if (map.Remove(key)) {
+    SetModified();
+  }
+  StorePointer(&raw_ptr()->data_, map.Release());
+  return result.raw();
+}
+
+
+void LinkedHashMap::Clear() const {
+  ASSERT(!IsNull());
+  if (Length() != 0) {
+    EnumIndexDefaultMap map(Array::Handle(data()));
+    map.Initialize();
+    SetModified();
+    StorePointer(&raw_ptr()->data_, map.Release());
+  }
+}
+
+
+RawArray* LinkedHashMap::ToArray() const {
+  EnumIndexDefaultMap map(Array::Handle(data()));
+  const Array& result = Array::Handle(HashTables::ToArray(map, true));
+  RawArray* array = map.Release();
+  ASSERT(array == data());
+  return result.raw();
+}
+
+
+void LinkedHashMap::SetModified() const {
+  StorePointer(&raw_ptr()->cme_mark_, Instance::null());
+}
+
+
+RawInstance* LinkedHashMap::GetModificationMark(bool create) const {
+  if (create && raw_ptr()->cme_mark_ == Instance::null()) {
+    Isolate* isolate = Isolate::Current();
+    const Class& object_class =
+        Class::Handle(isolate, isolate->object_store()->object_class());
+    const Instance& current =
+        Instance::Handle(isolate, Instance::New(object_class));
+    StorePointer(&raw_ptr()->cme_mark_, current.raw());
+  }
+  return raw_ptr()->cme_mark_;
+}
+
+
+RawLinkedHashMap* LinkedHashMap::New(Heap::Space space) {
+  ASSERT(Isolate::Current()->object_store()->linked_hash_map_class()
+         != Class::null());
+  static const intptr_t kInitialCapacity = 4;
+  const Array& data =
+      Array::Handle(HashTables::New<EnumIndexDefaultMap>(kInitialCapacity,
+                                                         space));
+  LinkedHashMap& result = LinkedHashMap::Handle();
+  {
+    RawObject* raw = Object::Allocate(LinkedHashMap::kClassId,
+                                      LinkedHashMap::InstanceSize(),
+                                      space);
+    NoGCScope no_gc;
+    result ^= raw;
+    result.SetData(data);
+    result.SetModified();
+  }
+  return result.raw();
+}
+
+
+const char* LinkedHashMap::ToCString() const {
+  // TODO(koda): Print key/value pairs.
+  return "_LinkedHashMap";
+}
+
+
+void LinkedHashMap::PrintJSONImpl(JSONStream* stream, bool ref) const {
+  // TODO(koda): Print key/value pairs.
+  Instance::PrintJSONImpl(stream, ref);
+}
+
+
 RawFloat32x4* Float32x4::New(float v0, float v1, float v2, float v3,
                              Heap::Space space) {
   ASSERT(Isolate::Current()->object_store()->float32x4_class() !=
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 7dd070e..ba8b625 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -5,7 +5,6 @@
 #ifndef VM_OBJECT_H_
 #define VM_OBJECT_H_
 
-#include <limits>
 #include "include/dart_api.h"
 #include "platform/assert.h"
 #include "platform/utils.h"
@@ -3003,9 +3002,9 @@
     rec->set_pc(pc);
     rec->set_kind(kind);
     ASSERT(Utils::IsInt(32, deopt_id));
-    rec->set_deopt_id(deopt_id);
+    rec->set_deopt_id(static_cast<int32_t>(deopt_id));
     ASSERT(Utils::IsInt(32, token_pos));
-    rec->set_token_pos(token_pos,
+    rec->set_token_pos(static_cast<int32_t>(token_pos),
         RecordSizeInBytes() == RawPcDescriptors::kCompressedRecSize);
     ASSERT(Utils::IsInt(16, try_index));
     rec->set_try_index(try_index);
@@ -5078,7 +5077,7 @@
   static intptr_t InstanceSize() { return 0; }
 
   static RawSmi* New(intptr_t value) {
-    word raw_smi = (value << kSmiTagShift) | kSmiTag;
+    intptr_t raw_smi = (value << kSmiTagShift) | kSmiTag;
     ASSERT(ValueFromRaw(raw_smi) == value);
     return reinterpret_cast<RawSmi*>(raw_smi);
   }
@@ -5093,18 +5092,8 @@
     return reinterpret_cast<intptr_t>(New(value));
   }
 
-  template <typename T>
-  static bool IsValid(T value) {
-    COMPILE_ASSERT(sizeof(kMinValue) == sizeof(kMaxValue));
-    COMPILE_ASSERT(std::numeric_limits<T>::is_integer);
-    if (sizeof(value) < sizeof(kMinValue)) {
-      return true;
-    }
-
-    T min_value = std::numeric_limits<T>::is_signed
-        ? static_cast<T>(kMinValue) : 0;
-    return (value >= min_value)
-        && (value <= static_cast<T>(kMaxValue));
+  static bool IsValid(int64_t value) {
+    return (value >= kMinValue) && (value <= kMaxValue);
   }
 
   RawInteger* ShiftOp(Token::Kind kind,
@@ -6297,6 +6286,53 @@
 };
 
 
+// Corresponds to
+// - "new Map()",
+// - non-const map literals, and
+// - the default constructor of LinkedHashMap in dart:collection.
+class LinkedHashMap : public Instance {
+ public:
+  intptr_t Length() const;
+  RawObject* LookUp(const Object& key) const;
+  void InsertOrUpdate(const Object& key, const Object& value) const;
+  bool Contains(const Object& key) const;
+  RawObject* Remove(const Object& key) const;
+  void Clear() const;
+  // List of key, value pairs in iteration (i.e., key insertion) order.
+  RawArray* ToArray() const;
+
+  static intptr_t InstanceSize() {
+    return RoundedAllocationSize(sizeof(RawLinkedHashMap));
+  }
+
+  static RawLinkedHashMap* New(Heap::Space space = Heap::kNew);
+
+  virtual RawTypeArguments* GetTypeArguments() const {
+    return raw_ptr()->type_arguments_;
+  }
+  virtual void SetTypeArguments(const TypeArguments& value) const {
+    ASSERT(value.IsNull() || ((value.Length() >= 2) && value.IsInstantiated()));
+    StorePointer(&raw_ptr()->type_arguments_, value.raw());
+  }
+  static intptr_t type_arguments_offset() {
+    return OFFSET_OF(RawLinkedHashMap, type_arguments_);
+  }
+
+  // Called whenever the set of keys changes.
+  void SetModified() const;
+  RawInstance* GetModificationMark(bool create) const;
+
+ private:
+  RawArray* data() const { return raw_ptr()->data_; }
+  void SetData(const Array& value) const {
+    StorePointer(&raw_ptr()->data_, value.raw());
+  }
+
+  FINAL_HEAP_OBJECT_IMPLEMENTATION(LinkedHashMap, Instance);
+  friend class Class;
+};
+
+
 class Float32x4 : public Instance {
  public:
   static RawFloat32x4* New(float value0, float value1, float value2,
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc
index 0c6a9fe..4bd14d2 100644
--- a/runtime/vm/object_store.cc
+++ b/runtime/vm/object_store.cc
@@ -44,6 +44,7 @@
     array_type_(Type::null()),
     immutable_array_class_(Class::null()),
     growable_object_array_class_(Class::null()),
+    linked_hash_map_class_(Class::null()),
     float32x4_class_(Class::null()),
     int32x4_class_(Class::null()),
     float64x2_class_(Class::null()),
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index 9aead15..4fc280d 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -194,6 +194,13 @@
     return OFFSET_OF(ObjectStore, growable_object_array_class_);
   }
 
+  RawClass* linked_hash_map_class() const {
+    return linked_hash_map_class_;
+  }
+  void set_linked_hash_map_class(const Class& value) {
+    linked_hash_map_class_ = value.raw();
+  }
+
   RawClass* float32x4_class() const {
     return float32x4_class_;
   }
@@ -471,6 +478,7 @@
   RawType* array_type_;
   RawClass* immutable_array_class_;
   RawClass* growable_object_array_class_;
+  RawClass* linked_hash_map_class_;
   RawClass* float32x4_class_;
   RawClass* int32x4_class_;
   RawClass* float64x2_class_;
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index c8508cd..42b39ad 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -319,7 +319,6 @@
   EXPECT(!Smi::IsValid(kMaxInt64));
   EXPECT(Smi::IsValid(0x3FFFFFFFFFFFFFFF));
   EXPECT(Smi::IsValid(-1));
-  EXPECT(!Smi::IsValid(0xFFFFFFFFFFFFFFFFu));
 #else
   EXPECT(!Smi::IsValid(kMaxInt32));
   EXPECT(Smi::IsValid(0x3FFFFFFF));
diff --git a/runtime/vm/os.h b/runtime/vm/os.h
index beceeab..60456e4 100644
--- a/runtime/vm/os.h
+++ b/runtime/vm/os.h
@@ -65,7 +65,7 @@
 
   // Returns the activation frame alignment constraint or one if
   // the platform doesn't care. Guaranteed to be a power of two.
-  static word ActivationFrameAlignment();
+  static intptr_t ActivationFrameAlignment();
 
   // This constant is guaranteed to be greater or equal to the
   // preferred code alignment on all platforms.
@@ -73,10 +73,7 @@
 
   // Returns the preferred code alignment or zero if
   // the platform doesn't care. Guaranteed to be a power of two.
-  static word PreferredCodeAlignment();
-
-  // Returns the stack size limit.
-  static uword GetStackSizeLimit();
+  static intptr_t PreferredCodeAlignment();
 
   // Returns true if StackFrameIterator can be used from an isolate that isn't
   // the calling thread's current isolate.
diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc
index db1ec03..f305414 100644
--- a/runtime/vm/os_android.cc
+++ b/runtime/vm/os_android.cc
@@ -204,7 +204,7 @@
 
 // TODO(5411554):  May need to hoist these architecture dependent code
 // into a architecture specific file e.g: os_ia32_linux.cc
-word OS::ActivationFrameAlignment() {
+intptr_t OS::ActivationFrameAlignment() {
 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
   const int kMinimumAlignment = 16;
 #elif defined(TARGET_ARCH_ARM)
@@ -212,7 +212,7 @@
 #else
 #error Unsupported architecture.
 #endif
-  word alignment = kMinimumAlignment;
+  intptr_t alignment = kMinimumAlignment;
   // TODO(5411554): Allow overriding default stack alignment for
   // testing purposes.
   // Flags::DebugIsInt("stackalign", &alignment);
@@ -222,7 +222,7 @@
 }
 
 
-word OS::PreferredCodeAlignment() {
+intptr_t OS::PreferredCodeAlignment() {
 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
   const int kMinimumAlignment = 16;
 #elif defined(TARGET_ARCH_ARM)
@@ -230,7 +230,7 @@
 #else
 #error Unsupported architecture.
 #endif
-  word alignment = kMinimumAlignment;
+  intptr_t alignment = kMinimumAlignment;
   // TODO(5411554): Allow overriding default code alignment for
   // testing purposes.
   // Flags::DebugIsInt("codealign", &alignment);
@@ -241,19 +241,6 @@
 }
 
 
-uword OS::GetStackSizeLimit() {
-  struct rlimit stack_limit;
-  int retval = getrlimit(RLIMIT_STACK, &stack_limit);
-  ASSERT(retval == 0);
-  if (stack_limit.rlim_cur > INT_MAX) {
-    retval = INT_MAX;
-  } else {
-    retval = stack_limit.rlim_cur;
-  }
-  return retval;
-}
-
-
 bool OS::AllowStackFrameIteratorFromAnotherThread() {
   return false;
 }
diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_linux.cc
index 92864e0..5cf230d 100644
--- a/runtime/vm/os_linux.cc
+++ b/runtime/vm/os_linux.cc
@@ -424,7 +424,7 @@
 
 // TODO(5411554):  May need to hoist these architecture dependent code
 // into a architecture specific file e.g: os_ia32_linux.cc
-word OS::ActivationFrameAlignment() {
+intptr_t OS::ActivationFrameAlignment() {
 #if defined(TARGET_ARCH_IA32) ||                                               \
     defined(TARGET_ARCH_X64) ||                                                \
     defined(TARGET_ARCH_ARM64)
@@ -434,7 +434,7 @@
 #else
 #error Unsupported architecture.
 #endif
-  word alignment = kMinimumAlignment;
+  intptr_t alignment = kMinimumAlignment;
   // TODO(5411554): Allow overriding default stack alignment for
   // testing purposes.
   // Flags::DebugIsInt("stackalign", &alignment);
@@ -444,7 +444,7 @@
 }
 
 
-word OS::PreferredCodeAlignment() {
+intptr_t OS::PreferredCodeAlignment() {
 #if defined(TARGET_ARCH_IA32) ||                                               \
     defined(TARGET_ARCH_X64) ||                                                \
     defined(TARGET_ARCH_ARM64)
@@ -454,7 +454,7 @@
 #else
 #error Unsupported architecture.
 #endif
-  word alignment = kMinimumAlignment;
+  intptr_t alignment = kMinimumAlignment;
   // TODO(5411554): Allow overriding default code alignment for
   // testing purposes.
   // Flags::DebugIsInt("codealign", &alignment);
@@ -465,19 +465,6 @@
 }
 
 
-uword OS::GetStackSizeLimit() {
-  struct rlimit stack_limit;
-  int retval = getrlimit(RLIMIT_STACK, &stack_limit);
-  ASSERT(retval == 0);
-  if (stack_limit.rlim_cur > INT_MAX) {
-    retval = INT_MAX;
-  } else {
-    retval = stack_limit.rlim_cur;
-  }
-  return retval;
-}
-
-
 bool OS::AllowStackFrameIteratorFromAnotherThread() {
   return false;
 }
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
index b32f621..046d475 100644
--- a/runtime/vm/os_macos.cc
+++ b/runtime/vm/os_macos.cc
@@ -99,32 +99,19 @@
 }
 
 
-word OS::ActivationFrameAlignment() {
+intptr_t OS::ActivationFrameAlignment() {
   // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI
   // Function Call Guide".
   return 16;
 }
 
 
-word OS::PreferredCodeAlignment() {
+intptr_t OS::PreferredCodeAlignment() {
   ASSERT(32 <= OS::kMaxPreferredCodeAlignment);
   return 32;
 }
 
 
-uword OS::GetStackSizeLimit() {
-  struct rlimit stack_limit;
-  int retval = getrlimit(RLIMIT_STACK, &stack_limit);
-  ASSERT(retval == 0);
-  if (stack_limit.rlim_cur > INT_MAX) {
-    retval = INT_MAX;
-  } else {
-    retval = stack_limit.rlim_cur;
-  }
-  return retval;
-}
-
-
 bool OS::AllowStackFrameIteratorFromAnotherThread() {
   return false;
 }
@@ -145,10 +132,14 @@
   struct timespec req;  // requested.
   struct timespec rem;  // remainder.
   int64_t seconds = micros / kMicrosecondsPerSecond;
+  if (seconds > kMaxInt32) {
+    // Avoid truncation of overly large sleep values.
+    seconds = kMaxInt32;
+  }
   micros = micros - seconds * kMicrosecondsPerSecond;
   int64_t nanos = micros * kNanosecondsPerMicrosecond;
-  req.tv_sec = seconds;
-  req.tv_nsec = nanos;
+  req.tv_sec = static_cast<int32_t>(seconds);
+  req.tv_nsec = static_cast<long>(nanos);  // NOLINT (long used in timespec).
   while (true) {
     int r = nanosleep(&req, &rem);
     if (r == 0) {
diff --git a/runtime/vm/os_test.cc b/runtime/vm/os_test.cc
index ff577b4..d7239a6 100644
--- a/runtime/vm/os_test.cc
+++ b/runtime/vm/os_test.cc
@@ -51,7 +51,6 @@
   EXPECT(Utils::IsPowerOfTwo(OS::PreferredCodeAlignment()));
   int procs = OS::NumberOfAvailableProcessors();
   EXPECT_LE(1, procs);
-  EXPECT_LT(0U, OS::GetStackSizeLimit());
 }
 
 
diff --git a/runtime/vm/os_win.cc b/runtime/vm/os_win.cc
index bacec0e..9b8b25b 100644
--- a/runtime/vm/os_win.cc
+++ b/runtime/vm/os_win.cc
@@ -137,7 +137,7 @@
 }
 
 
-word OS::ActivationFrameAlignment() {
+intptr_t OS::ActivationFrameAlignment() {
 #ifdef _WIN64
   // Windows 64-bit ABI requires the stack to be 16-byte aligned.
   return 16;
@@ -148,20 +148,12 @@
 }
 
 
-word OS::PreferredCodeAlignment() {
+intptr_t OS::PreferredCodeAlignment() {
   ASSERT(32 <= OS::kMaxPreferredCodeAlignment);
   return 32;
 }
 
 
-uword OS::GetStackSizeLimit() {
-  // TODO(ager): Can you programatically determine the actual stack
-  // size limit on Windows? The 2MB limit is set at link time. Maybe
-  // that value should be propagated here?
-  return 2 * MB;
-}
-
-
 bool OS::AllowStackFrameIteratorFromAnotherThread() {
   return true;
 }
diff --git a/runtime/vm/port_test.cc b/runtime/vm/port_test.cc
index 56a74e6..26be6a3 100644
--- a/runtime/vm/port_test.cc
+++ b/runtime/vm/port_test.cc
@@ -45,7 +45,7 @@
 
 TEST_CASE(PortMap_CreateAndCloseOnePort) {
   PortTestMessageHandler handler;
-  intptr_t port = PortMap::CreatePort(&handler);
+  Dart_Port port = PortMap::CreatePort(&handler);
   EXPECT_NE(0, port);
   EXPECT(PortMapTestPeer::IsActivePort(port));
 
@@ -101,7 +101,7 @@
 
 TEST_CASE(PortMap_SetLive) {
   PortTestMessageHandler handler;
-  intptr_t port = PortMap::CreatePort(&handler);
+  Dart_Port port = PortMap::CreatePort(&handler);
   EXPECT_NE(0, port);
   EXPECT(PortMapTestPeer::IsActivePort(port));
   EXPECT(!PortMapTestPeer::IsLivePort(port));
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index a2dec35..cf0ff5e 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -173,22 +173,22 @@
     start_ = FLAG_trace_profiled_isolates ? OS::GetCurrentTimeMillis() : 0;
   }
 
-  intptr_t GetElapsed() const {
-    intptr_t end = OS::GetCurrentTimeMillis();
+  int64_t GetElapsed() const {
+    int64_t end = OS::GetCurrentTimeMillis();
     ASSERT(end >= start_);
     return end - start_;
   }
 
   ~ScopeStopwatch() {
     if (FLAG_trace_profiled_isolates) {
-      intptr_t elapsed = GetElapsed();
-      OS::Print("%s took %" Pd " millis.\n", name_, elapsed);
+      int64_t elapsed = GetElapsed();
+      OS::Print("%s took %" Pd64 " millis.\n", name_, elapsed);
     }
   }
 
  private:
   const char* name_;
-  intptr_t start_;
+  int64_t start_;
 };
 
 
@@ -1042,8 +1042,10 @@
     CreateTag(sample->vm_tag());
     // Make sure user tag is created.
     CreateUserTag(sample->user_tag());
-    // Exclusive tick for bottom frame.
-    Tick(sample->At(0), true, timestamp);
+    // Exclusive tick for bottom frame if we aren't sampled from an exit frame.
+    if (!sample->exit_frame_sample()) {
+      Tick(sample->At(0), true, timestamp);
+    }
     // Inclusive tick for all frames.
     for (intptr_t i = 0; i < FLAG_profile_depth; i++) {
       if (sample->At(i) == 0) {
@@ -1691,6 +1693,8 @@
       : sample_(sample),
         frame_iterator_(isolate) {
     ASSERT(sample_ != NULL);
+    // Mark that this sample was collected from an exit frame.
+    sample_->set_exit_frame_sample(true);
   }
 
   void walk() {
@@ -2055,13 +2059,13 @@
     // the native stack.
     if ((isolate->stub_code() != NULL) &&
         (isolate->top_exit_frame_info() != 0) &&
-        (isolate->vm_tag() != VMTag::kScriptTagId)) {
+        (isolate->vm_tag() != VMTag::kDartTagId)) {
       // We have a valid exit frame info, use the Dart stack walker.
       ProfilerDartExitStackWalker stackWalker(isolate, sample);
       stackWalker.walk();
     } else if ((isolate->stub_code() != NULL) &&
                (isolate->top_exit_frame_info() == 0) &&
-               (isolate->vm_tag() == VMTag::kScriptTagId)) {
+               (isolate->vm_tag() == VMTag::kDartTagId)) {
       // We are executing Dart code. We have frame pointers.
       ProfilerDartStackWalker stackWalker(isolate,
                                           sample,
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index 0f629c6..05e2576 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -241,6 +241,14 @@
     state_ = IgnoreBit::update(ignore_sample, state_);
   }
 
+  bool exit_frame_sample() const {
+    return ExitFrameBit::decode(state_);
+  }
+
+  void set_exit_frame_sample(bool exit_frame_sample) {
+    state_ = ExitFrameBit::update(exit_frame_sample, state_);
+  }
+
   static void InitOnce();
 
   static intptr_t instance_size() {
@@ -256,10 +264,12 @@
     kProcessedBit = 0,
     kLeafFrameIsDartBit = 1,
     kIgnoreBit = 2,
+    kExitFrameBit = 3,
   };
   class ProcessedBit : public BitField<bool, kProcessedBit, 1> {};
   class LeafFrameIsDart : public BitField<bool, kLeafFrameIsDartBit, 1> {};
   class IgnoreBit : public BitField<bool, kIgnoreBit, 1> {};
+  class ExitFrameBit : public BitField<bool, kExitFrameBit, 1> {};
 
   int64_t timestamp_;
   ThreadId tid_;
@@ -304,6 +314,10 @@
     const intptr_t length = capacity();
     for (intptr_t i = 0; i < length; i++) {
       Sample* sample = At(i);
+      if (sample->ignore_sample()) {
+        // Bad sample.
+        continue;
+      }
       if (sample->isolate() != visitor->isolate()) {
         // Another isolate.
         continue;
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index 3a5c751..b571174 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -773,6 +773,13 @@
 }
 
 
+intptr_t RawLinkedHashMap::VisitLinkedHashMapPointers(
+    RawLinkedHashMap* raw_obj, ObjectPointerVisitor* visitor) {
+  visitor->VisitPointers(raw_obj->from(), raw_obj->to());
+  return LinkedHashMap::InstanceSize();
+}
+
+
 intptr_t RawFloat32x4::VisitFloat32x4Pointers(
     RawFloat32x4* raw_obj,
     ObjectPointerVisitor* visitor) {
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 5529293..cf3ca12 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -72,6 +72,7 @@
     V(JSRegExp)                                                                \
     V(WeakProperty)                                                            \
     V(MirrorReference)                                                         \
+    V(LinkedHashMap)                                                         \
     V(UserTag)                                                                 \
 
 #define CLASS_LIST_ARRAYS(V)                                                   \
@@ -1498,6 +1499,7 @@
   friend class RawImmutableArray;
   friend class SnapshotReader;
   friend class GrowableObjectArray;
+  friend class LinkedHashMap;
   friend class Object;
   friend class ICData;  // For high performance access.
   friend class SubtypeTestCache;  // For high performance access.
@@ -1528,6 +1530,23 @@
 };
 
 
+class RawLinkedHashMap : public RawInstance {
+  RAW_HEAP_OBJECT_IMPLEMENTATION(LinkedHashMap);
+
+  RawObject** from() {
+    return reinterpret_cast<RawObject**>(&ptr()->type_arguments_);
+  }
+  RawTypeArguments* type_arguments_;
+  RawInstance* cme_mark_;
+  RawArray* data_;
+  RawObject** to() {
+    return reinterpret_cast<RawObject**>(&ptr()->data_);
+  }
+
+  friend class SnapshotReader;
+};
+
+
 class RawFloat32x4 : public RawInstance {
   RAW_HEAP_OBJECT_IMPLEMENTATION(Float32x4);
 
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index f311d34..94358f6 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -2163,11 +2163,11 @@
   reader->AddBackRef(object_id, &array, kIsDeserialized);
   intptr_t length = reader->ReadSmiValue();
   array.SetLength(length);
-  Array& contents = Array::Handle();
+  Array& contents = Array::Handle(reader->isolate());
   contents ^= reader->ReadObjectImpl();
   array.SetData(contents);
   const TypeArguments& type_arguments =
-      TypeArguments::Handle(contents.GetTypeArguments());
+      TypeArguments::Handle(reader->isolate(), contents.GetTypeArguments());
   array.SetTypeArguments(type_arguments);
   return array.raw();
 }
@@ -2193,6 +2193,56 @@
 }
 
 
+RawLinkedHashMap* LinkedHashMap::ReadFrom(SnapshotReader* reader,
+                                              intptr_t object_id,
+                                              intptr_t tags,
+                                              Snapshot::Kind kind) {
+  ASSERT(reader != NULL);
+
+  LinkedHashMap& map = LinkedHashMap::ZoneHandle(
+      reader->isolate(), LinkedHashMap::null());
+  if (kind == Snapshot::kFull || kind == Snapshot::kScript) {
+    // The immutable maps that seed map literals are not yet VM-internal, so
+    // we don't reach this.
+    UNREACHABLE();
+  } else {
+    map = LinkedHashMap::New(HEAP_SPACE(kind));
+  }
+  reader->AddBackRef(object_id, &map, kIsDeserialized);
+  Array& contents = Array::Handle(reader->isolate());
+  contents ^= reader->ReadObjectImpl();
+  map.SetData(contents);
+  const TypeArguments& type_arguments =
+      TypeArguments::Handle(reader->isolate(), contents.GetTypeArguments());
+  map.SetTypeArguments(type_arguments);
+  return map.raw();
+}
+
+
+void RawLinkedHashMap::WriteTo(SnapshotWriter* writer,
+                                 intptr_t object_id,
+                                 Snapshot::Kind kind) {
+  if (kind == Snapshot::kFull || kind == Snapshot::kScript) {
+    // The immutable maps that seed map literals are not yet VM-internal, so
+    // we don't reach this.
+    UNREACHABLE();
+  }
+  ASSERT(writer != NULL);
+
+  // Write out the serialization header value for this object.
+  writer->WriteInlinedObjectHeader(object_id);
+
+  // Write out the class and tags information.
+  writer->WriteIndexedObject(kLinkedHashMapCid);
+  writer->WriteTags(writer->GetObjectTags(this));
+
+  // Write out the backing array.
+  // TODO(koda): Serialize as pairs (like ToArray) instead, to reduce space and
+  // support per-isolate salted hash codes.
+  writer->WriteObjectImpl(ptr()->data_);
+}
+
+
 RawFloat32x4* Float32x4::ReadFrom(SnapshotReader* reader,
                                   intptr_t object_id,
                                   intptr_t tags,
diff --git a/runtime/vm/ring_buffer.h b/runtime/vm/ring_buffer.h
index aa0115d..e015930 100644
--- a/runtime/vm/ring_buffer.h
+++ b/runtime/vm/ring_buffer.h
@@ -27,7 +27,9 @@
   }
 
   // Returns the number of elements currently stored in this buffer (at most N).
-  int Size() const { return Utils::Minimum(count_, static_cast<int64_t>(N)); }
+  int64_t Size() const {
+    return Utils::Minimum(count_, static_cast<int64_t>(N));
+  }
 
  private:
   static const int kMask = N - 1;
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 5b7aee5f..1716b0c 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -368,7 +368,7 @@
       return;
     }
     // Setup arguments for call.
-    intptr_t port_id = isolate->main_port();
+    Dart_Port port_id = isolate->main_port();
     const Integer& port_int = Integer::Handle(Integer::New(port_id));
     ASSERT(!port_int.IsNull());
     const SendPort& send_port = SendPort::Handle(SendPort::New(port_id));
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index 619fee2..5dda706 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -3714,7 +3714,7 @@
   set_register(SP, static_cast<int32_t>(sp));
   set_register(FP, static_cast<int32_t>(fp));
   // Set the tag.
-  isolate->set_vm_tag(VMTag::kScriptTagId);
+  isolate->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   isolate->set_top_exit_frame_info(0);
 
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index f9339c5..649a1f7 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -3049,7 +3049,7 @@
   set_register(NULL, SP, static_cast<int64_t>(sp));
   set_register(NULL, FP, static_cast<int64_t>(fp));
   // Set the tag.
-  isolate->set_vm_tag(VMTag::kScriptTagId);
+  isolate->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   isolate->set_top_exit_frame_info(0);
 
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index b0f7d5f..36019a0 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -2240,7 +2240,7 @@
   set_register(SP, static_cast<int32_t>(sp));
   set_register(FP, static_cast<int32_t>(fp));
   // Set the tag.
-  isolate->set_vm_tag(VMTag::kScriptTagId);
+  isolate->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   isolate->set_top_exit_frame_info(0);
 
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index c070c31..dd1c050 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -226,7 +226,8 @@
   if ((value & kSmiTagMask) == kSmiTag) {
     return NewInteger(value);
   }
-  return ReadObjectImpl(value);
+  ASSERT((value <= kIntptrMax) && (value >= kIntptrMin));
+  return ReadObjectImpl(static_cast<intptr_t>(value));
 }
 
 
@@ -236,7 +237,6 @@
 
 
 RawObject* SnapshotReader::ReadObjectImpl(intptr_t header_value) {
-  ASSERT((header_value <= kIntptrMax) && (header_value >= kIntptrMin));
   if (IsVMIsolateObject(header_value)) {
     return ReadVMIsolateObject(header_value);
   } else {
@@ -259,13 +259,14 @@
     return NewInteger(header_value);
   }
   ASSERT((header_value <= kIntptrMax) && (header_value >= kIntptrMin));
-  if (IsVMIsolateObject(header_value)) {
-    return ReadVMIsolateObject(header_value);
-  } else if (SerializedHeaderTag::decode(header_value) == kObjectId) {
-    return ReadIndexedObject(SerializedHeaderData::decode(header_value));
+  intptr_t value = static_cast<intptr_t>(header_value);
+  if (IsVMIsolateObject(value)) {
+    return ReadVMIsolateObject(value);
+  } else if (SerializedHeaderTag::decode(value) == kObjectId) {
+    return ReadIndexedObject(SerializedHeaderData::decode(value));
   }
-  ASSERT(SerializedHeaderTag::decode(header_value) == kInlined);
-  intptr_t object_id = SerializedHeaderData::decode(header_value);
+  ASSERT(SerializedHeaderTag::decode(value) == kInlined);
+  intptr_t object_id = SerializedHeaderData::decode(value);
   if (object_id == kOmittedObjectId) {
     object_id = NextAvailableObjectId();
   }
@@ -705,8 +706,8 @@
 RawObject* SnapshotReader::NewInteger(int64_t value) {
   ASSERT((value & kSmiTagMask) == kSmiTag);
   value = value >> kSmiTagShift;
-  if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) {
-    return Smi::New(value);
+  if (Smi::IsValid(value)) {
+    return Smi::New(static_cast<intptr_t>(value));
   }
   if (kind_ == Snapshot::kFull) {
     return NewMint(value);
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index b5f8f44..0d5d54f 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -42,6 +42,7 @@
 class RawRedirectionData;
 class RawFunction;
 class RawGrowableObjectArray;
+class RawLinkedHashMap;
 class RawFloat32x4;
 class RawFloat64x2;
 class RawInt32x4;
@@ -141,7 +142,7 @@
 
   // Getters.
   const uint8_t* content() const { return content_; }
-  int64_t length() const { return length_; }
+  intptr_t length() const { return static_cast<intptr_t>(length_); }
   Kind kind() const { return static_cast<Kind>(kind_); }
 
   bool IsMessageSnapshot() const { return kind_ == kMessage; }
@@ -376,6 +377,7 @@
   friend class RedirectionData;
   friend class Function;
   friend class GrowableObjectArray;
+  friend class LinkedHashMap;
   friend class ImmutableArray;
   friend class JSRegExp;
   friend class LanguageError;
@@ -613,6 +615,7 @@
   friend class RawClass;
   friend class RawClosureData;
   friend class RawGrowableObjectArray;
+  friend class RawLinkedHashMap;
   friend class RawImmutableArray;
   friend class RawJSRegExp;
   friend class RawLibrary;
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 6db2aaf..fddf7f9 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -64,7 +64,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset());
-    __ CompareImmediate(R6, VMTag::kScriptTagId);
+    __ CompareImmediate(R6, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -102,7 +102,7 @@
   __ blx(R5);
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(R2, VMTag::kScriptTagId);
+  __ LoadImmediate(R2, VMTag::kDartTagId);
   __ StoreToOffset(kWord, R2, CTX, Isolate::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
@@ -178,7 +178,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset());
-    __ CompareImmediate(R6, VMTag::kScriptTagId);
+    __ CompareImmediate(R6, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -229,7 +229,7 @@
 #endif
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(R2, VMTag::kScriptTagId);
+  __ LoadImmediate(R2, VMTag::kDartTagId);
   __ StoreToOffset(kWord, R2, CTX, Isolate::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
@@ -286,7 +286,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(kWord, R6, CTX, Isolate::vm_tag_offset());
-    __ CompareImmediate(R6, VMTag::kScriptTagId);
+    __ CompareImmediate(R6, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -328,7 +328,7 @@
   __ blx(R5);
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(R2, VMTag::kScriptTagId);
+  __ LoadImmediate(R2, VMTag::kDartTagId);
   __ StoreToOffset(kWord, R2, CTX, Isolate::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
@@ -757,7 +757,7 @@
   __ Push(R5);
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(R5, VMTag::kScriptTagId);
+  __ LoadImmediate(R5, VMTag::kDartTagId);
   __ StoreToOffset(kWord, R5, R8, Isolate::vm_tag_offset());
 
   // Save the top exit frame info. Use R5 as a temporary register.
@@ -1720,7 +1720,7 @@
   __ mov(FP, Operand(R2));  // Frame_pointer.
   __ mov(SP, Operand(IP));  // Set Stack pointer.
   // Set the tag.
-  __ LoadImmediate(R2, VMTag::kScriptTagId);
+  __ LoadImmediate(R2, VMTag::kDartTagId);
   __ StoreToOffset(kWord, R2, R3, Isolate::vm_tag_offset());
   // Clear top exit frame.
   __ LoadImmediate(R2, 0);
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index 6ccef25..4331fce 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -63,7 +63,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(R8, R0, Isolate::vm_tag_offset(), kNoPP);
-    __ CompareImmediate(R8, VMTag::kScriptTagId, kNoPP);
+    __ CompareImmediate(R8, VMTag::kDartTagId, kNoPP);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -122,7 +122,7 @@
 
   // Retval is next to 1st argument.
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(R2, VMTag::kScriptTagId, kNoPP);
+  __ LoadImmediate(R2, VMTag::kDartTagId, kNoPP);
   __ StoreToOffset(R2, CTX, Isolate::vm_tag_offset(), kNoPP);
 
   // Reset exit frame information in Isolate structure.
@@ -181,7 +181,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(R6, CTX, Isolate::vm_tag_offset(), kNoPP);
-    __ CompareImmediate(R6, VMTag::kScriptTagId, kNoPP);
+    __ CompareImmediate(R6, VMTag::kDartTagId, kNoPP);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -246,7 +246,7 @@
   __ mov(CSP, R26);
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(R2, VMTag::kScriptTagId, kNoPP);
+  __ LoadImmediate(R2, VMTag::kDartTagId, kNoPP);
   __ StoreToOffset(R2, CTX, Isolate::vm_tag_offset(), kNoPP);
 
   // Reset exit frame information in Isolate structure.
@@ -298,7 +298,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ LoadFromOffset(R6, CTX, Isolate::vm_tag_offset(), kNoPP);
-    __ CompareImmediate(R6, VMTag::kScriptTagId, kNoPP);
+    __ CompareImmediate(R6, VMTag::kDartTagId, kNoPP);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -354,7 +354,7 @@
   __ mov(CSP, R26);
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(R2, VMTag::kScriptTagId, kNoPP);
+  __ LoadImmediate(R2, VMTag::kDartTagId, kNoPP);
   __ StoreToOffset(R2, CTX, Isolate::vm_tag_offset(), kNoPP);
 
   // Reset exit frame information in Isolate structure.
@@ -823,7 +823,7 @@
   __ Push(R4);
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(R6, VMTag::kScriptTagId, PP);
+  __ LoadImmediate(R6, VMTag::kDartTagId, PP);
   __ StoreToOffset(R6, R5, Isolate::vm_tag_offset(), PP);
 
   // Save the top exit frame info. Use R6 as a temporary register.
@@ -1830,7 +1830,7 @@
   __ mov(R0, R3);  // Exception object.
   __ mov(R1, R4);  // StackTrace object.
   // Set the tag.
-  __ LoadImmediate(R2, VMTag::kScriptTagId, kNoPP);
+  __ LoadImmediate(R2, VMTag::kDartTagId, kNoPP);
   __ StoreToOffset(R2, R5, Isolate::vm_tag_offset(), kNoPP);
   // Clear top exit frame.
   __ StoreToOffset(ZR, R5, Isolate::top_exit_frame_info_offset(), kNoPP);
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 0845ca8..407c555 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -77,7 +77,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ movl(EAX, Address(CTX, Isolate::vm_tag_offset()));
-    __ cmpl(EAX, Immediate(VMTag::kScriptTagId));
+    __ cmpl(EAX, Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -106,7 +106,7 @@
 
   // Mark that the isolate is executing Dart code.
   __ movl(Address(CTX, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movl(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0));
@@ -199,7 +199,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ movl(EDI, Address(CTX, Isolate::vm_tag_offset()));
-    __ cmpl(EDI, Immediate(VMTag::kScriptTagId));
+    __ cmpl(EDI, Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -231,7 +231,7 @@
 
   // Mark that the isolate is executing Dart code.
   __ movl(Address(CTX, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movl(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0));
@@ -303,7 +303,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ movl(EDI, Address(CTX, Isolate::vm_tag_offset()));
-    __ cmpl(EDI, Immediate(VMTag::kScriptTagId));
+    __ cmpl(EDI, Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
@@ -333,7 +333,7 @@
 
   // Mark that the isolate is executing Dart code.
   __ movl(Address(CTX, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movl(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0));
@@ -768,7 +768,7 @@
 
   // Mark that the isolate is executing Dart code.
   __ movl(Address(EDI, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
 
   // Save the top exit frame info. Use EDX as a temporary register.
   // StackFrameIterator reads the top exit frame info saved in this frame.
@@ -1798,7 +1798,7 @@
   __ movl(ESP, Address(ESP, 2 * kWordSize));  // Load target stack_pointer.
   // Set tag.
   __ movl(Address(EDI, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
   // Clear top exit frame.
   __ movl(Address(EDI, Isolate::top_exit_frame_info_offset()), Immediate(0));
   __ jmp(EBX);  // Jump to the exception handler code.
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index db6ca35..c28eae6 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -67,7 +67,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ lw(T0, Address(A0, Isolate::vm_tag_offset()));
-    __ BranchEqual(T0, VMTag::kScriptTagId, &ok);
+    __ BranchEqual(T0, VMTag::kDartTagId, &ok);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
@@ -111,7 +111,7 @@
   __ TraceSimMsg("CallToRuntimeStub return");
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(A2, VMTag::kScriptTagId);
+  __ LoadImmediate(A2, VMTag::kDartTagId);
   __ sw(A2, Address(CTX, Isolate::vm_tag_offset()));
 
   // Reset exit frame information in Isolate structure.
@@ -193,7 +193,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ lw(T0, Address(A0, Isolate::vm_tag_offset()));
-    __ BranchEqual(T0, VMTag::kScriptTagId, &ok);
+    __ BranchEqual(T0, VMTag::kDartTagId, &ok);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
@@ -245,7 +245,7 @@
   __ TraceSimMsg("CallNativeCFunctionStub return");
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(A2, VMTag::kScriptTagId);
+  __ LoadImmediate(A2, VMTag::kDartTagId);
   __ sw(A2, Address(CTX, Isolate::vm_tag_offset()));
 
   // Reset exit frame information in Isolate structure.
@@ -308,7 +308,7 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ lw(T0, Address(A0, Isolate::vm_tag_offset()));
-    __ BranchEqual(T0, VMTag::kScriptTagId, &ok);
+    __ BranchEqual(T0, VMTag::kDartTagId, &ok);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
@@ -355,7 +355,7 @@
   __ TraceSimMsg("CallNativeCFunctionStub return");
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(A2, VMTag::kScriptTagId);
+  __ LoadImmediate(A2, VMTag::kDartTagId);
   __ sw(A2, Address(CTX, Isolate::vm_tag_offset()));
 
   // Reset exit frame information in Isolate structure.
@@ -862,7 +862,7 @@
   __ sw(T1, Address(SP, 2 * kWordSize));
 
   // Mark that the isolate is executing Dart code.
-  __ LoadImmediate(T0, VMTag::kScriptTagId);
+  __ LoadImmediate(T0, VMTag::kDartTagId);
   __ sw(T0, Address(T2, Isolate::vm_tag_offset()));
 
   // Save the top exit frame info. Use T0 as a temporary register.
@@ -1941,7 +1941,7 @@
   __ mov(FP, A2);  // Frame_pointer.
   __ lw(A3, Address(SP, 5 * kWordSize));  // Isolate.
   // Set tag.
-  __ LoadImmediate(A2, VMTag::kScriptTagId);
+  __ LoadImmediate(A2, VMTag::kDartTagId);
   __ sw(A2, Address(A3, Isolate::vm_tag_offset()));
   // Clear top exit frame.
   __ sw(ZR, Address(A3, Isolate::top_exit_frame_info_offset()));
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index a931ca9..c5456fd 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -62,7 +62,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ movq(RAX, Immediate(VMTag::kScriptTagId));
+    __ movq(RAX, Immediate(VMTag::kDartTagId));
     __ cmpq(RAX, Address(CTX, Isolate::vm_tag_offset()));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
@@ -96,7 +96,7 @@
 
   // Mark that the isolate is executing Dart code.
   __ movq(Address(CTX, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movq(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0));
@@ -174,7 +174,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ movq(R8, Immediate(VMTag::kScriptTagId));
+    __ movq(R8, Immediate(VMTag::kDartTagId));
     __ cmpq(R8, Address(CTX, Isolate::vm_tag_offset()));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
@@ -208,7 +208,7 @@
 
   // Mark that the isolate is executing Dart code.
   __ movq(Address(CTX, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movq(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0));
@@ -263,7 +263,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ movq(R8, Immediate(VMTag::kScriptTagId));
+    __ movq(R8, Immediate(VMTag::kDartTagId));
     __ cmpq(R8, Address(CTX, Isolate::vm_tag_offset()));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
@@ -295,7 +295,7 @@
 
   // Mark that the isolate is executing Dart code.
   __ movq(Address(CTX, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movq(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0));
@@ -750,7 +750,7 @@
 
   // Mark that the isolate is executing Dart code.
   __ movq(Address(kIsolateReg, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
 
   // Save the top exit frame info. Use RAX as a temporary register.
   // StackFrameIterator reads the top exit frame info saved in this frame.
@@ -1774,7 +1774,7 @@
   __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg);
   // Set the tag.
   __ movq(Address(isolate_reg, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kScriptTagId));
+          Immediate(VMTag::kDartTagId));
   // Clear top exit frame.
   __ movq(Address(isolate_reg, Isolate::top_exit_frame_info_offset()),
           Immediate(0));
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index 21253ab..395eca0 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -126,6 +126,7 @@
   V(_GrowableListFactory, "_GrowableList.")                                    \
   V(_GrowableListWithData, "_GrowableList.withData")                           \
   V(_ImmutableList, "_ImmutableList")                                          \
+  V(_LinkedHashMap, "_InternalLinkedHashMap")                                  \
   V(_String, "String")                                                         \
   V(OneByteString, "_OneByteString")                                           \
   V(TwoByteString, "_TwoByteString")                                           \
diff --git a/runtime/vm/tags.h b/runtime/vm/tags.h
index d8644b9..f2288b3 100644
--- a/runtime/vm/tags.h
+++ b/runtime/vm/tags.h
@@ -20,7 +20,7 @@
   V(CompileUnoptimized)                                                        \
   V(CompileTopLevel)                                                           \
   V(CompileScanner)                                                            \
-  V(Script)                                                                    \
+  V(Dart)                                                                      \
   V(GCNewSpace)                                                                \
   V(GCOldSpace)                                                                \
   V(Runtime)                                                                   \
diff --git a/sdk/bin/docgen b/sdk/bin/docgen
index db0c6af..b5795d0 100755
--- a/sdk/bin/docgen
+++ b/sdk/bin/docgen
@@ -24,9 +24,9 @@
 
 SNAPSHOT="$BIN_DIR/snapshots/utils_wrapper.dart.snapshot"
 
-if test -f $SNAPSHOT; then
+if test -f "$SNAPSHOT"; then
   exec "$BIN_DIR"/dart \
-      "--package-root=$BIN_DIR/../packages/" $SNAPSHOT \
+      "--package-root=$BIN_DIR/../packages/" "$SNAPSHOT" \
       docgen "--sdk=$SDK_DIR" "$@"
 else
   exec "$BIN_DIR"/dart \
diff --git a/sdk/lib/_internal/compiler/implementation/closure.dart b/sdk/lib/_internal/compiler/implementation/closure.dart
index 54ad643..1661366 100644
--- a/sdk/lib/_internal/compiler/implementation/closure.dart
+++ b/sdk/lib/_internal/compiler/implementation/closure.dart
@@ -644,7 +644,7 @@
   }
 
   visitTypeAnnotation(TypeAnnotation node) {
-    Element member = executableContext.enclosingMember;
+    MemberElement member = executableContext.memberContext;
     DartType type = elements.getType(node);
     // TODO(karlklose,johnniwinther): if the type is null, the annotation is
     // from a parameter which has been analyzed before the method has been
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
index 64bd682..d02c786 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_builder.dart
@@ -775,8 +775,9 @@
           add(new ir.LetPrim(initialValue));
         }
         if (isClosureVariable(element)) {
-          add(new ir.SetClosureVariable(element, initialValue,
-                                          isDeclaration: true));
+          LocalElement local = element;
+          add(new ir.SetClosureVariable(local, initialValue,
+                                        isDeclaration: true));
         } else {
           // In case a primitive was introduced for the initializer expression,
           // use this variable element to help derive a good name for it.
@@ -1018,7 +1019,8 @@
     if (element == null) {
       closureTarget = visit(node.selector);
     } else if (isClosureVariable(element)) {
-      closureTarget = new ir.GetClosureVariable(element);
+      LocalElement local = element;
+      closureTarget = new ir.GetClosureVariable(local);
       add(new ir.LetPrim(closureTarget));
     } else {
       assert(Elements.isLocal(element));
@@ -1072,7 +1074,8 @@
       // Reference to constant local, top-level or static field
       result = translateConstant(node);
     } else if (isClosureVariable(element)) {
-      result = new ir.GetClosureVariable(element);
+      LocalElement local = element;
+      result = new ir.GetClosureVariable(local);
       add(new ir.LetPrim(result));
     } else if (Elements.isLocal(element)) {
       // Reference to local variable
@@ -1324,6 +1327,8 @@
   /// True if [element] is a local variable, local function, or parameter that
   /// is accessed from an inner function. Recursive self-references in a local
   /// function count as closure accesses.
+  ///
+  /// If `true`, [element] is a [LocalElement].
   bool isClosureVariable(Element element) {
     return closureLocals.isClosureVariable(element);
   }
@@ -1390,7 +1395,8 @@
 
     // Set the value
     if (isClosureVariable(element)) {
-      add(new ir.SetClosureVariable(element, valueToStore));
+      LocalElement local = element;
+      add(new ir.SetClosureVariable(local, valueToStore));
     } else if (Elements.isLocal(element)) {
       valueToStore.useElementAsHint(element);
       assignedVars[variableIndex[element]] = valueToStore;
@@ -1481,7 +1487,7 @@
   }
 
   ir.Primitive visitFunctionDeclaration(ast.FunctionDeclaration node) {
-    FunctionElement element = elements[node.function];
+    LocalFunctionElement element = elements[node.function];
     ir.FunctionDefinition inner = makeSubFunction(node.function);
     if (isClosureVariable(element)) {
       add(new ir.DeclareFunction(element, inner));
@@ -1683,13 +1689,13 @@
   DetectClosureVariables(this.elements);
 
   FunctionElement currentFunction;
-  Set<Element> usedFromClosure = new Set<Element>();
+  Set<Local> usedFromClosure = new Set<Local>();
   Set<FunctionElement> recursiveFunctions = new Set<FunctionElement>();
 
-  bool isClosureVariable(Element element) => usedFromClosure.contains(element);
+  bool isClosureVariable(Entity entity) => usedFromClosure.contains(entity);
 
-  void markAsClosureVariable(Element element) {
-    usedFromClosure.add(element);
+  void markAsClosureVariable(Local local) {
+    usedFromClosure.add(local);
   }
 
   visit(ast.Node node) => node.accept(this);
@@ -1703,7 +1709,8 @@
     if (Elements.isLocal(element) &&
         !element.isConst &&
         element.enclosingElement != currentFunction) {
-      markAsClosureVariable(element);
+      LocalElement local = element;
+      markAsClosureVariable(local);
     }
     node.visitChildren(this);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart
index 0d92855..3d816c4 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart
@@ -272,7 +272,7 @@
 }
 
 /// Gets the value from a closure variable. The identity of the variable is
-/// determined by an [Element].
+/// determined by a [Local].
 ///
 /// Closure variables can be seen as ref cells that are not first-class values.
 /// A [LetPrim] with a [GetClosureVariable] can then be seen as:
@@ -280,7 +280,7 @@
 ///   let prim p = ![variable] in [body]
 ///
 class GetClosureVariable extends Primitive {
-  final Element variable;
+  final Local variable;
 
   GetClosureVariable(this.variable) {
     assert(variable != null);
@@ -290,7 +290,7 @@
 }
 
 /// Assign or declare a closure variable. The identity of the variable is
-/// determined by an [Element].
+/// determined by a [Local].
 ///
 /// Closure variables can be seen as ref cells that are not first-class values.
 /// If [isDeclaration], this can seen as a let binding:
@@ -304,7 +304,7 @@
 /// Closure variables without a declaring [SetClosureVariable] are implicitly
 /// declared at the entry to the [variable]'s enclosing function.
 class SetClosureVariable extends Expression {
-  final Element variable;
+  final Local variable;
   final Reference value;
   Expression body;
 
@@ -317,7 +317,7 @@
   final bool isDeclaration;
 
   SetClosureVariable(this.variable, Primitive value,
-                      {this.isDeclaration : false })
+                     {this.isDeclaration : false })
       : this.value = new Reference(value) {
     assert(variable != null);
   }
@@ -339,7 +339,7 @@
 ///   let rec [variable] = [definition] in [body]
 ///
 class DeclareFunction extends Expression {
-  final Element variable;
+  final Local variable;
   final FunctionDefinition definition;
   Expression body;
 
@@ -502,7 +502,7 @@
 }
 
 List<Reference> _referenceList(List<Definition> definitions) {
-  return definitions.map((e) => new Reference(e)).toList(growable: false);
+  return definitions.map((e) => new Reference(e)).toList();
 }
 
 abstract class Visitor<T> {
@@ -546,6 +546,74 @@
   T visitIsTrue(IsTrue node) => visitCondition(node);
 }
 
+abstract class RecursiveVisitor extends Visitor {
+  // Ensures that RecursiveVisitor contains overrides for all relevant nodes.
+  // As a rule of thumb, nodes with structure to traverse should be overridden
+  // with the appropriate visits in this class (for example, visitLetCont),
+  // while leaving other nodes for subclasses (i.e., visitLiteralList).
+  visitNode(Node node) {
+    throw "RecursiveVisitor is stale, add missing visit overrides";
+  }
+
+  visitFunctionDefinition(FunctionDefinition node) {
+    visit(node.body);
+  }
+
+  // Expressions.
+
+  visitLetPrim(LetPrim node) {
+    visit(node.primitive);
+    visit(node.body);
+  }
+
+  visitLetCont(LetCont node) {
+    visit(node.continuation.body);
+    visit(node.body);
+  }
+
+  visitInvokeStatic(InvokeStatic node) => null;
+  visitInvokeContinuation(InvokeContinuation node) => null;
+  visitInvokeMethod(InvokeMethod node) => null;
+  visitInvokeSuperMethod(InvokeSuperMethod node) => null;
+  visitInvokeConstructor(InvokeConstructor node) => null;
+  visitConcatenateStrings(ConcatenateStrings node) => null;
+
+  visitBranch(Branch node) {
+    visit(node.condition);
+  }
+
+  visitTypeOperator(TypeOperator node) => null;
+
+  visitSetClosureVariable(SetClosureVariable node) {
+    visit(node.body);
+  }
+
+  visitDeclareFunction(DeclareFunction node) {
+    visit(node.definition);
+    visit(node.body);
+  }
+
+  // Definitions.
+
+  visitLiteralList(LiteralList node) => null;
+  visitLiteralMap(LiteralMap node) => null;
+  visitConstant(Constant node) => null;
+  visitThis(This node) => null;
+  visitReifyTypeVar(ReifyTypeVar node) => null;
+
+  visitCreateFunction(CreateFunction node) {
+    visit(node.definition);
+  }
+
+  visitGetClosureVariable(GetClosureVariable node) => null;
+  visitParameter(Parameter node) => null;
+  visitContinuation(Continuation node) => null;
+
+  // Conditions.
+
+  visitIsTrue(IsTrue node) => null;
+}
+
 /// Keeps track of currently unused register indices.
 class RegisterArray {
   int nextIndex = 0;
@@ -711,3 +779,127 @@
   }
 
 }
+
+/// Eliminate redundant phis from the given [FunctionDefinition].
+///
+/// Phis in this case are [Continuations] together with corresponding
+/// [InvokeContinuation]s. A [Continuation] parameter at position i is redundant
+/// if for all [InvokeContinuation]s, the parameter at position i is identical
+/// (except for feedback). Redundant parameters are removed from the
+/// continuation signature, all invocations, and replaced within the
+/// continuation body.
+class RedundantPhiEliminator extends RecursiveVisitor {
+  final Map<Continuation, List<InvokeContinuation>> cont2invokes =
+      <Continuation, List<InvokeContinuation>>{};
+  // For each reference r used in a continuation invocation i, stores the
+  // corresponding continuation i.continuation. If required by other passes,
+  // we could consider adding parent pointers to references instead.
+  final Map<Reference, Continuation> ref2cont = <Reference, Continuation>{};
+  final Set<Continuation> workSet = new Set<Continuation>();
+
+  void rewrite(final FunctionDefinition root) {
+    // Traverse the tree once to build the work set.
+    visit(root);
+    workSet.addAll(cont2invokes.keys);
+
+    // Process each continuation one-by-one.
+    while (workSet.isNotEmpty) {
+      Continuation cont = workSet.first;
+      workSet.remove(cont);
+
+      if (cont.body == null) {
+        continue; // Skip function return continuations.
+      }
+
+      List<InvokeContinuation> invokes = cont2invokes[cont];
+      assert(invokes != null);
+
+      _processContinuation(cont, invokes);
+    }
+  }
+
+  /// Called for each continuation on the work set, together with its
+  /// invocations.
+  void _processContinuation(Continuation cont,
+                            List<InvokeContinuation> invokes) {
+    /// Returns the unique definition of parameter i if it exists and null
+    /// otherwise. A definition is unique if it is the only value used to
+    /// invoke the continuation, excluding feedback.
+    Definition uniqueDefinitionOf(int i) {
+      Definition value = null;
+      for (InvokeContinuation invoke in invokes) {
+        Definition def = invoke.arguments[i].definition;
+
+        if (cont.parameters[i] == def) {
+          // Invocation param == param in LetCont (i.e. a recursive call).
+          continue;
+        } else if (value == null) {
+          value = def; // Set initial comparison value.
+        } else if (value != def) {
+          return null; // Differing invocation arguments.
+        }
+      }
+
+      return value;
+    }
+
+    // Check if individual parameters are always called with a unique
+    // definition, and remove them if that is the case. During each iteration,
+    // we read the current parameter/argument from index `src` and copy it
+    // to index `dst`.
+    int dst = 0;
+    for (int src = 0; src < cont.parameters.length; src++) {
+      // Is the current phi redundant?
+      Definition uniqueDefinition = uniqueDefinitionOf(src);
+      if (uniqueDefinition == null) {
+        // Reorganize parameters and arguments in case of deletions.
+        cont.parameters[dst] = cont.parameters[src];
+        for (InvokeContinuation invoke in invokes) {
+            invoke.arguments[dst] = invoke.arguments[src];
+        }
+
+        dst++;
+        continue;
+      }
+
+      Definition oldDefinition = cont.parameters[src];
+
+      // Add continuations of about-to-be modified invokes to worklist since
+      // we might introduce new optimization opportunities.
+      for (Reference ref = oldDefinition.firstRef; ref != null;
+           ref = ref.nextRef) {
+        Continuation thatCont = ref2cont[ref];
+        // thatCont is null if ref does not belong to a continuation invocation.
+        if (thatCont != null && thatCont != cont) {
+          workSet.add(thatCont);
+        }
+      }
+
+      // Replace individual parameters:
+      // * In the continuation body, replace occurrence of param with value,
+      // * and implicitly remove param from continuation signature and
+      //   invocations by not incrementing `dst`.
+      uniqueDefinition.substituteFor(oldDefinition);
+    }
+
+    // Remove trailing items from parameter and argument lists.
+    cont.parameters.length = dst;
+    for (InvokeContinuation invoke in invokes) {
+      invoke.arguments.length = dst;
+    }
+  }
+
+  void visitInvokeContinuation(InvokeContinuation node) {
+    // Update the continuation map.
+    Continuation cont = node.continuation.definition;
+    assert(cont != null);
+    cont2invokes.putIfAbsent(cont, () => <InvokeContinuation>[])
+        .add(node);
+
+    // And the reference map.
+    node.arguments.forEach((Reference ref) {
+      assert(!ref2cont.containsKey(ref));
+      ref2cont[ref] = node.continuation.definition;
+    });
+  }
+}
diff --git a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart
index c0af4ae..967088c 100644
--- a/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart
+++ b/sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart
@@ -20,6 +20,7 @@
   String newContinuationName() => 'k${_continuationCounter++}';
 
   String visitFunctionDefinition(FunctionDefinition node) {
+    String name = node.element.name;
     names[node.returnContinuation] = 'return';
     String parameters = node.parameters
         .map((Parameter p) {
@@ -28,7 +29,8 @@
           return name;
         })
         .join(' ');
-    return '(FunctionDefinition ($parameters return) ${visit(node.body)})';
+    String body = visit(node.body);
+    return '(FunctionDefinition $name ($parameters return) $body)';
   }
 
   String visitLetPrim(LetPrim node) {
@@ -137,7 +139,7 @@
 
   String visitCreateFunction(CreateFunction node) {
     String function = visit(node.definition);
-    return '(CreateFunction ${node.definition.element} $function)';
+    return '(CreateFunction $function)';
   }
 
   String visitParameter(Parameter node) {
@@ -180,7 +182,7 @@
   String visitDeclareFunction(DeclareFunction node) {
     String function = visit(node.definition);
     String body = visit(node.body);
-    return '(DeclareFunction ${node.variable} = $function in $body)';
+    return '(DeclareFunction ${node.variable.name} = $function in $body)';
   }
 
   String visitIsTrue(IsTrue node) {
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
index e71cb71..f761f63 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
@@ -231,6 +231,8 @@
         return new ElementAst(element);
       } else {
         cps_ir.FunctionDefinition function = compiler.irBuilder.getIr(element);
+        new cps_ir.RedundantPhiEliminator().rewrite(function);
+        compiler.tracer.traceGraph("Redundant phi elimination", function);
         tree_builder.Builder builder = new tree_builder.Builder(compiler);
         tree_ir.FunctionDefinition definition = builder.build(function);
         assert(definition != null);
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_emitter.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_emitter.dart
index c2d2a33..513b68d 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_emitter.dart
@@ -146,7 +146,7 @@
     }
   }
 
-  Parameter emitParameterFromElement(ParameterElement element, [String name]) {
+  Parameter emitParameterFromElement(FormalElement element, [String name]) {
     if (name == null) {
       name = element.name;
     }
@@ -285,11 +285,10 @@
     // Synthesize an element for the variable
     if (variable.element == null || name != variable.element.name) {
       // TODO(johnniwinther): Replace by synthetic [Entity].
-      variable.element = new modelx.LocalVariableElementX(
+      variable.element = new modelx.LocalVariableElementX.synthetic(
           name,
           functionElement,
-          variableList,
-          null);
+          variableList);
     }
     return name;
   }
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_nodes.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_nodes.dart
index 527ef26..2733720 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/backend_ast_nodes.dart
@@ -278,7 +278,7 @@
   /// Parameters to function parameter. Null for non-function parameters.
   final Parameters parameters;
 
-  elements.ParameterElement element;
+  elements.FormalElement element;
 
   Parameter(this.name, {this.type, this.defaultValue})
       : parameters = null;
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_builder.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_builder.dart
index faab874..2e12220 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_builder.dart
@@ -49,8 +49,8 @@
       <Element,List<Variable>>{};
 
   /// Like [element2variables], except for closure variables. Closure variables
-  /// are not subject to SSA, so at most one variable is used per element.
-  final Map<Element, Variable> element2closure = <Element, Variable>{};
+  /// are not subject to SSA, so at most one variable is used per local.
+  final Map<Local, Variable> local2closure = <Local, Variable>{};
 
   // Continuations with more than one use are replaced with Tree labels.  This
   // is the mapping from continuations to labels.
@@ -71,14 +71,14 @@
   /// variables.
   Variable phiTempVar;
 
-  Variable getClosureVariable(Element element) {
-    if (element.enclosingElement != function.element) {
-      return parent.getClosureVariable(element);
+  Variable getClosureVariable(Local local) {
+    if (local.executableContext != function.element) {
+      return parent.getClosureVariable(local);
     }
-    Variable variable = element2closure[element];
+    Variable variable = local2closure[local];
     if (variable == null) {
-      variable = new Variable(function, element);
-      element2closure[element] = variable;
+      variable = new Variable(function, local);
+      local2closure[local] = variable;
     }
     return variable;
   }
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_nodes.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_nodes.dart
index 27acff6..04da473 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_nodes.dart
@@ -89,9 +89,9 @@
   /// Function that declares this variable.
   FunctionDefinition host;
 
-  /// Element used for synthesizing a name for the variable.
-  /// Different variables may have the same element. May be null.
-  Element element;
+  /// [Entity] used for synthesizing a name for the variable.
+  /// Different variables may have the same entity. May be null.
+  Entity element;
 
   int readCount = 0;
 
diff --git a/sdk/lib/_internal/compiler/implementation/deferred_load.dart b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
index 87cd4ed..310799a 100644
--- a/sdk/lib/_internal/compiler/implementation/deferred_load.dart
+++ b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
@@ -175,6 +175,15 @@
 
     element = element.implementation;
     while (!_elementToOutputUnit.containsKey(element)) {
+      // Hack: it looks like we output annotation constants for classes that we
+      // don't include in the output. This seems to happen when we have
+      // reflection but can see that some classes are not needed. We still add
+      // the annotation but don't run through it below (where we assign every
+      // element to its output unit).
+      if (element.enclosingElement == null) {
+        _elementToOutputUnit[element] = mainOutputUnit;
+        break;
+      }
       element = element.enclosingElement.implementation;
     }
     return _elementToOutputUnit[element];
@@ -333,7 +342,6 @@
       for (Element dependency in treeElements.allElements) {
         if (Elements.isLocal(dependency) && !dependency.isFunction) continue;
         if (dependency.isErroneous) continue;
-        if (dependency.isStatement) continue;
         if (dependency.isTypeVariable) continue;
 
         elements.add(dependency);
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index 8246b93..cb0f3c8 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -112,11 +112,6 @@
   static const ElementKind TYPEDEF =
       const ElementKind('typedef', ElementCategory.ALIAS);
 
-  static const ElementKind STATEMENT =
-      const ElementKind('statement', ElementCategory.NONE);
-  static const ElementKind LABEL =
-      const ElementKind('label', ElementCategory.NONE);
-
   static const ElementKind AMBIGUOUS =
       const ElementKind('ambiguous', ElementCategory.NONE);
   static const ElementKind WARN_ON_USE =
@@ -283,19 +278,29 @@
   /// is a formal of the form `this.foo`.
   bool get isInitializingFormal => kind == ElementKind.INITIALIZING_FORMAL;
 
-  bool get isStatement;
+  /// `true` if this element represents a resolution error.
+  bool get isErroneous => kind == ElementKind.ERROR;
 
-  bool get isErroneous;
-  bool get isAmbiguous;
-  bool get isWarnOnUse;
+  /// `true` if this element represents an ambiguous name.
+  ///
+  /// Ambiguous names occur when two imports/exports contain different entities
+  /// by the same name. If an ambiguous name is resolved an warning or error
+  /// is produced.
+  bool get isAmbiguous => kind == ElementKind.AMBIGUOUS;
+
+  /// `true` if this element represents an entity whose access causes one or
+  /// more warnings.
+  bool get isWarnOnUse => kind == ElementKind.WARN_ON_USE;
 
   bool get isClosure;
 
   /// `true` if the element is a (static or instance) member of a class.
+  ///
   /// Members are constructors, methods and fields.
   bool get isClassMember;
 
   /// `true` if the element is a nonstatic member of a class.
+  ///
   /// Instance members are methods and fields but not constructors.
   bool get isInstanceMember;
 
@@ -335,7 +340,6 @@
   LibraryElement get implementationLibrary;
   ClassElement get enclosingClass;
   Element get enclosingClassOrCompilationUnit;
-  Element get enclosingMember;
   Element get outermostEnclosingMemberOrTopLevel;
 
   /// The enclosing class that defines the type environment for this element.
@@ -729,7 +733,7 @@
                                                 Compiler compiler) {
     if (compiler.typedDataLibrary == null) return false;
     if (!element.isConstructor) return false;
-    ConstructorElement constructor = element;
+    ConstructorElement constructor = element.implementation;
     constructor = constructor.effectiveTarget;
     ClassElement cls = constructor.enclosingClass;
     return cls.library == compiler.typedDataLibrary
@@ -745,7 +749,7 @@
       for (Node labelOrCase in switchCase.labelsAndCases) {
         Node label = labelOrCase.asLabel();
         if (label != null) {
-          LabelElement labelElement = elements[label];
+          LabelDefinition labelElement = elements.getLabelDefinition(label);
           if (labelElement != null && labelElement.isContinueTarget) {
             return true;
           }
@@ -757,7 +761,7 @@
 
   static bool isUnusedLabel(LabeledStatement node, TreeElements elements) {
     Node body = node.statement;
-    TargetElement element = elements[body];
+    JumpTarget element = elements.getTargetDefinition(body);
     // Labeled statements with no element on the body have no breaks.
     // A different target statement only happens if the body is itself
     // a break or continue for a different target. In that case, this
@@ -767,13 +771,26 @@
 }
 
 /// An element representing an erroneous resolution.
+///
+/// An [ErroneousElement] is used instead of `null` to provide additional
+/// information about the error that caused the element to be unresolvable
+/// or otherwise invalid.
+///
+/// Accessing any field or calling any method defined on [ErroneousElement]
+/// except [isErroneous] will currently throw an exception. (This might
+/// change when we actually want more information on the erroneous element,
+/// e.g., the name of the element we were trying to resolve.)
+///
+/// Code that cannot not handle an [ErroneousElement] should use
+/// `Element.isUnresolved(element)` to check for unresolvable elements instead
+/// of `element == null`.
 abstract class ErroneousElement extends Element implements ConstructorElement {
   MessageKind get messageKind;
   Map get messageArguments;
   String get message;
 }
 
-/// An [Element] whose usage should cause a warning.
+/// An [Element] whose usage should cause one or more warnings.
 abstract class WarnOnUseElement extends Element {
   /// The element whose usage cause a warning.
   Element get wrappedElement;
@@ -784,7 +801,12 @@
   Element unwrap(DiagnosticListener listener, Spannable usageSpannable);
 }
 
-/// An element representing the ambiguous resolution of a name.
+/// An ambiguous element represents multiple elements accessible by the same
+/// name.
+///
+/// Ambiguous elements are created during handling of import/export scopes. If
+/// an ambiguous element is encountered during resolution a warning/error is
+/// reported.
 abstract class AmbiguousElement extends Element {
   MessageKind get messageKind;
   Map get messageArguments;
@@ -958,9 +980,8 @@
 /// An entity that defines a local entity (memory slot) in generated code.
 ///
 /// Parameters, local variables and local functions (can) define local entity
-/// and thus implement [Local] through [LocalElement]. For
-/// non-element locals, like `this` and boxes, specialized [Local] class are
-/// created.
+/// and thus implement [Local] through [LocalElement]. For non-element locals,
+/// like `this` and boxes, specialized [Local] classes are created.
 ///
 /// Type variables can introduce locals in factories and constructors
 /// but since one type variable can introduce different locals in different
@@ -1332,11 +1353,11 @@
   void addConstructor(FunctionElement constructor);
 }
 
-// TODO(johnniwinther): Make this a pure [Entity].
-abstract class LabelElement extends Element {
+/// The label entity defined by a labeled statement.
+abstract class LabelDefinition extends Entity {
   Label get label;
   String get labelName;
-  TargetElement get target;
+  JumpTarget get target;
 
   bool get isTarget;
   bool get isBreakTarget;
@@ -1346,11 +1367,12 @@
   void setContinueTarget();
 }
 
-// TODO(johnniwinther): Make this a pure [Entity].
-abstract class TargetElement extends Element implements Local {
+/// A jump target is the reference point of a statement or switch-case,
+/// either by label or as the default target of a break or continue.
+abstract class JumpTarget extends Local {
   Node get statement;
   int get nestingLevel;
-  Link<LabelElement> get labels;
+  Link<LabelDefinition> get labels;
 
   bool get isTarget;
   bool get isBreakTarget;
@@ -1361,7 +1383,7 @@
   void set isBreakTarget(bool value);
   void set isContinueTarget(bool value);
 
-  LabelElement addLabel(Label label, String labelName);
+  LabelDefinition addLabel(Label label, String labelName);
 }
 
 /// The [Element] for a type variable declaration on a generic class or typedef.
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index c4e0708..1d7537d 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -87,18 +87,8 @@
   bool get isFinal => modifiers.isFinal;
   bool get isStatic => modifiers.isStatic;
   bool get isOperator => Elements.isOperatorName(name);
-  bool get isStatement => identical(kind, ElementKind.STATEMENT);
   bool get impliesType => (kind.category & ElementCategory.IMPLIES_TYPE) != 0;
 
-  /** See [ErroneousElement] for documentation. */
-  bool get isErroneous => false;
-
-  /** See [AmbiguousElement] for documentation. */
-  bool get isAmbiguous => false;
-
-  /** See [WarnOnUseElement] for documentation. */
-  bool get isWarnOnUse => false;
-
   bool get isPatched => false;
 
   bool get isPatch => false;
@@ -194,17 +184,6 @@
     return null;
   }
 
-  /**
-   * Returns the member enclosing this element or the element itself if it is a
-   * member. If no enclosing element is found, [:null:] is returned.
-   */
-  Element get enclosingMember {
-    for (Element e = this; e != null; e = e.enclosingElement) {
-      if (e.isClassMember) return e;
-    }
-    return null;
-  }
-
   Element get outermostEnclosingMemberOrTopLevel {
     // TODO(lrn): Why is this called "Outermost"?
     // TODO(johnniwinther): Clean up this method: This method does not return
@@ -281,23 +260,6 @@
   }
 }
 
-/**
- * Represents an unresolvable or duplicated element.
- *
- * An [ErroneousElement] is used instead of [:null:] to provide additional
- * information about the error that caused the element to be unresolvable
- * or otherwise invalid.
- *
- * Accessing any field or calling any method defined on [ErroneousElement]
- * except [isErroneous] will currently throw an exception. (This might
- * change when we actually want more information on the erroneous element,
- * e.g., the name of the element we were trying to resolve.)
- *
- * Code that cannot not handle an [ErroneousElement] should use
- *   [: Element.isInvalid(element) :]
- * to check for unresolvable elements instead of
- *   [: element == null :].
- */
 class ErroneousElementX extends ElementX implements ErroneousElement {
   final MessageKind messageKind;
   final Map messageArguments;
@@ -306,8 +268,6 @@
                     String name, Element enclosing)
       : super(name, ElementKind.ERROR, enclosing);
 
-  bool get isErroneous => true;
-
   bool get isSynthesized => true;
 
   AbstractFieldElement abstractField;
@@ -369,9 +329,6 @@
   WrappedMessage(this.spannable, this.messageKind, this.messageArguments);
 }
 
-/**
- * An [Element] whose reference should cause one or more warnings.
- */
 class WarnOnUseElementX extends ElementX implements WarnOnUseElement {
   /// Warning to report on resolving this element.
   final WrappedMessage warning;
@@ -387,8 +344,6 @@
       : this.wrappedElement = wrappedElement,
         super(wrappedElement.name, ElementKind.WARN_ON_USE, enclosingElement);
 
-  bool get isWarnOnUse => true;
-
   Element unwrap(DiagnosticListener listener, Spannable usageSpannable) {
     var unwrapped = wrappedElement;
     if (warning != null) {
@@ -412,13 +367,6 @@
   accept(ElementVisitor visitor) => visitor.visitWarnOnUseElement(this);
 }
 
-/**
- * An ambiguous element represents multiple elements accessible by the same name.
- *
- * Ambiguous elements are created during handling of import/export scopes. If an
- * ambiguous element is encountered during resolution a warning/error should be
- * reported.
- */
 class AmbiguousElementX extends ElementX implements AmbiguousElement {
   /**
    * The message to report on resolving this element.
@@ -446,8 +394,6 @@
         this.newElement = newElement,
         super(existingElement.name, ElementKind.AMBIGUOUS, enclosingElement);
 
-  bool get isAmbiguous => true;
-
   Setlet flatten() {
     Element element = this;
     var set = new Setlet();
@@ -1264,6 +1210,13 @@
     createDefinitions(variables.definitions);
   }
 
+  // TODO(johnniwinther): Remove this when the dart `backend_ast` does not need
+  // [Element] for entities.
+  LocalVariableElementX.synthetic(String name,
+                                  ExecutableElement enclosingElement,
+                                  VariableList variables)
+      : super(name, ElementKind.VARIABLE, enclosingElement, variables, null);
+
   ExecutableElement get executableContext => enclosingElement;
 
   ExecutableElement get memberContext => executableContext.memberContext;
@@ -2499,75 +2452,59 @@
   accept(ElementVisitor visitor) => visitor.visitMixinApplicationElement(this);
 }
 
-class LabelElementX extends ElementX implements LabelElement {
-
-  // We store the original label here so it can be returned by [parseNode].
+class LabelDefinitionX implements LabelDefinition {
   final Label label;
   final String labelName;
-  final TargetElement target;
+  final JumpTarget target;
   bool isBreakTarget = false;
   bool isContinueTarget = false;
-  LabelElementX(Label label, String labelName, this.target,
-                Element enclosingElement)
+
+  LabelDefinitionX(Label label, String labelName, this.target)
       : this.label = label,
-        this.labelName = labelName,
-        // In case of a synthetic label, just use [labelName] for
-        // identifying the element.
-        super(label == null
-                  ? labelName
-                  : label.identifier.source,
-              ElementKind.LABEL,
-              enclosingElement);
+        this.labelName = labelName;
+
+  // In case of a synthetic label, just use [labelName] for identifying the
+  // label.
+  String get name => label == null ? labelName : label.identifier.source;
 
   void setBreakTarget() {
     isBreakTarget = true;
     target.isBreakTarget = true;
   }
+
   void setContinueTarget() {
     isContinueTarget = true;
     target.isContinueTarget = true;
   }
 
   bool get isTarget => isBreakTarget || isContinueTarget;
-  Node parseNode(DiagnosticListener l) => label;
 
-  Token get position => label.getBeginToken();
-  String toString() => "${labelName}:";
-
-  accept(ElementVisitor visitor) => visitor.visitLabelElement(this);
+  String toString() => 'Label:${name}';
 }
 
-// Represents a reference to a statement or switch-case, either by label or the
-// default target of a break or continue.
-class TargetElementX extends ElementX implements TargetElement {
+class JumpTargetX implements JumpTarget {
+  final ExecutableElement executableContext;
   final Node statement;
   final int nestingLevel;
-  Link<LabelElement> labels = const Link<LabelElement>();
+  Link<LabelDefinition> labels = const Link<LabelDefinition>();
   bool isBreakTarget = false;
   bool isContinueTarget = false;
 
-  TargetElementX(this.statement, this.nestingLevel, Element enclosingElement)
-      : super("target", ElementKind.STATEMENT, enclosingElement);
+  JumpTargetX(this.statement, this.nestingLevel, this.executableContext);
+
+  String get name => "target";
+
   bool get isTarget => isBreakTarget || isContinueTarget;
 
-  LabelElement addLabel(Label label, String labelName) {
-    LabelElement result = new LabelElementX(label, labelName, this,
-                                            enclosingElement);
+  LabelDefinition addLabel(Label label, String labelName) {
+    LabelDefinition result = new LabelDefinitionX(label, labelName, this);
     labels = labels.prepend(result);
     return result;
   }
 
-  Node parseNode(DiagnosticListener l) => statement;
-
   bool get isSwitch => statement is SwitchStatement;
 
-  Token get position => statement.getBeginToken();
-  String toString() => statement.toString();
-
-  accept(ElementVisitor visitor) => visitor.visitTargetElement(this);
-
-  // TODO(johnniwinther): Remove this when [TargetElement] is a non-element.
-  get executableContext => enclosingElement;
+  String toString() => 'Target:$statement';
 }
 
 class TypeVariableElementX extends ElementX with AstElementMixin
diff --git a/sdk/lib/_internal/compiler/implementation/elements/visitor.dart b/sdk/lib/_internal/compiler/implementation/elements/visitor.dart
index 961bc22..8d0323f 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/visitor.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/visitor.dart
@@ -36,8 +36,6 @@
   R visitMixinApplicationElement(MixinApplicationElement e) {
     return visitClassElement(e);
   }
-  R visitLabelElement(LabelElement e) => visitElement(e);
-  R visitTargetElement(TargetElement e) => visitElement(e);
   R visitTypeVariableElement(TypeVariableElement e) => visitElement(e);
   R visitBoxFieldElement(BoxFieldElement e) => visitElement(e);
   R visitClosureClassElement(ClosureClassElement e) => visitClassElement(e);
diff --git a/sdk/lib/_internal/compiler/implementation/enqueue.dart b/sdk/lib/_internal/compiler/implementation/enqueue.dart
index bef705d..b16a9f1 100644
--- a/sdk/lib/_internal/compiler/implementation/enqueue.dart
+++ b/sdk/lib/_internal/compiler/implementation/enqueue.dart
@@ -607,7 +607,7 @@
     }
   }
 
-  void registerClosure(FunctionElement element, Registry registry) {
+  void registerClosure(LocalFunctionElement element, Registry registry) {
     universe.allClosures.add(element);
     registerIfGeneric(element, registry);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart b/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
index c427573..7d5a3c4 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart
@@ -599,10 +599,10 @@
   final AstElement analyzedElement;
   final TypeSystem<T> types;
   final E inferrer;
-  final Map<TargetElement, List<LocalsHandler<T>>> breaksFor =
-      new Map<TargetElement, List<LocalsHandler<T>>>();
-  final Map<TargetElement, List<LocalsHandler>> continuesFor =
-      new Map<TargetElement, List<LocalsHandler<T>>>();
+  final Map<JumpTarget, List<LocalsHandler<T>>> breaksFor =
+      new Map<JumpTarget, List<LocalsHandler<T>>>();
+  final Map<JumpTarget, List<LocalsHandler>> continuesFor =
+      new Map<JumpTarget, List<LocalsHandler<T>>>();
   LocalsHandler<T> locals;
   final List<T> cascadeReceiverStack = new List<T>();
 
@@ -985,25 +985,25 @@
     return null;
   }
 
-  void setupBreaksAndContinues(TargetElement element) {
+  void setupBreaksAndContinues(JumpTarget element) {
     if (element == null) return;
     if (element.isContinueTarget) continuesFor[element] = <LocalsHandler>[];
     if (element.isBreakTarget) breaksFor[element] = <LocalsHandler>[];
   }
 
-  void clearBreaksAndContinues(TargetElement element) {
+  void clearBreaksAndContinues(JumpTarget element) {
     continuesFor.remove(element);
     breaksFor.remove(element);
   }
 
-  List<LocalsHandler<T>> getBreaks(TargetElement element) {
+  List<LocalsHandler<T>> getBreaks(JumpTarget element) {
     List<LocalsHandler<T>> list = <LocalsHandler<T>>[locals];
     if (element == null) return list;
     if (!element.isBreakTarget) return list;
     return list..addAll(breaksFor[element]);
   }
 
-  List<LocalsHandler<T>> getLoopBackEdges(TargetElement element) {
+  List<LocalsHandler<T>> getLoopBackEdges(JumpTarget element) {
     List<LocalsHandler<T>> list = <LocalsHandler<T>>[locals];
     if (element == null) return list;
     if (!element.isContinueTarget) return list;
@@ -1013,7 +1013,7 @@
   T handleLoop(Node node, void logic()) {
     loopLevel++;
     bool changed = false;
-    TargetElement target = elements[node];
+    JumpTarget target = elements.getTargetDefinition(node);
     LocalsHandler<T> saved = locals;
     saved.startLoop(node);
     do {
@@ -1128,7 +1128,7 @@
       // Loops and switches handle their own labels.
       visit(body);
     } else {
-      TargetElement targetElement = elements[body];
+      JumpTarget targetElement = elements.getTargetDefinition(body);
       setupBreaksAndContinues(targetElement);
       visit(body);
       locals.mergeAfterBreaks(getBreaks(targetElement));
@@ -1138,7 +1138,7 @@
   }
 
   T visitBreakStatement(BreakStatement node) {
-    TargetElement target = elements[node];
+    JumpTarget target = elements.getTargetOf(node);
     locals.seenBreakOrContinue = true;
     // Do a deep-copy of the locals, because the code following the
     // break will change them.
@@ -1147,7 +1147,7 @@
   }
 
   T visitContinueStatement(ContinueStatement node) {
-    TargetElement target = elements[node];
+    JumpTarget target = elements.getTargetOf(node);
     locals.seenBreakOrContinue = true;
     // Do a deep-copy of the locals, because the code following the
     // continue will change them.
@@ -1162,13 +1162,14 @@
   T visitSwitchStatement(SwitchStatement node) {
     visit(node.parenthesizedExpression);
 
-    setupBreaksAndContinues(elements[node]);
+    setupBreaksAndContinues(elements.getTargetDefinition(node));
     if (Elements.switchStatementHasContinue(node, elements)) {
-      void forEachLabeledCase(void action(TargetElement target)) {
+      void forEachLabeledCase(void action(JumpTarget target)) {
         for (SwitchCase switchCase in node.cases) {
           for (Node labelOrCase in switchCase.labelsAndCases) {
             if (labelOrCase.asLabel() == null) continue;
-            LabelElement labelElement = elements[labelOrCase];
+            LabelDefinition labelElement =
+                elements.getLabelDefinition(labelOrCase);
             if (labelElement != null) {
               action(labelElement.target);
             }
@@ -1176,7 +1177,7 @@
         }
       }
 
-      forEachLabeledCase((TargetElement target) {
+      forEachLabeledCase((JumpTarget target) {
         setupBreaksAndContinues(target);
       });
 
@@ -1197,7 +1198,7 @@
       } while (changed);
       locals.endLoop(node);
 
-      forEachLabeledCase((TargetElement target) {
+      forEachLabeledCase((JumpTarget target) {
         clearBreaksAndContinues(target);
       });
     } else {
@@ -1216,7 +1217,7 @@
       saved.mergeAfterBreaks(localsToMerge, keepOwnLocals: !hasDefaultCase);
       locals = saved;
     }
-    clearBreaksAndContinues(elements[node]);
+    clearBreaksAndContinues(elements.getTargetDefinition(node));
     return null;
   }
 
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
index 12aa1df..871859c 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
@@ -1008,7 +1008,7 @@
               elementType, length));
     } else if (Elements.isConstructorOfTypedArraySubclass(element, compiler)) {
       int length = findLength(node);
-      ConstructorElement constructor = element;
+      ConstructorElement constructor = element.implementation;
       constructor = constructor.effectiveTarget;
       T elementType = inferrer.returnTypeOfElement(
           constructor.enclosingClass.lookupMember('[]'));
@@ -1116,6 +1116,9 @@
                      ArgumentsTypes arguments) {
     // Erroneous elements may be unresolved, for example missing getters.
     if (Elements.isUnresolved(element)) return types.dynamicType;
+    // TODO(herhut): should we follow redirecting constructors here? We would
+    // need to pay attention of the constructor is pointing to an erroneous
+    // element.
     return inferrer.registerCalledElement(
         node, selector, outermostElement, element, arguments,
         sideEffects, inLoop);
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 45b3ada..ec4854d 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1835,9 +1835,9 @@
     }
     // Compute a mapping from class to the closures it contains, so we
     // can include the correct ones when including the class.
-    Map<ClassElement, List<Element>> closureMap =
-        new Map<ClassElement, List<Element>>();
-    for (FunctionElement closure in compiler.resolverWorld.allClosures) {
+    Map<ClassElement, List<LocalFunctionElement>> closureMap =
+        new Map<ClassElement, List<LocalFunctionElement>>();
+    for (LocalFunctionElement closure in compiler.resolverWorld.allClosures) {
       closureMap.putIfAbsent(closure.enclosingClass, () => []).add(closure);
     }
     bool foundClosure = false;
@@ -1877,7 +1877,7 @@
           }
         }
         // 5) all its closures
-        List<Element> closures = closureMap[cls];
+        List<LocalFunctionElement> closures = closureMap[cls];
         if (closures != null) {
           reflectableMembers.addAll(closures);
           foundClosure = true;
@@ -1898,10 +1898,10 @@
         });
         // Also add in closures. Those might be reflectable is their enclosing
         // member is.
-        List<Element> closures = closureMap[cls];
+        List<LocalFunctionElement> closures = closureMap[cls];
         if (closures != null) {
-          for (Element closure in closures) {
-            if (referencedFromMirrorSystem(closure.enclosingMember, false)) {
+          for (LocalFunctionElement closure in closures) {
+            if (referencedFromMirrorSystem(closure.memberContext, false)) {
               reflectableMembers.add(closure);
               foundClosure = true;
             }
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
index 51167f6..96115b9 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
@@ -331,21 +331,21 @@
     return longName;
   }
 
-  String breakLabelName(LabelElement label) {
+  String breakLabelName(LabelDefinition label) {
     return '\$${label.labelName}\$${label.target.nestingLevel}';
   }
 
-  String implicitBreakLabelName(TargetElement target) {
+  String implicitBreakLabelName(JumpTarget target) {
     return '\$${target.nestingLevel}';
   }
 
   // We sometimes handle continue targets differently from break targets,
   // so we have special continue-only labels.
-  String continueLabelName(LabelElement label) {
+  String continueLabelName(LabelDefinition label) {
     return 'c\$${label.labelName}\$${label.target.nestingLevel}';
   }
 
-  String implicitContinueLabelName(TargetElement target) {
+  String implicitContinueLabelName(JumpTarget target) {
     return 'c\$${target.nestingLevel}';
   }
 
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
index c4142ce..ebb6ea5 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
@@ -80,7 +80,7 @@
     int indexOfLastOptionalArgumentInParameters = optionalParameterStart - 1;
 
     int parameterIndex = 0;
-    parameters.orderedForEachParameter((Element element) {
+    parameters.orderedForEachParameter((ParameterElement element) {
       String jsName = backend.namer.safeName(element.name);
       assert(jsName != receiverArgumentName);
       if (count < optionalParameterStart) {
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/js_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/js_emitter.dart
index 268e852..8fceeea 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/js_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/js_emitter.dart
@@ -19,7 +19,8 @@
 
 import '../elements/elements.dart' show
     TypeVariableElement,
-    ConstructorBodyElement;
+    ConstructorBodyElement,
+    ParameterElement;
 
 import '../js/js.dart' show
     js, templateManager;
diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart
index 5fd785e..c9f38ad 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -1125,33 +1125,6 @@
   return token;
 }
 
-Token handleNativeClassBodyToSkip(Listener listener, Token token) {
-  checkAllowedLibrary(listener, token);
-  listener.handleIdentifier(token);
-  token = token.next;
-  if (!identical(token.kind, STRING_TOKEN)) {
-    return listener.unexpected(token);
-  }
-  token = token.next;
-  if (!identical(token.stringValue, '{')) {
-    return listener.unexpected(token);
-  }
-  BeginGroupToken beginGroupToken = token;
-  token = beginGroupToken.endGroup;
-  return token;
-}
-
-Token handleNativeClassBody(Listener listener, Token token) {
-  checkAllowedLibrary(listener, token);
-  token = token.next;
-  if (!identical(token.kind, STRING_TOKEN)) {
-    listener.unexpected(token);
-  } else {
-    token = token.next;
-  }
-  return token;
-}
-
 Token handleNativeFunctionBody(ElementListener listener, Token token) {
   checkAllowedLibrary(listener, token);
   Token begin = token;
@@ -1170,18 +1143,6 @@
   return token.next;
 }
 
-String checkForNativeClass(ElementListener listener) {
-  String nativeTagInfo;
-  Node node = listener.nodes.head;
-  if (node != null
-      && node.asIdentifier() != null
-      && node.asIdentifier().source == 'native') {
-    nativeTagInfo = node.asIdentifier().token.next.value;
-    listener.popNode();
-  }
-  return nativeTagInfo;
-}
-
 // The tags string contains comma-separated 'words' which are either dispatch
 // tags (having JavaScript identifier syntax) and directives that begin with
 // `!`.
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 0061fd7..1f608ad 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -61,6 +61,18 @@
 
   /// Returns a list of nodes that access [element] within a closure in [node].
   List<Node> getAccessesByClosureIn(Node node, VariableElement element);
+
+  /// Returns the jump target defined by [node].
+  JumpTarget getTargetDefinition(Node node);
+
+  /// Returns the jump target of the [node].
+  JumpTarget getTargetOf(GotoStatement node);
+
+  /// Returns the label defined by [node].
+  LabelDefinition getLabelDefinition(Label node);
+
+  /// Returns the label that [node] targets.
+  LabelDefinition getTargetLabel(GotoStatement node);
 }
 
 class TreeElementMapping implements TreeElements {
@@ -81,6 +93,18 @@
   final Setlet<Element> elements = new Setlet<Element>();
   final Setlet<Send> asserts = new Setlet<Send>();
 
+  /// Map from nodes to the targets they define.
+  Map<Node, JumpTarget> definedTargets;
+
+  /// Map from goto statements to their targets.
+  Map<GotoStatement, JumpTarget> usedTargets;
+
+  /// Map from labels to their label definition.
+  Map<Label, LabelDefinition> definedLabels;
+
+  /// Map from labeled goto statements to the labels they target.
+  Map<GotoStatement, LabelDefinition> targetLabels;
+
   final int hashCode = ++hashCodeCounter;
   static int hashCodeCounter = 0;
 
@@ -114,10 +138,6 @@
 
   operator [](Node node) => getTreeElement(node);
 
-  void remove(Node node) {
-    setTreeElement(node, null);
-  }
-
   void setType(Node node, DartType type) {
     types[node] = type;
   }
@@ -264,6 +284,74 @@
   bool isAssert(Send node) {
     return asserts.contains(node);
   }
+
+  void defineTarget(Node node, JumpTarget target) {
+    if (definedTargets == null) {
+      // TODO(johnniwinther): Use [Maplet] when available.
+      definedTargets = <Node, JumpTarget>{};
+    }
+    definedTargets[node] = target;
+  }
+
+  void undefineTarget(Node node) {
+    if (definedTargets != null) {
+      definedTargets.remove(node);
+      if (definedTargets.isEmpty) {
+        definedTargets = null;
+      }
+    }
+  }
+
+  JumpTarget getTargetDefinition(Node node) {
+    return definedTargets != null ? definedTargets[node] : null;
+  }
+
+  void registerTargetOf(GotoStatement node, JumpTarget target) {
+    if (usedTargets == null) {
+      // TODO(johnniwinther): Use [Maplet] when available.
+      usedTargets = <GotoStatement, JumpTarget>{};
+    }
+    usedTargets[node] = target;
+  }
+
+  JumpTarget getTargetOf(GotoStatement node) {
+    return usedTargets != null ? usedTargets[node] : null;
+  }
+
+  void defineLabel(Label label, LabelDefinition target) {
+    if (definedLabels == null) {
+      // TODO(johnniwinther): Use [Maplet] when available.
+      definedLabels = <Label, LabelDefinition>{};
+    }
+    definedLabels[label] = target;
+  }
+
+  void undefineLabel(Label label) {
+    if (definedLabels != null) {
+      definedLabels.remove(label);
+      if (definedLabels.isEmpty) {
+        definedLabels = null;
+      }
+    }
+  }
+
+  LabelDefinition getLabelDefinition(Label label) {
+    return definedLabels != null ? definedLabels[label] : null;
+  }
+
+  void registerTargetLabel(GotoStatement node, LabelDefinition label) {
+    assert(node.target != null);
+    if (targetLabels == null) {
+      // TODO(johnniwinther): Use [Maplet] when available.
+      targetLabels = <GotoStatement, LabelDefinition>{};
+    }
+    targetLabels[node] = label;
+  }
+
+  LabelDefinition getTargetLabel(GotoStatement node) {
+    assert(node.target != null);
+    return targetLabels != null ? targetLabels[node] : null;
+  }
 }
 
 class ResolverTask extends CompilerTask {
@@ -1565,15 +1653,15 @@
 
 abstract class LabelScope {
   LabelScope get outer;
-  LabelElement lookup(String label);
+  LabelDefinition lookup(String label);
 }
 
 class LabeledStatementLabelScope implements LabelScope {
   final LabelScope outer;
-  final Map<String, LabelElement> labels;
+  final Map<String, LabelDefinition> labels;
   LabeledStatementLabelScope(this.outer, this.labels);
-  LabelElement lookup(String labelName) {
-    LabelElement label = labels[labelName];
+  LabelDefinition lookup(String labelName) {
+    LabelDefinition label = labels[labelName];
     if (label != null) return label;
     return outer.lookup(labelName);
   }
@@ -1581,12 +1669,12 @@
 
 class SwitchLabelScope implements LabelScope {
   final LabelScope outer;
-  final Map<String, LabelElement> caseLabels;
+  final Map<String, LabelDefinition> caseLabels;
 
   SwitchLabelScope(this.outer, this.caseLabels);
 
-  LabelElement lookup(String labelName) {
-    LabelElement result = caseLabels[labelName];
+  LabelDefinition lookup(String labelName) {
+    LabelDefinition result = caseLabels[labelName];
     if (result != null) return result;
     return outer.lookup(labelName);
   }
@@ -1594,7 +1682,7 @@
 
 class EmptyLabelScope implements LabelScope {
   const EmptyLabelScope();
-  LabelElement lookup(String label) => null;
+  LabelDefinition lookup(String label) => null;
   LabelScope get outer {
     throw 'internal error: empty label scope has no outer';
   }
@@ -1602,28 +1690,28 @@
 
 class StatementScope {
   LabelScope labels;
-  Link<TargetElement> breakTargetStack;
-  Link<TargetElement> continueTargetStack;
+  Link<JumpTarget> breakTargetStack;
+  Link<JumpTarget> continueTargetStack;
   // Used to provide different numbers to statements if one is inside the other.
   // Can be used to make otherwise duplicate labels unique.
   int nestingLevel = 0;
 
   StatementScope()
       : labels = const EmptyLabelScope(),
-        breakTargetStack = const Link<TargetElement>(),
-        continueTargetStack = const Link<TargetElement>();
+        breakTargetStack = const Link<JumpTarget>(),
+        continueTargetStack = const Link<JumpTarget>();
 
-  LabelElement lookupLabel(String label) {
+  LabelDefinition lookupLabel(String label) {
     return labels.lookup(label);
   }
 
-  TargetElement currentBreakTarget() =>
+  JumpTarget currentBreakTarget() =>
     breakTargetStack.isEmpty ? null : breakTargetStack.head;
 
-  TargetElement currentContinueTarget() =>
+  JumpTarget currentContinueTarget() =>
     continueTargetStack.isEmpty ? null : continueTargetStack.head;
 
-  void enterLabelScope(Map<String, LabelElement> elements) {
+  void enterLabelScope(Map<String, LabelDefinition> elements) {
     labels = new LabeledStatementLabelScope(labels, elements);
     nestingLevel++;
   }
@@ -1633,7 +1721,7 @@
     labels = labels.outer;
   }
 
-  void enterLoop(TargetElement element) {
+  void enterLoop(JumpTarget element) {
     breakTargetStack = breakTargetStack.prepend(element);
     continueTargetStack = continueTargetStack.prepend(element);
     nestingLevel++;
@@ -1645,8 +1733,8 @@
     continueTargetStack = continueTargetStack.tail;
   }
 
-  void enterSwitch(TargetElement breakElement,
-                   Map<String, LabelElement> continueElements) {
+  void enterSwitch(JumpTarget breakElement,
+                   Map<String, LabelDefinition> continueElements) {
     breakTargetStack = breakTargetStack.prepend(breakElement);
     labels = new SwitchLabelScope(labels, continueElements);
     nestingLevel++;
@@ -2069,10 +2157,10 @@
   }
 
   // Create, or reuse an already created, target element for a statement.
-  TargetElement getOrDefineTarget(Node statement) {
-    TargetElement element = registry.getTargetDefinition(statement);
+  JumpTarget getOrDefineTarget(Node statement) {
+    JumpTarget element = registry.getTargetDefinition(statement);
     if (element == null) {
-      element = new TargetElementX(statement,
+      element = new JumpTargetX(statement,
                                    statementScope.nestingLevel,
                                    enclosingElement);
       registry.defineTarget(statement, element);
@@ -2267,7 +2355,7 @@
    * before visiting the body of the loop
    */
   visitLoopBodyIn(Loop loop, Node body, Scope bodyScope) {
-    TargetElement element = getOrDefineTarget(loop);
+    JumpTarget element = getOrDefineTarget(loop);
     statementScope.enterLoop(element);
     visitIn(body, bodyScope);
     statementScope.exitLoop();
@@ -3295,7 +3383,7 @@
   }
 
   visitBreakStatement(BreakStatement node) {
-    TargetElement target;
+    JumpTarget target;
     if (node.target == null) {
       target = statementScope.currentBreakTarget();
       if (target == null) {
@@ -3305,7 +3393,7 @@
       target.isBreakTarget = true;
     } else {
       String labelName = node.target.source;
-      LabelElement label = statementScope.lookupLabel(labelName);
+      LabelDefinition label = statementScope.lookupLabel(labelName);
       if (label == null) {
         error(node.target, MessageKind.UNBOUND_LABEL, {'labelName': labelName});
         return;
@@ -3318,16 +3406,11 @@
       label.setBreakTarget();
       registry.useLabel(node, label);
     }
-    if (registry.getTargetDefinition(node) != null) {
-      // This is need for code like `L: break L;` where the definition and
-      // target are the same node.
-      registry.undefineTarget(node);
-    }
     registry.registerTargetOf(node, target);
   }
 
   visitContinueStatement(ContinueStatement node) {
-    TargetElement target;
+    JumpTarget target;
     if (node.target == null) {
       target = statementScope.currentContinueTarget();
       if (target == null) {
@@ -3337,7 +3420,7 @@
       target.isContinueTarget = true;
     } else {
       String labelName = node.target.source;
-      LabelElement label = statementScope.lookupLabel(labelName);
+      LabelDefinition label = statementScope.lookupLabel(labelName);
       if (label == null) {
         error(node.target, MessageKind.UNBOUND_LABEL, {'labelName': labelName});
         return;
@@ -3427,18 +3510,18 @@
 
   visitLabeledStatement(LabeledStatement node) {
     Statement body = node.statement;
-    TargetElement targetElement = getOrDefineTarget(body);
-    Map<String, LabelElement> labelElements = <String, LabelElement>{};
+    JumpTarget targetElement = getOrDefineTarget(body);
+    Map<String, LabelDefinition> labelElements = <String, LabelDefinition>{};
     for (Label label in node.labels) {
       String labelName = label.labelName;
       if (labelElements.containsKey(labelName)) continue;
-      LabelElement element = targetElement.addLabel(label, labelName);
+      LabelDefinition element = targetElement.addLabel(label, labelName);
       labelElements[labelName] = element;
     }
     statementScope.enterLabelScope(labelElements);
     visit(node.statement);
     statementScope.exitLabelScope();
-    labelElements.forEach((String labelName, LabelElement element) {
+    labelElements.forEach((String labelName, LabelDefinition element) {
       if (element.isTarget) {
         registry.defineLabel(element.label, element);
       } else {
@@ -3446,10 +3529,7 @@
                 {'labelName': labelName});
       }
     });
-    if (!targetElement.isTarget &&
-        registry.getTargetOf(body) == targetElement) {
-      // If the body is itself a break or continue for another target, it
-      // might have updated its mapping to the target it actually does target.
+    if (!targetElement.isTarget) {
       registry.undefineTarget(body);
     }
   }
@@ -3533,8 +3613,8 @@
   }
 
   void checkCaseExpressions(SwitchStatement node) {
-    TargetElement breakElement = getOrDefineTarget(node);
-    Map<String, LabelElement> continueLabels = <String, LabelElement>{};
+    JumpTarget breakElement = getOrDefineTarget(node);
+    Map<String, LabelDefinition> continueLabels = <String, LabelDefinition>{};
 
     Link<Node> cases = node.cases.nodes;
     SwitchCase switchCase = cases.head;
@@ -3602,8 +3682,8 @@
   visitSwitchStatement(SwitchStatement node) {
     node.expression.accept(this);
 
-    TargetElement breakElement = getOrDefineTarget(node);
-    Map<String, LabelElement> continueLabels = <String, LabelElement>{};
+    JumpTarget breakElement = getOrDefineTarget(node);
+    Map<String, LabelDefinition> continueLabels = <String, LabelDefinition>{};
     Link<Node> cases = node.cases.nodes;
     while (!cases.isEmpty) {
       SwitchCase switchCase = cases.head;
@@ -3616,7 +3696,7 @@
         Label label = labelOrCase;
         String labelName = label.labelName;
 
-        LabelElement existingElement = continueLabels[labelName];
+        LabelDefinition existingElement = continueLabels[labelName];
         if (existingElement != null) {
           // It's an error if the same label occurs twice in the same switch.
           compiler.reportError(
@@ -3638,8 +3718,8 @@
           }
         }
 
-        TargetElement targetElement = getOrDefineTarget(switchCase);
-        LabelElement labelElement = targetElement.addLabel(label, labelName);
+        JumpTarget targetElement = getOrDefineTarget(switchCase);
+        LabelDefinition labelElement = targetElement.addLabel(label, labelName);
         registry.defineLabel(label, labelElement);
         continueLabels[labelName] = labelElement;
       }
@@ -3659,9 +3739,9 @@
     statementScope.exitSwitch();
 
     // Clean-up unused labels.
-    continueLabels.forEach((String key, LabelElement label) {
+    continueLabels.forEach((String key, LabelDefinition label) {
       if (!label.isContinueTarget) {
-        TargetElement targetElement = label.target;
+        JumpTarget targetElement = label.target;
         SwitchCase switchCase = targetElement.statement;
         registry.undefineTarget(switchCase);
         registry.undefineLabel(label.label);
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/registry.dart b/sdk/lib/_internal/compiler/implementation/resolution/registry.dart
index 12073bf..2dc4962 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/registry.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/registry.dart
@@ -42,12 +42,6 @@
     mapping[node] = element;
   }
 
-  /// Unregister the element declared by [node].
-  // TODO(johnniwinther): Try to remove this.
-  void undefineElement(Node node) {
-    mapping.remove(node);
-  }
-
   /// Returns the [Element] defined by [node].
   Element getDefinition(Node node) {
     return mapping[node];
@@ -110,52 +104,45 @@
   //////////////////////////////////////////////////////////////////////////////
 
   /// Register [node] to be the declaration of [label].
-  void defineLabel(Label node, LabelElement label) {
-    defineElement(node, label);
+  void defineLabel(Label node, LabelDefinition label) {
+    mapping.defineLabel(node, label);
   }
 
   /// Undefine the label of [node].
   /// This is used to cleanup and detect unused labels.
   void undefineLabel(Label node) {
-    undefineElement(node);
+    mapping.undefineLabel(node);
   }
 
   /// Register the target of [node] as reference to [label].
-  void useLabel(GotoStatement node, LabelElement label) {
-    mapping[node.target] = label;
+  void useLabel(GotoStatement node, LabelDefinition label) {
+    mapping.registerTargetLabel(node, label);
   }
 
   /// Register [node] to be the declaration of [target].
-  void defineTarget(Node node, TargetElement target) {
+  void defineTarget(Node node, JumpTarget target) {
     assert(invariant(node, node is Statement || node is SwitchCase,
         message: "Only statements and switch cases can define targets."));
-    defineElement(node, target);
+    mapping.defineTarget(node, target);
   }
 
-  /// Returns the [TargetElement] defined by [node].
-  TargetElement getTargetDefinition(Node node) {
+  /// Returns the [JumpTarget] defined by [node].
+  JumpTarget getTargetDefinition(Node node) {
     assert(invariant(node, node is Statement || node is SwitchCase,
         message: "Only statements and switch cases can define targets."));
-    return getDefinition(node);
+    return mapping.getTargetDefinition(node);
   }
 
   /// Undefine the target of [node]. This is used to cleanup unused targets.
   void undefineTarget(Node node) {
     assert(invariant(node, node is Statement || node is SwitchCase,
         message: "Only statements and switch cases can define targets."));
-    undefineElement(node);
+    mapping.undefineTarget(node);
   }
 
   /// Register the target of [node] to be [target].
-  void registerTargetOf(GotoStatement node, TargetElement target) {
-    mapping[node] = target;
-  }
-
-  /// Returns the target of [node].
-  // TODO(johnniwinther): Change [Node] to [GotoStatement] when we store
-  // target def and use in separate locations.
-  TargetElement getTargetOf(Node node) {
-    return mapping[node];
+  void registerTargetOf(GotoStatement node, JumpTarget target) {
+    mapping.registerTargetOf(node, target);
   }
 
   //////////////////////////////////////////////////////////////////////////////
@@ -227,7 +214,7 @@
     backend.resolutionCallbacks.onAsCheck(type, this);
   }
 
-  void registerClosure(Element element) {
+  void registerClosure(LocalFunctionElement element) {
     world.registerClosure(element, this);
   }
 
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart b/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart
index a5f8778..c96deeb 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart
@@ -19,7 +19,7 @@
          FunctionElementX,
          FunctionSignatureX,
          InitializingFormalElementX,
-         LabelElementX,
+         LabelDefinitionX,
          LocalFunctionElementX,
          LocalParameterElementX,
          LocalVariableElementX,
@@ -28,7 +28,7 @@
          ParameterElementX,
          ParameterMetadataAnnotation,
          SynthesizedConstructorElementX,
-         TargetElementX,
+         JumpTargetX,
          TypedefElementX,
          TypeVariableElementX,
          VariableElementX,
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/listener.dart b/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
index 3be7141..d884211 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
@@ -909,7 +909,6 @@
   void endClassDeclaration(int interfacesCount, Token beginToken,
                            Token extendsKeyword, Token implementsKeyword,
                            Token endToken) {
-    String nativeTagInfo = native.checkForNativeClass(this);
     NodeList interfaces =
         makeNodeList(interfacesCount, implementsKeyword, null, ",");
     Node supertype = popNode();
@@ -918,7 +917,6 @@
     int id = idGenerator();
     PartialClassElement element = new PartialClassElement(
         name.source, beginToken, endToken, compilationUnitElement, id);
-    element.setNative(nativeTagInfo);
     pushElement(element);
     rejectBuiltInIdentifier(name);
   }
@@ -1212,11 +1210,7 @@
   }
 
   Token expectedClassBodyToSkip(Token token) {
-    if (identical(token.stringValue, 'native')) {
-      return native.handleNativeClassBodyToSkip(this, token);
-    } else {
-      return unexpected(token);
-    }
+    return unexpected(token);
   }
 
   Link<Token> expectedDeclaration(Token token) {
@@ -1608,9 +1602,7 @@
   }
 
   Token expectedClassBody(Token token) {
-    if (identical(token.stringValue, 'native')) {
-      return native.handleNativeClassBody(this, token);
-    } else if (token is ErrorToken) {
+    if (token is ErrorToken) {
       reportErrorToken(token);
     } else {
       reportFatalError(token,
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 460614d..5ab75da 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -56,7 +56,7 @@
         if (!identical(kind, ElementKind.FIELD)) {
           FunctionElement function = element;
           FunctionSignature signature = function.functionSignature;
-          signature.forEachOptionalParameter((Element parameter) {
+          signature.forEachOptionalParameter((ParameterElement parameter) {
             // This ensures the default value will be computed.
             Constant constant =
                 backend.constants.getConstantForVariable(parameter);
@@ -686,19 +686,19 @@
 
 
 abstract class JumpHandler {
-  factory JumpHandler(SsaBuilder builder, TargetElement target) {
+  factory JumpHandler(SsaBuilder builder, JumpTarget target) {
     return new TargetJumpHandler(builder, target);
   }
-  void generateBreak([LabelElement label]);
-  void generateContinue([LabelElement label]);
+  void generateBreak([LabelDefinition label]);
+  void generateContinue([LabelDefinition label]);
   void forEachBreak(void action(HBreak instruction, LocalsHandler locals));
   void forEachContinue(void action(HContinue instruction,
                                    LocalsHandler locals));
   bool hasAnyContinue();
   bool hasAnyBreak();
   void close();
-  final TargetElement target;
-  List<LabelElement> labels();
+  final JumpTarget target;
+  List<LabelDefinition> labels();
 }
 
 // Insert break handler used to avoid null checks when a target isn't
@@ -709,12 +709,12 @@
 
   NullJumpHandler(this.compiler);
 
-  void generateBreak([LabelElement label]) {
+  void generateBreak([LabelDefinition label]) {
     compiler.internalError(CURRENT_ELEMENT_SPANNABLE,
         'NullJumpHandler.generateBreak should not be called.');
   }
 
-  void generateContinue([LabelElement label]) {
+  void generateContinue([LabelDefinition label]) {
     compiler.internalError(CURRENT_ELEMENT_SPANNABLE,
         'NullJumpHandler.generateContinue should not be called.');
   }
@@ -725,8 +725,8 @@
   bool hasAnyContinue() => false;
   bool hasAnyBreak() => false;
 
-  List<LabelElement> labels() => const <LabelElement>[];
-  TargetElement get target => null;
+  List<LabelDefinition> labels() => const <LabelDefinition>[];
+  JumpTarget get target => null;
 }
 
 // Records breaks until a target block is available.
@@ -735,7 +735,7 @@
 // Continues in switches is currently not handled.
 class TargetJumpHandler implements JumpHandler {
   final SsaBuilder builder;
-  final TargetElement target;
+  final JumpTarget target;
   final List<JumpHandlerEntry> jumps;
 
   TargetJumpHandler(SsaBuilder builder, this.target)
@@ -745,7 +745,7 @@
     builder.jumpTargets[target] = this;
   }
 
-  void generateBreak([LabelElement label]) {
+  void generateBreak([LabelDefinition label]) {
     HInstruction breakInstruction;
     if (label == null) {
       breakInstruction = new HBreak(target);
@@ -757,7 +757,7 @@
     jumps.add(new JumpHandlerEntry(breakInstruction, locals));
   }
 
-  void generateContinue([LabelElement label]) {
+  void generateContinue([LabelDefinition label]) {
     HInstruction continueInstruction;
     if (label == null) {
       continueInstruction = new HContinue(target);
@@ -803,13 +803,13 @@
     builder.jumpTargets.remove(target);
   }
 
-  List<LabelElement> labels() {
-    List<LabelElement> result = null;
-    for (LabelElement element in target.labels) {
-      if (result == null) result = <LabelElement>[];
+  List<LabelDefinition> labels() {
+    List<LabelDefinition> result = null;
+    for (LabelDefinition element in target.labels) {
+      if (result == null) result = <LabelDefinition>[];
       result.add(element);
     }
-    return (result == null) ? const <LabelElement>[] : result;
+    return (result == null) ? const <LabelDefinition>[] : result;
   }
 }
 
@@ -818,10 +818,10 @@
 class SwitchCaseJumpHandler extends TargetJumpHandler {
   /// Map from switch case targets to indices used to encode the flow of the
   /// switch case loop.
-  final Map<TargetElement, int> targetIndexMap = new Map<TargetElement, int>();
+  final Map<JumpTarget, int> targetIndexMap = new Map<JumpTarget, int>();
 
   SwitchCaseJumpHandler(SsaBuilder builder,
-                        TargetElement target,
+                        JumpTarget target,
                         ast.SwitchStatement node)
       : super(builder, target) {
     // The switch case indices must match those computed in
@@ -833,9 +833,10 @@
       for (ast.Node labelOrCase in switchCase.labelsAndCases) {
         ast.Node label = labelOrCase.asLabel();
         if (label != null) {
-          LabelElement labelElement = builder.elements[label];
+          LabelDefinition labelElement =
+              builder.elements.getLabelDefinition(label);
           if (labelElement != null && labelElement.isContinueTarget) {
-            TargetElement continueTarget = labelElement.target;
+            JumpTarget continueTarget = labelElement.target;
             targetIndexMap[continueTarget] = switchIndex;
             assert(builder.jumpTargets[continueTarget] == null);
             builder.jumpTargets[continueTarget] = this;
@@ -846,7 +847,7 @@
     }
   }
 
-  void generateBreak([LabelElement label]) {
+  void generateBreak([LabelDefinition label]) {
     if (label == null) {
       // Creates a special break instruction for the synthetic loop generated
       // for a switch statement with continue statements. See
@@ -862,11 +863,11 @@
     }
   }
 
-  bool isContinueToSwitchCase(LabelElement label) {
+  bool isContinueToSwitchCase(LabelDefinition label) {
     return label != null && targetIndexMap.containsKey(label.target);
   }
 
-  void generateContinue([LabelElement label]) {
+  void generateContinue([LabelDefinition label]) {
     if (isContinueToSwitchCase(label)) {
       // Creates the special instructions 'label = i; continue l;' used in
       // switch statements with continue statements. See
@@ -890,7 +891,7 @@
 
   void close() {
     // The mapping from TargetElement to JumpHandler is no longer needed.
-    for (TargetElement target in targetIndexMap.keys) {
+    for (JumpTarget target in targetIndexMap.keys) {
       builder.jumpTargets.remove(target);
     }
     super.close();
@@ -968,7 +969,7 @@
   Map<ParameterElement, HInstruction> parameters =
       <ParameterElement, HInstruction>{};
 
-  Map<TargetElement, JumpHandler> jumpTargets = <TargetElement, JumpHandler>{};
+  Map<JumpTarget, JumpHandler> jumpTargets = <JumpTarget, JumpHandler>{};
 
   /**
    * Variables stored in the current activation. These variables are
@@ -995,6 +996,11 @@
 
   CodegenRegistry get registry => work.registry;
 
+  /// Returns the current source element.
+  ///
+  /// The returned element is a declaration element.
+  // TODO(johnniwinther): Check that all usages of sourceElement agree on
+  // implementation/declaration distinction.
   Element get sourceElement => sourceElementStack.last;
 
   HBasicBlock addNewBlock() {
@@ -2557,8 +2563,8 @@
           continueHandlers[0].mergeMultiple(continueHandlers, updateBlock);
 
       HLabeledBlockInformation labelInfo;
-      List<LabelElement> labels = jumpHandler.labels();
-      TargetElement target = elements[loop];
+      List<LabelDefinition> labels = jumpHandler.labels();
+      JumpTarget target = elements.getTargetDefinition(loop);
       if (!labels.isEmpty) {
         beginBodyBlock.setBlockFlow(
             new HLabeledBlockInformation(
@@ -2648,13 +2654,13 @@
       // If the body has any break, attach a synthesized label to the
       // if block.
       if (jumpHandler.hasAnyBreak()) {
-        TargetElement target = elements[loop];
-        LabelElement label = target.addLabel(null, 'loop');
+        JumpTarget target = elements.getTargetDefinition(loop);
+        LabelDefinition label = target.addLabel(null, 'loop');
         label.setBreakTarget();
         SubGraph labelGraph = new SubGraph(conditionBlock, current);
         HLabeledBlockInformation labelInfo = new HLabeledBlockInformation(
                 new HSubGraphBlockInformation(labelGraph),
-                <LabelElement>[label]);
+                <LabelDefinition>[label]);
 
         conditionBlock.setBlockFlow(labelInfo, current);
 
@@ -2724,7 +2730,7 @@
     HLoopInformation loopInfo = current.loopInformation;
     HBasicBlock loopEntryBlock = current;
     HBasicBlock bodyEntryBlock = current;
-    TargetElement target = elements[node];
+    JumpTarget target = elements.getTargetDefinition(node);
     bool hasContinues = target != null && target.isContinueTarget;
     if (hasContinues) {
       // Add extra block to hang labels on.
@@ -2771,7 +2777,7 @@
         localsHandler =
             savedLocals.mergeMultiple(continueHandlers, conditionBlock);
         SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock);
-        List<LabelElement> labels = jumpHandler.labels();
+        List<LabelDefinition> labels = jumpHandler.labels();
         HSubGraphBlockInformation bodyInfo =
             new HSubGraphBlockInformation(bodyGraph);
         HLabeledBlockInformation info;
@@ -2837,11 +2843,11 @@
         // Since the body of the loop has a break, we attach a synthesized label
         // to the body.
         SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock);
-        TargetElement target = elements[node];
-        LabelElement label = target.addLabel(null, 'loop');
+        JumpTarget target = elements.getTargetDefinition(node);
+        LabelDefinition label = target.addLabel(null, 'loop');
         label.setBreakTarget();
         HLabeledBlockInformation info = new HLabeledBlockInformation(
-            new HSubGraphBlockInformation(bodyGraph), <LabelElement>[label]);
+            new HSubGraphBlockInformation(bodyGraph), <LabelDefinition>[label]);
         loopEntryBlock.setBlockFlow(info, current);
         jumpHandler.forEachBreak((HBreak breakInstruction, _) {
           HBasicBlock block = breakInstruction.block;
@@ -4075,7 +4081,8 @@
     Element constructor = elements[send];
     Selector selector = elements.getSelector(send);
     ConstructorElement constructorDeclaration = constructor;
-    constructor = constructorDeclaration.effectiveTarget;
+    ConstructorElement constructorImplementation = constructor.implementation;
+    constructor = constructorImplementation.effectiveTarget;
 
     final bool isSymbolConstructor =
         constructorDeclaration == compiler.symbolConstructor;
@@ -4886,7 +4893,7 @@
     if (node.isRedirectingFactoryBody) {
       FunctionElement targetConstructor =
           elements[node.expression].implementation;
-      ConstructorElement redirectingConstructor = sourceElement;
+      ConstructorElement redirectingConstructor = sourceElement.implementation;
       List<HInstruction> inputs = <HInstruction>[];
       FunctionSignature targetSignature = targetConstructor.functionSignature;
       FunctionSignature redirectingSignature =
@@ -5030,28 +5037,28 @@
   visitBreakStatement(ast.BreakStatement node) {
     assert(!isAborted());
     handleInTryStatement();
-    TargetElement target = elements[node];
+    JumpTarget target = elements.getTargetOf(node);
     assert(target != null);
     JumpHandler handler = jumpTargets[target];
     assert(handler != null);
     if (node.target == null) {
       handler.generateBreak();
     } else {
-      LabelElement label = elements[node.target];
+      LabelDefinition label = elements.getTargetLabel(node);
       handler.generateBreak(label);
     }
   }
 
   visitContinueStatement(ast.ContinueStatement node) {
     handleInTryStatement();
-    TargetElement target = elements[node];
+    JumpTarget target = elements.getTargetOf(node);
     assert(target != null);
     JumpHandler handler = jumpTargets[target];
     assert(handler != null);
     if (node.target == null) {
       handler.generateContinue();
     } else {
-      LabelElement label = elements[node.target];
+      LabelDefinition label = elements.getTargetLabel(node);
       assert(label != null);
       handler.generateContinue(label);
     }
@@ -5067,7 +5074,7 @@
    * continue statements from simple switch statements.
    */
   JumpHandler createJumpHandler(ast.Statement node, {bool isLoopJump}) {
-    TargetElement element = elements[node];
+    JumpTarget element = elements.getTargetDefinition(node);
     if (element == null || !identical(element.statement, node)) {
       // No breaks or continues to this node.
       return new NullJumpHandler(compiler);
@@ -5144,7 +5151,7 @@
       visit(body);
       return;
     }
-    TargetElement targetElement = elements[body];
+    JumpTarget targetElement = elements.getTargetDefinition(body);
     LocalsHandler beforeLocals = new LocalsHandler.from(localsHandler);
     assert(targetElement.isBreakTarget);
     JumpHandler handler = new JumpHandler(this, targetElement);
@@ -5275,7 +5282,7 @@
       for (ast.Node labelOrCase in switchCase.labelsAndCases) {
         ast.Node label = labelOrCase.asLabel();
         if (label != null) {
-          LabelElement labelElement = elements[label];
+          LabelDefinition labelElement = elements.getLabelDefinition(label);
           if (labelElement != null && labelElement.isContinueTarget) {
             hasContinue = true;
           }
@@ -5368,7 +5375,7 @@
     //     }
     //   }
 
-    TargetElement switchTarget = elements[node];
+    JumpTarget switchTarget = elements.getTargetDefinition(node);
     HInstruction initialValue = graph.addConstantNull(compiler);
     localsHandler.updateLocal(switchTarget, initialValue);
 
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index c9b8d3a..49119a4 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -84,7 +84,7 @@
   }
 }
 
-typedef void ElementAction(Element element);
+typedef void EntityAction(Entity element);
 
 class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
   /**
@@ -114,8 +114,8 @@
 
   final Set<HInstruction> generateAtUseSite;
   final Set<HInstruction> controlFlowOperators;
-  final Map<Element, ElementAction> breakAction;
-  final Map<Element, ElementAction> continueAction;
+  final Map<Entity, EntityAction> breakAction;
+  final Map<Entity, EntityAction> continueAction;
   final List<js.Parameter> parameters;
 
   js.Block currentContainer;
@@ -163,8 +163,8 @@
       oldContainerStack = <js.Block>[],
       generateAtUseSite = new Set<HInstruction>(),
       controlFlowOperators = new Set<HInstruction>(),
-      breakAction = new Map<Element, ElementAction>(),
-      continueAction = new Map<Element, ElementAction>();
+      breakAction = new Map<Entity, EntityAction>(),
+      continueAction = new Map<Entity, EntityAction>();
 
   Compiler get compiler => backend.compiler;
   NativeEmitter get nativeEmitter => backend.emitter.nativeEmitter;
@@ -609,21 +609,21 @@
     }
   }
 
-  void continueAsBreak(LabelElement target) {
+  void continueAsBreak(LabelDefinition target) {
     pushStatement(new js.Break(backend.namer.continueLabelName(target)));
   }
 
-  void implicitContinueAsBreak(TargetElement target) {
+  void implicitContinueAsBreak(JumpTarget target) {
     pushStatement(new js.Break(
         backend.namer.implicitContinueLabelName(target)));
   }
 
-  void implicitBreakWithLabel(TargetElement target) {
+  void implicitBreakWithLabel(JumpTarget target) {
     pushStatement(new js.Break(backend.namer.implicitBreakLabelName(target)));
   }
 
-  js.Statement wrapIntoLabels(js.Statement result, List<LabelElement> labels) {
-    for (LabelElement label in labels) {
+  js.Statement wrapIntoLabels(js.Statement result, List<LabelDefinition> labels) {
+    for (LabelDefinition label in labels) {
       if (label.isTarget) {
         String breakLabelString = backend.namer.breakLabelName(label);
         result = new js.LabeledStatement(breakLabelString, result);
@@ -969,7 +969,7 @@
   }
 
   bool visitLabeledBlockInfo(HLabeledBlockInformation labeledBlockInfo) {
-    Link<Element> continueOverrides = const Link<Element>();
+    Link<Entity> continueOverrides = const Link<Entity>();
 
     js.Block oldContainer = currentContainer;
     js.Block body = new js.Block.empty();
@@ -982,7 +982,7 @@
     // continues of the loop can be written as breaks of the body
     // block.
     if (labeledBlockInfo.isContinue) {
-      for (LabelElement label in labeledBlockInfo.labels) {
+      for (LabelDefinition label in labeledBlockInfo.labels) {
         if (label.isContinueTarget) {
           String labelName = backend.namer.continueLabelName(label);
           result = new js.LabeledStatement(labelName, result);
@@ -993,20 +993,20 @@
       // For handling unlabeled continues from the body of a loop.
       // TODO(lrn): Consider recording whether the target is in fact
       // a target of an unlabeled continue, and not generate this if it isn't.
-      TargetElement target = labeledBlockInfo.target;
+      JumpTarget target = labeledBlockInfo.target;
       String labelName = backend.namer.implicitContinueLabelName(target);
       result = new js.LabeledStatement(labelName, result);
       continueAction[target] = implicitContinueAsBreak;
       continueOverrides = continueOverrides.prepend(target);
     } else {
-      for (LabelElement label in labeledBlockInfo.labels) {
+      for (LabelDefinition label in labeledBlockInfo.labels) {
         if (label.isBreakTarget) {
           String labelName = backend.namer.breakLabelName(label);
           result = new js.LabeledStatement(labelName, result);
         }
       }
     }
-    TargetElement target = labeledBlockInfo.target;
+    JumpTarget target = labeledBlockInfo.target;
     if (target.isSwitch) {
       // This is an extra block around a switch that is generated
       // as a nested if/else chain. We add an extra break target
@@ -1036,13 +1036,13 @@
   // Wraps a loop body in a block to make continues have a target to break
   // to (if necessary).
   void wrapLoopBodyForContinue(HLoopBlockInformation info) {
-    TargetElement target = info.target;
+    JumpTarget target = info.target;
     if (target != null && target.isContinueTarget) {
       js.Block oldContainer = currentContainer;
       js.Block body = new js.Block.empty();
       currentContainer = body;
       js.Statement result = body;
-      for (LabelElement label in info.labels) {
+      for (LabelDefinition label in info.labels) {
         if (label.isContinueTarget) {
           String labelName = backend.namer.continueLabelName(label);
           result = new js.LabeledStatement(labelName, result);
@@ -1054,7 +1054,7 @@
       continueAction[info.target] = implicitContinueAsBreak;
       visitBodyIgnoreLabels(info);
       continueAction.remove(info.target);
-      for (LabelElement label in info.labels) {
+      for (LabelDefinition label in info.labels) {
         if (label.isContinueTarget) {
           continueAction.remove(label);
         }
@@ -1355,26 +1355,26 @@
   }
 
   /**
-   * Checks if [map] contains an [ElementAction] for [element], and
+   * Checks if [map] contains an [EntityAction] for [entity], and
    * if so calls that action and returns true.
    * Otherwise returns false.
    */
-  bool tryCallAction(Map<Element, ElementAction> map, Element element) {
-    ElementAction action = map[element];
+  bool tryCallAction(Map<Entity, EntityAction> map, Entity entity) {
+    EntityAction action = map[entity];
     if (action == null) return false;
-    action(element);
+    action(entity);
     return true;
   }
 
   visitBreak(HBreak node) {
     assert(node.block.successors.length == 1);
     if (node.label != null) {
-      LabelElement label = node.label;
+      LabelDefinition label = node.label;
       if (!tryCallAction(breakAction, label)) {
         pushStatement(new js.Break(backend.namer.breakLabelName(label)), node);
       }
     } else {
-      TargetElement target = node.target;
+      JumpTarget target = node.target;
       if (!tryCallAction(breakAction, target)) {
         if (node.breakSwitchContinueLoop) {
           pushStatement(new js.Break(
@@ -1389,14 +1389,14 @@
   visitContinue(HContinue node) {
     assert(node.block.successors.length == 1);
     if (node.label != null) {
-      LabelElement label = node.label;
+      LabelDefinition label = node.label;
       if (!tryCallAction(continueAction, label)) {
         // TODO(floitsch): should this really be the breakLabelName?
         pushStatement(new js.Continue(backend.namer.breakLabelName(label)),
                       node);
       }
     } else {
-      TargetElement target = node.target;
+      JumpTarget target = node.target;
       if (!tryCallAction(continueAction, target)) {
         if (target.statement is ast.SwitchStatement) {
           pushStatement(new js.Continue(
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index 608b5c2..5987b54 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -162,8 +162,8 @@
     return result;
   }
 
-  HBasicBlock addNewLoopHeaderBlock(TargetElement target,
-                                    List<LabelElement> labels) {
+  HBasicBlock addNewLoopHeaderBlock(JumpTarget target,
+                                    List<LabelDefinition> labels) {
     HBasicBlock result = addNewBlock();
     result.loopInformation =
         new HLoopInformation(result, target, labels);
@@ -1921,10 +1921,10 @@
 }
 
 abstract class HJump extends HControlFlow {
-  final TargetElement target;
-  final LabelElement label;
+  final JumpTarget target;
+  final LabelDefinition label;
   HJump(this.target) : label = null, super(const <HInstruction>[]);
-  HJump.toLabel(LabelElement label)
+  HJump.toLabel(LabelDefinition label)
       : label = label, target = label.target, super(const <HInstruction>[]);
 }
 
@@ -1935,17 +1935,17 @@
    * [SsaFromAstMixin.buildComplexSwitchStatement] for detail.
    */
   final bool breakSwitchContinueLoop;
-  HBreak(TargetElement target, {bool this.breakSwitchContinueLoop: false})
+  HBreak(JumpTarget target, {bool this.breakSwitchContinueLoop: false})
       : super(target);
-  HBreak.toLabel(LabelElement label)
+  HBreak.toLabel(LabelDefinition label)
       : breakSwitchContinueLoop = false, super.toLabel(label);
   toString() => (label != null) ? 'break ${label.labelName}' : 'break';
   accept(HVisitor visitor) => visitor.visitBreak(this);
 }
 
 class HContinue extends HJump {
-  HContinue(TargetElement target) : super(target);
-  HContinue.toLabel(LabelElement label) : super.toLabel(label);
+  HContinue(JumpTarget target) : super(target);
+  HContinue.toLabel(LabelDefinition label) : super.toLabel(label);
   toString() => (label != null) ? 'continue ${label.labelName}' : 'continue';
   accept(HVisitor visitor) => visitor.visitContinue(this);
 }
@@ -2642,8 +2642,8 @@
   final HBasicBlock header;
   final List<HBasicBlock> blocks;
   final List<HBasicBlock> backEdges;
-  final List<LabelElement> labels;
-  final TargetElement target;
+  final List<LabelDefinition> labels;
+  final JumpTarget target;
 
   /** Corresponding block information for the loop. */
   HLoopBlockInformation loopBlockInformation;
@@ -2789,19 +2789,19 @@
 
 class HLabeledBlockInformation implements HStatementInformation {
   final HStatementInformation body;
-  final List<LabelElement> labels;
-  final TargetElement target;
+  final List<LabelDefinition> labels;
+  final JumpTarget target;
   final bool isContinue;
 
   HLabeledBlockInformation(this.body,
-                           List<LabelElement> labels,
+                           List<LabelDefinition> labels,
                            {this.isContinue: false}) :
       this.labels = labels, this.target = labels[0].target;
 
   HLabeledBlockInformation.implicit(this.body,
                                     this.target,
                                     {this.isContinue: false})
-      : this.labels = const<LabelElement>[];
+      : this.labels = const<LabelDefinition>[];
 
   HBasicBlock get start => body.start;
   HBasicBlock get end => body.end;
@@ -2834,8 +2834,8 @@
   final HExpressionInformation condition;
   final HStatementInformation body;
   final HExpressionInformation updates;
-  final TargetElement target;
-  final List<LabelElement> labels;
+  final JumpTarget target;
+  final List<LabelDefinition> labels;
   final SourceFileLocation sourcePosition;
   final SourceFileLocation endSourcePosition;
 
@@ -2935,8 +2935,8 @@
 class HSwitchBlockInformation implements HStatementInformation {
   final HExpressionInformation expression;
   final List<HStatementInformation> statements;
-  final TargetElement target;
-  final List<LabelElement> labels;
+  final JumpTarget target;
+  final List<LabelDefinition> labels;
 
   HSwitchBlockInformation(this.expression,
                           this.statements,
diff --git a/sdk/lib/_internal/compiler/implementation/universe/universe.dart b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
index ee87577..910c9d0 100644
--- a/sdk/lib/_internal/compiler/implementation/universe/universe.dart
+++ b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
@@ -68,7 +68,7 @@
    * Set of all closures in the program. Used by the mirror tracking system
    * to find all live closure instances.
    */
-  final Set<FunctionElement> allClosures = new Set<FunctionElement>();
+  final Set<LocalFunctionElement> allClosures = new Set<LocalFunctionElement>();
 
   /**
    * Set of methods in instantiated classes that are potentially
diff --git a/sdk/lib/_internal/compiler/implementation/use_unused_api.dart b/sdk/lib/_internal/compiler/implementation/use_unused_api.dart
index 5591741..41a6a6f 100644
--- a/sdk/lib/_internal/compiler/implementation/use_unused_api.dart
+++ b/sdk/lib/_internal/compiler/implementation/use_unused_api.dart
@@ -144,12 +144,10 @@
     ..visitErroneousElement(null)
     ..visitFieldParameterElement(null)
     ..visitFunctionElement(null)
-    ..visitLabelElement(null)
     ..visitLibraryElement(null)
     ..visitMixinApplicationElement(null)
     ..visitPrefixElement(null)
     ..visitScopeContainerElement(null)
-    ..visitTargetElement(null)
     ..visitTypeDeclarationElement(null)
     ..visitTypeVariableElement(null)
     ..visitTypedefElement(null)
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index b4a250d..912af14 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -1798,8 +1798,15 @@
       JS('void', '#[#] = #', JS_CURRENT_ISOLATE(), jsName, arg);
       return reflect(arg);
     }
-    throw new NoSuchStaticMethodError.method(
-        null, setterSymbol(fieldName), [arg], null);
+    Symbol setterName = setterSymbol(fieldName);
+    if (mirror == null) {
+      JsMethodMirror setter = __setters[setterName];
+      if (setter != null) {
+        setter._invoke([arg], const {});
+        return reflect(arg);
+      }
+    }
+    throw new NoSuchStaticMethodError.method(null, setterName, [arg], null);
   }
 
   bool _staticFieldExists(Symbol fieldName) {
@@ -2168,6 +2175,7 @@
     if (callName == null) {
       throw new RuntimeError('Cannot find callName on "$reflectee"');
     }
+    // TODO(floitsch): What about optional parameters?
     int parameterCount = int.parse(callName.split(r'$')[1]);
     if (reflectee is BoundClosure) {
       var target = BoundClosure.targetOf(reflectee);
@@ -2181,8 +2189,9 @@
     } else {
       bool isStatic = true; // TODO(ahe): Compute isStatic correctly.
       var jsFunction = JS('', '#[#]', reflectee, callName);
+      var dummyOptionalParameterCount = 0;
       cachedFunction = new JsMethodMirror(
-          s(callName), jsFunction, parameterCount,
+          s(callName), jsFunction, parameterCount, dummyOptionalParameterCount,
           false, false, isStatic, false, false);
     }
     JS('void', r'#.constructor[#] = #', reflectee, cacheName, cachedFunction);
@@ -2203,7 +2212,8 @@
 
 class JsMethodMirror extends JsDeclarationMirror implements MethodMirror {
   final _jsFunction;
-  final int _parameterCount;
+  final int _requiredParameterCount;
+  final int _optionalParameterCount;
   final bool isGetter;
   final bool isSetter;
   final bool isStatic;
@@ -2216,7 +2226,8 @@
 
   JsMethodMirror(Symbol simpleName,
                  this._jsFunction,
-                 this._parameterCount,
+                 this._requiredParameterCount,
+                 this._optionalParameterCount,
                  this.isGetter,
                  this.isSetter,
                  this.isStatic,
@@ -2247,12 +2258,14 @@
       optionalParameterCount = int.parse(info[2]);
     }
     return new JsMethodMirror(
-        s(name), jsFunction, requiredParameterCount + optionalParameterCount,
+        s(name), jsFunction, requiredParameterCount, optionalParameterCount,
         isGetter, isSetter, isStatic, isConstructor, isOperator);
   }
 
   String get _prettyName => 'MethodMirror';
 
+  int get _parameterCount => _requiredParameterCount + _optionalParameterCount;
+
   List<ParameterMirror> get parameters {
     if (_parameters != null) return _parameters;
     metadata; // Compute _parameters as a side-effect of extracting metadata.
@@ -2339,11 +2352,23 @@
     if (!isStatic && !isConstructor) {
       throw new RuntimeError('Cannot invoke instance method without receiver.');
     }
-    if (_parameterCount != positionalArguments.length || _jsFunction == null) {
+    int positionalLength = positionalArguments.length;
+    if (positionalLength < _requiredParameterCount ||
+        positionalLength >  _parameterCount ||
+        _jsFunction == null) {
       // TODO(ahe): What receiver to use?
       throw new NoSuchMethodError(
           owner, simpleName, positionalArguments, namedArguments);
     }
+    if (positionalLength < _parameterCount) {
+      // Fill up with default values.
+      // Make a copy so we don't modify the input.
+      positionalArguments = positionalArguments.toList();
+      for (int i = positionalLength; i < parameters.length; i++) {
+        JsParameterMirror parameter = parameters[i];
+        positionalArguments.add(parameter.defaultValue.reflectee);
+      }
+    }
     // Using JS_CURRENT_ISOLATE() ('$') here is actually correct, although
     // _jsFunction may not be a property of '$', most static functions do not
     // care who their receiver is. But to lazy getters, it is important that
diff --git a/sdk/lib/_internal/lib/typed_data_patch.dart b/sdk/lib/_internal/lib/typed_data_patch.dart
index c32964b..e9af062 100644
--- a/sdk/lib/_internal/lib/typed_data_patch.dart
+++ b/sdk/lib/_internal/lib/typed_data_patch.dart
@@ -13,88 +13,78 @@
 import 'dart:_native_typed_data';
 
 @patch class ByteData {
-  @patch factory ByteData(int length) =>
-      new NativeByteData(length);
+  @patch factory ByteData(int length) = NativeByteData;
 }
 
 
 @patch class Float32List {
-  @patch factory Float32List(int length) =>
-      new NativeFloat32List(length);
+  @patch factory Float32List(int length) = NativeFloat32List;
 
-  @patch factory Float32List.fromList(List<double> elements) =>
-      new NativeFloat32List.fromList(elements);
+  @patch factory Float32List.fromList(List<double> elements) =
+      NativeFloat32List.fromList;
 }
 
 
 @patch class Float64List {
-  @patch factory Float64List(int length) =>
-      new NativeFloat64List(length);
+  @patch factory Float64List(int length) = NativeFloat64List;
 
-  @patch factory Float64List.fromList(List<double> elements) =>
-      new NativeFloat64List.fromList(elements);
+  @patch factory Float64List.fromList(List<double> elements) =
+      NativeFloat64List.fromList;
 }
 
 
 @patch class Int16List {
-  @patch factory Int16List(int length) =>
-      new NativeInt16List(length);
+  @patch factory Int16List(int length) = NativeInt16List;
 
-  @patch factory Int16List.fromList(List<int> elements) =>
-      new NativeInt16List.fromList(elements);
+  @patch factory Int16List.fromList(List<int> elements) =
+      NativeInt16List.fromList;
 }
 
 @patch class Int32List {
-  @patch factory Int32List(int length) =>
-      new NativeInt32List(length);
+  @patch factory Int32List(int length) = NativeInt32List;
 
-  @patch factory Int32List.fromList(List<int> elements) =>
-      new NativeInt32List.fromList(elements);
+  @patch factory Int32List.fromList(List<int> elements) =
+      NativeInt32List.fromList;
 }
 
 
 @patch class Int8List {
-  @patch factory Int8List(int length) =>
-      new NativeInt8List(length);
+  @patch factory Int8List(int length) = NativeInt8List;
 
-  @patch factory Int8List.fromList(List<int> elements) =>
-      new NativeInt8List.fromList(elements);
+  @patch factory Int8List.fromList(List<int> elements) =
+      NativeInt8List.fromList;
 }
 
 
 @patch class Uint32List {
-  @patch factory Uint32List(int length) =>
-      new NativeUint32List(length);
+  @patch factory Uint32List(int length) = NativeUint32List;
 
-  @patch factory Uint32List.fromList(List<int> elements) =>
-      new NativeUint32List.fromList(elements);
+  @patch factory Uint32List.fromList(List<int> elements) =
+      NativeUint32List.fromList;
 }
 
 
 @patch class Uint16List {
-  @patch factory Uint16List(int length) =>
-      new NativeUint16List(length);
+  @patch factory Uint16List(int length) = NativeUint16List;
 
-  @patch factory Uint16List.fromList(List<int> elements) =>
-      new NativeUint16List.fromList(elements);
+  @patch factory Uint16List.fromList(List<int> elements) =
+      NativeUint16List.fromList;
 }
 
 
 @patch class Uint8ClampedList {
-  @patch factory Uint8ClampedList(int length) =>
-      new NativeUint8ClampedList(length);
+  @patch factory Uint8ClampedList(int length) = NativeUint8ClampedList;
 
-  @patch factory Uint8ClampedList.fromList(List<int> elements) =>
-      new NativeUint8ClampedList.fromList(elements);
+  @patch factory Uint8ClampedList.fromList(List<int> elements) =
+      NativeUint8ClampedList.fromList;
 }
 
 
 @patch class Uint8List {
-  @patch factory Uint8List(int length) =>
-      new NativeUint8List(length);
+  @patch factory Uint8List(int length) = NativeUint8List;
 
-  @patch factory Uint8List.fromList(List<int> elements) =>
-      new NativeUint8List.fromList(elements);
+  @patch factory Uint8List.fromList(List<int> elements) =
+      NativeUint8List.fromList;
 }
 
 
@@ -120,56 +110,49 @@
 }
 
 @patch class Int32x4List {
-  @patch factory Int32x4List(int length) =>
-      new NativeInt32x4List(length);
+  @patch factory Int32x4List(int length) = NativeInt32x4List;
 
-  @patch factory Int32x4List.fromList(List<Int32x4> elements) =>
-      new NativeInt32x4List.fromList(elements);
+  @patch factory Int32x4List.fromList(List<Int32x4> elements) =
+      NativeInt32x4List.fromList;
 }
 
 @patch class Float32x4List {
-  @patch factory Float32x4List(int length) =>
-      new NativeFloat32x4List(length);
+  @patch factory Float32x4List(int length) = NativeFloat32x4List;
 
-  @patch factory Float32x4List.fromList(List<Float32x4> elements) =>
-      new NativeFloat32x4List.fromList(elements);
+  @patch factory Float32x4List.fromList(List<Float32x4> elements) =
+      NativeFloat32x4List.fromList;
 }
 
 @patch class Float64x2List {
-  @patch factory Float64x2List(int length) =>
-      new NativeFloat64x2List(length);
+  @patch factory Float64x2List(int length) = NativeFloat64x2List;
 
-  @patch factory Float64x2List.fromList(List<Float64x2> elements) =>
-      new NativeFloat64x2List.fromList(elements);
+  @patch factory Float64x2List.fromList(List<Float64x2> elements) =
+      NativeFloat64x2List.fromList;
 }
 
 @patch class Float32x4 {
-  @patch factory Float32x4(double x, double y, double z, double w) =>
-      new NativeFloat32x4(x, y, z, w);
-  @patch factory Float32x4.splat(double v) =>
-      new NativeFloat32x4.splat(v);
-  @patch factory Float32x4.zero() => new NativeFloat32x4.zero();
-  @patch factory Float32x4.fromInt32x4Bits(Int32x4 x) =>
-      new NativeFloat32x4.fromInt32x4Bits(x);
-  @patch factory Float32x4.fromFloat64x2(Float64x2 v) =>
-      new NativeFloat32x4.fromFloat64x2(v);
+  @patch factory Float32x4(double x, double y, double z, double w) =
+      NativeFloat32x4;
+  @patch factory Float32x4.splat(double v) = NativeFloat32x4.splat;
+  @patch factory Float32x4.zero() = NativeFloat32x4.zero;
+  @patch factory Float32x4.fromInt32x4Bits(Int32x4 x) =
+      NativeFloat32x4.fromInt32x4Bits;
+  @patch factory Float32x4.fromFloat64x2(Float64x2 v) =
+      NativeFloat32x4.fromFloat64x2;
 }
 
 @patch class Int32x4 {
-  @patch factory Int32x4(int x, int y, int z, int w)
-      => new NativeInt32x4(x, y, z , w);
-  @patch factory Int32x4.bool(bool x, bool y, bool z, bool w)
-      => new NativeInt32x4.bool(x, y, z, w);
-  @patch factory Int32x4.fromFloat32x4Bits(Float32x4 x)
-      => new NativeInt32x4.fromFloat32x4Bits(x);
+  @patch factory Int32x4(int x, int y, int z, int w) = NativeInt32x4;
+  @patch factory Int32x4.bool(bool x, bool y, bool z, bool w) =
+      NativeInt32x4.bool;
+  @patch factory Int32x4.fromFloat32x4Bits(Float32x4 x) =
+      NativeInt32x4.fromFloat32x4Bits;
 }
 
 @patch class Float64x2 {
-  @patch factory Float64x2(double x, double y) => new NativeFloat64x2(x, y);
-  @patch factory Float64x2.splat(double v)
-      => new NativeFloat64x2.splat(v);
-  @patch factory Float64x2.zero()
-      => new NativeFloat64x2.zero();
-  @patch factory Float64x2.fromFloat32x4(Float32x4 v)
-      => new NativeFloat64x2.fromFloat32x4(v);
+  @patch factory Float64x2(double x, double y) = NativeFloat64x2;
+  @patch factory Float64x2.splat(double v) = NativeFloat64x2.splat;
+  @patch factory Float64x2.zero() = NativeFloat64x2.zero;
+  @patch factory Float64x2.fromFloat32x4(Float32x4 v) =
+      NativeFloat64x2.fromFloat32x4;
 }
diff --git a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
index 814dbbe..1b22647 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart
@@ -10,6 +10,7 @@
 import 'package:analyzer/analyzer.dart';
 import 'package:barback/barback.dart';
 import 'package:path/path.dart' as path;
+import 'package:pool/pool.dart';
 import 'package:stack_trace/stack_trace.dart';
 
 import '../../../../compiler/compiler.dart' as compiler;
@@ -18,7 +19,6 @@
 import '../../../../compiler/implementation/source_file.dart';
 import '../barback.dart';
 import '../dart.dart' as dart;
-import '../pool.dart';
 import '../utils.dart';
 import 'asset_environment.dart';
 
diff --git a/sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart b/sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart
index 42ff5ba..e6f9912 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/transformer_config.dart
@@ -5,7 +5,7 @@
 library pub.barback.transformer_config;
 
 import 'package:path/path.dart' as p;
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 import 'package:yaml/yaml.dart';
 
 import 'transformer_id.dart';
@@ -27,7 +27,7 @@
   final Map configuration;
 
   /// The source span from which this configuration was parsed.
-  final Span span;
+  final SourceSpan span;
 
   /// The primary input inclusions.
   ///
@@ -65,7 +65,7 @@
   /// Parses [identifier] as a [TransformerId] with [configuration].
   ///
   /// [identifierSpan] is the source span for [identifier].
-  factory TransformerConfig.parse(String identifier, Span identifierSpan,
+  factory TransformerConfig.parse(String identifier, SourceSpan identifierSpan,
         YamlMap configuration) =>
       new TransformerConfig(new TransformerId.parse(identifier, identifierSpan),
           configuration);
@@ -81,13 +81,13 @@
       if (field is List) {
         for (var node in field.nodes) {
           if (node.value is String) continue;
-          throw new SpanFormatException(
+          throw new SourceSpanFormatException(
               '"$key" field may contain only strings.', node.span);
         }
 
         return new Set.from(field);
       } else {
-        throw new SpanFormatException(
+        throw new SourceSpanFormatException(
             '"$key" field must be a string or list.', fieldNode.span);
       }
     }
@@ -114,7 +114,7 @@
       // All other keys starting with "$" are unexpected.
       for (var key in configuration.keys) {
         if (key is! String || !key.startsWith(r'$')) continue;
-        throw new SpanFormatException(
+        throw new SourceSpanFormatException(
             'Unknown reserved field.', configurationNode.nodes[key].span);
       }
     }
diff --git a/sdk/lib/_internal/pub/lib/src/barback/transformer_id.dart b/sdk/lib/_internal/pub/lib/src/barback/transformer_id.dart
index e793ef3..5d111ab 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/transformer_id.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/transformer_id.dart
@@ -8,7 +8,7 @@
 
 import 'package:barback/barback.dart';
 import 'package:path/path.dart' as p;
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 
 import '../io.dart';
 import '../utils.dart';
@@ -35,7 +35,7 @@
   final String path;
 
   /// The source span from which this id was parsed.
-  final Span span;
+  final SourceSpan span;
 
   /// Whether this ID points to a built-in transformer exposed by pub.
   bool get isBuiltInTransformer => package.startsWith('\$');
@@ -47,7 +47,7 @@
   /// it just has a package name, it expands to lib/transformer.dart if that
   /// exists, or lib/${package}.dart otherwise. Otherwise, it expands to
   /// lib/${path}.dart. In either case it's located in the given package.
-  factory TransformerId.parse(String identifier, Span span) {
+  factory TransformerId.parse(String identifier, SourceSpan span) {
     if (identifier.isEmpty) {
       throw new FormatException('Invalid library identifier: "".');
     }
@@ -63,8 +63,8 @@
   TransformerId(this.package, this.path, this.span) {
     if (!package.startsWith('\$')) return;
     if (_BUILT_IN_TRANSFORMERS.contains(package)) return;
-    throw new SpanFormatException('Unsupported built-in transformer $package.',
-        span);
+    throw new SourceSpanFormatException(
+        'Unsupported built-in transformer $package.', span);
   }
 
   bool operator==(other) =>
diff --git a/sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart b/sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart
index fde4855..9a769e4 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart
@@ -9,7 +9,7 @@
 import 'dart:isolate';
 
 import 'package:barback/barback.dart';
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 import 'package:stack_trace/stack_trace.dart';
 
 import '../../../asset/dart/serialize.dart';
@@ -122,11 +122,12 @@
 }
 
 /// An error thrown when a transformer fails to load.
-class TransformerLoadError extends SpanException implements WrappedException {
+class TransformerLoadError extends SourceSpanException
+    implements WrappedException {
   final CrossIsolateException innerError;
   Chain get innerChain => innerError.stackTrace;
 
-  TransformerLoadError(CrossIsolateException error, Span span)
+  TransformerLoadError(CrossIsolateException error, SourceSpan span)
       : innerError = error,
         super("Error loading transformer: ${error.message}", span);
 }
diff --git a/sdk/lib/_internal/pub/lib/src/http.dart b/sdk/lib/_internal/pub/lib/src/http.dart
index 24dbacb..4fe118e 100644
--- a/sdk/lib/_internal/pub/lib/src/http.dart
+++ b/sdk/lib/_internal/pub/lib/src/http.dart
@@ -10,6 +10,7 @@
 import 'dart:io';
 
 import 'package:http/http.dart' as http;
+import 'package:http_throttle/http_throttle.dart';
 
 import 'io.dart';
 import 'log.dart' as log;
@@ -38,13 +39,13 @@
 /// This also adds a 30-second timeout to every request. This can be configured
 /// on a per-request basis by setting the 'Pub-Request-Timeout' header to the
 /// desired number of milliseconds, or to "None" to disable the timeout.
-class PubHttpClient extends http.BaseClient {
+class _PubHttpClient extends http.BaseClient {
   final _requestStopwatches = new Map<http.BaseRequest, Stopwatch>();
 
-  http.Client inner;
+  http.Client _inner;
 
-  PubHttpClient([http.Client inner])
-      : this.inner = inner == null ? new http.Client() : inner;
+  _PubHttpClient([http.Client inner])
+      : this._inner = inner == null ? new http.Client() : inner;
 
   Future<http.StreamedResponse> send(http.BaseRequest request) {
     _requestStopwatches[request] = new Stopwatch()..start();
@@ -67,7 +68,7 @@
       timeoutLength = int.parse(timeoutString);
     }
 
-    var future = inner.send(request).then((streamedResponse) {
+    var future = _inner.send(request).then((streamedResponse) {
       _logResponse(streamedResponse);
 
       var status = streamedResponse.statusCode;
@@ -191,8 +192,15 @@
   }
 }
 
+/// The [_PubHttpClient] wrapped by [httpClient].
+final _pubClient = new _PubHttpClient();
+
 /// The HTTP client to use for all HTTP requests.
-final httpClient = new PubHttpClient();
+final httpClient = new ThrottleClient(16, _pubClient);
+
+/// The underlying HTTP client wrapped by [httpClient].
+http.Client get innerHttpClient => _pubClient._inner;
+set innerHttpClient(http.Client client) => _pubClient._inner = client;
 
 /// Handles a successful JSON-formatted response from pub.dartlang.org.
 ///
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
index 5ccb3c2..90e8cf7 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -11,6 +11,7 @@
 import 'dart:io';
 
 import 'package:path/path.dart' as path;
+import 'package:pool/pool.dart';
 import 'package:http/http.dart' show ByteStream;
 import 'package:http_multi_server/http_multi_server.dart';
 import 'package:stack_trace/stack_trace.dart';
@@ -18,7 +19,6 @@
 import 'exit_codes.dart' as exit_codes;
 import 'error_group.dart';
 import 'log.dart' as log;
-import 'pool.dart';
 import 'sdk.dart' as sdk;
 import 'utils.dart';
 
diff --git a/sdk/lib/_internal/pub/lib/src/lock_file.dart b/sdk/lib/_internal/pub/lib/src/lock_file.dart
index 128a3a9..7501951 100644
--- a/sdk/lib/_internal/pub/lib/src/lock_file.dart
+++ b/sdk/lib/_internal/pub/lib/src/lock_file.dart
@@ -5,7 +5,7 @@
 library pub.lock_file;
 
 import 'package:path/path.dart' as p;
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 import 'package:yaml/yaml.dart';
 
 import 'io.dart';
@@ -54,9 +54,9 @@
 
     if (contents.trim() == '') return new LockFile.empty();
 
-    var sourceName;
-    if (filePath != null) sourceName = p.toUri(filePath).toString();
-    var parsed = loadYamlNode(contents, sourceName: sourceName);
+    var sourceUrl;
+    if (filePath != null) sourceUrl = p.toUri(filePath);
+    var parsed = loadYamlNode(contents, sourceUrl: sourceUrl);
 
     _validate(parsed is Map, 'The lockfile must be a YAML mapping.', parsed);
 
@@ -86,7 +86,8 @@
           description = source.parseDescription(filePath, description,
               fromLockFile: true);
         } on FormatException catch (ex) {
-          throw new SpanFormatException(ex.message, spec.nodes['source'].span);
+          throw new SourceSpanFormatException(ex.message,
+              spec.nodes['source'].span);
         }
 
         var id = new PackageId(name, sourceName, version, description);
@@ -105,7 +106,7 @@
   /// If [condition] is `false` throws a format error with [message] for [node].
   static void _validate(bool condition, String message, YamlNode node) {
     if (condition) return;
-    throw new SpanFormatException(message, node.span);
+    throw new SourceSpanFormatException(message, node.span);
   }
 
   /// Returns the serialized YAML text of the lock file.
diff --git a/sdk/lib/_internal/pub/lib/src/log.dart b/sdk/lib/_internal/pub/lib/src/log.dart
index 6821581..3eb2557 100644
--- a/sdk/lib/_internal/pub/lib/src/log.dart
+++ b/sdk/lib/_internal/pub/lib/src/log.dart
@@ -11,6 +11,7 @@
 
 import 'package:path/path.dart' as p;
 import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 import 'package:stack_trace/stack_trace.dart';
 
 import 'exceptions.dart';
@@ -317,6 +318,8 @@
   // spew a stack trace on our users.
   if (exception is SpanException) {
     error(exception.toString(useColors: canUseSpecialChars));
+  } else if (exception is SourceSpanException) {
+    error(exception.toString(color: canUseSpecialChars));
   } else {
     error(getErrorMessage(exception));
   }
@@ -507,7 +510,8 @@
     }
 
     // If the error came from a file, include the path.
-    if (error is SpanException && error.span.sourceUrl != null) {
+    if ((error is SpanException || error is SourceSpanException) &&
+        error.span.sourceUrl != null) {
       errorJson["path"] = p.fromUri(error.span.sourceUrl);
     }
 
diff --git a/sdk/lib/_internal/pub/lib/src/pool.dart b/sdk/lib/_internal/pub/lib/src/pool.dart
deleted file mode 100644
index 24100ca..0000000
--- a/sdk/lib/_internal/pub/lib/src/pool.dart
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library barback.pool;
-
-import 'dart:async';
-import 'dart:collection';
-
-import 'package:stack_trace/stack_trace.dart';
-
-import 'utils.dart';
-
-// TODO(nweiz): put this somewhere that it can be shared between packages.
-/// Manages an abstract pool of resources with a limit on how many may be in use
-/// at once.
-///
-/// When a resource is needed, the user should call [request]. When the returned
-/// future completes with a [PoolResource], the resource may be allocated. Once
-/// the resource has been released, the user should call [PoolResource.release].
-/// The pool will ensure that only a certain number of [PoolResource]s may be
-/// allocated at once.
-class Pool {
-  /// Completers for requests beyond the first [_maxAllocatedResources].
-  ///
-  /// When an item is released, the next element of [_requestedResources] will
-  /// be completed.
-  final _requestedResources = new Queue<Completer<PoolResource>>();
-
-  /// The maximum number of resources that may be allocated at once.
-  final int _maxAllocatedResources;
-
-  /// The number of resources that are currently allocated.
-  int _allocatedResources = 0;
-
-  /// The timeout timer.
-  ///
-  /// If [_timeout] isn't null, this timer is set as soon as the resource limit
-  /// is reached and is reset every time an resource is released or a new
-  /// resource is requested. If it fires, that indicates that the caller became
-  /// deadlocked, likely due to files waiting for additional files to be read
-  /// before they could be closed.
-  Timer _timer;
-
-  /// The amount of time to wait before timing out the pending resources.
-  Duration _timeout;
-
-  /// Creates a new pool with the given limit on how many resources may be
-  /// allocated at once.
-  ///
-  /// If [timeout] is passed, then if that much time passes without any activity
-  /// all pending [request] futures will throw an exception. This is indented
-  /// to avoid deadlocks.
-  Pool(this._maxAllocatedResources, {Duration timeout})
-      : _timeout = timeout;
-
-  /// Request a [PoolResource].
-  ///
-  /// If the maximum number of resources is already allocated, this will delay
-  /// until one of them is released.
-  Future<PoolResource> request() {
-    if (_allocatedResources < _maxAllocatedResources) {
-      _allocatedResources++;
-      return new Future.value(new PoolResource._(this));
-    } else {
-      var completer = new Completer<PoolResource>();
-      _requestedResources.add(completer);
-      _resetTimer();
-      return completer.future;
-    }
-  }
-
-  /// Requests a resource for the duration of [callback], which may return a
-  /// Future.
-  ///
-  /// The return value of [callback] is piped to the returned Future.
-  Future withResource(callback()) {
-    return request().then((resource) =>
-        syncFuture(callback).whenComplete(resource.release));
-  }
-
-  /// If there are any pending requests, this will fire the oldest one.
-  void _onResourceReleased() {
-    if (_requestedResources.isEmpty) {
-      _allocatedResources--;
-      if (_timer != null) {
-        _timer.cancel();
-        _timer = null;
-      }
-      return;
-    }
-
-    _resetTimer();
-    var pending = _requestedResources.removeFirst();
-    pending.complete(new PoolResource._(this));
-  }
-
-  /// A resource has been requested, allocated, or released.
-  void _resetTimer() {
-    if (_timer != null) _timer.cancel();
-    if (_timeout == null) {
-      _timer = null;
-    } else {
-      _timer = new Timer(_timeout, _onTimeout);
-    }
-  }
-
-  /// Handles [_timer] timing out by causing all pending resource completers to
-  /// emit exceptions.
-  void _onTimeout() {
-    for (var completer in _requestedResources) {
-      completer.completeError("Pool deadlock: all resources have been "
-          "allocated for too long.", new Chain.current());
-    }
-    _requestedResources.clear();
-    _timer = null;
-  }
-}
-
-/// A member of a [Pool].
-///
-/// A [PoolResource] is a token that indicates that a resource is allocated.
-/// When the associated resource is released, the user should call [release].
-class PoolResource {
-  final Pool _pool;
-
-  /// Whether [this] has been released yet.
-  bool _released = false;
-
-  PoolResource._(this._pool);
-
-  /// Tells the parent [Pool] that the resource associated with this resource is
-  /// no longer allocated, and that a new [PoolResource] may be allocated.
-  void release() {
-    if (_released) {
-      throw new StateError("A PoolResource may only be released once.");
-    }
-    _released = true;
-    _pool._onResourceReleased();
-  }
-}
\ No newline at end of file
diff --git a/sdk/lib/_internal/pub/lib/src/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart
index dafb513..883a77c 100644
--- a/sdk/lib/_internal/pub/lib/src/pubspec.dart
+++ b/sdk/lib/_internal/pub/lib/src/pubspec.dart
@@ -5,7 +5,7 @@
 library pub.pubspec;
 
 import 'package:path/path.dart' as path;
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
 import 'package:yaml/yaml.dart';
 
 import 'barback/transformer_config.dart';
@@ -38,8 +38,7 @@
   ///
   /// This can be null if the pubspec was created in-memory or if its location
   /// is unknown.
-  Uri get _location => fields.span.sourceUrl == null ? null :
-      Uri.parse(fields.span.sourceUrl);
+  Uri get _location => fields.span.sourceUrl;
 
   /// All pubspec fields.
   ///
@@ -257,8 +256,8 @@
   /// [location] is the location from which this pubspec was loaded.
   Pubspec.fromMap(Map fields, this._sources, {String expectedName,
       Uri location})
-      : fields = fields is YamlMap ? fields : new YamlMap.wrap(fields,
-          sourceName: location == null ? null : location.toString()) {
+      : fields = fields is YamlMap ? fields :
+            new YamlMap.wrap(fields, sourceUrl: location) {
     // If [expectedName] is passed, ensure that the actual 'name' field exists
     // and matches the expectation.
     if (expectedName == null) return;
@@ -274,11 +273,9 @@
   /// [Version.none].
   factory Pubspec.parse(String contents, SourceRegistry sources,
       {String expectedName, Uri location}) {
-    if (contents.trim() == '') return new Pubspec.empty();
-
-    var pubspecNode = loadYamlNode(contents, sourceName: location.toString());
+    var pubspecNode = loadYamlNode(contents, sourceUrl: location);
     if (pubspecNode is YamlScalar && pubspecNode.value == null) {
-      pubspecNode = new YamlMap();
+      pubspecNode = new YamlMap(sourceUrl: location);
     } else if (pubspecNode is! YamlMap) {
       throw new PubspecException(
           'The pubspec must be a YAML mapping.', pubspecNode.span);
@@ -431,7 +428,7 @@
   /// [description] should be a noun phrase that describes whatever's being
   /// parsed or processed by [fn]. [span] should be the location of whatever's
   /// being processed within the pubspec.
-  _wrapFormatException(String description, Span span, fn()) {
+  _wrapFormatException(String description, SourceSpan span, fn()) {
     try {
       return fn();
     } on FormatException catch (e) {
@@ -442,13 +439,13 @@
   _wrapSpanFormatException(String description, fn()) {
     try {
       return fn();
-    } on SpanFormatException catch (e) {
+    } on SourceSpanFormatException catch (e) {
       _error('Invalid $description: ${e.message}', e.span);
     }
   }
 
   /// Throws a [PubspecException] with the given message.
-  void _error(String message, Span span) {
+  void _error(String message, SourceSpan span) {
     var name;
     try {
       name = this.name;
@@ -475,9 +472,9 @@
 /// An exception thrown when parsing a pubspec.
 ///
 /// These exceptions are often thrown lazily while accessing pubspec properties.
-class PubspecException extends SpanFormatException
+class PubspecException extends SourceSpanFormatException
     implements ApplicationException {
-  PubspecException(String message, Span span)
+  PubspecException(String message, SourceSpan span)
       : super(message, span);
 }
 
diff --git a/sdk/lib/_internal/pub/test/get/path/empty_pubspec_test.dart b/sdk/lib/_internal/pub/test/get/path/empty_pubspec_test.dart
new file mode 100644
index 0000000..4950bec
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/get/path/empty_pubspec_test.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS d.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 d.file.
+
+import 'package:path/path.dart' as p;
+
+import '../../../lib/src/exit_codes.dart' as exit_codes;
+import '../../descriptor.dart' as d;
+import '../../test_pub.dart';
+
+main() {
+  initConfig();
+  // Regression test for issue 20103.
+  integration('path dependency to an empty pubspec', () {
+    d.dir('foo', [
+      d.libDir('foo'),
+      d.file('pubspec.yaml', '')
+    ]).create();
+
+    d.dir(appPath, [
+      d.appPubspec({
+        "foo": {"path": "../foo"}
+      })
+    ]).create();
+
+    pubGet(exitCode: exit_codes.DATA, error:
+        'Error on line 1, column 1 of ${p.join('..', 'foo', 'pubspec.yaml')}: '
+            'Missing the required "name" field.');
+  });
+}
\ No newline at end of file
diff --git a/sdk/lib/_internal/pub/test/test_pub.dart b/sdk/lib/_internal/pub/test/test_pub.dart
index 1bbf307..6729e0d 100644
--- a/sdk/lib/_internal/pub/test/test_pub.dart
+++ b/sdk/lib/_internal/pub/test/test_pub.dart
@@ -835,10 +835,10 @@
 /// Note that this will only affect HTTP requests made via http.dart in the
 /// parent process.
 void useMockClient(MockClient client) {
-  var oldInnerClient = httpClient.inner;
-  httpClient.inner = client;
+  var oldInnerClient = innerHttpClient;
+  innerHttpClient = client;
   currentSchedule.onComplete.schedule(() {
-    httpClient.inner = oldInnerClient;
+    innerHttpClient = oldInnerClient;
   }, 'de-activating the mock client');
 }
 
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 2c51456..fd51eca 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -54,7 +54,7 @@
 // Not actually used, but imported since dart:html can generate these objects.
 import 'dart:_js_helper' show
     convertDartClosureToJS, Creates, JavaScriptIndexingBehavior,
-    JSName, Null, Returns,
+    JSName, Native, Null, Returns,
     findDispatchTagForInterceptorClass, setNativeSubclassDispatchRecord,
     makeLeafDispatchRecord;
 import 'dart:_interceptors' show
@@ -90,7 +90,8 @@
 
 // Workaround for tags like <cite> that lack their own Element subclass --
 // Dart issue 1990.
-class HtmlElement extends Element native "HTMLElement" {
+@Native("HTMLElement")
+class HtmlElement extends Element {
   factory HtmlElement() { throw new UnsupportedError("Not supported"); }
 
   /**
@@ -104,7 +105,8 @@
 // EntryArray type was removed, so explicitly adding it to allow support for
 // older Chrome versions.
 // Issue #12573.
-abstract class _EntryArray implements List<Entry> native "EntryArray" {}
+@Native("EntryArray")
+abstract class _EntryArray implements List<Entry> {}
 
 /**
  * Spawn a DOM isolate using the given URI in the same window.
@@ -124,7 +126,8 @@
 
 @DocsEditable()
 @DomName('AbstractWorker')
-abstract class AbstractWorker extends Interceptor implements EventTarget native "AbstractWorker" {
+@Native("AbstractWorker")
+abstract class AbstractWorker extends Interceptor implements EventTarget {
   // To suppress missing implicit constructor warnings.
   factory AbstractWorker._() { throw new UnsupportedError("Not supported"); }
 
@@ -151,7 +154,8 @@
 @DocsEditable()
 @DomName('Algorithm')
 @Experimental() // untriaged
-class Algorithm extends Interceptor native "Algorithm" {
+@Native("Algorithm")
+class Algorithm extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Algorithm._() { throw new UnsupportedError("Not supported"); }
 
@@ -167,7 +171,8 @@
 
 @DocsEditable()
 @DomName('HTMLAnchorElement')
-class AnchorElement extends HtmlElement implements UrlUtils native "HTMLAnchorElement" {
+@Native("HTMLAnchorElement")
+class AnchorElement extends HtmlElement implements UrlUtils {
   // To suppress missing implicit constructor warnings.
   factory AnchorElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -267,7 +272,8 @@
 @DocsEditable()
 @DomName('Animation')
 @Experimental() // untriaged
-class Animation extends TimedItem native "Animation" {
+@Native("Animation")
+class Animation extends TimedItem {
   // To suppress missing implicit constructor warnings.
   factory Animation._() { throw new UnsupportedError("Not supported"); }
 
@@ -299,7 +305,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental()
-class AnimationEvent extends Event native "WebKitAnimationEvent" {
+@Native("WebKitAnimationEvent")
+class AnimationEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory AnimationEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -324,7 +331,8 @@
 @SupportedBrowser(SupportedBrowser.OPERA)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class ApplicationCache extends EventTarget native "ApplicationCache,DOMApplicationCache,OfflineResourceList" {
+@Native("ApplicationCache,DOMApplicationCache,OfflineResourceList")
+class ApplicationCache extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory ApplicationCache._() { throw new UnsupportedError("Not supported"); }
 
@@ -508,7 +516,8 @@
  * on MDN.
  */
 @DomName('HTMLAreaElement')
-class AreaElement extends HtmlElement implements UrlUtils native "HTMLAreaElement" {
+@Native("HTMLAreaElement")
+class AreaElement extends HtmlElement implements UrlUtils {
   // To suppress missing implicit constructor warnings.
   factory AreaElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -599,7 +608,8 @@
 
 @DocsEditable()
 @DomName('HTMLAudioElement')
-class AudioElement extends MediaElement native "HTMLAudioElement" {
+@Native("HTMLAudioElement")
+class AudioElement extends MediaElement {
   // To suppress missing implicit constructor warnings.
   factory AudioElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -629,7 +639,8 @@
 @DomName('AutocompleteErrorEvent')
 // http://wiki.whatwg.org/wiki/RequestAutocomplete
 @Experimental()
-class AutocompleteErrorEvent extends Event native "AutocompleteErrorEvent" {
+@Native("AutocompleteErrorEvent")
+class AutocompleteErrorEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory AutocompleteErrorEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -644,7 +655,8 @@
 
 @DocsEditable()
 @DomName('HTMLBRElement')
-class BRElement extends HtmlElement native "HTMLBRElement" {
+@Native("HTMLBRElement")
+class BRElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory BRElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -667,7 +679,8 @@
 @DomName('BarProp')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#barprop
 @deprecated // standard
-class BarProp extends Interceptor native "BarProp" {
+@Native("BarProp")
+class BarProp extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory BarProp._() { throw new UnsupportedError("Not supported"); }
 
@@ -682,7 +695,8 @@
 
 @DocsEditable()
 @DomName('HTMLBaseElement')
-class BaseElement extends HtmlElement native "HTMLBaseElement" {
+@Native("HTMLBaseElement")
+class BaseElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory BaseElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -712,7 +726,8 @@
 @DocsEditable()
 @DomName('BeforeLoadEvent')
 @Experimental()
-class BeforeLoadEvent extends Event native "BeforeLoadEvent" {
+@Native("BeforeLoadEvent")
+class BeforeLoadEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory BeforeLoadEvent._() { throw new UnsupportedError("Not supported"); }
 }
@@ -723,7 +738,8 @@
 
 @DocsEditable()
 @DomName('BeforeUnloadEvent')
-class BeforeUnloadEvent extends Event native "BeforeUnloadEvent" {
+@Native("BeforeUnloadEvent")
+class BeforeUnloadEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory BeforeUnloadEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -740,7 +756,8 @@
 
 
 @DomName('Blob')
-class Blob extends Interceptor native "Blob" {
+@Native("Blob")
+class Blob extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Blob._() { throw new UnsupportedError("Not supported"); }
 
@@ -775,7 +792,6 @@
   static _create_bag() => JS('var', '{}');
   static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); }
 }
-
 // 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.
@@ -783,7 +799,8 @@
 
 @DocsEditable()
 @DomName('HTMLBodyElement')
-class BodyElement extends HtmlElement implements WindowEventHandlers native "HTMLBodyElement" {
+@Native("HTMLBodyElement")
+class BodyElement extends HtmlElement implements WindowEventHandlers {
   // To suppress missing implicit constructor warnings.
   factory BodyElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -994,7 +1011,8 @@
 
 @DocsEditable()
 @DomName('HTMLButtonElement')
-class ButtonElement extends HtmlElement native "HTMLButtonElement" {
+@Native("HTMLButtonElement")
+class ButtonElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ButtonElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -1088,7 +1106,8 @@
 @DomName('CDATASection')
 // http://dom.spec.whatwg.org/#cdatasection
 @deprecated // deprecated
-class CDataSection extends Text native "CDATASection" {
+@Native("CDATASection")
+class CDataSection extends Text {
   // To suppress missing implicit constructor warnings.
   factory CDataSection._() { throw new UnsupportedError("Not supported"); }
 }
@@ -1101,7 +1120,8 @@
 @DomName('Canvas2DContextAttributes')
 // http://wiki.whatwg.org/wiki/CanvasOpaque#Suggested_IDL
 @Experimental()
-class Canvas2DContextAttributes extends Interceptor native "Canvas2DContextAttributes" {
+@Native("Canvas2DContextAttributes")
+class Canvas2DContextAttributes extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Canvas2DContextAttributes._() { throw new UnsupportedError("Not supported"); }
 
@@ -1115,7 +1135,8 @@
 
 
 @DomName('HTMLCanvasElement')
-class CanvasElement extends HtmlElement implements CanvasImageSource native "HTMLCanvasElement" {
+@Native("HTMLCanvasElement")
+class CanvasElement extends HtmlElement implements CanvasImageSource {
   // To suppress missing implicit constructor warnings.
   factory CanvasElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -1312,7 +1333,8 @@
  * * [CanvasGradient](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvasgradient) from W3C.
  */
 @DomName('CanvasGradient')
-class CanvasGradient extends Interceptor native "CanvasGradient" {
+@Native("CanvasGradient")
+class CanvasGradient extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory CanvasGradient._() { throw new UnsupportedError("Not supported"); }
 
@@ -1363,7 +1385,8 @@
  * * [CanvasPattern](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvaspattern) from W3C.
  */
 @DomName('CanvasPattern')
-class CanvasPattern extends Interceptor native "CanvasPattern" {
+@Native("CanvasPattern")
+class CanvasPattern extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory CanvasPattern._() { throw new UnsupportedError("Not supported"); }
 }
@@ -1380,7 +1403,8 @@
  * [WebGLRenderingContext].
  */
 @DomName('CanvasRenderingContext')
-class CanvasRenderingContext extends Interceptor native "CanvasRenderingContext" {
+@Native("CanvasRenderingContext")
+class CanvasRenderingContext extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory CanvasRenderingContext._() { throw new UnsupportedError("Not supported"); }
 
@@ -1395,7 +1419,8 @@
 
 
 @DomName('CanvasRenderingContext2D')
-class CanvasRenderingContext2D extends CanvasRenderingContext native "CanvasRenderingContext2D" {
+@Native("CanvasRenderingContext2D")
+class CanvasRenderingContext2D extends CanvasRenderingContext {
   // To suppress missing implicit constructor warnings.
   factory CanvasRenderingContext2D._() { throw new UnsupportedError("Not supported"); }
 
@@ -1978,7 +2003,6 @@
   @deprecated
   double get backingStorePixelRatio => 1.0;
 }
-
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -1986,7 +2010,8 @@
 
 @DocsEditable()
 @DomName('CharacterData')
-class CharacterData extends Node implements ChildNode native "CharacterData" {
+@Native("CharacterData")
+class CharacterData extends Node implements ChildNode {
   // To suppress missing implicit constructor warnings.
   factory CharacterData._() { throw new UnsupportedError("Not supported"); }
 
@@ -2053,7 +2078,8 @@
 
 @DocsEditable()
 @DomName('CloseEvent')
-class CloseEvent extends Event native "CloseEvent" {
+@Native("CloseEvent")
+class CloseEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory CloseEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -2076,7 +2102,8 @@
 
 @DocsEditable()
 @DomName('Comment')
-class Comment extends CharacterData native "Comment" {
+@Native("Comment")
+class Comment extends CharacterData {
   factory Comment([String data]) {
     if (data != null) {
       return JS('Comment', '#.createComment(#)', document, data);
@@ -2094,7 +2121,8 @@
 
 
 @DomName('CompositionEvent')
-class CompositionEvent extends UIEvent native "CompositionEvent" {
+@Native("CompositionEvent")
+class CompositionEvent extends UIEvent {
   factory CompositionEvent(String type,
       {bool canBubble: false, bool cancelable: false, Window view,
       String data}) {
@@ -2241,7 +2269,8 @@
 @DocsEditable()
 @DomName('ConsoleBase')
 @Experimental() // untriaged
-class ConsoleBase extends Interceptor native "ConsoleBase" {
+@Native("ConsoleBase")
+class ConsoleBase extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ConsoleBase._() { throw new UnsupportedError("Not supported"); }
 
@@ -2265,7 +2294,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '26')
 @Experimental()
 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#content-element
-class ContentElement extends HtmlElement native "HTMLContentElement" {
+@Native("HTMLContentElement")
+class ContentElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ContentElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2303,7 +2333,8 @@
 
 @DocsEditable()
 @DomName('Coordinates')
-class Coordinates extends Interceptor native "Coordinates" {
+@Native("Coordinates")
+class Coordinates extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Coordinates._() { throw new UnsupportedError("Not supported"); }
 
@@ -2346,7 +2377,8 @@
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental()
 // http://www.w3.org/TR/WebCryptoAPI/
-class Crypto extends Interceptor native "Crypto" {
+@Native("Crypto")
+class Crypto extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Crypto._() { throw new UnsupportedError("Not supported"); }
 
@@ -2372,7 +2404,8 @@
 @DocsEditable()
 @DomName('Key')
 @Experimental() // untriaged
-class CryptoKey extends Interceptor native "Key" {
+@Native("Key")
+class CryptoKey extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory CryptoKey._() { throw new UnsupportedError("Not supported"); }
 
@@ -2405,7 +2438,8 @@
 @DomName('CSS')
 // http://www.w3.org/TR/css3-conditional/#the-css-interface
 @Experimental() // None
-class Css extends Interceptor native "CSS" {
+@Native("CSS")
+class Css extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Css._() { throw new UnsupportedError("Not supported"); }
 
@@ -2427,7 +2461,8 @@
 @DomName('CSSCharsetRule')
 // http://dev.w3.org/csswg/cssom/#the-csscharsetrule-interface
 @Experimental()
-class CssCharsetRule extends CssRule native "CSSCharsetRule" {
+@Native("CSSCharsetRule")
+class CssCharsetRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssCharsetRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2446,7 +2481,8 @@
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental()
 // http://www.w3.org/TR/filter-effects/
-class CssFilterRule extends CssRule native "WebKitCSSFilterRule" {
+@Native("WebKitCSSFilterRule")
+class CssFilterRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssFilterRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2463,7 +2499,8 @@
 @DomName('CSSFontFaceLoadEvent')
 // http://www.w3.org/TR/css3-fonts/
 @Experimental()
-class CssFontFaceLoadEvent extends Event native "CSSFontFaceLoadEvent" {
+@Native("CSSFontFaceLoadEvent")
+class CssFontFaceLoadEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory CssFontFaceLoadEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -2479,7 +2516,8 @@
 
 @DocsEditable()
 @DomName('CSSFontFaceRule')
-class CssFontFaceRule extends CssRule native "CSSFontFaceRule" {
+@Native("CSSFontFaceRule")
+class CssFontFaceRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssFontFaceRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2494,7 +2532,8 @@
 
 @DocsEditable()
 @DomName('CSSImportRule')
-class CssImportRule extends CssRule native "CSSImportRule" {
+@Native("CSSImportRule")
+class CssImportRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssImportRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2518,7 +2557,8 @@
 @DocsEditable()
 @DomName('CSSKeyframeRule')
 @Experimental() // untriaged
-class CssKeyframeRule extends CssRule native "CSSKeyframeRule,MozCSSKeyframeRule,WebKitCSSKeyframeRule" {
+@Native("CSSKeyframeRule,MozCSSKeyframeRule,WebKitCSSKeyframeRule")
+class CssKeyframeRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssKeyframeRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2540,7 +2580,8 @@
 @DocsEditable()
 @DomName('CSSKeyframesRule')
 @Experimental() // untriaged
-class CssKeyframesRule extends CssRule native "CSSKeyframesRule,MozCSSKeyframesRule,WebKitCSSKeyframesRule" {
+@Native("CSSKeyframesRule,MozCSSKeyframesRule,WebKitCSSKeyframesRule")
+class CssKeyframesRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssKeyframesRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2584,7 +2625,8 @@
 
 @DocsEditable()
 @DomName('CSSMediaRule')
-class CssMediaRule extends CssRule native "CSSMediaRule" {
+@Native("CSSMediaRule")
+class CssMediaRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssMediaRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2613,7 +2655,8 @@
 
 @DocsEditable()
 @DomName('CSSPageRule')
-class CssPageRule extends CssRule native "CSSPageRule" {
+@Native("CSSPageRule")
+class CssPageRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssPageRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2632,7 +2675,8 @@
 
 @DocsEditable()
 @DomName('CSSRule')
-class CssRule extends Interceptor native "CSSRule" {
+@Native("CSSRule")
+class CssRule extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory CssRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -2719,8 +2763,9 @@
 
 
 @DomName('CSSStyleDeclaration')
+@Native("CSSStyleDeclaration,MSStyleCSSProperties,CSS2Properties")
  class CssStyleDeclaration  extends Interceptor with 
-    CssStyleDeclarationBase  native "CSSStyleDeclaration,MSStyleCSSProperties,CSS2Properties" {
+    CssStyleDeclarationBase  {
   factory CssStyleDeclaration() => new CssStyleDeclaration.css('');
 
   factory CssStyleDeclaration.css(String css) {
@@ -6002,7 +6047,8 @@
 
 @DocsEditable()
 @DomName('CSSStyleRule')
-class CssStyleRule extends CssRule native "CSSStyleRule" {
+@Native("CSSStyleRule")
+class CssStyleRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssStyleRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -6021,7 +6067,8 @@
 
 @DocsEditable()
 @DomName('CSSStyleSheet')
-class CssStyleSheet extends StyleSheet native "CSSStyleSheet" {
+@Native("CSSStyleSheet")
+class CssStyleSheet extends StyleSheet {
   // To suppress missing implicit constructor warnings.
   factory CssStyleSheet._() { throw new UnsupportedError("Not supported"); }
 
@@ -6067,7 +6114,8 @@
 
 @DocsEditable()
 @DomName('CSSSupportsRule')
-class CssSupportsRule extends CssRule native "CSSSupportsRule" {
+@Native("CSSSupportsRule")
+class CssSupportsRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssSupportsRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -6097,7 +6145,8 @@
 @DocsEditable()
 @DomName('CSSViewportRule')
 @Experimental() // untriaged
-class CssViewportRule extends CssRule native "CSSViewportRule" {
+@Native("CSSViewportRule")
+class CssViewportRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory CssViewportRule._() { throw new UnsupportedError("Not supported"); }
 
@@ -6114,7 +6163,8 @@
 
 
 @DomName('CustomEvent')
-class CustomEvent extends Event native "CustomEvent" {
+@Native("CustomEvent")
+class CustomEvent extends Event {
     @Creates('Null')  // Set from Dart code; does not instantiate a native type.
   var _dartDetail;
 
@@ -6175,7 +6225,8 @@
 
 @DocsEditable()
 @DomName('HTMLDListElement')
-class DListElement extends HtmlElement native "HTMLDListElement" {
+@Native("HTMLDListElement")
+class DListElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory DListElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6200,7 +6251,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class DataListElement extends HtmlElement native "HTMLDataListElement" {
+@Native("HTMLDataListElement")
+class DataListElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory DataListElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6230,7 +6282,8 @@
 
 @DocsEditable()
 @DomName('Clipboard')
-class DataTransfer extends Interceptor native "Clipboard,DataTransfer" {
+@Native("Clipboard,DataTransfer")
+class DataTransfer extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DataTransfer._() { throw new UnsupportedError("Not supported"); }
 
@@ -6297,7 +6350,8 @@
 @DomName('DataTransferItem')
 // http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html#the-datatransferitem-interface
 @Experimental()
-class DataTransferItem extends Interceptor native "DataTransferItem" {
+@Native("DataTransferItem")
+class DataTransferItem extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DataTransferItem._() { throw new UnsupportedError("Not supported"); }
 
@@ -6345,7 +6399,8 @@
 @DomName('DataTransferItemList')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitemlist-interface
 @Experimental()
-class DataTransferItemList extends Interceptor native "DataTransferItemList" {
+@Native("DataTransferItemList")
+class DataTransferItemList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DataTransferItemList._() { throw new UnsupportedError("Not supported"); }
 
@@ -6406,7 +6461,8 @@
 @DocsEditable()
 @DomName('DedicatedWorkerGlobalScope')
 @Experimental() // untriaged
-class DedicatedWorkerGlobalScope extends WorkerGlobalScope native "DedicatedWorkerGlobalScope" {
+@Native("DedicatedWorkerGlobalScope")
+class DedicatedWorkerGlobalScope extends WorkerGlobalScope {
   // To suppress missing implicit constructor warnings.
   factory DedicatedWorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }
 
@@ -6440,7 +6496,8 @@
 @DocsEditable()
 @DomName('DeprecatedStorageInfo')
 @Experimental() // untriaged
-class DeprecatedStorageInfo extends Interceptor native "DeprecatedStorageInfo" {
+@Native("DeprecatedStorageInfo")
+class DeprecatedStorageInfo extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DeprecatedStorageInfo._() { throw new UnsupportedError("Not supported"); }
 
@@ -6472,7 +6529,8 @@
 @DocsEditable()
 @DomName('DeprecatedStorageQuota')
 @Experimental() // untriaged
-class DeprecatedStorageQuota extends Interceptor native "DeprecatedStorageQuota" {
+@Native("DeprecatedStorageQuota")
+class DeprecatedStorageQuota extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DeprecatedStorageQuota._() { throw new UnsupportedError("Not supported"); }
 
@@ -6496,7 +6554,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental()
-class DetailsElement extends HtmlElement native "HTMLDetailsElement" {
+@Native("HTMLDetailsElement")
+class DetailsElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory DetailsElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6526,7 +6585,8 @@
 @DomName('DeviceAcceleration')
 // http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
 @Experimental()
-class DeviceAcceleration extends Interceptor native "DeviceAcceleration" {
+@Native("DeviceAcceleration")
+class DeviceAcceleration extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DeviceAcceleration._() { throw new UnsupportedError("Not supported"); }
 
@@ -6551,7 +6611,8 @@
 @DomName('DeviceMotionEvent')
 // http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
 @Experimental()
-class DeviceMotionEvent extends Event native "DeviceMotionEvent" {
+@Native("DeviceMotionEvent")
+class DeviceMotionEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory DeviceMotionEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -6585,7 +6646,8 @@
 @DomName('DeviceOrientationEvent')
 // http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
 @Experimental()
-class DeviceOrientationEvent extends Event native "DeviceOrientationEvent" {
+@Native("DeviceOrientationEvent")
+class DeviceOrientationEvent extends Event {
   factory DeviceOrientationEvent(String type,
       {bool canBubble: true, bool cancelable: true, num alpha: 0, num beta: 0,
       num gamma: 0, bool absolute: false}) {
@@ -6628,7 +6690,8 @@
 @DomName('DeviceRotationRate')
 // http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
 @Experimental()
-class DeviceRotationRate extends Interceptor native "DeviceRotationRate" {
+@Native("DeviceRotationRate")
+class DeviceRotationRate extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DeviceRotationRate._() { throw new UnsupportedError("Not supported"); }
 
@@ -6652,7 +6715,8 @@
 @DocsEditable()
 @DomName('HTMLDialogElement')
 @Unstable()
-class DialogElement extends HtmlElement native "HTMLDialogElement" {
+@Native("HTMLDialogElement")
+class DialogElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory DialogElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -6691,7 +6755,8 @@
 @DomName('DirectoryEntry')
 // http://www.w3.org/TR/file-system-api/#the-directoryentry-interface
 @Experimental()
-class DirectoryEntry extends Entry native "DirectoryEntry" {
+@Native("DirectoryEntry")
+class DirectoryEntry extends Entry {
 
   /**
    * Create a new directory with the specified `path`. If `exclusive` is true,
@@ -6851,7 +6916,6 @@
   }
 
 }
-
 // 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.
@@ -6861,7 +6925,8 @@
 @DomName('DirectoryReader')
 // http://www.w3.org/TR/file-system-api/#the-directoryreader-interface
 @Experimental()
-class DirectoryReader extends Interceptor native "DirectoryReader" {
+@Native("DirectoryReader")
+class DirectoryReader extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DirectoryReader._() { throw new UnsupportedError("Not supported"); }
 
@@ -6910,7 +6975,8 @@
  * * [Inline-level element](http://www.w3.org/TR/CSS2/visuren.html#inline-boxes) from W3C.
  */
 @DomName('HTMLDivElement')
-class DivElement extends HtmlElement native "HTMLDivElement" {
+@Native("HTMLDivElement")
+class DivElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory DivElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6940,7 +7006,8 @@
  * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connect-dart-html/).
  */
 @DomName('Document')
-class Document extends Node  native "Document"
+@Native("Document")
+class Document extends Node
 {
 
   // To suppress missing implicit constructor warnings.
@@ -7705,7 +7772,8 @@
 
 
 @DomName('DocumentFragment')
-class DocumentFragment extends Node implements ParentNode native "DocumentFragment" {
+@Native("DocumentFragment")
+class DocumentFragment extends Node implements ParentNode {
   factory DocumentFragment() => document.createDocumentFragment();
 
   factory DocumentFragment.html(String html,
@@ -7868,7 +7936,8 @@
 
 @DocsEditable()
 @DomName('DOMError')
-class DomError extends Interceptor native "DOMError" {
+@Native("DOMError")
+class DomError extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DomError._() { throw new UnsupportedError("Not supported"); }
 
@@ -7888,7 +7957,8 @@
 
 @DomName('DOMException')
 @Unstable()
-class DomException extends Interceptor native "DOMException" {
+@Native("DOMException")
+class DomException extends Interceptor {
 
   static const String INDEX_SIZE = 'IndexSizeError';
   static const String HIERARCHY_REQUEST = 'HierarchyRequestError';
@@ -7941,7 +8011,8 @@
 
 @DocsEditable()
 @DomName('DOMImplementation')
-class DomImplementation extends Interceptor native "DOMImplementation" {
+@Native("DOMImplementation")
+class DomImplementation extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DomImplementation._() { throw new UnsupportedError("Not supported"); }
 
@@ -7969,7 +8040,8 @@
 
 @DocsEditable()
 @DomName('DOMParser')
-class DomParser extends Interceptor native "DOMParser" {
+@Native("DOMParser")
+class DomParser extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DomParser._() { throw new UnsupportedError("Not supported"); }
 
@@ -7991,7 +8063,8 @@
 
 @DocsEditable()
 @DomName('DOMSettableTokenList')
-class DomSettableTokenList extends DomTokenList native "DOMSettableTokenList" {
+@Native("DOMSettableTokenList")
+class DomSettableTokenList extends DomTokenList {
   // To suppress missing implicit constructor warnings.
   factory DomSettableTokenList._() { throw new UnsupportedError("Not supported"); }
 
@@ -8010,7 +8083,8 @@
 
 @DocsEditable()
 @DomName('DOMStringList')
-class DomStringList extends Interceptor with ListMixin<String>, ImmutableListMixin<String> implements JavaScriptIndexingBehavior, List<String> native "DOMStringList" {
+@Native("DOMStringList")
+class DomStringList extends Interceptor with ListMixin<String>, ImmutableListMixin<String> implements JavaScriptIndexingBehavior, List<String> {
   // To suppress missing implicit constructor warnings.
   factory DomStringList._() { throw new UnsupportedError("Not supported"); }
 
@@ -8094,7 +8168,8 @@
 
 @DocsEditable()
 @DomName('DOMTokenList')
-class DomTokenList extends Interceptor native "DOMTokenList" {
+@Native("DOMTokenList")
+class DomTokenList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DomTokenList._() { throw new UnsupportedError("Not supported"); }
 
@@ -9191,7 +9266,8 @@
  * An abstract class, which all HTML elements extend.
  */
 @DomName('Element')
-abstract class Element extends Node implements GlobalEventHandlers, ParentNode, ChildNode native "Element" {
+@Native("Element")
+abstract class Element extends Node implements GlobalEventHandlers, ParentNode, ChildNode {
 
   /**
    * Creates an HTML element from a valid fragment of HTML.
@@ -11742,7 +11818,8 @@
 @SupportedBrowser(SupportedBrowser.IE)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class EmbedElement extends HtmlElement native "HTMLEmbedElement" {
+@Native("HTMLEmbedElement")
+class EmbedElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory EmbedElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -11807,7 +11884,8 @@
 @DomName('Entry')
 // http://www.w3.org/TR/file-system-api/#the-entry-interface
 @Experimental()
-class Entry extends Interceptor native "Entry" {
+@Native("Entry")
+class Entry extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Entry._() { throw new UnsupportedError("Not supported"); }
 
@@ -11946,7 +12024,8 @@
 @DocsEditable()
 @DomName('ErrorEvent')
 @Unstable()
-class ErrorEvent extends Event native "ErrorEvent" {
+@Native("ErrorEvent")
+class ErrorEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory ErrorEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -11981,7 +12060,8 @@
 
 
 @DomName('Event')
-class Event extends Interceptor native "Event,InputEvent,ClipboardEvent" {
+@Native("Event,InputEvent,ClipboardEvent")
+class Event extends Interceptor {
   // In JS, canBubble and cancelable are technically required parameters to
   // init*Event. In practice, though, if they aren't provided they simply
   // default to false (since that's Boolean(undefined)).
@@ -12176,7 +12256,8 @@
 @DomName('EventSource')
 // http://www.w3.org/TR/eventsource/#the-eventsource-interface
 @Experimental() // stable
-class EventSource extends EventTarget native "EventSource" {
+@Native("EventSource")
+class EventSource extends EventTarget {
   factory EventSource(String title, {withCredentials: false}) {
     var parsedOptions = {
       'withCredentials': withCredentials,
@@ -12363,7 +12444,8 @@
  * for compile-time type checks and a more concise API.
  */
 @DomName('EventTarget')
-class EventTarget extends Interceptor native "EventTarget" {
+@Native("EventTarget")
+class EventTarget extends Interceptor {
 
   // Custom element created callback.
   EventTarget._created();
@@ -12397,7 +12479,8 @@
 @DocsEditable()
 @DomName('HTMLFieldSetElement')
 @Unstable()
-class FieldSetElement extends HtmlElement native "HTMLFieldSetElement" {
+@Native("HTMLFieldSetElement")
+class FieldSetElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory FieldSetElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -12460,7 +12543,8 @@
 
 @DocsEditable()
 @DomName('File')
-class File extends Blob native "File" {
+@Native("File")
+class File extends Blob {
   // To suppress missing implicit constructor warnings.
   factory File._() { throw new UnsupportedError("Not supported"); }
 
@@ -12511,7 +12595,8 @@
 @DomName('FileEntry')
 // http://www.w3.org/TR/file-system-api/#the-fileentry-interface
 @Experimental()
-class FileEntry extends Entry native "FileEntry" {
+@Native("FileEntry")
+class FileEntry extends Entry {
   // To suppress missing implicit constructor warnings.
   factory FileEntry._() { throw new UnsupportedError("Not supported"); }
 
@@ -12556,7 +12641,8 @@
 @DomName('FileError')
 // http://dev.w3.org/2009/dap/file-system/pub/FileSystem/
 @Experimental()
-class FileError extends DomError native "FileError" {
+@Native("FileError")
+class FileError extends DomError {
   // To suppress missing implicit constructor warnings.
   factory FileError._() { throw new UnsupportedError("Not supported"); }
 
@@ -12619,7 +12705,8 @@
 
 @DocsEditable()
 @DomName('FileList')
-class FileList extends Interceptor with ListMixin<File>, ImmutableListMixin<File> implements JavaScriptIndexingBehavior, List<File> native "FileList" {
+@Native("FileList")
+class FileList extends Interceptor with ListMixin<File>, ImmutableListMixin<File> implements JavaScriptIndexingBehavior, List<File> {
   // To suppress missing implicit constructor warnings.
   factory FileList._() { throw new UnsupportedError("Not supported"); }
 
@@ -12682,7 +12769,8 @@
 
 @DocsEditable()
 @DomName('FileReader')
-class FileReader extends EventTarget native "FileReader" {
+@Native("FileReader")
+class FileReader extends EventTarget {
 
   @DomName('FileReader.result')
   @DocsEditable()
@@ -12840,7 +12928,8 @@
 @DocsEditable()
 @DomName('Stream')
 @Experimental() // untriaged
-class FileStream extends Interceptor native "Stream" {
+@Native("Stream")
+class FileStream extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory FileStream._() { throw new UnsupportedError("Not supported"); }
 
@@ -12859,7 +12948,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://www.w3.org/TR/file-system-api/
-class FileSystem extends Interceptor native "DOMFileSystem" {
+@Native("DOMFileSystem")
+class FileSystem extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory FileSystem._() { throw new UnsupportedError("Not supported"); }
 
@@ -12894,7 +12984,8 @@
 @DomName('FileWriter')
 // http://www.w3.org/TR/file-writer-api/#the-filewriter-interface
 @Experimental()
-class FileWriter extends EventTarget native "FileWriter" {
+@Native("FileWriter")
+class FileWriter extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory FileWriter._() { throw new UnsupportedError("Not supported"); }
 
@@ -13050,7 +13141,8 @@
 
 @DocsEditable()
 @DomName('FocusEvent')
-class FocusEvent extends UIEvent native "FocusEvent" {
+@Native("FocusEvent")
+class FocusEvent extends UIEvent {
   // To suppress missing implicit constructor warnings.
   factory FocusEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -13071,7 +13163,8 @@
 @DocsEditable()
 @DomName('FontFace')
 @Experimental() // untriaged
-class FontFace extends Interceptor native "FontFace" {
+@Native("FontFace")
+class FontFace extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory FontFace._() { throw new UnsupportedError("Not supported"); }
 
@@ -13135,7 +13228,8 @@
 @DocsEditable()
 @DomName('FontFaceSet')
 @Experimental() // untriaged
-class FontFaceSet extends EventTarget native "FontFaceSet" {
+@Native("FontFaceSet")
+class FontFaceSet extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory FontFaceSet._() { throw new UnsupportedError("Not supported"); }
 
@@ -13200,7 +13294,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FormData extends Interceptor native "FormData" {
+@Native("FormData")
+class FormData extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory FormData._() { throw new UnsupportedError("Not supported"); }
 
@@ -13234,7 +13329,8 @@
 
 @DocsEditable()
 @DomName('HTMLFormElement')
-class FormElement extends HtmlElement native "HTMLFormElement" {
+@Native("HTMLFormElement")
+class FormElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory FormElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -13369,7 +13465,8 @@
 @DomName('Gamepad')
 // https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#gamepad-interface
 @Experimental()
-class Gamepad extends Interceptor native "Gamepad" {
+@Native("Gamepad")
+class Gamepad extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Gamepad._() { throw new UnsupportedError("Not supported"); }
 
@@ -13401,7 +13498,8 @@
 @DocsEditable()
 @DomName('Geolocation')
 @Unstable()
-class Geolocation extends Interceptor native "Geolocation" {
+@Native("Geolocation")
+class Geolocation extends Interceptor {
 
   @DomName('Geolocation.getCurrentPosition')
   Future<Geoposition> getCurrentPosition({bool enableHighAccuracy,
@@ -13510,8 +13608,6 @@
   Coordinates get coords => JS('Coordinates', '#.coords', _ptr);
   int get timestamp => JS('int', '#.timestamp', _ptr);
 }
-
-
 // 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.
@@ -13520,7 +13616,8 @@
 @DocsEditable()
 @DomName('Geoposition')
 @Unstable()
-class Geoposition extends Interceptor native "Geoposition" {
+@Native("Geoposition")
+class Geoposition extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Geoposition._() { throw new UnsupportedError("Not supported"); }
 
@@ -13894,7 +13991,8 @@
  * An `<hr>` tag.
  */
 @DomName('HTMLHRElement')
-class HRElement extends HtmlElement native "HTMLHRElement" {
+@Native("HTMLHRElement")
+class HRElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory HRElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -13924,7 +14022,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class HashChangeEvent extends Event native "HashChangeEvent" {
+@Native("HashChangeEvent")
+class HashChangeEvent extends Event {
   factory HashChangeEvent(String type,
       {bool canBubble: true, bool cancelable: true, String oldUrl,
       String newUrl}) {
@@ -13961,7 +14060,8 @@
 
 @DocsEditable()
 @DomName('HTMLHeadElement')
-class HeadElement extends HtmlElement native "HTMLHeadElement" {
+@Native("HTMLHeadElement")
+class HeadElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory HeadElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -13982,7 +14082,8 @@
 
 @DocsEditable()
 @DomName('HTMLHeadingElement')
-class HeadingElement extends HtmlElement native "HTMLHeadingElement" {
+@Native("HTMLHeadingElement")
+class HeadingElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory HeadingElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -14022,7 +14123,8 @@
 
 
 @DomName('History')
-class History extends Interceptor implements HistoryBase native "History" {
+@Native("History")
+class History extends Interceptor implements HistoryBase {
 
   /**
    * Checks if the State APIs are supported on the current platform.
@@ -14086,7 +14188,8 @@
 
 @DocsEditable()
 @DomName('HTMLCollection')
-class HtmlCollection extends Interceptor with ListMixin<Node>, ImmutableListMixin<Node> implements JavaScriptIndexingBehavior, List<Node> native "HTMLCollection" {
+@Native("HTMLCollection")
+class HtmlCollection extends Interceptor with ListMixin<Node>, ImmutableListMixin<Node> implements JavaScriptIndexingBehavior, List<Node> {
   // To suppress missing implicit constructor warnings.
   factory HtmlCollection._() { throw new UnsupportedError("Not supported"); }
 
@@ -14154,7 +14257,8 @@
 
 
 @DomName('HTMLDocument')
-class HtmlDocument extends Document native "HTMLDocument" {
+@Native("HTMLDocument")
+class HtmlDocument extends Document {
   // To suppress missing implicit constructor warnings.
   factory HtmlDocument._() { throw new UnsupportedError("Not supported"); }
 
@@ -14446,7 +14550,8 @@
 
 @DocsEditable()
 @DomName('HTMLFormControlsCollection')
-class HtmlFormControlsCollection extends HtmlCollection native "HTMLFormControlsCollection" {
+@Native("HTMLFormControlsCollection")
+class HtmlFormControlsCollection extends HtmlCollection {
   // To suppress missing implicit constructor warnings.
   factory HtmlFormControlsCollection._() { throw new UnsupportedError("Not supported"); }
 }
@@ -14457,7 +14562,8 @@
 
 @DocsEditable()
 @DomName('HTMLHtmlElement')
-class HtmlHtmlElement extends HtmlElement native "HTMLHtmlElement" {
+@Native("HTMLHtmlElement")
+class HtmlHtmlElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory HtmlHtmlElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -14478,7 +14584,8 @@
 
 @DocsEditable()
 @DomName('HTMLOptionsCollection')
-class HtmlOptionsCollection extends HtmlCollection native "HTMLOptionsCollection" {
+@Native("HTMLOptionsCollection")
+class HtmlOptionsCollection extends HtmlCollection {
   // To suppress missing implicit constructor warnings.
   factory HtmlOptionsCollection._() { throw new UnsupportedError("Not supported"); }
 }
@@ -14535,7 +14642,8 @@
   * * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest)
  */
 @DomName('XMLHttpRequest')
-class HttpRequest extends HttpRequestEventTarget native "XMLHttpRequest" {
+@Native("XMLHttpRequest")
+class HttpRequest extends HttpRequestEventTarget {
 
   /**
    * Creates a GET request for the specified [url].
@@ -15182,7 +15290,8 @@
 @DocsEditable()
 @DomName('XMLHttpRequestEventTarget')
 @Experimental() // untriaged
-class HttpRequestEventTarget extends EventTarget native "XMLHttpRequestEventTarget" {
+@Native("XMLHttpRequestEventTarget")
+class HttpRequestEventTarget extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory HttpRequestEventTarget._() { throw new UnsupportedError("Not supported"); }
 
@@ -15322,7 +15431,8 @@
 @DomName('XMLHttpRequestUpload')
 // http://xhr.spec.whatwg.org/#xmlhttprequestupload
 @Experimental()
-class HttpRequestUpload extends HttpRequestEventTarget native "XMLHttpRequestUpload" {
+@Native("XMLHttpRequestUpload")
+class HttpRequestUpload extends HttpRequestEventTarget {
   // To suppress missing implicit constructor warnings.
   factory HttpRequestUpload._() { throw new UnsupportedError("Not supported"); }
 }
@@ -15333,7 +15443,8 @@
 
 @DocsEditable()
 @DomName('HTMLIFrameElement')
-class IFrameElement extends HtmlElement native "HTMLIFrameElement" {
+@Native("HTMLIFrameElement")
+class IFrameElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory IFrameElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -15389,7 +15500,8 @@
 @DocsEditable()
 @DomName('ImageBitmap')
 @Experimental() // untriaged
-class ImageBitmap extends Interceptor native "ImageBitmap" {
+@Native("ImageBitmap")
+class ImageBitmap extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ImageBitmap._() { throw new UnsupportedError("Not supported"); }
 
@@ -15408,7 +15520,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 @DomName('ImageData')
-class ImageData extends Interceptor native "ImageData" {
+@Native("ImageData")
+class ImageData extends Interceptor {
 
   // To suppress missing implicit constructor warnings.
   factory ImageData._() { throw new UnsupportedError("Not supported"); }
@@ -15434,7 +15547,8 @@
 
 
 @DomName('HTMLImageElement')
-class ImageElement extends HtmlElement implements CanvasImageSource native "HTMLImageElement" {
+@Native("HTMLImageElement")
+class ImageElement extends HtmlElement implements CanvasImageSource {
   // To suppress missing implicit constructor warnings.
   factory ImageElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -15508,7 +15622,8 @@
 @DocsEditable()
 @DomName('InjectedScriptHost')
 @Experimental() // untriaged
-class InjectedScriptHost extends Interceptor native "InjectedScriptHost" {
+@Native("InjectedScriptHost")
+class InjectedScriptHost extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory InjectedScriptHost._() { throw new UnsupportedError("Not supported"); }
 
@@ -15523,6 +15638,7 @@
 
 
 @DomName('HTMLInputElement')
+@Native("HTMLInputElement")
 class InputElement extends HtmlElement implements
     HiddenInputElement,
     SearchInputElement,
@@ -15544,8 +15660,7 @@
     SubmitButtonInputElement,
     ImageButtonInputElement,
     ResetButtonInputElement,
-    ButtonInputElement
-     native "HTMLInputElement" {
+    ButtonInputElement {
 
   factory InputElement({String type}) {
     var e = document.createElement("input");
@@ -16391,7 +16506,6 @@
 abstract class ButtonInputElement implements InputElementBase {
   factory ButtonInputElement() => new InputElement(type: 'button');
 }
-
 // 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.
@@ -16401,7 +16515,8 @@
 @DomName('InputMethodContext')
 // http://www.w3.org/TR/ime-api/#idl-def-InputMethodContext
 @Experimental()
-class InputMethodContext extends EventTarget native "InputMethodContext" {
+@Native("InputMethodContext")
+class InputMethodContext extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory InputMethodContext._() { throw new UnsupportedError("Not supported"); }
 
@@ -16436,7 +16551,8 @@
 @DocsEditable()
 @DomName('InstallEvent')
 @Experimental() // untriaged
-class InstallEvent extends InstallPhaseEvent native "InstallEvent" {
+@Native("InstallEvent")
+class InstallEvent extends InstallPhaseEvent {
   // To suppress missing implicit constructor warnings.
   factory InstallEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -16453,7 +16569,8 @@
 @DocsEditable()
 @DomName('InstallPhaseEvent')
 @Experimental() // untriaged
-class InstallPhaseEvent extends Event native "InstallPhaseEvent" {
+@Native("InstallPhaseEvent")
+class InstallPhaseEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory InstallPhaseEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -16470,7 +16587,8 @@
 @DocsEditable()
 @DomName('KeyPair')
 @Experimental() // untriaged
-class KeyPair extends Interceptor native "KeyPair" {
+@Native("KeyPair")
+class KeyPair extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory KeyPair._() { throw new UnsupportedError("Not supported"); }
 
@@ -16499,7 +16617,8 @@
  * * [KeyboardEvent](https://developer.mozilla.org/en/DOM/KeyboardEvent) at MDN.
  */
 @DomName('KeyboardEvent')
-class KeyboardEvent extends UIEvent native "KeyboardEvent" {
+@Native("KeyboardEvent")
+class KeyboardEvent extends UIEvent {
 
   /** 
    * Programmatically create a KeyboardEvent. 
@@ -16632,7 +16751,8 @@
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental()
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-keygen-element
-class KeygenElement extends HtmlElement native "HTMLKeygenElement" {
+@Native("HTMLKeygenElement")
+class KeygenElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory KeygenElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -16711,7 +16831,8 @@
 
 @DocsEditable()
 @DomName('HTMLLIElement')
-class LIElement extends HtmlElement native "HTMLLIElement" {
+@Native("HTMLLIElement")
+class LIElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory LIElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -16736,7 +16857,8 @@
 
 @DocsEditable()
 @DomName('HTMLLabelElement')
-class LabelElement extends HtmlElement native "HTMLLabelElement" {
+@Native("HTMLLabelElement")
+class LabelElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory LabelElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -16769,7 +16891,8 @@
 
 @DocsEditable()
 @DomName('HTMLLegendElement')
-class LegendElement extends HtmlElement native "HTMLLegendElement" {
+@Native("HTMLLegendElement")
+class LegendElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory LegendElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -16794,7 +16917,8 @@
 
 @DocsEditable()
 @DomName('HTMLLinkElement')
-class LinkElement extends HtmlElement native "HTMLLinkElement" {
+@Native("HTMLLinkElement")
+class LinkElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory LinkElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -16864,7 +16988,8 @@
 
 @DocsEditable()
 @DomName('Location')
-class Location extends Interceptor implements LocationBase native "Location" {
+@Native("Location")
+class Location extends Interceptor implements LocationBase {
   // To suppress missing implicit constructor warnings.
   factory Location._() { throw new UnsupportedError("Not supported"); }
 
@@ -16960,7 +17085,8 @@
 
 @DocsEditable()
 @DomName('HTMLMapElement')
-class MapElement extends HtmlElement native "HTMLMapElement" {
+@Native("HTMLMapElement")
+class MapElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory MapElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -16993,7 +17119,8 @@
 @DomName('MediaController')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#mediacontroller
 @Experimental()
-class MediaController extends EventTarget native "MediaController" {
+@Native("MediaController")
+class MediaController extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory MediaController._() { throw new UnsupportedError("Not supported"); }
 
@@ -17068,7 +17195,8 @@
 @DocsEditable()
 @DomName('HTMLMediaElement')
 @Unstable()
-class MediaElement extends HtmlElement native "HTMLMediaElement" {
+@Native("HTMLMediaElement")
+class MediaElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory MediaElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -17711,7 +17839,8 @@
 @DocsEditable()
 @DomName('MediaError')
 @Unstable()
-class MediaError extends Interceptor native "MediaError" {
+@Native("MediaError")
+class MediaError extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MediaError._() { throw new UnsupportedError("Not supported"); }
 
@@ -17750,7 +17879,8 @@
 @DomName('MediaKeyError')
 // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#error-codes
 @Experimental()
-class MediaKeyError extends Interceptor native "MediaKeyError" {
+@Native("MediaKeyError")
+class MediaKeyError extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MediaKeyError._() { throw new UnsupportedError("Not supported"); }
 
@@ -17796,7 +17926,8 @@
 @DomName('MediaKeyEvent')
 // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#event-definitions
 @Experimental()
-class MediaKeyEvent extends Event native "MediaKeyEvent" {
+@Native("MediaKeyEvent")
+class MediaKeyEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory MediaKeyEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -17838,7 +17969,8 @@
 @DomName('MediaKeyMessageEvent')
 // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-mediakeymessageevent
 @Experimental()
-class MediaKeyMessageEvent extends Event native "MediaKeyMessageEvent" {
+@Native("MediaKeyMessageEvent")
+class MediaKeyMessageEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory MediaKeyMessageEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -17860,7 +17992,8 @@
 @DomName('MediaKeyNeededEvent')
 // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-mediakeyneededevent
 @Experimental()
-class MediaKeyNeededEvent extends Event native "MediaKeyNeededEvent" {
+@Native("MediaKeyNeededEvent")
+class MediaKeyNeededEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory MediaKeyNeededEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -17882,7 +18015,8 @@
 @DomName('MediaKeySession')
 // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-mediakeysession
 @Experimental()
-class MediaKeySession extends EventTarget native "MediaKeySession" {
+@Native("MediaKeySession")
+class MediaKeySession extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory MediaKeySession._() { throw new UnsupportedError("Not supported"); }
 
@@ -17916,7 +18050,8 @@
 @DomName('MediaKeys')
 // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html
 @Experimental()
-class MediaKeys extends Interceptor native "MediaKeys" {
+@Native("MediaKeys")
+class MediaKeys extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MediaKeys._() { throw new UnsupportedError("Not supported"); }
 
@@ -17943,7 +18078,8 @@
 @DocsEditable()
 @DomName('MediaList')
 @Unstable()
-class MediaList extends Interceptor native "MediaList" {
+@Native("MediaList")
+class MediaList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MediaList._() { throw new UnsupportedError("Not supported"); }
 
@@ -17975,7 +18111,8 @@
 @DocsEditable()
 @DomName('MediaQueryList')
 @Unstable()
-class MediaQueryList extends Interceptor native "MediaQueryList" {
+@Native("MediaQueryList")
+class MediaQueryList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MediaQueryList._() { throw new UnsupportedError("Not supported"); }
 
@@ -17996,7 +18133,8 @@
 @DomName('MediaSource')
 // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#mediasource
 @Experimental()
-class MediaSource extends EventTarget native "MediaSource" {
+@Native("MediaSource")
+class MediaSource extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory MediaSource._() { throw new UnsupportedError("Not supported"); }
 
@@ -18048,7 +18186,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastream
-class MediaStream extends EventTarget native "MediaStream" {
+@Native("MediaStream")
+class MediaStream extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory MediaStream._() { throw new UnsupportedError("Not supported"); }
 
@@ -18182,7 +18321,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html
-class MediaStreamEvent extends Event native "MediaStreamEvent" {
+@Native("MediaStreamEvent")
+class MediaStreamEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory MediaStreamEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -18203,7 +18343,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamtrack
-class MediaStreamTrack extends EventTarget native "MediaStreamTrack" {
+@Native("MediaStreamTrack")
+class MediaStreamTrack extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory MediaStreamTrack._() { throw new UnsupportedError("Not supported"); }
 
@@ -18304,7 +18445,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html
-class MediaStreamTrackEvent extends Event native "MediaStreamTrackEvent" {
+@Native("MediaStreamTrackEvent")
+class MediaStreamTrackEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory MediaStreamTrackEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -18333,7 +18475,8 @@
 @DocsEditable()
 @DomName('MemoryInfo')
 @Experimental() // nonstandard
-class MemoryInfo extends Interceptor native "MemoryInfo" {
+@Native("MemoryInfo")
+class MemoryInfo extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MemoryInfo._() { throw new UnsupportedError("Not supported"); }
 
@@ -18366,7 +18509,8 @@
  *  * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-element) from the W3C.
  */
 @DomName('HTMLMenuElement')
-class MenuElement extends HtmlElement native "HTMLMenuElement" {
+@Native("HTMLMenuElement")
+class MenuElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory MenuElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -18388,7 +18532,8 @@
 @DocsEditable()
 @DomName('MessageChannel')
 @Unstable()
-class MessageChannel extends Interceptor native "MessageChannel" {
+@Native("MessageChannel")
+class MessageChannel extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MessageChannel._() { throw new UnsupportedError("Not supported"); }
 
@@ -18408,7 +18553,8 @@
 
 
 @DomName('MessageEvent')
-class MessageEvent extends Event native "MessageEvent" {
+@Native("MessageEvent")
+class MessageEvent extends Event {
   factory MessageEvent(String type,
       {bool canBubble: false, bool cancelable: false, Object data,
       String origin, String lastEventId,
@@ -18473,7 +18619,8 @@
 @DocsEditable()
 @DomName('MessagePort')
 @Unstable()
-class MessagePort extends EventTarget native "MessagePort" {
+@Native("MessagePort")
+class MessagePort extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory MessagePort._() { throw new UnsupportedError("Not supported"); }
 
@@ -18528,7 +18675,8 @@
 
 @DocsEditable()
 @DomName('HTMLMetaElement')
-class MetaElement extends HtmlElement native "HTMLMetaElement" {
+@Native("HTMLMetaElement")
+class MetaElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory MetaElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -18563,7 +18711,8 @@
 @DomName('Metadata')
 // http://www.w3.org/TR/file-system-api/#the-metadata-interface
 @Experimental()
-class Metadata extends Interceptor native "Metadata" {
+@Native("Metadata")
+class Metadata extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Metadata._() { throw new UnsupportedError("Not supported"); }
 
@@ -18602,7 +18751,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class MeterElement extends HtmlElement native "HTMLMeterElement" {
+@Native("HTMLMeterElement")
+class MeterElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory MeterElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -18659,7 +18809,8 @@
 @DomName('MIDIAccess')
 // http://webaudio.github.io/web-midi-api/#midiaccess-interface
 @Experimental()
-class MidiAccess extends EventTarget native "MIDIAccess" {
+@Native("MIDIAccess")
+class MidiAccess extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory MidiAccess._() { throw new UnsupportedError("Not supported"); }
 
@@ -18709,7 +18860,8 @@
 @DocsEditable()
 @DomName('MIDIAccessPromise')
 @Experimental() // untriaged
-class MidiAccessPromise extends Interceptor native "MIDIAccessPromise" {
+@Native("MIDIAccessPromise")
+class MidiAccessPromise extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MidiAccessPromise._() { throw new UnsupportedError("Not supported"); }
 
@@ -18727,7 +18879,8 @@
 @DomName('MIDIConnectionEvent')
 // http://webaudio.github.io/web-midi-api/#midiconnectionevent-interface
 @Experimental()
-class MidiConnectionEvent extends Event native "MIDIConnectionEvent" {
+@Native("MIDIConnectionEvent")
+class MidiConnectionEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory MidiConnectionEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -18744,7 +18897,8 @@
 @DomName('MIDIInput')
 // http://webaudio.github.io/web-midi-api/#idl-def-MIDIInput
 @Experimental()
-class MidiInput extends MidiPort native "MIDIInput" {
+@Native("MIDIInput")
+class MidiInput extends MidiPort {
   // To suppress missing implicit constructor warnings.
   factory MidiInput._() { throw new UnsupportedError("Not supported"); }
 
@@ -18772,7 +18926,8 @@
 @DomName('MIDIMessageEvent')
 // http://webaudio.github.io/web-midi-api/#midimessageevent-interface
 @Experimental()
-class MidiMessageEvent extends Event native "MIDIMessageEvent" {
+@Native("MIDIMessageEvent")
+class MidiMessageEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory MidiMessageEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -18793,7 +18948,8 @@
 @DomName('MIDIOutput')
 // http://webaudio.github.io/web-midi-api/#midioutput-interface
 @Experimental()
-class MidiOutput extends MidiPort native "MIDIOutput" {
+@Native("MIDIOutput")
+class MidiOutput extends MidiPort {
   // To suppress missing implicit constructor warnings.
   factory MidiOutput._() { throw new UnsupportedError("Not supported"); }
 
@@ -18810,7 +18966,8 @@
 @DomName('MIDIPort')
 // http://webaudio.github.io/web-midi-api/#idl-def-MIDIPort
 @Experimental()
-class MidiPort extends EventTarget native "MIDIPort" {
+@Native("MIDIPort")
+class MidiPort extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory MidiPort._() { throw new UnsupportedError("Not supported"); }
 
@@ -18857,7 +19014,8 @@
 @DocsEditable()
 @DomName('MimeType')
 @Experimental() // non-standard
-class MimeType extends Interceptor native "MimeType" {
+@Native("MimeType")
+class MimeType extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MimeType._() { throw new UnsupportedError("Not supported"); }
 
@@ -18885,7 +19043,8 @@
 @DocsEditable()
 @DomName('MimeTypeArray')
 @Experimental() // non-standard
-class MimeTypeArray extends Interceptor with ListMixin<MimeType>, ImmutableListMixin<MimeType> implements JavaScriptIndexingBehavior, List<MimeType> native "MimeTypeArray" {
+@Native("MimeTypeArray")
+class MimeTypeArray extends Interceptor with ListMixin<MimeType>, ImmutableListMixin<MimeType> implements JavaScriptIndexingBehavior, List<MimeType> {
   // To suppress missing implicit constructor warnings.
   factory MimeTypeArray._() { throw new UnsupportedError("Not supported"); }
 
@@ -18957,7 +19116,8 @@
 @DocsEditable()
 @DomName('HTMLModElement')
 @Unstable()
-class ModElement extends HtmlElement native "HTMLModElement" {
+@Native("HTMLModElement")
+class ModElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ModElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -18981,7 +19141,8 @@
 
 
 @DomName('MouseEvent')
-class MouseEvent extends UIEvent native "MouseEvent,DragEvent,PointerEvent,MSPointerEvent" {
+@Native("MouseEvent,DragEvent,PointerEvent,MSPointerEvent")
+class MouseEvent extends UIEvent {
   factory MouseEvent(String type,
       {Window view, int detail: 0, int screenX: 0, int screenY: 0,
       int clientX: 0, int clientY: 0, int button: 0, bool canBubble: true,
@@ -19152,7 +19313,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental()
-class MutationObserver extends Interceptor native "MutationObserver,WebKitMutationObserver" {
+@Native("MutationObserver,WebKitMutationObserver")
+class MutationObserver extends Interceptor {
 
   @DomName('MutationObserver.disconnect')
   @DocsEditable()
@@ -19258,7 +19420,8 @@
 
 @DocsEditable()
 @DomName('MutationRecord')
-class MutationRecord extends Interceptor native "MutationRecord" {
+@Native("MutationRecord")
+class MutationRecord extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory MutationRecord._() { throw new UnsupportedError("Not supported"); }
 
@@ -19308,7 +19471,8 @@
 
 
 @DomName('Navigator')
-class Navigator extends Interceptor implements NavigatorOnLine, NavigatorID native "Navigator" {
+@Native("Navigator")
+class Navigator extends Interceptor implements NavigatorOnLine, NavigatorID {
 
   @DomName('Navigator.language')
   String get language => JS('String', '#.language || #.userLanguage', this,
@@ -19589,7 +19753,8 @@
 @DomName('NavigatorUserMediaError')
 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-NavigatorUserMediaError
 @Experimental()
-class NavigatorUserMediaError extends Interceptor native "NavigatorUserMediaError" {
+@Native("NavigatorUserMediaError")
+class NavigatorUserMediaError extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory NavigatorUserMediaError._() { throw new UnsupportedError("Not supported"); }
 
@@ -19795,7 +19960,8 @@
 
 
 @DomName('Node')
-class Node extends EventTarget native "Node" {
+@Native("Node")
+class Node extends EventTarget {
 
   // Custom element created callback.
   Node._created() : super._created();
@@ -20220,7 +20386,8 @@
 @DocsEditable()
 @DomName('NodeFilter')
 @Unstable()
-class NodeFilter extends Interceptor native "NodeFilter" {
+@Native("NodeFilter")
+class NodeFilter extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory NodeFilter._() { throw new UnsupportedError("Not supported"); }
 
@@ -20275,7 +20442,8 @@
 
 @DomName('NodeIterator')
 @Unstable()
-class NodeIterator extends Interceptor native "NodeIterator" {
+@Native("NodeIterator")
+class NodeIterator extends Interceptor {
   factory NodeIterator(Node root, int whatToShow) {
     return document._createNodeIterator(root, whatToShow, null);
   }
@@ -20318,7 +20486,8 @@
 
 @DocsEditable()
 @DomName('NodeList')
-class NodeList extends Interceptor with ListMixin<Node>, ImmutableListMixin<Node> implements JavaScriptIndexingBehavior, List<Node> native "NodeList,RadioNodeList" {
+@Native("NodeList,RadioNodeList")
+class NodeList extends Interceptor with ListMixin<Node>, ImmutableListMixin<Node> implements JavaScriptIndexingBehavior, List<Node> {
   // To suppress missing implicit constructor warnings.
   factory NodeList._() { throw new UnsupportedError("Not supported"); }
 
@@ -20383,7 +20552,8 @@
 @DomName('Notification')
 // http://www.w3.org/TR/notifications/#notification
 @Experimental() // experimental
-class Notification extends EventTarget native "Notification" {
+@Native("Notification")
+class Notification extends EventTarget {
 
   factory Notification(String title, {String titleDir: null, String body: null,
       String bodyDir: null, String tag: null, String iconUrl: null}) {
@@ -20543,7 +20713,8 @@
 
 @DocsEditable()
 @DomName('HTMLOListElement')
-class OListElement extends HtmlElement native "HTMLOListElement" {
+@Native("HTMLOListElement")
+class OListElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory OListElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -20580,7 +20751,8 @@
 @SupportedBrowser(SupportedBrowser.IE)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class ObjectElement extends HtmlElement native "HTMLObjectElement" {
+@Native("HTMLObjectElement")
+class ObjectElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ObjectElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -20660,7 +20832,8 @@
 
 @DocsEditable()
 @DomName('HTMLOptGroupElement')
-class OptGroupElement extends HtmlElement native "HTMLOptGroupElement" {
+@Native("HTMLOptGroupElement")
+class OptGroupElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory OptGroupElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -20688,7 +20861,8 @@
 
 
 @DomName('HTMLOptionElement')
-class OptionElement extends HtmlElement native "HTMLOptionElement" {
+@Native("HTMLOptionElement")
+class OptionElement extends HtmlElement {
   factory OptionElement({String data: '', String value : '', bool selected: false}) {
     return new OptionElement._(data, value, null, selected);
   }
@@ -20761,7 +20935,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class OutputElement extends HtmlElement native "HTMLOutputElement" {
+@Native("HTMLOutputElement")
+class OutputElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory OutputElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -20837,7 +21012,8 @@
 @DocsEditable()
 @DomName('OverflowEvent')
 @Experimental() // nonstandard
-class OverflowEvent extends Event native "OverflowEvent" {
+@Native("OverflowEvent")
+class OverflowEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory OverflowEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -20874,7 +21050,8 @@
 @DomName('PageTransitionEvent')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#pagetransitionevent
 @Experimental()
-class PageTransitionEvent extends Event native "PageTransitionEvent" {
+@Native("PageTransitionEvent")
+class PageTransitionEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory PageTransitionEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -20889,7 +21066,8 @@
 
 @DocsEditable()
 @DomName('HTMLParagraphElement')
-class ParagraphElement extends HtmlElement native "HTMLParagraphElement" {
+@Native("HTMLParagraphElement")
+class ParagraphElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ParagraphElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -20911,7 +21089,8 @@
 @DocsEditable()
 @DomName('HTMLParamElement')
 @Unstable()
-class ParamElement extends HtmlElement native "HTMLParamElement" {
+@Native("HTMLParamElement")
+class ParamElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ParamElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -20962,7 +21141,8 @@
 @DomName('Path')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#path-objects
 @Experimental()
-class Path extends Interceptor native "Path" {
+@Native("Path")
+class Path extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Path._() { throw new UnsupportedError("Not supported"); }
 
@@ -21026,7 +21206,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE)
-class Performance extends EventTarget native "Performance" {
+@Native("Performance")
+class Performance extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory Performance._() { throw new UnsupportedError("Not supported"); }
 
@@ -21140,7 +21321,8 @@
 @DomName('PerformanceEntry')
 // http://www.w3.org/TR/performance-timeline/#sec-PerformanceEntry-interface
 @Experimental()
-class PerformanceEntry extends Interceptor native "PerformanceEntry" {
+@Native("PerformanceEntry")
+class PerformanceEntry extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory PerformanceEntry._() { throw new UnsupportedError("Not supported"); }
 
@@ -21169,7 +21351,8 @@
 @DomName('PerformanceMark')
 // http://www.w3.org/TR/user-timing/#performancemark
 @Experimental()
-class PerformanceMark extends PerformanceEntry native "PerformanceMark" {
+@Native("PerformanceMark")
+class PerformanceMark extends PerformanceEntry {
   // To suppress missing implicit constructor warnings.
   factory PerformanceMark._() { throw new UnsupportedError("Not supported"); }
 }
@@ -21182,7 +21365,8 @@
 @DomName('PerformanceMeasure')
 // http://www.w3.org/TR/user-timing/#performancemeasure
 @Experimental()
-class PerformanceMeasure extends PerformanceEntry native "PerformanceMeasure" {
+@Native("PerformanceMeasure")
+class PerformanceMeasure extends PerformanceEntry {
   // To suppress missing implicit constructor warnings.
   factory PerformanceMeasure._() { throw new UnsupportedError("Not supported"); }
 }
@@ -21194,7 +21378,8 @@
 @DocsEditable()
 @DomName('PerformanceNavigation')
 @Unstable()
-class PerformanceNavigation extends Interceptor native "PerformanceNavigation" {
+@Native("PerformanceNavigation")
+class PerformanceNavigation extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory PerformanceNavigation._() { throw new UnsupportedError("Not supported"); }
 
@@ -21231,7 +21416,8 @@
 @DomName('PerformanceResourceTiming')
 // http://www.w3c-test.org/webperf/specs/ResourceTiming/#performanceresourcetiming
 @Experimental()
-class PerformanceResourceTiming extends PerformanceEntry native "PerformanceResourceTiming" {
+@Native("PerformanceResourceTiming")
+class PerformanceResourceTiming extends PerformanceEntry {
   // To suppress missing implicit constructor warnings.
   factory PerformanceResourceTiming._() { throw new UnsupportedError("Not supported"); }
 
@@ -21294,7 +21480,8 @@
 @DocsEditable()
 @DomName('PerformanceTiming')
 @Unstable()
-class PerformanceTiming extends Interceptor native "PerformanceTiming" {
+@Native("PerformanceTiming")
+class PerformanceTiming extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory PerformanceTiming._() { throw new UnsupportedError("Not supported"); }
 
@@ -21390,7 +21577,8 @@
 @DocsEditable()
 @DomName('Player')
 @Experimental() // untriaged
-class Player extends Interceptor native "Player" {
+@Native("Player")
+class Player extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Player._() { throw new UnsupportedError("Not supported"); }
 
@@ -21462,7 +21650,8 @@
 @DocsEditable()
 @DomName('Plugin')
 @Experimental() // non-standard
-class Plugin extends Interceptor native "Plugin" {
+@Native("Plugin")
+class Plugin extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Plugin._() { throw new UnsupportedError("Not supported"); }
 
@@ -21502,7 +21691,8 @@
 @DocsEditable()
 @DomName('PluginArray')
 @Experimental() // non-standard
-class PluginArray extends Interceptor with ListMixin<Plugin>, ImmutableListMixin<Plugin> implements JavaScriptIndexingBehavior, List<Plugin> native "PluginArray" {
+@Native("PluginArray")
+class PluginArray extends Interceptor with ListMixin<Plugin>, ImmutableListMixin<Plugin> implements JavaScriptIndexingBehavior, List<Plugin> {
   // To suppress missing implicit constructor warnings.
   factory PluginArray._() { throw new UnsupportedError("Not supported"); }
 
@@ -21581,7 +21771,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class PopStateEvent extends Event native "PopStateEvent" {
+@Native("PopStateEvent")
+class PopStateEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory PopStateEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -21613,7 +21804,8 @@
 @DocsEditable()
 @DomName('PositionError')
 @Unstable()
-class PositionError extends Interceptor native "PositionError" {
+@Native("PositionError")
+class PositionError extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory PositionError._() { throw new UnsupportedError("Not supported"); }
 
@@ -21654,7 +21846,8 @@
 
 @DocsEditable()
 @DomName('HTMLPreElement')
-class PreElement extends HtmlElement native "HTMLPreElement" {
+@Native("HTMLPreElement")
+class PreElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory PreElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -21676,7 +21869,8 @@
 @DocsEditable()
 @DomName('ProcessingInstruction')
 @Unstable()
-class ProcessingInstruction extends CharacterData native "ProcessingInstruction" {
+@Native("ProcessingInstruction")
+class ProcessingInstruction extends CharacterData {
   // To suppress missing implicit constructor warnings.
   factory ProcessingInstruction._() { throw new UnsupportedError("Not supported"); }
 
@@ -21700,7 +21894,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class ProgressElement extends HtmlElement native "HTMLProgressElement" {
+@Native("HTMLProgressElement")
+class ProgressElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ProgressElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -21743,7 +21938,8 @@
 
 @DocsEditable()
 @DomName('ProgressEvent')
-class ProgressEvent extends Event native "ProgressEvent" {
+@Native("ProgressEvent")
+class ProgressEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory ProgressEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -21766,7 +21962,8 @@
 
 @DocsEditable()
 @DomName('HTMLQuoteElement')
-class QuoteElement extends HtmlElement native "HTMLQuoteElement" {
+@Native("HTMLQuoteElement")
+class QuoteElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory QuoteElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -21826,7 +22023,8 @@
 
 @DomName('Range')
 @Unstable()
-class Range extends Interceptor native "Range" {
+@Native("Range")
+class Range extends Interceptor {
   factory Range() => document.createRange();
 
   factory Range.fromPoint(Point point) =>
@@ -22018,7 +22216,8 @@
 @DomName('ResourceProgressEvent')
 // https://chromiumcodereview.appspot.com/14773025/
 @deprecated // experimental
-class ResourceProgressEvent extends ProgressEvent native "ResourceProgressEvent" {
+@Native("ResourceProgressEvent")
+class ResourceProgressEvent extends ProgressEvent {
   // To suppress missing implicit constructor warnings.
   factory ResourceProgressEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -22035,7 +22234,8 @@
 @DomName('RTCDataChannel')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDataChannel
 @Experimental()
-class RtcDataChannel extends EventTarget native "RTCDataChannel,DataChannel" {
+@Native("RTCDataChannel,DataChannel")
+class RtcDataChannel extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory RtcDataChannel._() { throw new UnsupportedError("Not supported"); }
 
@@ -22186,7 +22386,8 @@
 @DomName('RTCDataChannelEvent')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcdatachannelevent
 @Experimental()
-class RtcDataChannelEvent extends Event native "RTCDataChannelEvent" {
+@Native("RTCDataChannelEvent")
+class RtcDataChannelEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory RtcDataChannelEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -22203,7 +22404,8 @@
 @DomName('RTCDTMFSender')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDTMFSender
 @Experimental()
-class RtcDtmfSender extends EventTarget native "RTCDTMFSender" {
+@Native("RTCDTMFSender")
+class RtcDtmfSender extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory RtcDtmfSender._() { throw new UnsupportedError("Not supported"); }
 
@@ -22257,7 +22459,8 @@
 @DomName('RTCDTMFToneChangeEvent')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDTMFToneChangeEvent
 @Experimental()
-class RtcDtmfToneChangeEvent extends Event native "RTCDTMFToneChangeEvent" {
+@Native("RTCDTMFToneChangeEvent")
+class RtcDtmfToneChangeEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory RtcDtmfToneChangeEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -22274,7 +22477,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCIceCandidate
-class RtcIceCandidate extends Interceptor native "RTCIceCandidate,mozRTCIceCandidate" {
+@Native("RTCIceCandidate,mozRTCIceCandidate")
+class RtcIceCandidate extends Interceptor {
   factory RtcIceCandidate(Map dictionary) {
     // TODO(efortuna): Remove this check if when you can actually construct with
     // the unprefixed RTCIceCandidate in Firefox (currently both are defined,
@@ -22310,7 +22514,8 @@
 @DomName('RTCIceCandidateEvent')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcicecandidate-type
 @Experimental()
-class RtcIceCandidateEvent extends Event native "RTCIceCandidateEvent" {
+@Native("RTCIceCandidateEvent")
+class RtcIceCandidateEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory RtcIceCandidateEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -22327,7 +22532,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection
-class RtcPeerConnection extends EventTarget native "RTCPeerConnection,mozRTCPeerConnection" {
+@Native("RTCPeerConnection,mozRTCPeerConnection")
+class RtcPeerConnection extends EventTarget {
   factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
     var constructorName = JS('RtcPeerConnection', 'window[#]',
         '${Device.propertyPrefix}RTCPeerConnection');
@@ -22691,7 +22897,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCSessionDescription
-class RtcSessionDescription extends Interceptor native "RTCSessionDescription,mozRTCSessionDescription" {
+@Native("RTCSessionDescription,mozRTCSessionDescription")
+class RtcSessionDescription extends Interceptor {
   factory RtcSessionDescription(Map dictionary) {
     // TODO(efortuna): Remove this check if when you can actually construct with
     // the unprefixed RTCIceCandidate in Firefox (currently both are defined,
@@ -22724,7 +22931,8 @@
 @DomName('RTCStatsReport')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCStatsReport
 @Experimental()
-class RtcStatsReport extends Interceptor native "RTCStatsReport" {
+@Native("RTCStatsReport")
+class RtcStatsReport extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory RtcStatsReport._() { throw new UnsupportedError("Not supported"); }
 
@@ -22770,7 +22978,8 @@
 @DomName('RTCStatsResponse')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-RTCStatsReport-RTCStats-getter-DOMString-id
 @Experimental()
-class RtcStatsResponse extends Interceptor native "RTCStatsResponse" {
+@Native("RTCStatsResponse")
+class RtcStatsResponse extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory RtcStatsResponse._() { throw new UnsupportedError("Not supported"); }
 
@@ -22793,7 +23002,8 @@
 
 @DocsEditable()
 @DomName('Screen')
-class Screen extends EventTarget native "Screen" {
+@Native("Screen")
+class Screen extends EventTarget {
 
   @DomName('Screen.availHeight')
   @DomName('Screen.availLeft')
@@ -22864,7 +23074,8 @@
 
 @DocsEditable()
 @DomName('HTMLScriptElement')
-class ScriptElement extends HtmlElement native "HTMLScriptElement" {
+@Native("HTMLScriptElement")
+class ScriptElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ScriptElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -22919,7 +23130,8 @@
 @DomName('SecurityPolicyViolationEvent')
 // https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#securitypolicyviolationevent-events
 @Experimental()
-class SecurityPolicyViolationEvent extends Event native "SecurityPolicyViolationEvent" {
+@Native("SecurityPolicyViolationEvent")
+class SecurityPolicyViolationEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory SecurityPolicyViolationEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -22972,7 +23184,8 @@
 
 
 @DomName('HTMLSelectElement')
-class SelectElement extends HtmlElement native "HTMLSelectElement" {
+@Native("HTMLSelectElement")
+class SelectElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory SelectElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -23095,7 +23308,8 @@
 
 @DocsEditable()
 @DomName('Selection')
-class Selection extends Interceptor native "Selection" {
+@Native("Selection")
+class Selection extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Selection._() { throw new UnsupportedError("Not supported"); }
 
@@ -23221,7 +23435,8 @@
 @DocsEditable()
 @DomName('ServiceWorkerContainer')
 @Experimental() // untriaged
-class ServiceWorkerContainer extends Interceptor native "ServiceWorkerContainer" {
+@Native("ServiceWorkerContainer")
+class ServiceWorkerContainer extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ServiceWorkerContainer._() { throw new UnsupportedError("Not supported"); }
 }
@@ -23233,7 +23448,8 @@
 @DocsEditable()
 @DomName('ServiceWorkerGlobalScope')
 @Experimental() // untriaged
-class ServiceWorkerGlobalScope extends WorkerGlobalScope native "ServiceWorkerGlobalScope" {
+@Native("ServiceWorkerGlobalScope")
+class ServiceWorkerGlobalScope extends WorkerGlobalScope {
   // To suppress missing implicit constructor warnings.
   factory ServiceWorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }
 }
@@ -23247,7 +23463,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '26')
 @Experimental()
 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-element
-class ShadowElement extends HtmlElement native "HTMLShadowElement" {
+@Native("HTMLShadowElement")
+class ShadowElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ShadowElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -23286,7 +23503,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '26')
 @Experimental()
 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#api-shadow-root
-class ShadowRoot extends DocumentFragment native "ShadowRoot" {
+@Native("ShadowRoot")
+class ShadowRoot extends DocumentFragment {
   // To suppress missing implicit constructor warnings.
   factory ShadowRoot._() { throw new UnsupportedError("Not supported"); }
 
@@ -23398,7 +23616,8 @@
 @DomName('SharedWorker')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#shared-workers-and-the-sharedworker-interface
 @Experimental()
-class SharedWorker extends EventTarget implements AbstractWorker native "SharedWorker" {
+@Native("SharedWorker")
+class SharedWorker extends EventTarget implements AbstractWorker {
   // To suppress missing implicit constructor warnings.
   factory SharedWorker._() { throw new UnsupportedError("Not supported"); }
 
@@ -23440,7 +23659,8 @@
 @DocsEditable()
 @DomName('SharedWorkerGlobalScope')
 @Experimental() // untriaged
-class SharedWorkerGlobalScope extends WorkerGlobalScope native "SharedWorkerGlobalScope" {
+@Native("SharedWorkerGlobalScope")
+class SharedWorkerGlobalScope extends WorkerGlobalScope {
   // To suppress missing implicit constructor warnings.
   factory SharedWorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }
 
@@ -23475,7 +23695,8 @@
 @DomName('SourceBuffer')
 // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer
 @Experimental()
-class SourceBuffer extends EventTarget native "SourceBuffer" {
+@Native("SourceBuffer")
+class SourceBuffer extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory SourceBuffer._() { throw new UnsupportedError("Not supported"); }
 
@@ -23541,7 +23762,8 @@
 @DomName('SourceBufferList')
 // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebufferlist
 @Experimental()
-class SourceBufferList extends EventTarget with ListMixin<SourceBuffer>, ImmutableListMixin<SourceBuffer> implements JavaScriptIndexingBehavior, List<SourceBuffer> native "SourceBufferList" {
+@Native("SourceBufferList")
+class SourceBufferList extends EventTarget with ListMixin<SourceBuffer>, ImmutableListMixin<SourceBuffer> implements JavaScriptIndexingBehavior, List<SourceBuffer> {
   // To suppress missing implicit constructor warnings.
   factory SourceBufferList._() { throw new UnsupportedError("Not supported"); }
 
@@ -23604,7 +23826,8 @@
 
 @DocsEditable()
 @DomName('HTMLSourceElement')
-class SourceElement extends HtmlElement native "HTMLSourceElement" {
+@Native("HTMLSourceElement")
+class SourceElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory SourceElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -23638,7 +23861,8 @@
 @DocsEditable()
 @DomName('SourceInfo')
 @Experimental() // untriaged
-class SourceInfo extends Interceptor native "SourceInfo" {
+@Native("SourceInfo")
+class SourceInfo extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SourceInfo._() { throw new UnsupportedError("Not supported"); }
 
@@ -23669,7 +23893,8 @@
 
 @DocsEditable()
 @DomName('HTMLSpanElement')
-class SpanElement extends HtmlElement native "HTMLSpanElement" {
+@Native("HTMLSpanElement")
+class SpanElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory SpanElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -23692,7 +23917,8 @@
 @DomName('SpeechGrammar')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#dfn-speechgrammar
 @Experimental()
-class SpeechGrammar extends Interceptor native "SpeechGrammar" {
+@Native("SpeechGrammar")
+class SpeechGrammar extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SpeechGrammar._() { throw new UnsupportedError("Not supported"); }
 
@@ -23720,7 +23946,8 @@
 @DomName('SpeechGrammarList')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#dfn-speechgrammarlist
 @Experimental()
-class SpeechGrammarList extends Interceptor with ListMixin<SpeechGrammar>, ImmutableListMixin<SpeechGrammar> implements JavaScriptIndexingBehavior, List<SpeechGrammar> native "SpeechGrammarList" {
+@Native("SpeechGrammarList")
+class SpeechGrammarList extends Interceptor with ListMixin<SpeechGrammar>, ImmutableListMixin<SpeechGrammar> implements JavaScriptIndexingBehavior, List<SpeechGrammar> {
   // To suppress missing implicit constructor warnings.
   factory SpeechGrammarList._() { throw new UnsupportedError("Not supported"); }
 
@@ -23800,7 +24027,8 @@
 @DomName('SpeechInputEvent')
 // http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#speech_input_event_interface
 @Experimental()
-class SpeechInputEvent extends Event native "SpeechInputEvent" {
+@Native("SpeechInputEvent")
+class SpeechInputEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory SpeechInputEvent._() { throw new UnsupportedError("Not supported"); }
 }
@@ -23813,7 +24041,8 @@
 @DomName('SpeechInputResult')
 // http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#speech_input_result_interface
 @Experimental()
-class SpeechInputResult extends Interceptor native "SpeechInputResult" {
+@Native("SpeechInputResult")
+class SpeechInputResult extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SpeechInputResult._() { throw new UnsupportedError("Not supported"); }
 }
@@ -23826,7 +24055,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental()
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-section
-class SpeechRecognition extends EventTarget native "SpeechRecognition" {
+@Native("SpeechRecognition")
+class SpeechRecognition extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognition._() { throw new UnsupportedError("Not supported"); }
 
@@ -24045,7 +24275,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental()
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionalternative
-class SpeechRecognitionAlternative extends Interceptor native "SpeechRecognitionAlternative" {
+@Native("SpeechRecognitionAlternative")
+class SpeechRecognitionAlternative extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognitionAlternative._() { throw new UnsupportedError("Not supported"); }
 
@@ -24067,7 +24298,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental()
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-error
-class SpeechRecognitionError extends Event native "SpeechRecognitionError" {
+@Native("SpeechRecognitionError")
+class SpeechRecognitionError extends Event {
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognitionError._() { throw new UnsupportedError("Not supported"); }
 
@@ -24089,7 +24321,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental()
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-event
-class SpeechRecognitionEvent extends Event native "SpeechRecognitionEvent" {
+@Native("SpeechRecognitionEvent")
+class SpeechRecognitionEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognitionEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -24121,7 +24354,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental()
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionresult
-class SpeechRecognitionResult extends Interceptor native "SpeechRecognitionResult" {
+@Native("SpeechRecognitionResult")
+class SpeechRecognitionResult extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognitionResult._() { throw new UnsupportedError("Not supported"); }
 
@@ -24146,7 +24380,8 @@
 @DomName('SpeechSynthesis')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
 @Experimental()
-class SpeechSynthesis extends EventTarget native "SpeechSynthesis" {
+@Native("SpeechSynthesis")
+class SpeechSynthesis extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory SpeechSynthesis._() { throw new UnsupportedError("Not supported"); }
 
@@ -24191,7 +24426,8 @@
 @DomName('SpeechSynthesisEvent')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
 @Experimental()
-class SpeechSynthesisEvent extends Event native "SpeechSynthesisEvent" {
+@Native("SpeechSynthesisEvent")
+class SpeechSynthesisEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory SpeechSynthesisEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -24216,7 +24452,8 @@
 @DomName('SpeechSynthesisUtterance')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
 @Experimental()
-class SpeechSynthesisUtterance extends EventTarget native "SpeechSynthesisUtterance" {
+@Native("SpeechSynthesisUtterance")
+class SpeechSynthesisUtterance extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory SpeechSynthesisUtterance._() { throw new UnsupportedError("Not supported"); }
 
@@ -24369,7 +24606,8 @@
 @DomName('SpeechSynthesisVoice')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
 @Experimental()
-class SpeechSynthesisVoice extends Interceptor native "SpeechSynthesisVoice" {
+@Native("SpeechSynthesisVoice")
+class SpeechSynthesisVoice extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SpeechSynthesisVoice._() { throw new UnsupportedError("Not supported"); }
 
@@ -24427,8 +24665,9 @@
  */
 @DomName('Storage')
 @Unstable()
+@Native("Storage")
 class Storage extends Interceptor
-    implements Map<String, String>  native "Storage" {
+    implements Map<String, String> {
 
   void addAll(Map<String, String> other) {
     other.forEach((k, v) { this[k] = v; });
@@ -24548,7 +24787,8 @@
 
 @DomName('StorageEvent')
 @Unstable()
-class StorageEvent extends Event native "StorageEvent" {
+@Native("StorageEvent")
+class StorageEvent extends Event {
   factory StorageEvent(String type,
     {bool canBubble: false, bool cancelable: false, String key, String oldValue,
     String newValue, String url, Storage storageArea}) {
@@ -24596,7 +24836,8 @@
 @DomName('StorageInfo')
 // http://www.w3.org/TR/file-system-api/
 @Experimental()
-class StorageInfo extends Interceptor native "StorageInfo" {
+@Native("StorageInfo")
+class StorageInfo extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory StorageInfo._() { throw new UnsupportedError("Not supported"); }
 
@@ -24619,7 +24860,8 @@
 @DomName('StorageQuota')
 // http://www.w3.org/TR/quota-api/#idl-def-StorageQuota
 @Experimental()
-class StorageQuota extends Interceptor native "StorageQuota" {
+@Native("StorageQuota")
+class StorageQuota extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory StorageQuota._() { throw new UnsupportedError("Not supported"); }
 
@@ -24668,7 +24910,8 @@
 
 @DocsEditable()
 @DomName('HTMLStyleElement')
-class StyleElement extends HtmlElement native "HTMLStyleElement" {
+@Native("HTMLStyleElement")
+class StyleElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory StyleElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -24711,7 +24954,8 @@
 @DomName('StyleMedia')
 // http://developer.apple.com/library/safari/#documentation/SafariDOMAdditions/Reference/StyleMedia/StyleMedia/StyleMedia.html
 @Experimental() // nonstandard
-class StyleMedia extends Interceptor native "StyleMedia" {
+@Native("StyleMedia")
+class StyleMedia extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory StyleMedia._() { throw new UnsupportedError("Not supported"); }
 
@@ -24730,7 +24974,8 @@
 
 @DocsEditable()
 @DomName('StyleSheet')
-class StyleSheet extends Interceptor native "StyleSheet" {
+@Native("StyleSheet")
+class StyleSheet extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory StyleSheet._() { throw new UnsupportedError("Not supported"); }
 
@@ -24769,7 +25014,8 @@
 
 @DocsEditable()
 @DomName('HTMLTableCaptionElement')
-class TableCaptionElement extends HtmlElement native "HTMLTableCaptionElement" {
+@Native("HTMLTableCaptionElement")
+class TableCaptionElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory TableCaptionElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -24790,7 +25036,8 @@
 
 @DocsEditable()
 @DomName('HTMLTableCellElement')
-class TableCellElement extends HtmlElement native "HTMLTableCellElement,HTMLTableDataCellElement,HTMLTableHeaderCellElement" {
+@Native("HTMLTableCellElement,HTMLTableDataCellElement,HTMLTableHeaderCellElement")
+class TableCellElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory TableCellElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -24827,7 +25074,8 @@
 
 @DocsEditable()
 @DomName('HTMLTableColElement')
-class TableColElement extends HtmlElement native "HTMLTableColElement" {
+@Native("HTMLTableColElement")
+class TableColElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory TableColElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -24852,7 +25100,8 @@
 
 @DocsEditable()
 @DomName('HTMLTableElement')
-class TableElement extends HtmlElement native "HTMLTableElement" {
+@Native("HTMLTableElement")
+class TableElement extends HtmlElement {
 
   @DomName('HTMLTableElement.tBodies')
   List<TableSectionElement> get tBodies =>
@@ -24982,7 +25231,8 @@
 
 @DocsEditable()
 @DomName('HTMLTableRowElement')
-class TableRowElement extends HtmlElement native "HTMLTableRowElement" {
+@Native("HTMLTableRowElement")
+class TableRowElement extends HtmlElement {
 
   @DomName('HTMLTableRowElement.cells')
   List<TableCellElement> get cells =>
@@ -25053,7 +25303,8 @@
 
 @DocsEditable()
 @DomName('HTMLTableSectionElement')
-class TableSectionElement extends HtmlElement native "HTMLTableSectionElement" {
+@Native("HTMLTableSectionElement")
+class TableSectionElement extends HtmlElement {
 
   @DomName('HTMLTableSectionElement.rows')
   List<TableRowElement> get rows =>
@@ -25116,7 +25367,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#template-element
-class TemplateElement extends HtmlElement native "HTMLTemplateElement" {
+@Native("HTMLTemplateElement")
+class TemplateElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory TemplateElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -25162,7 +25414,8 @@
 
 
 @DomName('Text')
-class Text extends CharacterData native "Text" {
+@Native("Text")
+class Text extends CharacterData {
   factory Text(String data) => document._createTextNode(data);
   // To suppress missing implicit constructor warnings.
   factory Text._() { throw new UnsupportedError("Not supported"); }
@@ -25190,7 +25443,8 @@
 
 @DocsEditable()
 @DomName('HTMLTextAreaElement')
-class TextAreaElement extends HtmlElement native "HTMLTextAreaElement" {
+@Native("HTMLTextAreaElement")
+class TextAreaElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory TextAreaElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -25337,7 +25591,8 @@
 
 @DomName('TextEvent')
 @Unstable()
-class TextEvent extends UIEvent native "TextEvent" {
+@Native("TextEvent")
+class TextEvent extends UIEvent {
   factory TextEvent(String type,
     {bool canBubble: false, bool cancelable: false, Window view, String data}) {
     if (view == null) {
@@ -25367,7 +25622,8 @@
 
 @DocsEditable()
 @DomName('TextMetrics')
-class TextMetrics extends Interceptor native "TextMetrics" {
+@Native("TextMetrics")
+class TextMetrics extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory TextMetrics._() { throw new UnsupportedError("Not supported"); }
 
@@ -25384,7 +25640,8 @@
 @DomName('TextTrack')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrack
 @Experimental()
-class TextTrack extends EventTarget native "TextTrack" {
+@Native("TextTrack")
+class TextTrack extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory TextTrack._() { throw new UnsupportedError("Not supported"); }
 
@@ -25464,7 +25721,8 @@
 @DomName('TextTrackCue')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcue
 @Experimental()
-class TextTrackCue extends EventTarget native "TextTrackCue" {
+@Native("TextTrackCue")
+class TextTrackCue extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory TextTrackCue._() { throw new UnsupportedError("Not supported"); }
 
@@ -25527,7 +25785,8 @@
 @DomName('TextTrackCueList')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcuelist
 @Experimental()
-class TextTrackCueList extends Interceptor with ListMixin<TextTrackCue>, ImmutableListMixin<TextTrackCue> implements List<TextTrackCue>, JavaScriptIndexingBehavior native "TextTrackCueList" {
+@Native("TextTrackCueList")
+class TextTrackCueList extends Interceptor with ListMixin<TextTrackCue>, ImmutableListMixin<TextTrackCue> implements List<TextTrackCue>, JavaScriptIndexingBehavior {
   // To suppress missing implicit constructor warnings.
   factory TextTrackCueList._() { throw new UnsupportedError("Not supported"); }
 
@@ -25596,7 +25855,8 @@
 @DomName('TextTrackList')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttracklist
 @Experimental()
-class TextTrackList extends EventTarget with ListMixin<TextTrack>, ImmutableListMixin<TextTrack> implements JavaScriptIndexingBehavior, List<TextTrack> native "TextTrackList" {
+@Native("TextTrackList")
+class TextTrackList extends EventTarget with ListMixin<TextTrack>, ImmutableListMixin<TextTrack> implements JavaScriptIndexingBehavior, List<TextTrack> {
   // To suppress missing implicit constructor warnings.
   factory TextTrackList._() { throw new UnsupportedError("Not supported"); }
 
@@ -25690,7 +25950,8 @@
 @DocsEditable()
 @DomName('TimeRanges')
 @Unstable()
-class TimeRanges extends Interceptor native "TimeRanges" {
+@Native("TimeRanges")
+class TimeRanges extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory TimeRanges._() { throw new UnsupportedError("Not supported"); }
 
@@ -25714,7 +25975,8 @@
 @DocsEditable()
 @DomName('TimedItem')
 @Experimental() // untriaged
-class TimedItem extends Interceptor native "TimedItem" {
+@Native("TimedItem")
+class TimedItem extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory TimedItem._() { throw new UnsupportedError("Not supported"); }
 
@@ -25761,7 +26023,8 @@
 @DocsEditable()
 @DomName('Timeline')
 @Experimental() // untriaged
-class Timeline extends Interceptor native "Timeline" {
+@Native("Timeline")
+class Timeline extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Timeline._() { throw new UnsupportedError("Not supported"); }
 
@@ -25787,7 +26050,8 @@
 @DocsEditable()
 @DomName('Timing')
 @Experimental() // untriaged
-class Timing extends Interceptor native "Timing" {
+@Native("Timing")
+class Timing extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Timing._() { throw new UnsupportedError("Not supported"); }
 
@@ -25843,7 +26107,8 @@
 
 @DocsEditable()
 @DomName('HTMLTitleElement')
-class TitleElement extends HtmlElement native "HTMLTitleElement" {
+@Native("HTMLTitleElement")
+class TitleElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory TitleElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -25866,7 +26131,8 @@
 @DomName('Touch')
 // http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
 @Experimental()
-class Touch extends Interceptor native "Touch" {
+@Native("Touch")
+class Touch extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Touch._() { throw new UnsupportedError("Not supported"); }
 
@@ -25969,7 +26235,8 @@
 @DomName('TouchEvent')
 // http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
 @Experimental()
-class TouchEvent extends UIEvent native "TouchEvent" {
+@Native("TouchEvent")
+class TouchEvent extends UIEvent {
   factory TouchEvent(TouchList touches, TouchList targetTouches,
       TouchList changedTouches, String type,
       {Window view, int screenX: 0, int screenY: 0, int clientX: 0,
@@ -26038,7 +26305,8 @@
 @DomName('TouchList')
 // http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
 @Experimental()
-class TouchList extends Interceptor with ListMixin<Touch>, ImmutableListMixin<Touch> implements JavaScriptIndexingBehavior, List<Touch> native "TouchList" {
+@Native("TouchList")
+class TouchList extends Interceptor with ListMixin<Touch>, ImmutableListMixin<Touch> implements JavaScriptIndexingBehavior, List<Touch> {
   /// NB: This constructor likely does not work as you might expect it to! This
   /// constructor will simply fail (returning null) if you are not on a device
   /// with touch enabled. See dartbug.com/8314.
@@ -26115,7 +26383,8 @@
 @SupportedBrowser(SupportedBrowser.SAFARI)
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#the-track-element
 @Experimental()
-class TrackElement extends HtmlElement native "HTMLTrackElement" {
+@Native("HTMLTrackElement")
+class TrackElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory TrackElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -26185,7 +26454,8 @@
 @DocsEditable()
 @DomName('TrackEvent')
 @Unstable()
-class TrackEvent extends Event native "TrackEvent" {
+@Native("TrackEvent")
+class TrackEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory TrackEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -26201,7 +26471,8 @@
 
 @DocsEditable()
 @DomName('TransitionEvent')
-class TransitionEvent extends Event native "TransitionEvent,WebKitTransitionEvent" {
+@Native("TransitionEvent,WebKitTransitionEvent")
+class TransitionEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory TransitionEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -26224,7 +26495,8 @@
 
 @DomName('TreeWalker')
 @Unstable()
-class TreeWalker extends Interceptor native "TreeWalker" {
+@Native("TreeWalker")
+class TreeWalker extends Interceptor {
   factory TreeWalker(Node root, int whatToShow) {
     return document._createTreeWalker(root, whatToShow, null);
   }
@@ -26284,7 +26556,8 @@
 
 
 @DomName('UIEvent')
-class UIEvent extends Event native "UIEvent" {
+@Native("UIEvent")
+class UIEvent extends Event {
   // In JS, canBubble and cancelable are technically required parameters to
   // init*Event. In practice, though, if they aren't provided they simply
   // default to false (since that's Boolean(undefined)).
@@ -26384,7 +26657,8 @@
 
 @DocsEditable()
 @DomName('HTMLUListElement')
-class UListElement extends HtmlElement native "HTMLUListElement" {
+@Native("HTMLUListElement")
+class UListElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory UListElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -26405,7 +26679,8 @@
 
 @DocsEditable()
 @DomName('HTMLUnknownElement')
-class UnknownElement extends HtmlElement native "HTMLUnknownElement" {
+@Native("HTMLUnknownElement")
+class UnknownElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory UnknownElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -26421,7 +26696,8 @@
 
 
 @DomName('URL')
-class Url extends Interceptor implements UrlUtils native "URL" {
+@Native("URL")
+class Url extends Interceptor implements UrlUtils {
 
   static String createObjectUrl(blob_OR_source_OR_stream) =>
       JS('String',
@@ -26574,7 +26850,8 @@
 
 @DocsEditable()
 @DomName('ValidityState')
-class ValidityState extends Interceptor native "ValidityState" {
+@Native("ValidityState")
+class ValidityState extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ValidityState._() { throw new UnsupportedError("Not supported"); }
 
@@ -26624,7 +26901,8 @@
 
 
 @DomName('HTMLVideoElement')
-class VideoElement extends MediaElement implements CanvasImageSource native "HTMLVideoElement" {
+@Native("HTMLVideoElement")
+class VideoElement extends MediaElement implements CanvasImageSource {
   // To suppress missing implicit constructor warnings.
   factory VideoElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -26706,7 +26984,8 @@
 @DocsEditable()
 @DomName('VideoPlaybackQuality')
 @Experimental() // untriaged
-class VideoPlaybackQuality extends Interceptor native "VideoPlaybackQuality" {
+@Native("VideoPlaybackQuality")
+class VideoPlaybackQuality extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory VideoPlaybackQuality._() { throw new UnsupportedError("Not supported"); }
 
@@ -26749,7 +27028,8 @@
 @DocsEditable()
 @DomName('VTTCue')
 @Experimental() // untriaged
-class VttCue extends TextTrackCue native "VTTCue" {
+@Native("VTTCue")
+class VttCue extends TextTrackCue {
   // To suppress missing implicit constructor warnings.
   factory VttCue._() { throw new UnsupportedError("Not supported"); }
 
@@ -26814,7 +27094,8 @@
 @DocsEditable()
 @DomName('VTTRegion')
 @Experimental() // untriaged
-class VttRegion extends Interceptor native "VTTRegion" {
+@Native("VTTRegion")
+class VttRegion extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory VttRegion._() { throw new UnsupportedError("Not supported"); }
 
@@ -26878,7 +27159,8 @@
 @DocsEditable()
 @DomName('VTTRegionList')
 @Experimental() // untriaged
-class VttRegionList extends Interceptor native "VTTRegionList" {
+@Native("VTTRegionList")
+class VttRegionList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory VttRegionList._() { throw new UnsupportedError("Not supported"); }
 
@@ -26943,7 +27225,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class WebSocket extends EventTarget native "WebSocket" {
+@Native("WebSocket")
+class WebSocket extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory WebSocket._() { throw new UnsupportedError("Not supported"); }
 
@@ -27137,7 +27420,8 @@
 
 
 @DomName('WheelEvent')
-class WheelEvent extends MouseEvent native "WheelEvent,MouseWheelEvent,MouseScrollEvent" {
+@Native("WheelEvent,MouseWheelEvent,MouseScrollEvent")
+class WheelEvent extends MouseEvent {
 
   factory WheelEvent(String type,
       {Window view, int deltaX: 0, int deltaY: 0,
@@ -27428,7 +27712,8 @@
  * * [Window](http://www.w3.org/TR/Window/) from the W3C.
  */
 @DomName('Window')
-class Window extends EventTarget implements WindowEventHandlers, WindowBase, GlobalEventHandlers, _WindowTimers, WindowBase64 native "Window,DOMWindow" {
+@Native("Window,DOMWindow")
+class Window extends EventTarget implements WindowEventHandlers, WindowBase, GlobalEventHandlers, _WindowTimers, WindowBase64 {
 
   /**
    * Returns a Future that completes just before the window is about to
@@ -29369,7 +29654,8 @@
 @SupportedBrowser(SupportedBrowser.SAFARI)
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#worker
 @Experimental() // stable
-class Worker extends EventTarget implements AbstractWorker native "Worker" {
+@Native("Worker")
+class Worker extends EventTarget implements AbstractWorker {
   // To suppress missing implicit constructor warnings.
   factory Worker._() { throw new UnsupportedError("Not supported"); }
 
@@ -29431,7 +29717,8 @@
 @DocsEditable()
 @DomName('WorkerConsole')
 @Experimental() // untriaged
-class WorkerConsole extends ConsoleBase native "WorkerConsole" {
+@Native("WorkerConsole")
+class WorkerConsole extends ConsoleBase {
   // To suppress missing implicit constructor warnings.
   factory WorkerConsole._() { throw new UnsupportedError("Not supported"); }
 }
@@ -29443,7 +29730,8 @@
 @DocsEditable()
 @DomName('WorkerCrypto')
 @Experimental() // untriaged
-class WorkerCrypto extends Interceptor native "WorkerCrypto" {
+@Native("WorkerCrypto")
+class WorkerCrypto extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory WorkerCrypto._() { throw new UnsupportedError("Not supported"); }
 }
@@ -29455,7 +29743,8 @@
 @DocsEditable()
 @DomName('WorkerGlobalScope')
 @Experimental() // untriaged
-class WorkerGlobalScope extends EventTarget implements _WindowTimers, WindowBase64 native "WorkerGlobalScope" {
+@Native("WorkerGlobalScope")
+class WorkerGlobalScope extends EventTarget implements _WindowTimers, WindowBase64 {
   // To suppress missing implicit constructor warnings.
   factory WorkerGlobalScope._() { throw new UnsupportedError("Not supported"); }
 
@@ -29636,7 +29925,8 @@
 @DocsEditable()
 @DomName('WorkerPerformance')
 @Experimental() // untriaged
-class WorkerPerformance extends Interceptor native "WorkerPerformance" {
+@Native("WorkerPerformance")
+class WorkerPerformance extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory WorkerPerformance._() { throw new UnsupportedError("Not supported"); }
 
@@ -29654,7 +29944,8 @@
 @DomName('XPathEvaluator')
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
 @deprecated // experimental
-class XPathEvaluator extends Interceptor native "XPathEvaluator" {
+@Native("XPathEvaluator")
+class XPathEvaluator extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory XPathEvaluator._() { throw new UnsupportedError("Not supported"); }
 
@@ -29686,7 +29977,8 @@
 @DomName('XPathExpression')
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression
 @deprecated // experimental
-class XPathExpression extends Interceptor native "XPathExpression" {
+@Native("XPathExpression")
+class XPathExpression extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory XPathExpression._() { throw new UnsupportedError("Not supported"); }
 
@@ -29703,7 +29995,8 @@
 @DomName('XPathNSResolver')
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
 @deprecated // experimental
-class XPathNSResolver extends Interceptor native "XPathNSResolver" {
+@Native("XPathNSResolver")
+class XPathNSResolver extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory XPathNSResolver._() { throw new UnsupportedError("Not supported"); }
 
@@ -29721,7 +30014,8 @@
 @DomName('XPathResult')
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult
 @deprecated // experimental
-class XPathResult extends Interceptor native "XPathResult" {
+@Native("XPathResult")
+class XPathResult extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory XPathResult._() { throw new UnsupportedError("Not supported"); }
 
@@ -29809,7 +30103,8 @@
 @DocsEditable()
 @DomName('XMLDocument')
 @Experimental() // untriaged
-class XmlDocument extends Document native "XMLDocument" {
+@Native("XMLDocument")
+class XmlDocument extends Document {
   // To suppress missing implicit constructor warnings.
   factory XmlDocument._() { throw new UnsupportedError("Not supported"); }
 }
@@ -29822,7 +30117,8 @@
 @DomName('XMLSerializer')
 // http://domparsing.spec.whatwg.org/#the-xmlserializer-interface
 @deprecated // stable
-class XmlSerializer extends Interceptor native "XMLSerializer" {
+@Native("XMLSerializer")
+class XmlSerializer extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory XmlSerializer._() { throw new UnsupportedError("Not supported"); }
 
@@ -29848,7 +30144,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @deprecated // nonstandard
-class XsltProcessor extends Interceptor native "XSLTProcessor" {
+@Native("XSLTProcessor")
+class XsltProcessor extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory XsltProcessor._() { throw new UnsupportedError("Not supported"); }
 
@@ -29901,7 +30198,8 @@
 
 @DocsEditable()
 @DomName('Attr')
-class _Attr extends Node native "Attr" {
+@Native("Attr")
+class _Attr extends Node {
   // To suppress missing implicit constructor warnings.
   factory _Attr._() { throw new UnsupportedError("Not supported"); }
 
@@ -29928,7 +30226,8 @@
 @DomName('CSSPrimitiveValue')
 // http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
 @deprecated // deprecated
-abstract class _CSSPrimitiveValue extends _CSSValue native "CSSPrimitiveValue" {
+@Native("CSSPrimitiveValue")
+abstract class _CSSPrimitiveValue extends _CSSValue {
   // To suppress missing implicit constructor warnings.
   factory _CSSPrimitiveValue._() { throw new UnsupportedError("Not supported"); }
 }
@@ -29941,7 +30240,8 @@
 @DomName('CSSUnknownRule')
 // http://dev.w3.org/csswg/cssom/#the-cssstylesheet-interface
 @deprecated // deprecated
-abstract class _CSSUnknownRule extends CssRule native "CSSUnknownRule" {
+@Native("CSSUnknownRule")
+abstract class _CSSUnknownRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory _CSSUnknownRule._() { throw new UnsupportedError("Not supported"); }
 }
@@ -29954,7 +30254,8 @@
 @DomName('CSSValue')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _CSSValue extends Interceptor native "CSSValue" {
+@Native("CSSValue")
+abstract class _CSSValue extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _CSSValue._() { throw new UnsupportedError("Not supported"); }
 }
@@ -29965,7 +30266,8 @@
 
 @DocsEditable()
 @DomName('ClientRect')
-class _ClientRect extends Interceptor implements Rectangle native "ClientRect,DOMRect" {
+@Native("ClientRect,DOMRect")
+class _ClientRect extends Interceptor implements Rectangle {
 
   // NOTE! All code below should be common with RectangleBase.
    String toString() {
@@ -30127,7 +30429,8 @@
 
 @DocsEditable()
 @DomName('ClientRectList')
-class _ClientRectList extends Interceptor with ListMixin<Rectangle>, ImmutableListMixin<Rectangle> implements List<Rectangle>, JavaScriptIndexingBehavior native "ClientRectList,DOMRectList" {
+@Native("ClientRectList,DOMRectList")
+class _ClientRectList extends Interceptor with ListMixin<Rectangle>, ImmutableListMixin<Rectangle> implements List<Rectangle>, JavaScriptIndexingBehavior {
   // To suppress missing implicit constructor warnings.
   factory _ClientRectList._() { throw new UnsupportedError("Not supported"); }
 
@@ -30192,7 +30495,8 @@
 @DomName('Counter')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _Counter extends Interceptor native "Counter" {
+@Native("Counter")
+abstract class _Counter extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _Counter._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30203,7 +30507,8 @@
 
 @DocsEditable()
 @DomName('CSSRuleList')
-class _CssRuleList extends Interceptor with ListMixin<CssRule>, ImmutableListMixin<CssRule> implements JavaScriptIndexingBehavior, List<CssRule> native "CSSRuleList" {
+@Native("CSSRuleList")
+class _CssRuleList extends Interceptor with ListMixin<CssRule>, ImmutableListMixin<CssRule> implements JavaScriptIndexingBehavior, List<CssRule> {
   // To suppress missing implicit constructor warnings.
   factory _CssRuleList._() { throw new UnsupportedError("Not supported"); }
 
@@ -30268,7 +30573,8 @@
 @DomName('CSSValueList')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-class _CssValueList extends _CSSValue with ListMixin<_CSSValue>, ImmutableListMixin<_CSSValue> implements JavaScriptIndexingBehavior, List<_CSSValue> native "CSSValueList" {
+@Native("CSSValueList")
+class _CssValueList extends _CSSValue with ListMixin<_CSSValue>, ImmutableListMixin<_CSSValue> implements JavaScriptIndexingBehavior, List<_CSSValue> {
   // To suppress missing implicit constructor warnings.
   factory _CssValueList._() { throw new UnsupportedError("Not supported"); }
 
@@ -30334,7 +30640,8 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://www.w3.org/TR/file-system-api/#the-filesystemsync-interface
-abstract class _DOMFileSystemSync extends Interceptor native "DOMFileSystemSync" {
+@Native("DOMFileSystemSync")
+abstract class _DOMFileSystemSync extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _DOMFileSystemSync._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30350,7 +30657,8 @@
 @Experimental()
 // http://www.w3.org/TR/webdatabase/#databasesync
 @deprecated // deprecated
-abstract class _DatabaseSync extends Interceptor native "DatabaseSync" {
+@Native("DatabaseSync")
+abstract class _DatabaseSync extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _DatabaseSync._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30363,7 +30671,8 @@
 @DomName('DirectoryEntrySync')
 // http://www.w3.org/TR/file-system-api/#the-directoryentrysync-interface
 @Experimental()
-abstract class _DirectoryEntrySync extends _EntrySync native "DirectoryEntrySync" {
+@Native("DirectoryEntrySync")
+abstract class _DirectoryEntrySync extends _EntrySync {
   // To suppress missing implicit constructor warnings.
   factory _DirectoryEntrySync._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30376,7 +30685,8 @@
 @DomName('DirectoryReaderSync')
 // http://www.w3.org/TR/file-system-api/#idl-def-DirectoryReaderSync
 @Experimental()
-abstract class _DirectoryReaderSync extends Interceptor native "DirectoryReaderSync" {
+@Native("DirectoryReaderSync")
+abstract class _DirectoryReaderSync extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _DirectoryReaderSync._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30389,7 +30699,8 @@
 @DomName('DocumentType')
 // http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-412266927
 @deprecated // stable
-abstract class _DocumentType extends Node implements ChildNode native "DocumentType" {
+@Native("DocumentType")
+abstract class _DocumentType extends Node implements ChildNode {
   // To suppress missing implicit constructor warnings.
   factory _DocumentType._() { throw new UnsupportedError("Not supported"); }
 
@@ -30407,7 +30718,8 @@
 @Experimental()
 // http://developer.apple.com/library/safari/#documentation/DataManagement/Reference/DOMWindowAdditionsReference/DOMWindowAdditions/DOMWindowAdditions.html
 @Experimental() // non-standard
-class _DomPoint extends Interceptor native "WebKitPoint" {
+@Native("WebKitPoint")
+class _DomPoint extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _DomPoint._() { throw new UnsupportedError("Not supported"); }
 
@@ -30438,7 +30750,8 @@
 @DomName('EntrySync')
 // http://www.w3.org/TR/file-system-api/#idl-def-EntrySync
 @Experimental()
-abstract class _EntrySync extends Interceptor native "EntrySync" {
+@Native("EntrySync")
+abstract class _EntrySync extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _EntrySync._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30451,7 +30764,8 @@
 @DomName('FileEntrySync')
 // http://www.w3.org/TR/file-system-api/#the-fileentrysync-interface
 @Experimental()
-abstract class _FileEntrySync extends _EntrySync native "FileEntrySync" {
+@Native("FileEntrySync")
+abstract class _FileEntrySync extends _EntrySync {
   // To suppress missing implicit constructor warnings.
   factory _FileEntrySync._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30464,7 +30778,8 @@
 @DomName('FileReaderSync')
 // http://www.w3.org/TR/FileAPI/#FileReaderSync
 @Experimental()
-abstract class _FileReaderSync extends Interceptor native "FileReaderSync" {
+@Native("FileReaderSync")
+abstract class _FileReaderSync extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _FileReaderSync._() { throw new UnsupportedError("Not supported"); }
 
@@ -30484,7 +30799,8 @@
 @DomName('FileWriterSync')
 // http://www.w3.org/TR/file-writer-api/#idl-def-FileWriterSync
 @Experimental()
-abstract class _FileWriterSync extends Interceptor native "FileWriterSync" {
+@Native("FileWriterSync")
+abstract class _FileWriterSync extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _FileWriterSync._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30497,7 +30813,8 @@
 @DomName('GamepadList')
 // https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html
 @Experimental()
-class _GamepadList extends Interceptor with ListMixin<Gamepad>, ImmutableListMixin<Gamepad> implements JavaScriptIndexingBehavior, List<Gamepad> native "GamepadList" {
+@Native("GamepadList")
+class _GamepadList extends Interceptor with ListMixin<Gamepad>, ImmutableListMixin<Gamepad> implements JavaScriptIndexingBehavior, List<Gamepad> {
   // To suppress missing implicit constructor warnings.
   factory _GamepadList._() { throw new UnsupportedError("Not supported"); }
 
@@ -30562,7 +30879,8 @@
 @DomName('HTMLAllCollection')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dom-document-all
 @deprecated // deprecated
-abstract class _HTMLAllCollection extends Interceptor native "HTMLAllCollection" {
+@Native("HTMLAllCollection")
+abstract class _HTMLAllCollection extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _HTMLAllCollection._() { throw new UnsupportedError("Not supported"); }
 
@@ -30580,7 +30898,8 @@
 @DomName('HTMLAppletElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#the-applet-element
 @deprecated // deprecated
-abstract class _HTMLAppletElement extends HtmlElement native "HTMLAppletElement" {
+@Native("HTMLAppletElement")
+abstract class _HTMLAppletElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLAppletElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -30599,7 +30918,8 @@
 @DomName('HTMLDirectoryElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dir
 @deprecated // deprecated
-abstract class _HTMLDirectoryElement extends HtmlElement native "HTMLDirectoryElement" {
+@Native("HTMLDirectoryElement")
+abstract class _HTMLDirectoryElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLDirectoryElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -30618,7 +30938,8 @@
 @DomName('HTMLFontElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#htmlfontelement
 @deprecated // deprecated
-abstract class _HTMLFontElement extends HtmlElement native "HTMLFontElement" {
+@Native("HTMLFontElement")
+abstract class _HTMLFontElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLFontElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -30637,7 +30958,8 @@
 @DomName('HTMLFrameElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#htmlframeelement
 @deprecated // deprecated
-abstract class _HTMLFrameElement extends HtmlElement native "HTMLFrameElement" {
+@Native("HTMLFrameElement")
+abstract class _HTMLFrameElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLFrameElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -30656,7 +30978,8 @@
 @DomName('HTMLFrameSetElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#frameset
 @deprecated // deprecated
-abstract class _HTMLFrameSetElement extends HtmlElement implements WindowEventHandlers native "HTMLFrameSetElement" {
+@Native("HTMLFrameSetElement")
+abstract class _HTMLFrameSetElement extends HtmlElement implements WindowEventHandlers {
   // To suppress missing implicit constructor warnings.
   factory _HTMLFrameSetElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -30675,7 +30998,8 @@
 @DomName('HTMLMarqueeElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#the-marquee-element
 @deprecated // deprecated
-abstract class _HTMLMarqueeElement extends HtmlElement native "HTMLMarqueeElement" {
+@Native("HTMLMarqueeElement")
+abstract class _HTMLMarqueeElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLMarqueeElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -30693,7 +31017,8 @@
 @DomName('MutationEvent')
 // http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationevents
 @deprecated
-abstract class _MutationEvent extends Event native "MutationEvent" {
+@Native("MutationEvent")
+abstract class _MutationEvent extends Event {
   factory _MutationEvent(String type,
       {bool canBubble: false, bool cancelable: false, Node relatedNode,
       String prevValue, String newValue, String attrName, int attrChange: 0}) {
@@ -30707,9 +31032,6 @@
   factory _MutationEvent._() { throw new UnsupportedError("Not supported"); }
 
 }
-
-
-
 // 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.
@@ -30719,7 +31041,8 @@
 @DomName('NamedNodeMap')
 // http://dom.spec.whatwg.org/#namednodemap
 @deprecated // deprecated
-class _NamedNodeMap extends Interceptor with ListMixin<Node>, ImmutableListMixin<Node> implements JavaScriptIndexingBehavior, List<Node> native "NamedNodeMap,MozNamedAttrMap" {
+@Native("NamedNodeMap,MozNamedAttrMap")
+class _NamedNodeMap extends Interceptor with ListMixin<Node>, ImmutableListMixin<Node> implements JavaScriptIndexingBehavior, List<Node> {
   // To suppress missing implicit constructor warnings.
   factory _NamedNodeMap._() { throw new UnsupportedError("Not supported"); }
 
@@ -30812,7 +31135,8 @@
 @DomName('Notation')
 // http://dom.spec.whatwg.org/#notation
 @deprecated // deprecated
-abstract class _Notation extends Node native "Notation" {
+@Native("Notation")
+abstract class _Notation extends Node {
   // To suppress missing implicit constructor warnings.
   factory _Notation._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30828,7 +31152,8 @@
 @Experimental()
 // http://www.w3.org/TR/notifications/#showing-a-notification
 @deprecated // deprecated
-abstract class _NotificationCenter extends Interceptor native "NotificationCenter" {
+@Native("NotificationCenter")
+abstract class _NotificationCenter extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _NotificationCenter._() { throw new UnsupportedError("Not supported"); }
 
@@ -30843,7 +31168,8 @@
 @DocsEditable()
 @DomName('PagePopupController')
 @deprecated // nonstandard
-abstract class _PagePopupController extends Interceptor native "PagePopupController" {
+@Native("PagePopupController")
+abstract class _PagePopupController extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _PagePopupController._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30856,7 +31182,8 @@
 @DomName('RGBColor')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _RGBColor extends Interceptor native "RGBColor" {
+@Native("RGBColor")
+abstract class _RGBColor extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _RGBColor._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30878,7 +31205,8 @@
 @DomName('Rect')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _Rect extends Interceptor native "Rect" {
+@Native("Rect")
+abstract class _Rect extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _Rect._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30890,7 +31218,8 @@
 @DocsEditable()
 @DomName('ServiceWorker')
 @Experimental() // untriaged
-abstract class _ServiceWorker extends Interceptor native "ServiceWorker" {
+@Native("ServiceWorker")
+abstract class _ServiceWorker extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _ServiceWorker._() { throw new UnsupportedError("Not supported"); }
 }
@@ -30903,7 +31232,8 @@
 @DomName('SpeechInputResultList')
 // http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html#speech_input_result_list_interface
 @Experimental()
-class _SpeechInputResultList extends Interceptor with ListMixin<SpeechInputResult>, ImmutableListMixin<SpeechInputResult> implements JavaScriptIndexingBehavior, List<SpeechInputResult> native "SpeechInputResultList" {
+@Native("SpeechInputResultList")
+class _SpeechInputResultList extends Interceptor with ListMixin<SpeechInputResult>, ImmutableListMixin<SpeechInputResult> implements JavaScriptIndexingBehavior, List<SpeechInputResult> {
   // To suppress missing implicit constructor warnings.
   factory _SpeechInputResultList._() { throw new UnsupportedError("Not supported"); }
 
@@ -30968,7 +31298,8 @@
 @DomName('SpeechRecognitionResultList')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionresultlist
 @Experimental()
-class _SpeechRecognitionResultList extends Interceptor with ListMixin<SpeechRecognitionResult>, ImmutableListMixin<SpeechRecognitionResult> implements JavaScriptIndexingBehavior, List<SpeechRecognitionResult> native "SpeechRecognitionResultList" {
+@Native("SpeechRecognitionResultList")
+class _SpeechRecognitionResultList extends Interceptor with ListMixin<SpeechRecognitionResult>, ImmutableListMixin<SpeechRecognitionResult> implements JavaScriptIndexingBehavior, List<SpeechRecognitionResult> {
   // To suppress missing implicit constructor warnings.
   factory _SpeechRecognitionResultList._() { throw new UnsupportedError("Not supported"); }
 
@@ -31031,7 +31362,8 @@
 
 @DocsEditable()
 @DomName('StyleSheetList')
-class _StyleSheetList extends Interceptor with ListMixin<StyleSheet>, ImmutableListMixin<StyleSheet> implements JavaScriptIndexingBehavior, List<StyleSheet> native "StyleSheetList" {
+@Native("StyleSheetList")
+class _StyleSheetList extends Interceptor with ListMixin<StyleSheet>, ImmutableListMixin<StyleSheet> implements JavaScriptIndexingBehavior, List<StyleSheet> {
   // To suppress missing implicit constructor warnings.
   factory _StyleSheetList._() { throw new UnsupportedError("Not supported"); }
 
@@ -31099,7 +31431,8 @@
 @DocsEditable()
 @DomName('SubtleCrypto')
 @Experimental() // untriaged
-abstract class _SubtleCrypto extends Interceptor native "SubtleCrypto" {
+@Native("SubtleCrypto")
+abstract class _SubtleCrypto extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _SubtleCrypto._() { throw new UnsupportedError("Not supported"); }
 }
@@ -31112,7 +31445,8 @@
 @DomName('WebKitCSSFilterValue')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _WebKitCSSFilterValue extends _CssValueList native "WebKitCSSFilterValue" {
+@Native("WebKitCSSFilterValue")
+abstract class _WebKitCSSFilterValue extends _CssValueList {
   // To suppress missing implicit constructor warnings.
   factory _WebKitCSSFilterValue._() { throw new UnsupportedError("Not supported"); }
 }
@@ -31128,7 +31462,8 @@
 @Experimental()
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _WebKitCSSMatrix extends Interceptor native "WebKitCSSMatrix" {
+@Native("WebKitCSSMatrix")
+abstract class _WebKitCSSMatrix extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _WebKitCSSMatrix._() { throw new UnsupportedError("Not supported"); }
 
@@ -31152,7 +31487,8 @@
 @DomName('WebKitCSSTransformValue')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _WebKitCSSTransformValue extends _CssValueList native "WebKitCSSTransformValue" {
+@Native("WebKitCSSTransformValue")
+abstract class _WebKitCSSTransformValue extends _CssValueList {
   // To suppress missing implicit constructor warnings.
   factory _WebKitCSSTransformValue._() { throw new UnsupportedError("Not supported"); }
 }
@@ -31164,7 +31500,8 @@
 @DocsEditable()
 @DomName('WebKitMediaSource')
 @Experimental() // untriaged
-abstract class _WebKitMediaSource extends EventTarget native "WebKitMediaSource" {
+@Native("WebKitMediaSource")
+abstract class _WebKitMediaSource extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory _WebKitMediaSource._() { throw new UnsupportedError("Not supported"); }
 
@@ -31183,7 +31520,8 @@
 @DocsEditable()
 @DomName('WebKitNotification')
 @Experimental() // untriaged
-abstract class _WebKitNotification extends EventTarget native "WebKitNotification" {
+@Native("WebKitNotification")
+abstract class _WebKitNotification extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory _WebKitNotification._() { throw new UnsupportedError("Not supported"); }
 }
@@ -31195,7 +31533,8 @@
 @DocsEditable()
 @DomName('WebKitSourceBuffer')
 @Experimental() // untriaged
-abstract class _WebKitSourceBuffer extends Interceptor native "WebKitSourceBuffer" {
+@Native("WebKitSourceBuffer")
+abstract class _WebKitSourceBuffer extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _WebKitSourceBuffer._() { throw new UnsupportedError("Not supported"); }
 }
@@ -31207,7 +31546,8 @@
 @DocsEditable()
 @DomName('WebKitSourceBufferList')
 @Experimental() // untriaged
-abstract class _WebKitSourceBufferList extends EventTarget native "WebKitSourceBufferList" {
+@Native("WebKitSourceBufferList")
+abstract class _WebKitSourceBufferList extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory _WebKitSourceBufferList._() { throw new UnsupportedError("Not supported"); }
 
@@ -31246,7 +31586,8 @@
 @DomName('WorkerLocation')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workerlocation
 @Experimental()
-abstract class _WorkerLocation extends Interceptor implements UrlUtilsReadOnly native "WorkerLocation" {
+@Native("WorkerLocation")
+abstract class _WorkerLocation extends Interceptor implements UrlUtilsReadOnly {
   // To suppress missing implicit constructor warnings.
   factory _WorkerLocation._() { throw new UnsupportedError("Not supported"); }
 
@@ -31261,7 +31602,8 @@
 @DomName('WorkerNavigator')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workernavigator
 @Experimental()
-abstract class _WorkerNavigator extends Interceptor implements NavigatorOnLine, NavigatorID native "WorkerNavigator" {
+@Native("WorkerNavigator")
+abstract class _WorkerNavigator extends Interceptor implements NavigatorOnLine, NavigatorID {
   // To suppress missing implicit constructor warnings.
   factory _WorkerNavigator._() { throw new UnsupportedError("Not supported"); }
 
@@ -31277,7 +31619,8 @@
 @DocsEditable()
 @DomName('XMLHttpRequestProgressEvent')
 @Experimental() // nonstandard
-abstract class _XMLHttpRequestProgressEvent extends ProgressEvent native "XMLHttpRequestProgressEvent" {
+@Native("XMLHttpRequestProgressEvent")
+abstract class _XMLHttpRequestProgressEvent extends ProgressEvent {
   // To suppress missing implicit constructor warnings.
   factory _XMLHttpRequestProgressEvent._() { throw new UnsupportedError("Not supported"); }
 }
@@ -35095,10 +35438,10 @@
   if (e == null) {
     return null;
   }
-  // Assume it's a Window if it contains the setInterval property.  It may be
+  // Assume it's a Window if it contains the postMessage property.  It may be
   // from a different frame - without a patched prototype - so we cannot
   // rely on Dart type checking.
-  if (JS('bool', r'"setInterval" in #', e)) {
+  if (JS('bool', r'"postMessage" in #', e)) {
     var window = _DOMWindowCrossFrame._createSafe(e);
     // If it's a native window.
     if (window is EventTarget) {
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 89febfd..6f14303 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -1277,7 +1277,6 @@
   Blob slice([int start, int end, String contentType]) => _blink.BlinkBlob.$slice(this, start, end, contentType);
 
 }
-
 // 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.
@@ -2519,7 +2518,6 @@
   @deprecated
   double get backingStorePixelRatio => 1.0;
 }
-
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -7447,7 +7445,6 @@
   }
 
 }
-
 // 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.
@@ -7538,7 +7535,7 @@
  * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connect-dart-html/).
  */
 @DomName('Document')
-class Document extends Node 
+class Document extends Node
 {
 
   // To suppress missing implicit constructor warnings.
@@ -13799,8 +13796,6 @@
   int _watchPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Object options]) => _blink.BlinkGeolocation.$watchPosition_Callback(this, successCallback, errorCallback, options);
 }
 
-
-
 // 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.
@@ -16559,8 +16554,7 @@
     SubmitButtonInputElement,
     ImageButtonInputElement,
     ResetButtonInputElement,
-    ButtonInputElement
-     {
+    ButtonInputElement {
 
   factory InputElement({String type}) {
     var e = document.createElement("input");
@@ -17545,7 +17539,6 @@
 abstract class ButtonInputElement implements InputElementBase {
   factory ButtonInputElement() => new InputElement(type: 'button');
 }
-
 // 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.
@@ -26013,7 +26006,7 @@
 @DomName('Storage')
 @Unstable()
 class Storage extends NativeFieldWrapperClass2
-    implements Map<String, String>  {
+    implements Map<String, String> {
 
   void addAll(Map<String, String> other) {
     other.forEach((k, v) { this[k] = v; });
@@ -32303,9 +32296,6 @@
   factory _MutationEvent._() { throw new UnsupportedError("Not supported"); }
 
 }
-
-
-
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
diff --git a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
index b344977..229ad4e 100644
--- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
@@ -77,7 +77,7 @@
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, Returns, JSName, Null;
+import 'dart:_js_helper' show Creates, Returns, JSName, Native, Null;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -213,7 +213,8 @@
 
 @DomName('IDBCursor')
 @Unstable()
-class Cursor extends Interceptor native "IDBCursor" {
+@Native("IDBCursor")
+class Cursor extends Interceptor {
   @DomName('IDBCursor.delete')
   Future delete() {
    try {
@@ -300,7 +301,8 @@
 @DocsEditable()
 @DomName('IDBCursorWithValue')
 @Unstable()
-class CursorWithValue extends Cursor native "IDBCursorWithValue" {
+@Native("IDBCursorWithValue")
+class CursorWithValue extends Cursor {
   // To suppress missing implicit constructor warnings.
   factory CursorWithValue._() { throw new UnsupportedError("Not supported"); }
 
@@ -330,7 +332,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @Experimental()
 @Unstable()
-class Database extends EventTarget native "IDBDatabase" {
+@Native("IDBDatabase")
+class Database extends EventTarget {
   @DomName('IDBDatabase.createObjectStore')
   @DocsEditable()
   ObjectStore createObjectStore(String name,
@@ -508,7 +511,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @Experimental()
 @Unstable()
-class IdbFactory extends Interceptor native "IDBFactory" {
+@Native("IDBFactory")
+class IdbFactory extends Interceptor {
   /**
    * Checks to see if Indexed DB is supported on the current platform.
    */
@@ -643,7 +647,8 @@
 
 @DomName('IDBIndex')
 @Unstable()
-class Index extends Interceptor native "IDBIndex" {
+@Native("IDBIndex")
+class Index extends Interceptor {
   @DomName('IDBIndex.count')
   Future<int> count([key_OR_range]) {
    try {
@@ -800,7 +805,8 @@
 
 @DomName('IDBKeyRange')
 @Unstable()
-class KeyRange extends Interceptor native "IDBKeyRange" {
+@Native("IDBKeyRange")
+class KeyRange extends Interceptor {
   @DomName('IDBKeyRange.only')
   factory KeyRange.only(/*Key*/ value) =>
       _KeyRangeFactoryProvider.createKeyRange_only(value);
@@ -868,7 +874,8 @@
 
 @DomName('IDBObjectStore')
 @Unstable()
-class ObjectStore extends Interceptor native "IDBObjectStore" {
+@Native("IDBObjectStore")
+class ObjectStore extends Interceptor {
 
   @DomName('IDBObjectStore.add')
   Future add(value, [key]) {
@@ -1198,7 +1205,8 @@
 @DocsEditable()
 @DomName('IDBOpenDBRequest')
 @Unstable()
-class OpenDBRequest extends Request native "IDBOpenDBRequest,IDBVersionChangeRequest" {
+@Native("IDBOpenDBRequest,IDBVersionChangeRequest")
+class OpenDBRequest extends Request {
   // To suppress missing implicit constructor warnings.
   factory OpenDBRequest._() { throw new UnsupportedError("Not supported"); }
 
@@ -1240,7 +1248,8 @@
 @DocsEditable()
 @DomName('IDBRequest')
 @Unstable()
-class Request extends EventTarget native "IDBRequest" {
+@Native("IDBRequest")
+class Request extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory Request._() { throw new UnsupportedError("Not supported"); }
 
@@ -1307,7 +1316,8 @@
 
 @DomName('IDBTransaction')
 @Unstable()
-class Transaction extends EventTarget native "IDBTransaction" {
+@Native("IDBTransaction")
+class Transaction extends EventTarget {
 
   /**
    * Provides a Future which will be completed once the transaction has
@@ -1414,7 +1424,8 @@
 @DocsEditable()
 @DomName('IDBVersionChangeEvent')
 @Unstable()
-class VersionChangeEvent extends Event native "IDBVersionChangeEvent" {
+@Native("IDBVersionChangeEvent")
+class VersionChangeEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); }
 
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index 337029c..b64eb75 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -537,7 +537,7 @@
  */
 abstract class Socket implements Stream<List<int>>, IOSink {
   /**
-   * Creats a new socket connection to the host and port and returns a [Future]
+   * Creates a new socket connection to the host and port and returns a [Future]
    * that will complete with either a [Socket] once connected or an error
    * if the host-lookup or connection failed.
    *
diff --git a/sdk/lib/svg/dart2js/svg_dart2js.dart b/sdk/lib/svg/dart2js/svg_dart2js.dart
index c3ddd80..c7c799a 100644
--- a/sdk/lib/svg/dart2js/svg_dart2js.dart
+++ b/sdk/lib/svg/dart2js/svg_dart2js.dart
@@ -13,7 +13,7 @@
 import 'dart:_internal' hide deprecated;
 import 'dart:html';
 import 'dart:html_common';
-import 'dart:_js_helper' show Creates, Returns, JSName;
+import 'dart:_js_helper' show Creates, Returns, JSName, Native;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor;
 // DO NOT EDIT - unless you are editing documentation as per:
@@ -44,7 +44,8 @@
 @DocsEditable()
 @DomName('SVGAElement')
 @Unstable()
-class AElement extends GraphicsElement implements UriReference native "SVGAElement" {
+@Native("SVGAElement")
+class AElement extends GraphicsElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory AElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -79,7 +80,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class AltGlyphElement extends TextPositioningElement implements UriReference native "SVGAltGlyphElement" {
+@Native("SVGAltGlyphElement")
+class AltGlyphElement extends TextPositioningElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory AltGlyphElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -118,7 +120,8 @@
 @DocsEditable()
 @DomName('SVGAngle')
 @Unstable()
-class Angle extends Interceptor native "SVGAngle" {
+@Native("SVGAngle")
+class Angle extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Angle._() { throw new UnsupportedError("Not supported"); }
 
@@ -177,7 +180,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class AnimateElement extends AnimationElement native "SVGAnimateElement" {
+@Native("SVGAnimateElement")
+class AnimateElement extends AnimationElement {
   // To suppress missing implicit constructor warnings.
   factory AnimateElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -205,7 +209,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class AnimateMotionElement extends AnimationElement native "SVGAnimateMotionElement" {
+@Native("SVGAnimateMotionElement")
+class AnimateMotionElement extends AnimationElement {
   // To suppress missing implicit constructor warnings.
   factory AnimateMotionElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -233,7 +238,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class AnimateTransformElement extends AnimationElement native "SVGAnimateTransformElement" {
+@Native("SVGAnimateTransformElement")
+class AnimateTransformElement extends AnimationElement {
   // To suppress missing implicit constructor warnings.
   factory AnimateTransformElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -258,7 +264,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedAngle')
 @Unstable()
-class AnimatedAngle extends Interceptor native "SVGAnimatedAngle" {
+@Native("SVGAnimatedAngle")
+class AnimatedAngle extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedAngle._() { throw new UnsupportedError("Not supported"); }
 
@@ -278,7 +285,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedBoolean')
 @Unstable()
-class AnimatedBoolean extends Interceptor native "SVGAnimatedBoolean" {
+@Native("SVGAnimatedBoolean")
+class AnimatedBoolean extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedBoolean._() { throw new UnsupportedError("Not supported"); }
 
@@ -298,7 +306,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedEnumeration')
 @Unstable()
-class AnimatedEnumeration extends Interceptor native "SVGAnimatedEnumeration" {
+@Native("SVGAnimatedEnumeration")
+class AnimatedEnumeration extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedEnumeration._() { throw new UnsupportedError("Not supported"); }
 
@@ -318,7 +327,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedInteger')
 @Unstable()
-class AnimatedInteger extends Interceptor native "SVGAnimatedInteger" {
+@Native("SVGAnimatedInteger")
+class AnimatedInteger extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedInteger._() { throw new UnsupportedError("Not supported"); }
 
@@ -338,7 +348,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedLength')
 @Unstable()
-class AnimatedLength extends Interceptor native "SVGAnimatedLength" {
+@Native("SVGAnimatedLength")
+class AnimatedLength extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedLength._() { throw new UnsupportedError("Not supported"); }
 
@@ -358,7 +369,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedLengthList')
 @Unstable()
-class AnimatedLengthList extends Interceptor native "SVGAnimatedLengthList" {
+@Native("SVGAnimatedLengthList")
+class AnimatedLengthList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedLengthList._() { throw new UnsupportedError("Not supported"); }
 
@@ -378,7 +390,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedNumber')
 @Unstable()
-class AnimatedNumber extends Interceptor native "SVGAnimatedNumber" {
+@Native("SVGAnimatedNumber")
+class AnimatedNumber extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedNumber._() { throw new UnsupportedError("Not supported"); }
 
@@ -398,7 +411,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedNumberList')
 @Unstable()
-class AnimatedNumberList extends Interceptor native "SVGAnimatedNumberList" {
+@Native("SVGAnimatedNumberList")
+class AnimatedNumberList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedNumberList._() { throw new UnsupportedError("Not supported"); }
 
@@ -418,7 +432,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedPreserveAspectRatio')
 @Unstable()
-class AnimatedPreserveAspectRatio extends Interceptor native "SVGAnimatedPreserveAspectRatio" {
+@Native("SVGAnimatedPreserveAspectRatio")
+class AnimatedPreserveAspectRatio extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedPreserveAspectRatio._() { throw new UnsupportedError("Not supported"); }
 
@@ -438,7 +453,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedRect')
 @Unstable()
-class AnimatedRect extends Interceptor native "SVGAnimatedRect" {
+@Native("SVGAnimatedRect")
+class AnimatedRect extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedRect._() { throw new UnsupportedError("Not supported"); }
 
@@ -458,7 +474,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedString')
 @Unstable()
-class AnimatedString extends Interceptor native "SVGAnimatedString" {
+@Native("SVGAnimatedString")
+class AnimatedString extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedString._() { throw new UnsupportedError("Not supported"); }
 
@@ -478,7 +495,8 @@
 @DocsEditable()
 @DomName('SVGAnimatedTransformList')
 @Unstable()
-class AnimatedTransformList extends Interceptor native "SVGAnimatedTransformList" {
+@Native("SVGAnimatedTransformList")
+class AnimatedTransformList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AnimatedTransformList._() { throw new UnsupportedError("Not supported"); }
 
@@ -498,7 +516,8 @@
 @DocsEditable()
 @DomName('SVGAnimationElement')
 @Unstable()
-class AnimationElement extends SvgElement implements Tests native "SVGAnimationElement" {
+@Native("SVGAnimationElement")
+class AnimationElement extends SvgElement implements Tests {
   // To suppress missing implicit constructor warnings.
   factory AnimationElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -570,7 +589,8 @@
 @DocsEditable()
 @DomName('SVGCircleElement')
 @Unstable()
-class CircleElement extends GeometryElement native "SVGCircleElement" {
+@Native("SVGCircleElement")
+class CircleElement extends GeometryElement {
   // To suppress missing implicit constructor warnings.
   factory CircleElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -604,7 +624,8 @@
 @DocsEditable()
 @DomName('SVGClipPathElement')
 @Unstable()
-class ClipPathElement extends GraphicsElement native "SVGClipPathElement" {
+@Native("SVGClipPathElement")
+class ClipPathElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory ClipPathElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -630,7 +651,8 @@
 @DocsEditable()
 @DomName('SVGDefsElement')
 @Unstable()
-class DefsElement extends GraphicsElement native "SVGDefsElement" {
+@Native("SVGDefsElement")
+class DefsElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory DefsElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -652,7 +674,8 @@
 @DocsEditable()
 @DomName('SVGDescElement')
 @Unstable()
-class DescElement extends SvgElement native "SVGDescElement" {
+@Native("SVGDescElement")
+class DescElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory DescElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -674,7 +697,8 @@
 @DocsEditable()
 @DomName('SVGDiscardElement')
 @Experimental() // untriaged
-class DiscardElement extends SvgElement native "SVGDiscardElement" {
+@Native("SVGDiscardElement")
+class DiscardElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory DiscardElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -692,7 +716,8 @@
 @DocsEditable()
 @DomName('SVGElementInstance')
 @Unstable()
-class ElementInstance extends EventTarget native "SVGElementInstance" {
+@Native("SVGElementInstance")
+class ElementInstance extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory ElementInstance._() { throw new UnsupportedError("Not supported"); }
 
@@ -1370,7 +1395,8 @@
 @DocsEditable()
 @DomName('SVGEllipseElement')
 @Unstable()
-class EllipseElement extends GeometryElement native "SVGEllipseElement" {
+@Native("SVGEllipseElement")
+class EllipseElement extends GeometryElement {
   // To suppress missing implicit constructor warnings.
   factory EllipseElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -1412,7 +1438,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEBlendElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEBlendElement" {
+@Native("SVGFEBlendElement")
+class FEBlendElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEBlendElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -1499,7 +1526,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEColorMatrixElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEColorMatrixElement" {
+@Native("SVGFEColorMatrixElement")
+class FEColorMatrixElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEColorMatrixElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -1582,7 +1610,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEComponentTransferElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEComponentTransferElement" {
+@Native("SVGFEComponentTransferElement")
+class FEComponentTransferElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEComponentTransferElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -1633,7 +1662,8 @@
 @DocsEditable()
 @DomName('SVGFECompositeElement')
 @Unstable()
-class FECompositeElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFECompositeElement" {
+@Native("SVGFECompositeElement")
+class FECompositeElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FECompositeElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -1733,7 +1763,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEConvolveMatrixElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEConvolveMatrixElement" {
+@Native("SVGFEConvolveMatrixElement")
+class FEConvolveMatrixElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEConvolveMatrixElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -1848,7 +1879,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEDiffuseLightingElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEDiffuseLightingElement" {
+@Native("SVGFEDiffuseLightingElement")
+class FEDiffuseLightingElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEDiffuseLightingElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -1919,7 +1951,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEDisplacementMapElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEDisplacementMapElement" {
+@Native("SVGFEDisplacementMapElement")
+class FEDisplacementMapElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEDisplacementMapElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2010,7 +2043,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEDistantLightElement extends SvgElement native "SVGFEDistantLightElement" {
+@Native("SVGFEDistantLightElement")
+class FEDistantLightElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory FEDistantLightElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2047,7 +2081,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEFloodElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEFloodElement" {
+@Native("SVGFEFloodElement")
+class FEFloodElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEFloodElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2098,7 +2133,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEFuncAElement extends _SVGComponentTransferFunctionElement native "SVGFEFuncAElement" {
+@Native("SVGFEFuncAElement")
+class FEFuncAElement extends _SVGComponentTransferFunctionElement {
   // To suppress missing implicit constructor warnings.
   factory FEFuncAElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2127,7 +2163,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEFuncBElement extends _SVGComponentTransferFunctionElement native "SVGFEFuncBElement" {
+@Native("SVGFEFuncBElement")
+class FEFuncBElement extends _SVGComponentTransferFunctionElement {
   // To suppress missing implicit constructor warnings.
   factory FEFuncBElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2156,7 +2193,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEFuncGElement extends _SVGComponentTransferFunctionElement native "SVGFEFuncGElement" {
+@Native("SVGFEFuncGElement")
+class FEFuncGElement extends _SVGComponentTransferFunctionElement {
   // To suppress missing implicit constructor warnings.
   factory FEFuncGElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2185,7 +2223,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEFuncRElement extends _SVGComponentTransferFunctionElement native "SVGFEFuncRElement" {
+@Native("SVGFEFuncRElement")
+class FEFuncRElement extends _SVGComponentTransferFunctionElement {
   // To suppress missing implicit constructor warnings.
   factory FEFuncRElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2214,7 +2253,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEGaussianBlurElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEGaussianBlurElement" {
+@Native("SVGFEGaussianBlurElement")
+class FEGaussianBlurElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEGaussianBlurElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2281,7 +2321,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEImageElement extends SvgElement implements FilterPrimitiveStandardAttributes, UriReference native "SVGFEImageElement" {
+@Native("SVGFEImageElement")
+class FEImageElement extends SvgElement implements FilterPrimitiveStandardAttributes, UriReference {
   // To suppress missing implicit constructor warnings.
   factory FEImageElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2342,7 +2383,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEMergeElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEMergeElement" {
+@Native("SVGFEMergeElement")
+class FEMergeElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEMergeElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2393,7 +2435,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEMergeNodeElement extends SvgElement native "SVGFEMergeNodeElement" {
+@Native("SVGFEMergeNodeElement")
+class FEMergeNodeElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory FEMergeNodeElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2426,7 +2469,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEMorphologyElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEMorphologyElement" {
+@Native("SVGFEMorphologyElement")
+class FEMorphologyElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEMorphologyElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -2502,7 +2546,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEOffsetElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEOffsetElement" {
+@Native("SVGFEOffsetElement")
+class FEOffsetElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEOffsetElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2565,7 +2610,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FEPointLightElement extends SvgElement native "SVGFEPointLightElement" {
+@Native("SVGFEPointLightElement")
+class FEPointLightElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory FEPointLightElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2606,7 +2652,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FESpecularLightingElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFESpecularLightingElement" {
+@Native("SVGFESpecularLightingElement")
+class FESpecularLightingElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FESpecularLightingElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2673,7 +2720,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FESpotLightElement extends SvgElement native "SVGFESpotLightElement" {
+@Native("SVGFESpotLightElement")
+class FESpotLightElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory FESpotLightElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2734,7 +2782,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FETileElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFETileElement" {
+@Native("SVGFETileElement")
+class FETileElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FETileElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2789,7 +2838,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FETurbulenceElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFETurbulenceElement" {
+@Native("SVGFETurbulenceElement")
+class FETurbulenceElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FETurbulenceElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2888,7 +2938,8 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class FilterElement extends SvgElement implements UriReference native "SVGFilterElement" {
+@Native("SVGFilterElement")
+class FilterElement extends SvgElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory FilterElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -2996,7 +3047,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class ForeignObjectElement extends GraphicsElement native "SVGForeignObjectElement" {
+@Native("SVGForeignObjectElement")
+class ForeignObjectElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory ForeignObjectElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -3037,7 +3089,8 @@
 @DocsEditable()
 @DomName('SVGGElement')
 @Unstable()
-class GElement extends GraphicsElement native "SVGGElement" {
+@Native("SVGGElement")
+class GElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory GElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -3059,7 +3112,8 @@
 @DocsEditable()
 @DomName('SVGGeometryElement')
 @Experimental() // untriaged
-class GeometryElement extends GraphicsElement native "SVGGeometryElement" {
+@Native("SVGGeometryElement")
+class GeometryElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory GeometryElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -3087,7 +3141,8 @@
 @DocsEditable()
 @DomName('SVGGraphicsElement')
 @Experimental() // untriaged
-class GraphicsElement extends SvgElement implements Tests native "SVGGraphicsElement" {
+@Native("SVGGraphicsElement")
+class GraphicsElement extends SvgElement implements Tests {
   // To suppress missing implicit constructor warnings.
   factory GraphicsElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -3164,7 +3219,8 @@
 @DocsEditable()
 @DomName('SVGImageElement')
 @Unstable()
-class ImageElement extends GraphicsElement implements UriReference native "SVGImageElement" {
+@Native("SVGImageElement")
+class ImageElement extends GraphicsElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory ImageElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -3212,7 +3268,8 @@
 @DocsEditable()
 @DomName('SVGLength')
 @Unstable()
-class Length extends Interceptor native "SVGLength" {
+@Native("SVGLength")
+class Length extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Length._() { throw new UnsupportedError("Not supported"); }
 
@@ -3292,7 +3349,8 @@
 @DocsEditable()
 @DomName('SVGLengthList')
 @Unstable()
-class LengthList extends Interceptor with ListMixin<Length>, ImmutableListMixin<Length> implements List<Length> native "SVGLengthList" {
+@Native("SVGLengthList")
+class LengthList extends Interceptor with ListMixin<Length>, ImmutableListMixin<Length> implements List<Length> {
   // To suppress missing implicit constructor warnings.
   factory LengthList._() { throw new UnsupportedError("Not supported"); }
 
@@ -3382,7 +3440,8 @@
 @DocsEditable()
 @DomName('SVGLineElement')
 @Unstable()
-class LineElement extends GeometryElement native "SVGLineElement" {
+@Native("SVGLineElement")
+class LineElement extends GeometryElement {
   // To suppress missing implicit constructor warnings.
   factory LineElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -3420,7 +3479,8 @@
 @DocsEditable()
 @DomName('SVGLinearGradientElement')
 @Unstable()
-class LinearGradientElement extends _GradientElement native "SVGLinearGradientElement" {
+@Native("SVGLinearGradientElement")
+class LinearGradientElement extends _GradientElement {
   // To suppress missing implicit constructor warnings.
   factory LinearGradientElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -3458,7 +3518,8 @@
 @DocsEditable()
 @DomName('SVGMarkerElement')
 @Unstable()
-class MarkerElement extends SvgElement implements FitToViewBox native "SVGMarkerElement" {
+@Native("SVGMarkerElement")
+class MarkerElement extends SvgElement implements FitToViewBox {
   // To suppress missing implicit constructor warnings.
   factory MarkerElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -3550,7 +3611,8 @@
 @DocsEditable()
 @DomName('SVGMaskElement')
 @Unstable()
-class MaskElement extends SvgElement implements Tests native "SVGMaskElement" {
+@Native("SVGMaskElement")
+class MaskElement extends SvgElement implements Tests {
   // To suppress missing implicit constructor warnings.
   factory MaskElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -3614,7 +3676,8 @@
 @DocsEditable()
 @DomName('SVGMatrix')
 @Unstable()
-class Matrix extends Interceptor native "SVGMatrix" {
+@Native("SVGMatrix")
+class Matrix extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Matrix._() { throw new UnsupportedError("Not supported"); }
 
@@ -3694,7 +3757,8 @@
 @DocsEditable()
 @DomName('SVGMetadataElement')
 @Unstable()
-class MetadataElement extends SvgElement native "SVGMetadataElement" {
+@Native("SVGMetadataElement")
+class MetadataElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory MetadataElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -3712,7 +3776,8 @@
 @DocsEditable()
 @DomName('SVGNumber')
 @Unstable()
-class Number extends Interceptor native "SVGNumber" {
+@Native("SVGNumber")
+class Number extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Number._() { throw new UnsupportedError("Not supported"); }
 
@@ -3728,7 +3793,8 @@
 @DocsEditable()
 @DomName('SVGNumberList')
 @Unstable()
-class NumberList extends Interceptor with ListMixin<Number>, ImmutableListMixin<Number> implements List<Number> native "SVGNumberList" {
+@Native("SVGNumberList")
+class NumberList extends Interceptor with ListMixin<Number>, ImmutableListMixin<Number> implements List<Number> {
   // To suppress missing implicit constructor warnings.
   factory NumberList._() { throw new UnsupportedError("Not supported"); }
 
@@ -3818,7 +3884,8 @@
 @DocsEditable()
 @DomName('SVGPathElement')
 @Unstable()
-class PathElement extends GeometryElement native "SVGPathElement" {
+@Native("SVGPathElement")
+class PathElement extends GeometryElement {
   // To suppress missing implicit constructor warnings.
   factory PathElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -3967,7 +4034,8 @@
 @DocsEditable()
 @DomName('SVGPathSeg')
 @Unstable()
-class PathSeg extends Interceptor native "SVGPathSeg" {
+@Native("SVGPathSeg")
+class PathSeg extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory PathSeg._() { throw new UnsupportedError("Not supported"); }
 
@@ -4067,7 +4135,8 @@
 @DocsEditable()
 @DomName('SVGPathSegArcAbs')
 @Unstable()
-class PathSegArcAbs extends PathSeg native "SVGPathSegArcAbs" {
+@Native("SVGPathSegArcAbs")
+class PathSegArcAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegArcAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4107,7 +4176,8 @@
 @DocsEditable()
 @DomName('SVGPathSegArcRel')
 @Unstable()
-class PathSegArcRel extends PathSeg native "SVGPathSegArcRel" {
+@Native("SVGPathSegArcRel")
+class PathSegArcRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegArcRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4147,7 +4217,8 @@
 @DocsEditable()
 @DomName('SVGPathSegClosePath')
 @Unstable()
-class PathSegClosePath extends PathSeg native "SVGPathSegClosePath" {
+@Native("SVGPathSegClosePath")
+class PathSegClosePath extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegClosePath._() { throw new UnsupportedError("Not supported"); }
 }
@@ -4159,7 +4230,8 @@
 @DocsEditable()
 @DomName('SVGPathSegCurvetoCubicAbs')
 @Unstable()
-class PathSegCurvetoCubicAbs extends PathSeg native "SVGPathSegCurvetoCubicAbs" {
+@Native("SVGPathSegCurvetoCubicAbs")
+class PathSegCurvetoCubicAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoCubicAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4195,7 +4267,8 @@
 @DocsEditable()
 @DomName('SVGPathSegCurvetoCubicRel')
 @Unstable()
-class PathSegCurvetoCubicRel extends PathSeg native "SVGPathSegCurvetoCubicRel" {
+@Native("SVGPathSegCurvetoCubicRel")
+class PathSegCurvetoCubicRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoCubicRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4231,7 +4304,8 @@
 @DocsEditable()
 @DomName('SVGPathSegCurvetoCubicSmoothAbs')
 @Unstable()
-class PathSegCurvetoCubicSmoothAbs extends PathSeg native "SVGPathSegCurvetoCubicSmoothAbs" {
+@Native("SVGPathSegCurvetoCubicSmoothAbs")
+class PathSegCurvetoCubicSmoothAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoCubicSmoothAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4259,7 +4333,8 @@
 @DocsEditable()
 @DomName('SVGPathSegCurvetoCubicSmoothRel')
 @Unstable()
-class PathSegCurvetoCubicSmoothRel extends PathSeg native "SVGPathSegCurvetoCubicSmoothRel" {
+@Native("SVGPathSegCurvetoCubicSmoothRel")
+class PathSegCurvetoCubicSmoothRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoCubicSmoothRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4287,7 +4362,8 @@
 @DocsEditable()
 @DomName('SVGPathSegCurvetoQuadraticAbs')
 @Unstable()
-class PathSegCurvetoQuadraticAbs extends PathSeg native "SVGPathSegCurvetoQuadraticAbs" {
+@Native("SVGPathSegCurvetoQuadraticAbs")
+class PathSegCurvetoQuadraticAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoQuadraticAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4315,7 +4391,8 @@
 @DocsEditable()
 @DomName('SVGPathSegCurvetoQuadraticRel')
 @Unstable()
-class PathSegCurvetoQuadraticRel extends PathSeg native "SVGPathSegCurvetoQuadraticRel" {
+@Native("SVGPathSegCurvetoQuadraticRel")
+class PathSegCurvetoQuadraticRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoQuadraticRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4343,7 +4420,8 @@
 @DocsEditable()
 @DomName('SVGPathSegCurvetoQuadraticSmoothAbs')
 @Unstable()
-class PathSegCurvetoQuadraticSmoothAbs extends PathSeg native "SVGPathSegCurvetoQuadraticSmoothAbs" {
+@Native("SVGPathSegCurvetoQuadraticSmoothAbs")
+class PathSegCurvetoQuadraticSmoothAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoQuadraticSmoothAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4363,7 +4441,8 @@
 @DocsEditable()
 @DomName('SVGPathSegCurvetoQuadraticSmoothRel')
 @Unstable()
-class PathSegCurvetoQuadraticSmoothRel extends PathSeg native "SVGPathSegCurvetoQuadraticSmoothRel" {
+@Native("SVGPathSegCurvetoQuadraticSmoothRel")
+class PathSegCurvetoQuadraticSmoothRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoQuadraticSmoothRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4383,7 +4462,8 @@
 @DocsEditable()
 @DomName('SVGPathSegLinetoAbs')
 @Unstable()
-class PathSegLinetoAbs extends PathSeg native "SVGPathSegLinetoAbs" {
+@Native("SVGPathSegLinetoAbs")
+class PathSegLinetoAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4403,7 +4483,8 @@
 @DocsEditable()
 @DomName('SVGPathSegLinetoHorizontalAbs')
 @Unstable()
-class PathSegLinetoHorizontalAbs extends PathSeg native "SVGPathSegLinetoHorizontalAbs" {
+@Native("SVGPathSegLinetoHorizontalAbs")
+class PathSegLinetoHorizontalAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoHorizontalAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4419,7 +4500,8 @@
 @DocsEditable()
 @DomName('SVGPathSegLinetoHorizontalRel')
 @Unstable()
-class PathSegLinetoHorizontalRel extends PathSeg native "SVGPathSegLinetoHorizontalRel" {
+@Native("SVGPathSegLinetoHorizontalRel")
+class PathSegLinetoHorizontalRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoHorizontalRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4435,7 +4517,8 @@
 @DocsEditable()
 @DomName('SVGPathSegLinetoRel')
 @Unstable()
-class PathSegLinetoRel extends PathSeg native "SVGPathSegLinetoRel" {
+@Native("SVGPathSegLinetoRel")
+class PathSegLinetoRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4455,7 +4538,8 @@
 @DocsEditable()
 @DomName('SVGPathSegLinetoVerticalAbs')
 @Unstable()
-class PathSegLinetoVerticalAbs extends PathSeg native "SVGPathSegLinetoVerticalAbs" {
+@Native("SVGPathSegLinetoVerticalAbs")
+class PathSegLinetoVerticalAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoVerticalAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4471,7 +4555,8 @@
 @DocsEditable()
 @DomName('SVGPathSegLinetoVerticalRel')
 @Unstable()
-class PathSegLinetoVerticalRel extends PathSeg native "SVGPathSegLinetoVerticalRel" {
+@Native("SVGPathSegLinetoVerticalRel")
+class PathSegLinetoVerticalRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoVerticalRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4487,7 +4572,8 @@
 @DocsEditable()
 @DomName('SVGPathSegList')
 @Unstable()
-class PathSegList extends Interceptor with ListMixin<PathSeg>, ImmutableListMixin<PathSeg> implements List<PathSeg> native "SVGPathSegList" {
+@Native("SVGPathSegList")
+class PathSegList extends Interceptor with ListMixin<PathSeg>, ImmutableListMixin<PathSeg> implements List<PathSeg> {
   // To suppress missing implicit constructor warnings.
   factory PathSegList._() { throw new UnsupportedError("Not supported"); }
 
@@ -4577,7 +4663,8 @@
 @DocsEditable()
 @DomName('SVGPathSegMovetoAbs')
 @Unstable()
-class PathSegMovetoAbs extends PathSeg native "SVGPathSegMovetoAbs" {
+@Native("SVGPathSegMovetoAbs")
+class PathSegMovetoAbs extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegMovetoAbs._() { throw new UnsupportedError("Not supported"); }
 
@@ -4597,7 +4684,8 @@
 @DocsEditable()
 @DomName('SVGPathSegMovetoRel')
 @Unstable()
-class PathSegMovetoRel extends PathSeg native "SVGPathSegMovetoRel" {
+@Native("SVGPathSegMovetoRel")
+class PathSegMovetoRel extends PathSeg {
   // To suppress missing implicit constructor warnings.
   factory PathSegMovetoRel._() { throw new UnsupportedError("Not supported"); }
 
@@ -4617,7 +4705,8 @@
 @DocsEditable()
 @DomName('SVGPatternElement')
 @Unstable()
-class PatternElement extends SvgElement implements FitToViewBox, UriReference, Tests native "SVGPatternElement" {
+@Native("SVGPatternElement")
+class PatternElement extends SvgElement implements FitToViewBox, UriReference, Tests {
   // To suppress missing implicit constructor warnings.
   factory PatternElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -4701,7 +4790,8 @@
 @DocsEditable()
 @DomName('SVGPoint')
 @Unstable()
-class Point extends Interceptor native "SVGPoint" {
+@Native("SVGPoint")
+class Point extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Point._() { throw new UnsupportedError("Not supported"); }
 
@@ -4725,7 +4815,8 @@
 @DocsEditable()
 @DomName('SVGPointList')
 @Unstable()
-class PointList extends Interceptor native "SVGPointList" {
+@Native("SVGPointList")
+class PointList extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory PointList._() { throw new UnsupportedError("Not supported"); }
 
@@ -4769,7 +4860,8 @@
 @DocsEditable()
 @DomName('SVGPolygonElement')
 @Unstable()
-class PolygonElement extends GeometryElement native "SVGPolygonElement" {
+@Native("SVGPolygonElement")
+class PolygonElement extends GeometryElement {
   // To suppress missing implicit constructor warnings.
   factory PolygonElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -4799,7 +4891,8 @@
 @DocsEditable()
 @DomName('SVGPolylineElement')
 @Unstable()
-class PolylineElement extends GeometryElement native "SVGPolylineElement" {
+@Native("SVGPolylineElement")
+class PolylineElement extends GeometryElement {
   // To suppress missing implicit constructor warnings.
   factory PolylineElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -4829,7 +4922,8 @@
 @DocsEditable()
 @DomName('SVGPreserveAspectRatio')
 @Unstable()
-class PreserveAspectRatio extends Interceptor native "SVGPreserveAspectRatio" {
+@Native("SVGPreserveAspectRatio")
+class PreserveAspectRatio extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory PreserveAspectRatio._() { throw new UnsupportedError("Not supported"); }
 
@@ -4905,7 +4999,8 @@
 @DocsEditable()
 @DomName('SVGRadialGradientElement')
 @Unstable()
-class RadialGradientElement extends _GradientElement native "SVGRadialGradientElement" {
+@Native("SVGRadialGradientElement")
+class RadialGradientElement extends _GradientElement {
   // To suppress missing implicit constructor warnings.
   factory RadialGradientElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -4951,7 +5046,8 @@
 @DocsEditable()
 @DomName('SVGRect')
 @Unstable()
-class Rect extends Interceptor native "SVGRect" {
+@Native("SVGRect")
+class Rect extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Rect._() { throw new UnsupportedError("Not supported"); }
 
@@ -4979,7 +5075,8 @@
 @DocsEditable()
 @DomName('SVGRectElement')
 @Unstable()
-class RectElement extends GeometryElement native "SVGRectElement" {
+@Native("SVGRectElement")
+class RectElement extends GeometryElement {
   // To suppress missing implicit constructor warnings.
   factory RectElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -5025,7 +5122,8 @@
 @DocsEditable()
 @DomName('SVGRenderingIntent')
 @Unstable()
-class RenderingIntent extends Interceptor native "SVGRenderingIntent" {
+@Native("SVGRenderingIntent")
+class RenderingIntent extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory RenderingIntent._() { throw new UnsupportedError("Not supported"); }
 
@@ -5061,7 +5159,8 @@
 @DocsEditable()
 @DomName('SVGScriptElement')
 @Unstable()
-class ScriptElement extends SvgElement implements UriReference native "SVGScriptElement" {
+@Native("SVGScriptElement")
+class ScriptElement extends SvgElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory ScriptElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -5096,7 +5195,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Unstable()
-class SetElement extends AnimationElement native "SVGSetElement" {
+@Native("SVGSetElement")
+class SetElement extends AnimationElement {
   // To suppress missing implicit constructor warnings.
   factory SetElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -5121,7 +5221,8 @@
 @DocsEditable()
 @DomName('SVGStopElement')
 @Unstable()
-class StopElement extends SvgElement native "SVGStopElement" {
+@Native("SVGStopElement")
+class StopElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory StopElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -5148,7 +5249,8 @@
 @DocsEditable()
 @DomName('SVGStringList')
 @Unstable()
-class StringList extends Interceptor with ListMixin<String>, ImmutableListMixin<String> implements List<String> native "SVGStringList" {
+@Native("SVGStringList")
+class StringList extends Interceptor with ListMixin<String>, ImmutableListMixin<String> implements List<String> {
   // To suppress missing implicit constructor warnings.
   factory StringList._() { throw new UnsupportedError("Not supported"); }
 
@@ -5239,7 +5341,8 @@
 @DomName('SVGStyleElement')
 // http://www.w3.org/TR/SVG/types.html#InterfaceSVGStylable
 @Experimental() // nonstandard
-class StyleElement extends SvgElement native "SVGStyleElement" {
+@Native("SVGStyleElement")
+class StyleElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory StyleElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -5305,7 +5408,8 @@
 
 @DomName('SVGElement')
 @Unstable()
-class SvgElement extends Element implements GlobalEventHandlers native "SVGElement" {
+@Native("SVGElement")
+class SvgElement extends Element implements GlobalEventHandlers {
   static final _START_TAG_REGEXP = new RegExp('<(\\w+)');
 
   factory SvgElement.tag(String tag) =>
@@ -5989,7 +6093,8 @@
 
 @DomName('SVGSVGElement')
 @Unstable()
-class SvgSvgElement extends GraphicsElement implements FitToViewBox, ZoomAndPan native "SVGSVGElement" {
+@Native("SVGSVGElement")
+class SvgSvgElement extends GraphicsElement implements FitToViewBox, ZoomAndPan {
   factory SvgSvgElement() {
     final el = new SvgElement.tag("svg");
     // The SVG spec requires the version attribute to match the spec version
@@ -6187,7 +6292,8 @@
 @DocsEditable()
 @DomName('SVGSwitchElement')
 @Unstable()
-class SwitchElement extends GraphicsElement native "SVGSwitchElement" {
+@Native("SVGSwitchElement")
+class SwitchElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory SwitchElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6209,7 +6315,8 @@
 @DocsEditable()
 @DomName('SVGSymbolElement')
 @Unstable()
-class SymbolElement extends SvgElement implements FitToViewBox native "SVGSymbolElement" {
+@Native("SVGSymbolElement")
+class SymbolElement extends SvgElement implements FitToViewBox {
   // To suppress missing implicit constructor warnings.
   factory SymbolElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6241,7 +6348,8 @@
 @DocsEditable()
 @DomName('SVGTSpanElement')
 @Unstable()
-class TSpanElement extends TextPositioningElement native "SVGTSpanElement" {
+@Native("SVGTSpanElement")
+class TSpanElement extends TextPositioningElement {
   // To suppress missing implicit constructor warnings.
   factory TSpanElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6283,7 +6391,8 @@
 @DocsEditable()
 @DomName('SVGTextContentElement')
 @Unstable()
-class TextContentElement extends GraphicsElement native "SVGTextContentElement" {
+@Native("SVGTextContentElement")
+class TextContentElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory TextContentElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -6357,7 +6466,8 @@
 @DocsEditable()
 @DomName('SVGTextElement')
 @Unstable()
-class TextElement extends TextPositioningElement native "SVGTextElement" {
+@Native("SVGTextElement")
+class TextElement extends TextPositioningElement {
   // To suppress missing implicit constructor warnings.
   factory TextElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6379,7 +6489,8 @@
 @DocsEditable()
 @DomName('SVGTextPathElement')
 @Unstable()
-class TextPathElement extends TextContentElement implements UriReference native "SVGTextPathElement" {
+@Native("SVGTextPathElement")
+class TextPathElement extends TextContentElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory TextPathElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -6439,7 +6550,8 @@
 @DocsEditable()
 @DomName('SVGTextPositioningElement')
 @Unstable()
-class TextPositioningElement extends TextContentElement native "SVGTextPositioningElement" {
+@Native("SVGTextPositioningElement")
+class TextPositioningElement extends TextContentElement {
   // To suppress missing implicit constructor warnings.
   factory TextPositioningElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -6477,7 +6589,8 @@
 @DocsEditable()
 @DomName('SVGTitleElement')
 @Unstable()
-class TitleElement extends SvgElement native "SVGTitleElement" {
+@Native("SVGTitleElement")
+class TitleElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory TitleElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6499,7 +6612,8 @@
 @DocsEditable()
 @DomName('SVGTransform')
 @Unstable()
-class Transform extends Interceptor native "SVGTransform" {
+@Native("SVGTransform")
+class Transform extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Transform._() { throw new UnsupportedError("Not supported"); }
 
@@ -6575,7 +6689,8 @@
 @DocsEditable()
 @DomName('SVGTransformList')
 @Unstable()
-class TransformList extends Interceptor with ListMixin<Transform>, ImmutableListMixin<Transform> implements List<Transform> native "SVGTransformList" {
+@Native("SVGTransformList")
+class TransformList extends Interceptor with ListMixin<Transform>, ImmutableListMixin<Transform> implements List<Transform> {
   // To suppress missing implicit constructor warnings.
   factory TransformList._() { throw new UnsupportedError("Not supported"); }
 
@@ -6674,7 +6789,8 @@
 @DocsEditable()
 @DomName('SVGUnitTypes')
 @Unstable()
-class UnitTypes extends Interceptor native "SVGUnitTypes" {
+@Native("SVGUnitTypes")
+class UnitTypes extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory UnitTypes._() { throw new UnsupportedError("Not supported"); }
 
@@ -6712,7 +6828,8 @@
 @DocsEditable()
 @DomName('SVGUseElement')
 @Unstable()
-class UseElement extends GraphicsElement implements UriReference, Tests native "SVGUseElement" {
+@Native("SVGUseElement")
+class UseElement extends GraphicsElement implements UriReference, Tests {
   // To suppress missing implicit constructor warnings.
   factory UseElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6782,7 +6899,8 @@
 @DocsEditable()
 @DomName('SVGViewElement')
 @Unstable()
-class ViewElement extends SvgElement implements FitToViewBox, ZoomAndPan native "SVGViewElement" {
+@Native("SVGViewElement")
+class ViewElement extends SvgElement implements FitToViewBox, ZoomAndPan {
   // To suppress missing implicit constructor warnings.
   factory ViewElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -6824,7 +6942,8 @@
 @DocsEditable()
 @DomName('SVGViewSpec')
 @Unstable()
-class ViewSpec extends Interceptor implements FitToViewBox, ZoomAndPan native "SVGViewSpec" {
+@Native("SVGViewSpec")
+class ViewSpec extends Interceptor implements FitToViewBox, ZoomAndPan {
   // To suppress missing implicit constructor warnings.
   factory ViewSpec._() { throw new UnsupportedError("Not supported"); }
 
@@ -6905,7 +7024,8 @@
 @DocsEditable()
 @DomName('SVGZoomEvent')
 @Unstable()
-class ZoomEvent extends UIEvent native "SVGZoomEvent" {
+@Native("SVGZoomEvent")
+class ZoomEvent extends UIEvent {
   // To suppress missing implicit constructor warnings.
   factory ZoomEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -6937,7 +7057,8 @@
 @DocsEditable()
 @DomName('SVGElementInstanceList')
 @Unstable()
-class _ElementInstanceList extends Interceptor with ListMixin<ElementInstance>, ImmutableListMixin<ElementInstance> implements List<ElementInstance> native "SVGElementInstanceList" {
+@Native("SVGElementInstanceList")
+class _ElementInstanceList extends Interceptor with ListMixin<ElementInstance>, ImmutableListMixin<ElementInstance> implements List<ElementInstance> {
   // To suppress missing implicit constructor warnings.
   factory _ElementInstanceList._() { throw new UnsupportedError("Not supported"); }
 
@@ -7001,7 +7122,8 @@
 @DocsEditable()
 @DomName('SVGGradientElement')
 @Unstable()
-class _GradientElement extends SvgElement implements UriReference native "SVGGradientElement" {
+@Native("SVGGradientElement")
+class _GradientElement extends SvgElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory _GradientElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7053,7 +7175,8 @@
 @DocsEditable()
 @DomName('SVGAltGlyphDefElement')
 @Unstable()
-abstract class _SVGAltGlyphDefElement extends SvgElement native "SVGAltGlyphDefElement" {
+@Native("SVGAltGlyphDefElement")
+abstract class _SVGAltGlyphDefElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGAltGlyphDefElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7071,7 +7194,8 @@
 @DocsEditable()
 @DomName('SVGAltGlyphItemElement')
 @Unstable()
-abstract class _SVGAltGlyphItemElement extends SvgElement native "SVGAltGlyphItemElement" {
+@Native("SVGAltGlyphItemElement")
+abstract class _SVGAltGlyphItemElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGAltGlyphItemElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7089,7 +7213,8 @@
 @DocsEditable()
 @DomName('SVGComponentTransferFunctionElement')
 @Unstable()
-abstract class _SVGComponentTransferFunctionElement extends SvgElement native "SVGComponentTransferFunctionElement" {
+@Native("SVGComponentTransferFunctionElement")
+abstract class _SVGComponentTransferFunctionElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGComponentTransferFunctionElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7107,7 +7232,8 @@
 @DocsEditable()
 @DomName('SVGCursorElement')
 @Unstable()
-abstract class _SVGCursorElement extends SvgElement implements UriReference, Tests native "SVGCursorElement" {
+@Native("SVGCursorElement")
+abstract class _SVGCursorElement extends SvgElement implements UriReference, Tests {
   // To suppress missing implicit constructor warnings.
   factory _SVGCursorElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -7136,7 +7262,8 @@
 @DocsEditable()
 @DomName('SVGFEDropShadowElement')
 @Experimental() // nonstandard
-abstract class _SVGFEDropShadowElement extends SvgElement implements FilterPrimitiveStandardAttributes native "SVGFEDropShadowElement" {
+@Native("SVGFEDropShadowElement")
+abstract class _SVGFEDropShadowElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory _SVGFEDropShadowElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7156,7 +7283,8 @@
 @DocsEditable()
 @DomName('SVGFontElement')
 @Unstable()
-abstract class _SVGFontElement extends SvgElement native "SVGFontElement" {
+@Native("SVGFontElement")
+abstract class _SVGFontElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7174,7 +7302,8 @@
 @DocsEditable()
 @DomName('SVGFontFaceElement')
 @Unstable()
-abstract class _SVGFontFaceElement extends SvgElement native "SVGFontFaceElement" {
+@Native("SVGFontFaceElement")
+abstract class _SVGFontFaceElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7192,7 +7321,8 @@
 @DocsEditable()
 @DomName('SVGFontFaceFormatElement')
 @Unstable()
-abstract class _SVGFontFaceFormatElement extends SvgElement native "SVGFontFaceFormatElement" {
+@Native("SVGFontFaceFormatElement")
+abstract class _SVGFontFaceFormatElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceFormatElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7210,7 +7340,8 @@
 @DocsEditable()
 @DomName('SVGFontFaceNameElement')
 @Unstable()
-abstract class _SVGFontFaceNameElement extends SvgElement native "SVGFontFaceNameElement" {
+@Native("SVGFontFaceNameElement")
+abstract class _SVGFontFaceNameElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceNameElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7228,7 +7359,8 @@
 @DocsEditable()
 @DomName('SVGFontFaceSrcElement')
 @Unstable()
-abstract class _SVGFontFaceSrcElement extends SvgElement native "SVGFontFaceSrcElement" {
+@Native("SVGFontFaceSrcElement")
+abstract class _SVGFontFaceSrcElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceSrcElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7246,7 +7378,8 @@
 @DocsEditable()
 @DomName('SVGFontFaceUriElement')
 @Unstable()
-abstract class _SVGFontFaceUriElement extends SvgElement native "SVGFontFaceUriElement" {
+@Native("SVGFontFaceUriElement")
+abstract class _SVGFontFaceUriElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceUriElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7264,7 +7397,8 @@
 @DocsEditable()
 @DomName('SVGGlyphElement')
 @Unstable()
-abstract class _SVGGlyphElement extends SvgElement native "SVGGlyphElement" {
+@Native("SVGGlyphElement")
+abstract class _SVGGlyphElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGGlyphElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -7286,7 +7420,8 @@
 @DocsEditable()
 @DomName('SVGGlyphRefElement')
 @Unstable()
-abstract class _SVGGlyphRefElement extends SvgElement implements UriReference native "SVGGlyphRefElement" {
+@Native("SVGGlyphRefElement")
+abstract class _SVGGlyphRefElement extends SvgElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory _SVGGlyphRefElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7306,7 +7441,8 @@
 @DocsEditable()
 @DomName('SVGHKernElement')
 @Unstable()
-abstract class _SVGHKernElement extends SvgElement native "SVGHKernElement" {
+@Native("SVGHKernElement")
+abstract class _SVGHKernElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGHKernElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -7327,7 +7463,8 @@
 
 @DocsEditable()
 @DomName('SVGMPathElement')
-abstract class _SVGMPathElement extends SvgElement implements UriReference native "SVGMPathElement" {
+@Native("SVGMPathElement")
+abstract class _SVGMPathElement extends SvgElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory _SVGMPathElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -7351,7 +7488,8 @@
 @DocsEditable()
 @DomName('SVGMissingGlyphElement')
 @Unstable()
-abstract class _SVGMissingGlyphElement extends SvgElement native "SVGMissingGlyphElement" {
+@Native("SVGMissingGlyphElement")
+abstract class _SVGMissingGlyphElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGMissingGlyphElement._() { throw new UnsupportedError("Not supported"); }
   /**
@@ -7369,7 +7507,8 @@
 @DocsEditable()
 @DomName('SVGVKernElement')
 @Unstable()
-abstract class _SVGVKernElement extends SvgElement native "SVGVKernElement" {
+@Native("SVGVKernElement")
+abstract class _SVGVKernElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGVKernElement._() { throw new UnsupportedError("Not supported"); }
 
diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
index 5fdb510..3638497 100644
--- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
@@ -10,7 +10,7 @@
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, JSName, Returns, convertDartClosureToJS;
+import 'dart:_js_helper' show Creates, JSName, Native, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor;
 // DO NOT EDIT - unless you are editing documentation as per:
@@ -29,7 +29,8 @@
 @DomName('AnalyserNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AnalyserNode
 @Experimental()
-class AnalyserNode extends AudioNode native "AnalyserNode,RealtimeAnalyserNode" {
+@Native("AnalyserNode,RealtimeAnalyserNode")
+class AnalyserNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory AnalyserNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -74,7 +75,8 @@
 @DomName('AudioBuffer')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioBuffer-section
 @Experimental()
-class AudioBuffer extends Interceptor native "AudioBuffer" {
+@Native("AudioBuffer")
+class AudioBuffer extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AudioBuffer._() { throw new UnsupportedError("Not supported"); }
 
@@ -119,7 +121,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @Experimental()
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioBufferSourceNode-section
-class AudioBufferSourceNode extends AudioSourceNode native "AudioBufferSourceNode" {
+@Native("AudioBufferSourceNode")
+class AudioBufferSourceNode extends AudioSourceNode {
 
   // TODO(efortuna): Remove these methods when Chrome stable also uses start
   // instead of noteOn.
@@ -229,7 +232,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @Experimental()
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioContext-section
-class AudioContext extends EventTarget native "AudioContext,webkitAudioContext" {
+@Native("AudioContext,webkitAudioContext")
+class AudioContext extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory AudioContext._() { throw new UnsupportedError("Not supported"); }
 
@@ -391,7 +395,8 @@
 @DomName('AudioDestinationNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioDestinationNode-section
 @Experimental()
-class AudioDestinationNode extends AudioNode native "AudioDestinationNode" {
+@Native("AudioDestinationNode")
+class AudioDestinationNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory AudioDestinationNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -408,7 +413,8 @@
 @DomName('AudioListener')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioListener-section
 @Experimental()
-class AudioListener extends Interceptor native "AudioListener" {
+@Native("AudioListener")
+class AudioListener extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AudioListener._() { throw new UnsupportedError("Not supported"); }
 
@@ -440,7 +446,8 @@
 @DomName('AudioNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioNode-section
 @Experimental()
-class AudioNode extends EventTarget native "AudioNode" {
+@Native("AudioNode")
+class AudioNode extends EventTarget {
   // To suppress missing implicit constructor warnings.
   factory AudioNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -494,7 +501,8 @@
 @DomName('AudioParam')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioParam
 @Experimental()
-class AudioParam extends Interceptor native "AudioParam" {
+@Native("AudioParam")
+class AudioParam extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AudioParam._() { throw new UnsupportedError("Not supported"); }
 
@@ -555,7 +563,8 @@
 @DomName('AudioProcessingEvent')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioProcessingEvent-section
 @Experimental()
-class AudioProcessingEvent extends Event native "AudioProcessingEvent" {
+@Native("AudioProcessingEvent")
+class AudioProcessingEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory AudioProcessingEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -576,7 +585,8 @@
 @DomName('AudioSourceNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
 @Experimental()
-class AudioSourceNode extends AudioNode native "AudioSourceNode" {
+@Native("AudioSourceNode")
+class AudioSourceNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory AudioSourceNode._() { throw new UnsupportedError("Not supported"); }
 }
@@ -589,7 +599,8 @@
 @DomName('BiquadFilterNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#BiquadFilterNode-section
 @Experimental()
-class BiquadFilterNode extends AudioNode native "BiquadFilterNode" {
+@Native("BiquadFilterNode")
+class BiquadFilterNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory BiquadFilterNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -658,7 +669,8 @@
 @DomName('ChannelMergerNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#ChannelMergerNode-section
 @Experimental()
-class ChannelMergerNode extends AudioNode native "ChannelMergerNode,AudioChannelMerger" {
+@Native("ChannelMergerNode,AudioChannelMerger")
+class ChannelMergerNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory ChannelMergerNode._() { throw new UnsupportedError("Not supported"); }
 }
@@ -671,7 +683,8 @@
 @DomName('ChannelSplitterNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#ChannelSplitterNode-section
 @Experimental()
-class ChannelSplitterNode extends AudioNode native "ChannelSplitterNode,AudioChannelSplitter" {
+@Native("ChannelSplitterNode,AudioChannelSplitter")
+class ChannelSplitterNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory ChannelSplitterNode._() { throw new UnsupportedError("Not supported"); }
 }
@@ -684,7 +697,8 @@
 @DomName('ConvolverNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#ConvolverNode
 @Experimental()
-class ConvolverNode extends AudioNode native "ConvolverNode" {
+@Native("ConvolverNode")
+class ConvolverNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory ConvolverNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -705,7 +719,8 @@
 @DomName('DelayNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#DelayNode
 @Experimental()
-class DelayNode extends AudioNode native "DelayNode" {
+@Native("DelayNode")
+class DelayNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory DelayNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -722,7 +737,8 @@
 @DomName('DynamicsCompressorNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#DynamicsCompressorNode
 @Experimental()
-class DynamicsCompressorNode extends AudioNode native "DynamicsCompressorNode" {
+@Native("DynamicsCompressorNode")
+class DynamicsCompressorNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory DynamicsCompressorNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -759,7 +775,8 @@
 @DomName('GainNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#GainNode
 @Experimental()
-class GainNode extends AudioNode native "GainNode,AudioGainNode" {
+@Native("GainNode,AudioGainNode")
+class GainNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory GainNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -776,7 +793,8 @@
 @DomName('MediaElementAudioSourceNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaElementAudioSourceNode
 @Experimental()
-class MediaElementAudioSourceNode extends AudioSourceNode native "MediaElementAudioSourceNode" {
+@Native("MediaElementAudioSourceNode")
+class MediaElementAudioSourceNode extends AudioSourceNode {
   // To suppress missing implicit constructor warnings.
   factory MediaElementAudioSourceNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -794,7 +812,8 @@
 @DomName('MediaStreamAudioDestinationNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaStreamAudioDestinationNode
 @Experimental()
-class MediaStreamAudioDestinationNode extends AudioNode native "MediaStreamAudioDestinationNode" {
+@Native("MediaStreamAudioDestinationNode")
+class MediaStreamAudioDestinationNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory MediaStreamAudioDestinationNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -811,7 +830,8 @@
 @DomName('MediaStreamAudioSourceNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaStreamAudioSourceNode
 @Experimental()
-class MediaStreamAudioSourceNode extends AudioSourceNode native "MediaStreamAudioSourceNode" {
+@Native("MediaStreamAudioSourceNode")
+class MediaStreamAudioSourceNode extends AudioSourceNode {
   // To suppress missing implicit constructor warnings.
   factory MediaStreamAudioSourceNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -828,7 +848,8 @@
 @DomName('OfflineAudioCompletionEvent')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#OfflineAudioCompletionEvent-section
 @Experimental()
-class OfflineAudioCompletionEvent extends Event native "OfflineAudioCompletionEvent" {
+@Native("OfflineAudioCompletionEvent")
+class OfflineAudioCompletionEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory OfflineAudioCompletionEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -845,7 +866,8 @@
 @DomName('OfflineAudioContext')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#OfflineAudioContext-section
 @Experimental()
-class OfflineAudioContext extends AudioContext native "OfflineAudioContext" {
+@Native("OfflineAudioContext")
+class OfflineAudioContext extends AudioContext {
   // To suppress missing implicit constructor warnings.
   factory OfflineAudioContext._() { throw new UnsupportedError("Not supported"); }
 
@@ -865,7 +887,8 @@
 @DomName('OscillatorNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#dfn-OscillatorNode
 @Experimental()
-class OscillatorNode extends AudioSourceNode native "OscillatorNode,Oscillator" {
+@Native("OscillatorNode,Oscillator")
+class OscillatorNode extends AudioSourceNode {
   // To suppress missing implicit constructor warnings.
   factory OscillatorNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -944,7 +967,8 @@
 @DomName('PannerNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#PannerNode
 @Experimental()
-class PannerNode extends AudioNode native "PannerNode,AudioPannerNode" {
+@Native("PannerNode,AudioPannerNode")
+class PannerNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory PannerNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -1000,7 +1024,8 @@
 @DocsEditable()
 @DomName('PeriodicWave')
 @Experimental() // untriaged
-class PeriodicWave extends Interceptor native "PeriodicWave" {
+@Native("PeriodicWave")
+class PeriodicWave extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory PeriodicWave._() { throw new UnsupportedError("Not supported"); }
 }
@@ -1013,7 +1038,8 @@
 @DomName('ScriptProcessorNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#ScriptProcessorNode
 @Experimental()
-class ScriptProcessorNode extends AudioNode native "ScriptProcessorNode,JavaScriptAudioNode" {
+@Native("ScriptProcessorNode,JavaScriptAudioNode")
+class ScriptProcessorNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory ScriptProcessorNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -1054,7 +1080,8 @@
 @DomName('WaveShaperNode')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#dfn-WaveShaperNode
 @Experimental()
-class WaveShaperNode extends AudioNode native "WaveShaperNode" {
+@Native("WaveShaperNode")
+class WaveShaperNode extends AudioNode {
   // To suppress missing implicit constructor warnings.
   factory WaveShaperNode._() { throw new UnsupportedError("Not supported"); }
 
diff --git a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
index a94c162..111ef77 100644
--- a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
+++ b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
@@ -9,7 +9,7 @@
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, JSName, Null, Returns, convertDartClosureToJS;
+import 'dart:_js_helper' show Creates, JSName, Native, Null, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 // DO NOT EDIT - unless you are editing documentation as per:
@@ -329,7 +329,8 @@
 @DocsEditable()
 @DomName('WebGLActiveInfo')
 @Unstable()
-class ActiveInfo extends Interceptor native "WebGLActiveInfo" {
+@Native("WebGLActiveInfo")
+class ActiveInfo extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ActiveInfo._() { throw new UnsupportedError("Not supported"); }
 
@@ -353,7 +354,8 @@
 @DocsEditable()
 @DomName('ANGLEInstancedArrays')
 @Experimental() // untriaged
-class AngleInstancedArrays extends Interceptor native "ANGLEInstancedArrays" {
+@Native("ANGLEInstancedArrays")
+class AngleInstancedArrays extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory AngleInstancedArrays._() { throw new UnsupportedError("Not supported"); }
 
@@ -388,7 +390,8 @@
 @DocsEditable()
 @DomName('WebGLBuffer')
 @Unstable()
-class Buffer extends Interceptor native "WebGLBuffer" {
+@Native("WebGLBuffer")
+class Buffer extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Buffer._() { throw new UnsupportedError("Not supported"); }
 }
@@ -401,7 +404,8 @@
 @DomName('WebGLCompressedTextureATC')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_atc/
 @Experimental()
-class CompressedTextureAtc extends Interceptor native "WebGLCompressedTextureATC" {
+@Native("WebGLCompressedTextureATC")
+class CompressedTextureAtc extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory CompressedTextureAtc._() { throw new UnsupportedError("Not supported"); }
 
@@ -426,7 +430,8 @@
 @DomName('WebGLCompressedTexturePVRTC')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/
 @Experimental() // experimental
-class CompressedTexturePvrtc extends Interceptor native "WebGLCompressedTexturePVRTC" {
+@Native("WebGLCompressedTexturePVRTC")
+class CompressedTexturePvrtc extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory CompressedTexturePvrtc._() { throw new UnsupportedError("Not supported"); }
 
@@ -455,7 +460,8 @@
 @DomName('WebGLCompressedTextureS3TC')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/
 @Experimental() // experimental
-class CompressedTextureS3TC extends Interceptor native "WebGLCompressedTextureS3TC" {
+@Native("WebGLCompressedTextureS3TC")
+class CompressedTextureS3TC extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory CompressedTextureS3TC._() { throw new UnsupportedError("Not supported"); }
 
@@ -505,7 +511,8 @@
  */
 @DomName('WebGLContextAttributes')
 @Unstable()
-class ContextAttributes extends Interceptor native "WebGLContextAttributes" {
+@Native("WebGLContextAttributes")
+class ContextAttributes extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ContextAttributes._() { throw new UnsupportedError("Not supported"); }
 
@@ -546,7 +553,8 @@
 @DocsEditable()
 @DomName('WebGLContextEvent')
 @Unstable()
-class ContextEvent extends Event native "WebGLContextEvent" {
+@Native("WebGLContextEvent")
+class ContextEvent extends Event {
   // To suppress missing implicit constructor warnings.
   factory ContextEvent._() { throw new UnsupportedError("Not supported"); }
 
@@ -563,7 +571,8 @@
 @DomName('WebGLDebugRendererInfo')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/
 @Experimental() // experimental
-class DebugRendererInfo extends Interceptor native "WebGLDebugRendererInfo" {
+@Native("WebGLDebugRendererInfo")
+class DebugRendererInfo extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DebugRendererInfo._() { throw new UnsupportedError("Not supported"); }
 
@@ -584,7 +593,8 @@
 @DomName('WebGLDebugShaders')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/
 @Experimental() // experimental
-class DebugShaders extends Interceptor native "WebGLDebugShaders" {
+@Native("WebGLDebugShaders")
+class DebugShaders extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DebugShaders._() { throw new UnsupportedError("Not supported"); }
 
@@ -601,7 +611,8 @@
 @DomName('WebGLDepthTexture')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/
 @Experimental() // experimental
-class DepthTexture extends Interceptor native "WebGLDepthTexture" {
+@Native("WebGLDepthTexture")
+class DepthTexture extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DepthTexture._() { throw new UnsupportedError("Not supported"); }
 
@@ -618,7 +629,8 @@
 @DomName('WebGLDrawBuffers')
 // http://www.khronos.org/registry/webgl/specs/latest/
 @Experimental() // stable
-class DrawBuffers extends Interceptor native "WebGLDrawBuffers" {
+@Native("WebGLDrawBuffers")
+class DrawBuffers extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory DrawBuffers._() { throw new UnsupportedError("Not supported"); }
 
@@ -772,7 +784,8 @@
 @DomName('EXTFragDepth')
 // http://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/
 @Experimental()
-class ExtFragDepth extends Interceptor native "EXTFragDepth" {
+@Native("EXTFragDepth")
+class ExtFragDepth extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ExtFragDepth._() { throw new UnsupportedError("Not supported"); }
 }
@@ -785,7 +798,8 @@
 @DomName('EXTTextureFilterAnisotropic')
 // http://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/
 @Experimental()
-class ExtTextureFilterAnisotropic extends Interceptor native "EXTTextureFilterAnisotropic" {
+@Native("EXTTextureFilterAnisotropic")
+class ExtTextureFilterAnisotropic extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ExtTextureFilterAnisotropic._() { throw new UnsupportedError("Not supported"); }
 
@@ -805,7 +819,8 @@
 @DocsEditable()
 @DomName('WebGLFramebuffer')
 @Unstable()
-class Framebuffer extends Interceptor native "WebGLFramebuffer" {
+@Native("WebGLFramebuffer")
+class Framebuffer extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Framebuffer._() { throw new UnsupportedError("Not supported"); }
 }
@@ -818,7 +833,8 @@
 @DomName('WebGLLoseContext')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/
 @Experimental()
-class LoseContext extends Interceptor native "WebGLLoseContext,WebGLExtensionLoseContext" {
+@Native("WebGLLoseContext,WebGLExtensionLoseContext")
+class LoseContext extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory LoseContext._() { throw new UnsupportedError("Not supported"); }
 
@@ -839,7 +855,8 @@
 @DomName('OESElementIndexUint')
 // http://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/
 @Experimental() // experimental
-class OesElementIndexUint extends Interceptor native "OESElementIndexUint" {
+@Native("OESElementIndexUint")
+class OesElementIndexUint extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory OesElementIndexUint._() { throw new UnsupportedError("Not supported"); }
 }
@@ -852,7 +869,8 @@
 @DomName('OESStandardDerivatives')
 // http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/
 @Experimental() // experimental
-class OesStandardDerivatives extends Interceptor native "OESStandardDerivatives" {
+@Native("OESStandardDerivatives")
+class OesStandardDerivatives extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory OesStandardDerivatives._() { throw new UnsupportedError("Not supported"); }
 
@@ -869,7 +887,8 @@
 @DomName('OESTextureFloat')
 // http://www.khronos.org/registry/webgl/extensions/OES_texture_float/
 @Experimental() // experimental
-class OesTextureFloat extends Interceptor native "OESTextureFloat" {
+@Native("OESTextureFloat")
+class OesTextureFloat extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory OesTextureFloat._() { throw new UnsupportedError("Not supported"); }
 }
@@ -882,7 +901,8 @@
 @DomName('OESTextureFloatLinear')
 // http://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/
 @Experimental()
-class OesTextureFloatLinear extends Interceptor native "OESTextureFloatLinear" {
+@Native("OESTextureFloatLinear")
+class OesTextureFloatLinear extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory OesTextureFloatLinear._() { throw new UnsupportedError("Not supported"); }
 }
@@ -895,7 +915,8 @@
 @DomName('OESTextureHalfFloat')
 // http://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/
 @Experimental() // experimental
-class OesTextureHalfFloat extends Interceptor native "OESTextureHalfFloat" {
+@Native("OESTextureHalfFloat")
+class OesTextureHalfFloat extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory OesTextureHalfFloat._() { throw new UnsupportedError("Not supported"); }
 
@@ -912,7 +933,8 @@
 @DomName('OESTextureHalfFloatLinear')
 // http://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/
 @Experimental()
-class OesTextureHalfFloatLinear extends Interceptor native "OESTextureHalfFloatLinear" {
+@Native("OESTextureHalfFloatLinear")
+class OesTextureHalfFloatLinear extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory OesTextureHalfFloatLinear._() { throw new UnsupportedError("Not supported"); }
 }
@@ -925,7 +947,8 @@
 @DomName('OESVertexArrayObject')
 // http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
 @Experimental() // experimental
-class OesVertexArrayObject extends Interceptor native "OESVertexArrayObject" {
+@Native("OESVertexArrayObject")
+class OesVertexArrayObject extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory OesVertexArrayObject._() { throw new UnsupportedError("Not supported"); }
 
@@ -961,7 +984,8 @@
 @DocsEditable()
 @DomName('WebGLProgram')
 @Unstable()
-class Program extends Interceptor native "WebGLProgram" {
+@Native("WebGLProgram")
+class Program extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Program._() { throw new UnsupportedError("Not supported"); }
 }
@@ -973,7 +997,8 @@
 @DocsEditable()
 @DomName('WebGLRenderbuffer')
 @Unstable()
-class Renderbuffer extends Interceptor native "WebGLRenderbuffer" {
+@Native("WebGLRenderbuffer")
+class Renderbuffer extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Renderbuffer._() { throw new UnsupportedError("Not supported"); }
 }
@@ -987,7 +1012,8 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @Experimental()
 @Unstable()
-class RenderingContext extends CanvasRenderingContext native "WebGLRenderingContext" {
+@Native("WebGLRenderingContext")
+class RenderingContext extends CanvasRenderingContext {
   // To suppress missing implicit constructor warnings.
   factory RenderingContext._() { throw new UnsupportedError("Not supported"); }
 
@@ -3180,7 +3206,8 @@
 
 @DocsEditable()
 @DomName('WebGLShader')
-class Shader extends Interceptor native "WebGLShader" {
+@Native("WebGLShader")
+class Shader extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Shader._() { throw new UnsupportedError("Not supported"); }
 }
@@ -3191,7 +3218,8 @@
 
 @DocsEditable()
 @DomName('WebGLShaderPrecisionFormat')
-class ShaderPrecisionFormat extends Interceptor native "WebGLShaderPrecisionFormat" {
+@Native("WebGLShaderPrecisionFormat")
+class ShaderPrecisionFormat extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory ShaderPrecisionFormat._() { throw new UnsupportedError("Not supported"); }
 
@@ -3214,7 +3242,8 @@
 
 @DocsEditable()
 @DomName('WebGLTexture')
-class Texture extends Interceptor native "WebGLTexture" {
+@Native("WebGLTexture")
+class Texture extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory Texture._() { throw new UnsupportedError("Not supported"); }
 }
@@ -3225,7 +3254,8 @@
 
 @DocsEditable()
 @DomName('WebGLUniformLocation')
-class UniformLocation extends Interceptor native "WebGLUniformLocation" {
+@Native("WebGLUniformLocation")
+class UniformLocation extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory UniformLocation._() { throw new UnsupportedError("Not supported"); }
 }
@@ -3238,7 +3268,8 @@
 @DomName('WebGLVertexArrayObjectOES')
 // http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
 @Experimental() // experimental
-class VertexArrayObject extends Interceptor native "WebGLVertexArrayObjectOES" {
+@Native("WebGLVertexArrayObjectOES")
+class VertexArrayObject extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory VertexArrayObject._() { throw new UnsupportedError("Not supported"); }
 }
diff --git a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
index cdc5e17..163ad79 100644
--- a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
@@ -15,7 +15,7 @@
 import 'dart:_internal' hide deprecated;
 import 'dart:html';
 import 'dart:html_common';
-import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName;
+import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName, Native;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor;
 // DO NOT EDIT - unless you are editing documentation as per:
@@ -81,7 +81,8 @@
 @Experimental()
 // http://www.w3.org/TR/webdatabase/#asynchronous-database-api
 @Experimental() // deprecated
-class SqlDatabase extends Interceptor native "Database" {
+@Native("Database")
+class SqlDatabase extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SqlDatabase._() { throw new UnsupportedError("Not supported"); }
 
@@ -125,7 +126,8 @@
 @DomName('SQLError')
 // http://www.w3.org/TR/webdatabase/#sqlerror
 @Experimental() // deprecated
-class SqlError extends Interceptor native "SQLError" {
+@Native("SQLError")
+class SqlError extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SqlError._() { throw new UnsupportedError("Not supported"); }
 
@@ -178,7 +180,8 @@
 @DomName('SQLResultSet')
 // http://www.w3.org/TR/webdatabase/#sqlresultset
 @Experimental() // deprecated
-class SqlResultSet extends Interceptor native "SQLResultSet" {
+@Native("SQLResultSet")
+class SqlResultSet extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SqlResultSet._() { throw new UnsupportedError("Not supported"); }
 
@@ -203,7 +206,8 @@
 @DomName('SQLResultSetRowList')
 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist
 @Experimental() // deprecated
-class SqlResultSetRowList extends Interceptor with ListMixin<Map>, ImmutableListMixin<Map> implements List<Map> native "SQLResultSetRowList" {
+@Native("SQLResultSetRowList")
+class SqlResultSetRowList extends Interceptor with ListMixin<Map>, ImmutableListMixin<Map> implements List<Map> {
   // To suppress missing implicit constructor warnings.
   factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported"); }
 
@@ -279,7 +283,8 @@
 @Experimental()
 // http://www.w3.org/TR/webdatabase/#sqltransaction
 @deprecated // deprecated
-class SqlTransaction extends Interceptor native "SQLTransaction" {
+@Native("SQLTransaction")
+class SqlTransaction extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory SqlTransaction._() { throw new UnsupportedError("Not supported"); }
 
@@ -299,7 +304,8 @@
 @Experimental()
 // http://www.w3.org/TR/webdatabase/#sqltransactionsync
 @Experimental() // deprecated
-abstract class _SQLTransactionSync extends Interceptor native "SQLTransactionSync" {
+@Native("SQLTransactionSync")
+abstract class _SQLTransactionSync extends Interceptor {
   // To suppress missing implicit constructor warnings.
   factory _SQLTransactionSync._() { throw new UnsupportedError("Not supported"); }
 }
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index 02b15e0..2335037 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -7,6 +7,9 @@
 LibTest/collection/ListMixin/ListMixin_class_A01_t02: Crash # issue 19953
 LibTest/core/List/List_class_A01_t02: Crash # issue 19953
 
+[ $compiler == dart2dart && $builder_tag != new_backend ]
+Language/12_Expressions/18_Assignment_A04_t09: RuntimeError # co19-roll r667: Please triage this failure
+
 [ $compiler == dart2dart ]
 Language/07_Classes/07_Classes_A13_t02: Fail # Missing CT error on member with same name a type parameter
 Language/07_Classes/07_Classes_A13_t03: Fail # Missing CT error on member with same name a type parameter
@@ -26,8 +29,6 @@
 
 LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: CompileTimeError # dart issue 17523
 
-Language/12_Expressions/18_Assignment_A04_t09: RuntimeError # co19-roll r667: Please triage this failure
-
 Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t03: Fail # TODO(dart2dart-team): Please triage this failure.
 
 Language/03_Overview/2_Privacy_A01_t19: Fail # Calling unresolved class constructor.
diff --git a/tests/co19/co19-dartium.status b/tests/co19/co19-dartium.status
index b174280..5f37f97 100644
--- a/tests/co19/co19-dartium.status
+++ b/tests/co19/co19-dartium.status
@@ -5,6 +5,11 @@
 [ $compiler == none && $runtime == drt ]
 *: Skip # running co19 tests on content_shell would make our dartium cycle-times very long
 
+[ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid || $runtime == drt) ]
+LibTest/html/Window/document_A01_t01: RuntimeError # Issue 20146
+LibTest/html/Window/postMessage_A01_t02: RuntimeError # Issue 20146
+LibTest/html/Window/moveBy_A01_t01: RuntimeError # Issue 20146
+
 [ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) ]
 # Temporarily skip tests, to narrow down new breakage to a particular test by binary search:
 LayoutTests/fast/dom: Skip # Unknown tests are breaking the test infrastructure. Issue 18558
diff --git a/tests/compiler/dart2js/backend_dart/opt_cyclic_redundant_phi_test.dart b/tests/compiler/dart2js/backend_dart/opt_cyclic_redundant_phi_test.dart
new file mode 100644
index 0000000..7132824
--- /dev/null
+++ b/tests/compiler/dart2js/backend_dart/opt_cyclic_redundant_phi_test.dart
@@ -0,0 +1,97 @@
+// Copyright (c) 2014, 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 'opt_redundant_phi_test.dart';
+
+// The 'cyclic deps' IR tests removal of redundant phis with cyclic
+// dependencies.
+//
+//  void main() {
+//    var x = 0;
+//    var y = x;
+//    for (int i = 0; i < 10; i++) {
+//      if (i == -1) x = y;
+//      if (i == -1) y = x;
+//    }
+//    print(x);
+//    print(y);
+//  }
+
+String CYCLIC_DEPS_IN = """
+(FunctionDefinition main (return) (LetPrim v0 (Constant 0))
+  (LetPrim v1 (Constant 0))
+  (LetCont* (k0 v2 v3 v4)
+    (LetCont (k1)
+      (LetCont (k2 v5)
+        (LetCont (k3 v6) (LetPrim v7 (Constant null))
+          (InvokeContinuation return v7))
+        (InvokeStatic print v3 k3))
+      (InvokeStatic print v2 k2))
+    (LetCont (k4) (LetPrim v8 (Constant 1))
+      (LetCont (k5 v9)
+        (LetCont (k6 v10)
+          (LetCont (k7 v11) (LetPrim v12 (Constant 1))
+            (LetCont (k8 v13)
+              (LetCont (k9 v14)
+                (LetCont (k10 v15)
+                  (LetPrim v16 (Constant 1))
+                  (LetCont (k11 v17)
+                    (InvokeContinuation* k0 v11 v15 v17))
+                  (InvokeMethod v4 + v16 k11))
+                (LetCont (k12) (InvokeContinuation k10 v11))
+                (LetCont (k13) (InvokeContinuation k10 v3))
+                (Branch (IsTrue v14) k12 k13))
+              (InvokeMethod v4 == v13 k9))
+            (InvokeMethod v12 unary- k8))
+          (LetCont (k14) (InvokeContinuation k7 v3))
+          (LetCont (k15) (InvokeContinuation k7 v2))
+          (Branch (IsTrue v10) k14 k15))
+        (InvokeMethod v4 == v9 k6))
+      (InvokeMethod v8 unary- k5))
+    (LetPrim v18 (Constant 10))
+    (LetCont (k16 v19) (Branch (IsTrue v19) k4 k1))
+    (InvokeMethod v4 < v18 k16))
+  (InvokeContinuation k0 v0 v0 v1))
+""";
+
+String CYCLIC_DEPS_OUT = """
+(FunctionDefinition main (return) (LetPrim v0 (Constant 0))
+  (LetPrim v1 (Constant 0))
+  (LetCont* (k0 v2)
+    (LetCont (k1)
+      (LetCont (k2 v3)
+        (LetCont (k3 v4) (LetPrim v5 (Constant null))
+          (InvokeContinuation return v5))
+        (InvokeStatic print v0 k3))
+      (InvokeStatic print v0 k2))
+    (LetCont (k4) (LetPrim v6 (Constant 1))
+      (LetCont (k5 v7)
+        (LetCont (k6 v8)
+          (LetCont (k7) (LetPrim v9 (Constant 1))
+            (LetCont (k8 v10)
+              (LetCont (k9 v11)
+                (LetCont (k10)
+                  (LetPrim v12 (Constant 1))
+                  (LetCont (k11 v13)
+                    (InvokeContinuation* k0 v13))
+                  (InvokeMethod v2 + v12 k11))
+                (LetCont (k12) (InvokeContinuation k10))
+                (LetCont (k13) (InvokeContinuation k10))
+                (Branch (IsTrue v11) k12 k13))
+              (InvokeMethod v2 == v10 k9))
+            (InvokeMethod v9 unary- k8))
+          (LetCont (k14) (InvokeContinuation k7))
+          (LetCont (k15) (InvokeContinuation k7))
+          (Branch (IsTrue v8) k14 k15))
+        (InvokeMethod v2 == v7 k6))
+      (InvokeMethod v6 unary- k5))
+    (LetPrim v14 (Constant 10))
+    (LetCont (k16 v15) (Branch (IsTrue v15) k4 k1))
+    (InvokeMethod v2 < v14 k16))
+  (InvokeContinuation k0 v1))
+""";
+
+void main() {
+  testRedundantPhi(CYCLIC_DEPS_IN, CYCLIC_DEPS_OUT);
+}
diff --git a/tests/compiler/dart2js/backend_dart/opt_redundant_phi_test.dart b/tests/compiler/dart2js/backend_dart/opt_redundant_phi_test.dart
new file mode 100644
index 0000000..a463e20
--- /dev/null
+++ b/tests/compiler/dart2js/backend_dart/opt_redundant_phi_test.dart
@@ -0,0 +1,195 @@
+// Copyright (c) 2014, 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 'sexpr_unstringifier.dart';
+import "package:expect/expect.dart";
+import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart';
+import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';
+
+// The 'read in loop' IR tests the most basic case of redundant phi removal
+// and represents the following source code:
+//
+// void main() {
+//   int j = 42;
+//   for (int i = 0; i < 2; i++) {
+//     print(j.toString());
+//   }
+// }
+
+String READ_IN_LOOP_IN = """
+(FunctionDefinition main (return) (LetPrim v0 (Constant 42))
+  (LetPrim v1 (Constant 0))
+  (LetCont* (k0 v2 v3)
+    (LetCont (k1) (LetPrim v4 (Constant null))
+      (InvokeContinuation return v4))
+    (LetCont (k2)
+      (LetCont (k3 v5)
+        (LetCont (k4 v6) (LetPrim v7 (Constant 1))
+          (LetCont (k5 v8) (InvokeContinuation* k0 v2 v8))
+          (InvokeMethod v3 + v7 k5))
+        (InvokeStatic print v5 k4))
+      (InvokeMethod v2 toString k3))
+    (LetPrim v9 (Constant 2))
+    (LetCont (k6 v10) (Branch (IsTrue v10) k2 k1))
+    (InvokeMethod v3 < v9 k6))
+  (InvokeContinuation k0 v0 v1))
+""";
+
+String READ_IN_LOOP_OUT = """
+(FunctionDefinition main ( return) (LetPrim v0 (Constant 42))
+  (LetPrim v1 (Constant 0))
+  (LetCont* (k0 v2)
+    (LetCont (k1) (LetPrim v3 (Constant null))
+      (InvokeContinuation return v3))
+    (LetCont (k2)
+      (LetCont (k3 v4)
+        (LetCont (k4 v5) (LetPrim v6 (Constant 1))
+          (LetCont (k5 v7) (InvokeContinuation* k0 v7))
+          (InvokeMethod v2 + v6 k5))
+        (InvokeStatic print v4 k4))
+      (InvokeMethod v0 toString k3))
+    (LetPrim v8 (Constant 2))
+    (LetCont (k6 v9) (Branch (IsTrue v9) k2 k1))
+    (InvokeMethod v2 < v8 k6))
+  (InvokeContinuation k0 v1))
+""";
+
+// The 'inner loop' IR represents the following source code:
+//
+// void main() {
+//   int j = 42;
+//   for (int i = 0; i < 2; i++) {
+//     for (int k = 0; k < 2; k++) {
+//       print(i.toString());
+//     }
+//   }
+//   print(j.toString());
+// }
+//
+// This test case ensures that iterative optimization works: first, v8 and v9
+// are removed from k5, and only then can k0 be optimized as well.
+
+const String INNER_LOOP_IN = """
+(FunctionDefinition main (return) (LetPrim v0 (Constant 42))
+  (LetPrim v1 (Constant 0))
+  (LetCont* (k0 v2 v3)
+    (LetCont (k1)
+      (LetCont (k2 v4)
+        (LetCont (k3 v5) (LetPrim v6 (Constant null))
+          (InvokeContinuation return v6))
+        (InvokeStatic print v4 k3))
+      (InvokeMethod v2 toString k2))
+    (LetCont (k4) (LetPrim v7 (Constant 0))
+      (LetCont* (k5 v8 v9 v10)
+        (LetCont (k6) (LetPrim v11 (Constant 1))
+          (LetCont (k7 v12) (InvokeContinuation* k0 v8 v12))
+          (InvokeMethod v9 + v11 k7))
+        (LetCont (k8)
+          (LetCont (k9 v13)
+            (LetCont (k10 v14) (LetPrim v15 (Constant 1))
+              (LetCont (k11 v16)
+                (InvokeContinuation* k5 v8 v9 v16))
+              (InvokeMethod v10 + v15 k11))
+            (InvokeStatic print v13 k10))
+          (InvokeMethod v9 toString k9))
+        (LetPrim v17 (Constant 2))
+        (LetCont (k12 v18) (Branch (IsTrue v18) k8 k6))
+        (InvokeMethod v10 < v17 k12))
+      (InvokeContinuation k5 v2 v3 v7))
+    (LetPrim v19 (Constant 2))
+    (LetCont (k13 v20) (Branch (IsTrue v20) k4 k1))
+    (InvokeMethod v3 < v19 k13))
+  (InvokeContinuation k0 v0 v1))
+""";
+
+const String INNER_LOOP_OUT = """
+(FunctionDefinition main ( return) (LetPrim v0 (Constant 42))
+  (LetPrim v1 (Constant 0))
+  (LetCont* (k0 v2)
+    (LetCont (k1)
+      (LetCont (k2 v3)
+        (LetCont (k3 v4) (LetPrim v5 (Constant null))
+          (InvokeContinuation return v5))
+        (InvokeStatic print v3 k3))
+      (InvokeMethod v0 toString k2))
+    (LetCont (k4) (LetPrim v6 (Constant 0))
+      (LetCont* (k5 v7)
+        (LetCont (k6) (LetPrim v8 (Constant 1))
+          (LetCont (k7 v9) (InvokeContinuation* k0 v9))
+          (InvokeMethod v2 + v8 k7))
+        (LetCont (k8)
+          (LetCont (k9 v10)
+            (LetCont (k10 v11) (LetPrim v12 (Constant 1))
+              (LetCont (k11 v13)
+                (InvokeContinuation* k5 v13))
+              (InvokeMethod v7 + v12 k11))
+            (InvokeStatic print v10 k10))
+          (InvokeMethod v2 toString k9))
+        (LetPrim v14 (Constant 2))
+        (LetCont (k12 v15) (Branch (IsTrue v15) k8 k6))
+        (InvokeMethod v7 < v14 k12))
+      (InvokeContinuation k5 v6))
+    (LetPrim v16 (Constant 2))
+    (LetCont (k13 v17) (Branch (IsTrue v17) k4 k1))
+    (InvokeMethod v2 < v16 k13))
+  (InvokeContinuation k0 v1))
+""";
+
+// There are no redundant phis in the 'basic loop' IR, and this test ensures
+// simply that the optimization does not alter the IR. It represents the
+// following program:
+//
+// void main() {
+//   for (int i = 0; i < 2; i++) {
+//     print(i.toString());
+//   }
+// }
+
+String BASIC_LOOP_IN = """
+(FunctionDefinition main ( return) (LetPrim v0 (Constant 0))
+  (LetCont* (k0 v1)
+    (LetCont (k1) (LetPrim v2 (Constant null))
+      (InvokeContinuation return v2))
+    (LetCont (k2)
+      (LetCont (k3 v3)
+        (LetCont (k4 v4) (LetPrim v5 (Constant 1))
+          (LetCont (k5 v6) (InvokeContinuation* k0 v6))
+          (InvokeMethod v1 + v5 k5))
+        (InvokeStatic print v3 k4))
+      (InvokeMethod v1 toString k3))
+    (LetPrim v7 (Constant 2))
+    (LetCont (k6 v8) (Branch (IsTrue v8) k2 k1))
+    (InvokeMethod v1 < v7 k6))
+  (InvokeContinuation k0 v0))
+""";
+
+String BASIC_LOOP_OUT = BASIC_LOOP_IN;
+
+/// Normalizes whitespace by replacing all whitespace sequences by a single
+/// space and trimming leading and trailing whitespace.
+String normalizeSExpr(String input) {
+  return input.replaceAll(new RegExp(r'[ \n\t]+'), ' ').trim();
+}
+
+/// Parses the given input IR, runs a redundant phi pass over it, and compares
+/// the stringification of the result against the expected output.
+void testRedundantPhi(String input, String expectedOutput) {
+  final unstringifier = new SExpressionUnstringifier();
+  final stringifier   = new SExpressionStringifier();
+  final optimizer     = new RedundantPhiEliminator();
+
+  FunctionDefinition f = unstringifier.unstringify(input);
+  optimizer.rewrite(f);
+
+  String expected = normalizeSExpr(expectedOutput);
+  String actual   = normalizeSExpr(stringifier.visit(f));
+
+  Expect.equals(expected, actual);
+}
+
+void main() {
+  testRedundantPhi(READ_IN_LOOP_IN, READ_IN_LOOP_OUT);
+  testRedundantPhi(INNER_LOOP_IN, INNER_LOOP_OUT);
+  testRedundantPhi(BASIC_LOOP_IN, BASIC_LOOP_OUT);
+}
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_test.dart b/tests/compiler/dart2js/backend_dart/sexpr_test.dart
index a2bb628..a130463 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_test.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_test.dart
@@ -3,13 +3,13 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import '../compiler_helper.dart';
+import 'sexpr_unstringifier.dart';
 import 'dart:async';
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
 import 'package:compiler/implementation/dart2jslib.dart';
 import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart';
 import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';
-import 'package:compiler/implementation/dart_backend/dart_backend.dart';
 
 const String CODE = """
 class Foo {
@@ -65,6 +65,7 @@
                , 3: "three"
                };
     var double = 3.14;
+    list.forEach((i) => print(i.toString()));
     print("\$list \$map \$double");
   }
 
@@ -109,29 +110,39 @@
   });
 }
 
-Future<String> testStringifier(String code, List<String> expectedTokens) {
+/// Returns an S-expression string for each compiled function.
+List<String> stringifyAll(Iterable<FunctionDefinition> functions) {
+  final stringifier = new SExpressionStringifier();
+  return functions.map((f) => stringifier.visitFunctionDefinition(f)).toList();
+}
+
+Future<List<String>> testStringifier(String code,
+                                     Iterable<String> expectedTokens) {
   return compile(code)
       .then((List<FunctionDefinition> functions) {
-        final stringifier = new SExpressionStringifier();
-        return functions.map((f) {
-          String sexpr = stringifier.visitFunctionDefinition(f);
-          Expect.isNotNull(sexpr, "S-expression generation failed");
-          return sexpr;
-        }).join("\n");
-      })
-      .then((String sexpr) {
-        Expect.isFalse(sexpr.replaceAll("Constant null", "").contains("null"),
-                       "Output contains 'null':\n\n$sexpr");
+        List<String> sexprs = stringifyAll(functions);
+        String combined = sexprs.join();
+        String withoutNullConstants = combined.replaceAll("Constant null", "");
 
-        expectedTokens.forEach((String token) {
-          Expect.isTrue(sexpr.contains(token),
-                        "Expected token '$token' not present:\n\n$sexpr");
-        });
+        Expect.isFalse(withoutNullConstants.contains("null"));
+        for (String token in expectedTokens) {
+          Expect.isTrue(combined.contains(token));
+        }
 
-        return sexpr;
+        return sexprs;
       });
 }
 
+/// Checks if the generated S-expressions can be processed by the unstringifier,
+/// returns the resulting definitions.
+List<FunctionDefinition> testUnstringifier(List<String> sexprs) {
+  return sexprs.map((String sexpr) {
+    final function = new SExpressionUnstringifier().unstringify(sexpr);
+    Expect.isNotNull(function, "Unstringification failed:\n\n$sexpr");
+    return function;
+  }).toList();
+}
+
 void main() {
   final tokens =
           [ "FunctionDefinition"
@@ -162,5 +173,11 @@
           , "This"
           ];
 
-  asyncTest(() => testStringifier(CODE, tokens));
+  asyncTest(() => testStringifier(CODE, tokens).then((List<String> sexprs) {
+    final functions = testUnstringifier(sexprs);
+
+    // Ensure that
+    // stringified(CODE) == stringified(unstringified(stringified(CODE)))
+    Expect.listEquals(sexprs, stringifyAll(functions));
+  }));
 }
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
new file mode 100644
index 0000000..2cedbb1
--- /dev/null
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -0,0 +1,622 @@
+// Copyright (c) 2014, 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.
+
+// SExpressionUnstringifier implements the inverse operation to
+// [SExpressionStringifier].
+
+library sexpr_unstringifier;
+
+import 'package:compiler/implementation/dart2jslib.dart' as dart2js
+  show Constant, IntConstant, NullConstant, StringConstant,
+       DoubleConstant, MessageKind;
+import 'package:compiler/implementation/dart_types.dart' as dart_types
+  show DartType;
+import 'package:compiler/implementation/elements/elements.dart'
+  show Entity, Element, Elements, Local, TypeVariableElement, ErroneousElement,
+       TypeDeclarationElement, ExecutableElement;
+import 'package:compiler/implementation/elements/modelx.dart'
+  show ErroneousElementX, TypeVariableElementX;
+import 'package:compiler/implementation/tree/tree.dart'show LiteralDartString;
+import 'package:compiler/implementation/universe/universe.dart'
+  show Selector, SelectorKind;
+import 'package:compiler/implementation/cps_ir/cps_ir_nodes.dart';
+
+/// Used whenever a node constructed by [SExpressionUnstringifier] needs a
+/// named entity.
+class DummyEntity extends Entity {
+  final String name;
+  DummyEntity(this.name);
+}
+
+/// Used whenever a node constructed by [SExpressionUnstringifier] needs a
+/// local.
+class DummyLocal extends DummyEntity implements Local {
+  DummyLocal(String name) : super(name);
+
+  ExecutableElement get executableContext => null;
+}
+
+/// Used whenever a node constructed by [SExpressionUnstringifier] requires
+/// an [Element] or [FunctionElement]. Extends [ErroneousElementX] since there
+/// is currently a large amount of overhead when extending the base abstract
+/// classes, and erroneous elements conveniently also skip several assertion
+/// checks in CPS IR nodes that are irrelevant to us.
+class DummyElement extends ErroneousElementX
+    implements TypeVariableElement {
+  DummyElement(String name)
+      : super(dart2js.MessageKind.GENERIC, {}, name, null);
+
+  final dart_types.DartType bound = null;
+  final TypeDeclarationElement typeDeclaration = null;
+}
+
+/// Used whenever a node constructed by [SExpressionUnstringifier] requires
+/// a named type.
+class DummyNamedType extends dart_types.DartType {
+  final String name;
+
+  final kind = null;
+  final element = null;
+
+  DummyNamedType(this.name);
+
+  subst(arguments, parameters) => null;
+  unalias(compiler) => null;
+  accept(visitor, argument) => null;
+
+  String toString() => name;
+}
+
+/// Represents a list of tokens, but is basically a partial view into a list
+/// with appropriate convenience methods.
+class Tokens {
+  final List<String> _list;
+  int _index; // Current index into the list.
+
+  Tokens(List<String> this._list) : _index = 0;
+
+  String get current => _list[_index];
+  String get next    => _list[_index + 1];
+
+  String read([String expected]) {
+    if (expected != null) {
+      assert(current == expected);
+    }
+    return _list[_index++];
+  }
+
+  /// Consumes the preamble to a new node, consisting of an opening parenthesis
+  /// and a tag.
+  void consumeStart([String tag]) {
+    read("(");
+    if (tag != null) {
+      read(tag);
+    }
+  }
+
+  void consumeEnd() {
+    read(")");
+  }
+
+  bool get hasNext  => _index < _list.length;
+  String toString() => _list.sublist(_index).toString();
+}
+
+/// Constructs a minimal in-memory representation of the IR represented
+/// by the given string. Many fields are currently simply set to null.
+class SExpressionUnstringifier {
+
+  // Expressions
+  static const String BRANCH = "Branch";
+  static const String CONCATENATE_STRINGS = "ConcatenateStrings";
+  static const String DECLARE_FUNCTION = "DeclareFunction";
+  static const String INVOKE_CONSTRUCTOR = "InvokeConstructor";
+  static const String INVOKE_CONTINUATION = "InvokeContinuation";
+  static const String INVOKE_CONTINUATION_RECURSIVE = "InvokeContinuation*";
+  static const String INVOKE_STATIC = "InvokeStatic";
+  static const String INVOKE_SUPER_METHOD = "InvokeSuperMethod";
+  static const String INVOKE_METHOD = "InvokeMethod";
+  static const String LET_PRIM = "LetPrim";
+  static const String LET_CONT = "LetCont";
+  static const String LET_CONT_RECURSIVE = "LetCont*";
+  static const String SET_CLOSURE_VARIABLE = "SetClosureVariable";
+  static const String TYPE_OPERATOR = "TypeOperator";
+
+  // Primitives
+  static const String CONSTANT = "Constant";
+  static const String CREATE_FUNCTION = "CreateFunction";
+  static const String GET_CLOSURE_VARIABLE = "GetClosureVariable";
+  static const String LITERAL_LIST = "LiteralList";
+  static const String LITERAL_MAP = "LiteralMap";
+  static const String REIFY_TYPE_VAR = "ReifyTypeVar";
+  static const String THIS = "This";
+
+  // Other
+  static const String FUNCTION_DEFINITION = "FunctionDefinition";
+  static const String IS_TRUE = "IsTrue";
+
+  final Map<String, Definition> name2variable =
+      <String, Definition>{ "return": new Continuation.retrn() };
+
+  // The tokens currently being parsed.
+  Tokens tokens;
+
+  FunctionDefinition unstringify(String s) {
+    tokens = tokenize(s);
+    FunctionDefinition def = parseFunctionDefinition();
+    assert(!tokens.hasNext);
+    return def;
+  }
+
+  /// Returns a new named dummy selector with a roughly appropriate kind.
+  Selector dummySelector(String name, int argumentCount) {
+    SelectorKind kind = Elements.isOperatorName(name)
+        ? SelectorKind.OPERATOR : SelectorKind.CALL;
+    return new Selector(kind, name, null, argumentCount);
+  }
+
+  /// Returns the tokens in s. Note that string literals are not necessarily
+  /// preserved; for instance, "(literalString)" is transformed to
+  /// " ( literalString ) ".
+  Tokens tokenize(String s) =>
+      new Tokens(
+          s.replaceAll("(", " ( ")
+           .replaceAll(")", " ) ")
+           .replaceAll(new RegExp(r"[ \t\n]+"), " ")
+           .trim()
+           .split(" "));
+
+  Expression parseExpression() {
+    assert(tokens.current == "(");
+
+    switch (tokens.next) {
+      case BRANCH:
+        return parseBranch();
+      case CONCATENATE_STRINGS:
+        return parseConcatenateStrings();
+      case DECLARE_FUNCTION:
+        return parseDeclareFunction();
+      case INVOKE_CONSTRUCTOR:
+        return parseInvokeConstructor();
+      case INVOKE_CONTINUATION:
+        return parseInvokeContinuation(false);
+      case INVOKE_CONTINUATION_RECURSIVE:
+        return parseInvokeContinuation(true);
+      case INVOKE_METHOD:
+        return parseInvokeMethod();
+      case INVOKE_STATIC:
+        return parseInvokeStatic();
+      case INVOKE_SUPER_METHOD:
+        return parseInvokeSuperMethod();
+      case LET_PRIM:
+        return parseLetPrim();
+      case LET_CONT:
+        return parseLetCont(false);
+      case LET_CONT_RECURSIVE:
+        return parseLetCont(true);
+      case SET_CLOSURE_VARIABLE:
+        return parseSetClosureVariable();
+      case TYPE_OPERATOR:
+        return parseTypeOperator();
+      default:
+        assert(false);
+    }
+
+    return null;
+  }
+
+  /// def1 def2 ... defn cont )
+  /// Note that cont is *not* included in the returned list and not consumed.
+  List<Definition> parseDefinitionList() {
+    List<Definition> defs = <Definition>[];
+    while (tokens.next != ")") {
+      Definition def = name2variable[tokens.read()];
+      assert(def != null);
+      defs.add(def);
+    }
+    return defs;
+  }
+
+  /// (prim1 prim2 ... primn)
+  List<Primitive> parsePrimitiveList() {
+    tokens.consumeStart();
+    List<Primitive> prims = <Primitive>[];
+    while (tokens.current != ")") {
+      Primitive prim = name2variable[tokens.read()];
+      assert(prim != null);
+      prims.add(prim);
+    }
+    tokens.consumeEnd();
+    return prims;
+  }
+
+  /// (FunctionDefinition name (args cont) body)
+  FunctionDefinition parseFunctionDefinition() {
+    tokens.consumeStart(FUNCTION_DEFINITION);
+
+    // name
+    Element element = new DummyElement("");
+    if (tokens.current != "(") {
+      // This is a named function.
+      element = new DummyElement(tokens.read());
+    }
+
+    // (args cont)
+    List<Parameter> parameters = <Parameter>[];
+    tokens.consumeStart();
+    while (tokens.next != ")") {
+      String paramName = tokens.read();
+      Parameter param = new Parameter(new DummyElement(paramName));
+      name2variable[paramName] = param;
+      parameters.add(param);
+    }
+
+    String contName = tokens.read("return");
+    Continuation cont = name2variable[contName];
+    assert(cont != null);
+    tokens.consumeEnd();
+
+    // body
+    Expression body = parseExpression();
+
+    tokens.consumeEnd();
+    return new FunctionDefinition(element, cont, parameters, body, null, null);
+  }
+
+  /// (IsTrue arg)
+  Condition parseCondition() {
+    // Handles IsTrue only for now.
+    tokens.consumeStart(IS_TRUE);
+
+    Definition value = name2variable[tokens.read()];
+    assert(value != null);
+
+    tokens.consumeEnd();
+    return new IsTrue(value);
+  }
+
+  /// (Branch condition cont cont)
+  Branch parseBranch() {
+    tokens.consumeStart(BRANCH);
+
+    Condition cond = parseCondition();
+    Continuation trueCont = name2variable[tokens.read()];
+    Continuation falseCont = name2variable[tokens.read()];
+    assert(trueCont != null && falseCont != null);
+
+    tokens.consumeEnd();
+    return new Branch(cond, trueCont, falseCont);
+  }
+
+  /// (ConcatenateStrings args cont)
+  ConcatenateStrings parseConcatenateStrings() {
+    tokens.consumeStart(CONCATENATE_STRINGS);
+
+    List<Definition> args = parseDefinitionList();
+
+    Continuation cont = name2variable[tokens.read()];
+    assert(cont != null);
+
+    tokens.consumeEnd();
+    return new ConcatenateStrings(cont, args);
+  }
+
+  /// (DeclareFunction name = function in body)
+  DeclareFunction parseDeclareFunction() {
+    tokens.consumeStart(DECLARE_FUNCTION);
+
+    // name =
+    Local local = new DummyLocal(tokens.read());
+    tokens.read("=");
+
+    // function in
+    FunctionDefinition def = parseFunctionDefinition();
+    tokens.read("in");
+
+    // body
+    Expression body = parseExpression();
+
+    tokens.consumeEnd();
+    return new DeclareFunction(local, def)..plug(body);
+  }
+
+  /// (InvokeConstructor name args cont)
+  InvokeConstructor parseInvokeConstructor() {
+    tokens.consumeStart(INVOKE_CONSTRUCTOR);
+
+    String constructorName = tokens.read();
+    List<String> split = constructorName.split(".");
+    assert(split.length < 3);
+
+    dart_types.DartType type = new DummyNamedType(split[0]);
+    Element element = new DummyElement((split.length == 1) ? "" : split[1]);
+
+    List<Definition> args = parseDefinitionList();
+
+    Continuation cont = name2variable[tokens.read()];
+    assert(cont != null);
+
+    tokens.consumeEnd();
+    Selector selector = dummySelector(constructorName, args.length);
+    return new InvokeConstructor(type, element, selector, cont, args);
+  }
+
+  /// (InvokeContinuation name args)
+  InvokeContinuation parseInvokeContinuation(bool recursive) {
+    tokens.consumeStart(recursive
+        ? INVOKE_CONTINUATION_RECURSIVE : INVOKE_CONTINUATION);
+
+    Continuation cont = name2variable[tokens.read()];
+    assert(cont != null);
+
+    List<Definition> args = <Definition>[];
+    while (tokens.current != ")") {
+      Definition def = name2variable[tokens.read()];
+      assert(def != null);
+      args.add(def);
+    }
+
+    tokens.consumeEnd();
+    return new InvokeContinuation(cont, args, recursive: recursive);
+  }
+
+  /// (InvokeMethod receiver method args cont)
+  InvokeMethod parseInvokeMethod() {
+    tokens.consumeStart(INVOKE_METHOD);
+
+    Definition receiver = name2variable[tokens.read()];
+    assert(receiver != null);
+
+    String methodName = tokens.read();
+
+    List<Definition> args = parseDefinitionList();
+
+    Continuation cont = name2variable[tokens.read()];
+    assert(cont != null);
+
+    tokens.consumeEnd();
+    Selector selector = dummySelector(methodName, args.length);
+    return new InvokeMethod(receiver, selector, cont, args);
+  }
+
+  /// (InvokeStatic method args cont)
+  InvokeStatic parseInvokeStatic() {
+    tokens.consumeStart(INVOKE_STATIC);
+
+    String methodName = tokens.read();
+
+    List<Definition> args = parseDefinitionList();
+
+    Continuation cont = name2variable[tokens.read()];
+    assert(cont != null);
+
+    Entity entity = new DummyEntity(methodName);
+    Selector selector = dummySelector(methodName, args.length);
+
+    tokens.consumeEnd();
+    return new InvokeStatic(entity, selector, cont, args);
+  }
+
+  /// (InvokeSuperMethod method args cont)
+  InvokeSuperMethod parseInvokeSuperMethod() {
+    tokens.consumeStart(INVOKE_SUPER_METHOD);
+
+    String methodName = tokens.read();
+
+    List<Definition> args = parseDefinitionList();
+
+    Continuation cont = name2variable[tokens.read()];
+    assert(cont != null);
+
+    tokens.consumeEnd();
+    Selector selector = dummySelector(methodName, args.length);
+    return new InvokeSuperMethod(selector, cont, args);
+  }
+
+  /// (LetCont (cont args) (cont_body)) body
+  LetCont parseLetCont(bool recursive) {
+    tokens.consumeStart(recursive ? LET_CONT_RECURSIVE : LET_CONT);
+
+    // (name args) (cont_body))
+    tokens.consumeStart();
+    String name = tokens.read();
+
+    List<Parameter> params = <Parameter>[];
+    while (tokens.current != ")") {
+      String paramName = tokens.read();
+      Parameter param = new Parameter(new DummyElement(paramName));
+      name2variable[paramName] = param;
+      params.add(param);
+    }
+    tokens.consumeEnd();
+
+    Continuation cont = new Continuation(params);
+    name2variable[name] = cont;
+
+    cont.isRecursive = recursive;
+    cont.body = parseExpression();
+    tokens.consumeEnd();
+
+    // body
+    Expression body = parseExpression();
+
+    return new LetCont(cont, body);
+  }
+
+  /// (SetClosureVariable name value body)
+  SetClosureVariable parseSetClosureVariable() {
+    tokens.consumeStart(SET_CLOSURE_VARIABLE);
+
+    Local local = new DummyLocal(tokens.read());
+    Primitive value = name2variable[tokens.read()];
+    assert(value != null);
+
+    Expression body = parseExpression();
+
+    tokens.consumeEnd();
+    return new SetClosureVariable(local, value)
+                  ..plug(body);
+  }
+
+  /// (TypeOperator operator recv type cont)
+  TypeOperator parseTypeOperator() {
+    tokens.consumeStart(TYPE_OPERATOR);
+
+    String operator = tokens.read();
+
+    Primitive recv = name2variable[tokens.read()];
+    assert(recv != null);
+
+    dart_types.DartType type = new DummyNamedType(tokens.read());
+
+    Continuation cont = name2variable[tokens.read()];
+    assert(cont != null);
+
+    tokens.consumeEnd();
+    return new TypeOperator(operator, recv, type, cont);
+  }
+
+  /// (LetPrim name (primitive)) body
+  LetPrim parseLetPrim() {
+    tokens.consumeStart(LET_PRIM);
+
+    // name
+    String name = tokens.read();
+
+    // (primitive)
+    Primitive primitive = parsePrimitive();
+    name2variable[name] = primitive;
+    tokens.consumeEnd();
+
+    // body
+    Expression body = parseExpression();
+
+    return new LetPrim(primitive)..plug(body);
+  }
+
+  Primitive parsePrimitive() {
+    assert(tokens.current == "(");
+
+    switch (tokens.next) {
+      case CONSTANT:
+        return parseConstant();
+      case CREATE_FUNCTION:
+        return parseCreateFunction();
+      case GET_CLOSURE_VARIABLE:
+        return parseGetClosureVariable();
+      case LITERAL_LIST:
+        return parseLiteralList();
+      case LITERAL_MAP:
+        return parseLiteralMap();
+      case REIFY_TYPE_VAR:
+        return parseReifyTypeVar();
+      case THIS:
+        return parseThis();
+      default:
+        assert(false);
+    }
+
+    return null;
+  }
+
+  /// (Constant (constant))
+  Constant parseConstant() {
+    tokens.consumeStart(CONSTANT);
+    String tag = tokens.read();
+
+    if (tag == "null") {
+      tokens.consumeEnd();
+      return new Constant(null, new dart2js.NullConstant());
+    }
+
+    if (tag == "StringConstant") {
+      tokens.consumeStart();
+      List<String> strings = <String>[];
+      do {
+        strings.add(tokens.read());
+      } while (tokens.current != ")");
+      tokens.consumeEnd();
+
+      String string = strings.join(" ");
+      assert(string.startsWith('"') && string.endsWith('"'));
+
+      dart2js.StringConstant value = new dart2js.StringConstant(
+          new LiteralDartString(string.substring(1, string.length - 1)));
+
+      tokens.consumeEnd();
+      return new Constant(null, value);
+    }
+
+    // IntConstant.
+    int intValue = int.parse(tag, onError: (_) => null);
+    if (intValue != null) {
+      tokens.consumeEnd();
+      return new Constant(null, new dart2js.IntConstant(intValue));
+    }
+
+    // DoubleConstant.
+    double doubleValue = double.parse(tag, (_) => null);
+    if (doubleValue != null) {
+      tokens.consumeEnd();
+      return new Constant(null, new dart2js.DoubleConstant(doubleValue));
+    }
+
+    assert(false);
+    return null;
+  }
+
+  /// (CreateFunction (definition))
+  CreateFunction parseCreateFunction() {
+    tokens.consumeStart(CREATE_FUNCTION);
+    FunctionDefinition def = parseFunctionDefinition();
+    tokens.consumeEnd();
+    return new CreateFunction(def);
+  }
+
+  /// (GetClosureVariable name)
+  GetClosureVariable parseGetClosureVariable() {
+    tokens.consumeStart(GET_CLOSURE_VARIABLE);
+
+    Local local = new DummyLocal(tokens.read());
+    tokens.consumeEnd();
+
+    return new GetClosureVariable(local);
+  }
+
+  /// (LiteralList values)
+  LiteralList parseLiteralList() {
+    tokens.consumeStart(LITERAL_LIST);
+    List<Primitive> values = parsePrimitiveList();
+    tokens.consumeEnd();
+    return new LiteralList(null, values);
+  }
+
+  /// (LiteralMap keys values)
+  LiteralMap parseLiteralMap() {
+    tokens.consumeStart(LITERAL_MAP);
+
+    List<Primitive> keys   = parsePrimitiveList();
+    List<Primitive> values = parsePrimitiveList();
+
+    tokens.consumeEnd();
+    return new LiteralMap(null, keys, values);
+  }
+
+  /// (ReifyTypeVar type)
+  ReifyTypeVar parseReifyTypeVar() {
+    tokens.consumeStart(REIFY_TYPE_VAR);
+
+    TypeVariableElement type = new DummyElement(tokens.read());
+
+    tokens.consumeEnd();
+    return new ReifyTypeVar(type);
+  }
+
+  /// (This)
+  This parseThis() {
+    tokens.consumeStart(THIS);
+    tokens.consumeEnd();
+    return new This();
+  }
+}
diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status
index 37a246e..96da696 100644
--- a/tests/compiler/dart2js/dart2js.status
+++ b/tests/compiler/dart2js/dart2js.status
@@ -16,6 +16,8 @@
 
 gvn_dynamic_field_get_test: Fail # Issue 18519
 
+backend_dart/opt_cyclic_redundant_phi_test: Fail # Issue 20159
+
 mirrors/library_exports_hidden_test: Fail
 mirrors/library_exports_shown_test: Fail
 mirrors/library_imports_hidden_test: Fail
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_lib.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_lib.dart
new file mode 100644
index 0000000..92b9ede
--- /dev/null
+++ b/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_lib.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2014, 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:typed_data';
+import 'dart:mirrors';
+
+foo() {
+  var m = reflect(499);
+  return m.reflectee;
+}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_test.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_test.dart
new file mode 100644
index 0000000..10ed593
--- /dev/null
+++ b/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2014, 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:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+
+@MirrorsUsed(override: '*')
+import 'dart:mirrors';
+
+import 'deferred_mirrors1_lib.dart' deferred as lazy;
+
+main() {
+  asyncStart();
+
+  // The deferred library uses mirrors and has an unused import of typed_data.
+  // Dart2js must not crash on this test.
+  //
+  // Dart2js used to crash because:
+  // - the NativeInt8List was dragged in.
+  // - but not its constructors and the constructors' dependencies.
+  // - one of the dependencies (a local function "_ensureNativeList") was
+  //   not handled by the deferred-loader.
+  lazy.loadLibrary().then((_) {
+    Expect.equals(499, lazy.foo());
+    asyncEnd();
+  });
+}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lazy.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lazy.dart
new file mode 100644
index 0000000..9ec9473
--- /dev/null
+++ b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lazy.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2014, 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 lazy;
+
+import 'deferred_mirrors2_lib3.dart';
+
+@MirrorsUsed(metaTargets: const [Reflectable],
+    override: 'lazy')
+import 'dart:mirrors';
+
+class Reflectable {
+  const Reflectable();
+}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib2.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib2.dart
new file mode 100644
index 0000000..1a16daf
--- /dev/null
+++ b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib2.dart
@@ -0,0 +1,6 @@
+// Copyright (c) 2014, 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 lib2;
+import 'deferred_mirrors2_lazy.dart' deferred as admin;
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib3.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib3.dart
new file mode 100644
index 0000000..51b695f
--- /dev/null
+++ b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib3.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2014, 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 lib3;
+
+import 'deferred_mirrors2_lib4.dart';
+
+@MirrorsUsed(targets: const [
+    'lib3'
+])
+import 'dart:mirrors';
+
+class R {
+  void bind(Type type) {
+    ClassMirror classMirror = _reflectClass(type);
+    MethodMirror ctor = classMirror.declarations[classMirror.simpleName];
+    int length = ctor.parameters.length;
+    Function create = classMirror.newInstance;
+  }
+}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib4.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib4.dart
new file mode 100644
index 0000000..446b67d
--- /dev/null
+++ b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib4.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2014, 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 'deferred_mirrors2_lib5.dart' show Injectable;
+
+@Injectable()
+class A {
+}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib5.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib5.dart
new file mode 100644
index 0000000..f970ed0
--- /dev/null
+++ b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib5.dart
@@ -0,0 +1,7 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class Injectable {
+  const Injectable();
+}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_test.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_test.dart
new file mode 100644
index 0000000..195c826
--- /dev/null
+++ b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_test.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2014, 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:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+
+@MirrorsUsed(override: '*')
+import 'dart:mirrors';
+
+import 'deferred_mirrors2_lib2.dart';
+
+foo() {
+  ClassMirror classMirror = reflectType(int);
+  Expect.isTrue(classMirror.isTopLevel);
+}
+
+// This is a minimal test extracted from a bug-report we got.
+main() {
+  foo();
+}
diff --git a/tests/compiler/dart2js_native/jsobject_test.dart b/tests/compiler/dart2js_native/jsobject_test.dart
index dd3c991..45fac7a 100644
--- a/tests/compiler/dart2js_native/jsobject_test.dart
+++ b/tests/compiler/dart2js_native/jsobject_test.dart
@@ -16,7 +16,8 @@
 // export the interface [JSObject] to user level code, this test makes sure we
 // can distinguish plain JavaScript objects from ones with a complex prototype.
 
-class Q native 'QQ' {}
+@Native('QQ')
+class Q {}
 
 makeA() native;
 makeB() native;
diff --git a/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
index b4cf449..624ffb5 100644
--- a/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
@@ -26,8 +26,8 @@
 // TODO(sra): Add a case where the parameters have default values.  Wait until
 // dart:html need non-null default values.
 
-A makeA() native { return new A(); }
-B makeB() native { return new B(); }
+A makeA() native;
+B makeB() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
index 0257ed9..0adb955 100644
--- a/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
@@ -22,8 +22,8 @@
 // TODO(sra): Add a case where the parameters have default values.  Wait until
 // dart:html need non-null default values.
 
-A makeA() native { return new A(); }
-B makeB() native { return new B(); }
+A makeA() native;
+B makeB() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart b/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
index d87558d..bef06b4 100644
--- a/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
@@ -19,8 +19,8 @@
   int cmp(B other) native;
 }
 
-A makeA() native { return new A(); }
-B makeB() native { return new B(); }
+A makeA() native;
+B makeB() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart b/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
index 7648da4..8992dc0 100644
--- a/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
@@ -17,8 +17,8 @@
   String foo;
 }
 
-A makeA() native { return new A(); }
-B makeB() native { return new B(); }
+A makeA() native;
+B makeB() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_class_fields_test.dart b/tests/compiler/dart2js_native/native_class_fields_test.dart
index 110d6c5..cf6b1a9 100644
--- a/tests/compiler/dart2js_native/native_class_fields_test.dart
+++ b/tests/compiler/dart2js_native/native_class_fields_test.dart
@@ -40,7 +40,7 @@
 makeA = function(){return new A;};
 """;
 
-A makeA() native { return new A(); }
+A makeA() native;
 
 main() {
   setup();
diff --git a/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
index fcd1e3a..716be4d 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
@@ -29,8 +29,8 @@
   int method(int z) => _field2 + z;
 }
 
-A makeA() native { return new A(); }
-B makeB() native { return new B(); }
+A makeA() native;
+B makeB() native;
 
 void setup() native r"""
 function inherits(child, parent) {
diff --git a/tests/compiler/dart2js_native/native_class_with_dart_methods_frog_test.dart b/tests/compiler/dart2js_native/native_class_with_dart_methods_frog_test.dart
index eb9fd25..e2200ba 100644
--- a/tests/compiler/dart2js_native/native_class_with_dart_methods_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_with_dart_methods_frog_test.dart
@@ -18,7 +18,7 @@
   int method(int z) => _field + z;
 }
 
-A makeA() native { return new A(); }
+A makeA() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart b/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart
index 943b063..fe5e1d7 100644
--- a/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart
@@ -14,7 +14,7 @@
   invoke() native;
 }
 
-makeA() native { return new A(); }
+makeA() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart b/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
index aa3c3d6..222894f 100644
--- a/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
@@ -28,10 +28,10 @@
 // Type with exception-throwing methods.
 @Native("A")
 class A {
-  op(int x) native {
-    // Fake body calls constructor to mark the exception class (E) as used.
-    throw new E._used();
-  }
+  // Exception class E is created.
+  @Creates("E")
+  @Returns('int')
+  op(int x) native;
 }
 
 // This class is here just so that a dynamic context is polymorphic.
diff --git a/tests/compiler/dart2js_native/native_field_name_test.dart b/tests/compiler/dart2js_native/native_field_name_test.dart
index 42af8880..8c4c302 100644
--- a/tests/compiler/dart2js_native/native_field_name_test.dart
+++ b/tests/compiler/dart2js_native/native_field_name_test.dart
@@ -44,7 +44,7 @@
 makeA = function(){return new A;};
 """;
 
-A makeA() native { return new A(); }
+A makeA() native;
 
 main() {
   setup();
diff --git a/tests/compiler/dart2js_native/native_library_same_name_used_lib1.dart b/tests/compiler/dart2js_native/native_library_same_name_used_lib1.dart
index d74671c..5046ff7 100644
--- a/tests/compiler/dart2js_native/native_library_same_name_used_lib1.dart
+++ b/tests/compiler/dart2js_native/native_library_same_name_used_lib1.dart
@@ -7,10 +7,11 @@
 library native_library_same_name_used_lib1;
 
 import 'native_library_same_name_used_lib2.dart';
+import 'dart:_foreign_helper' show JS;
 
 abstract class I {
   I read();
   write(I x);
 }
 
-makeI() native { new Impl(); }  // Hint Impl is created by makeI.
+makeI() => JS('creates:Impl; returns:I;', 'makeI()');
diff --git a/tests/compiler/dart2js_native/native_method_with_keyword_name_test.dart b/tests/compiler/dart2js_native/native_method_with_keyword_name_test.dart
index 26ac11b..18c5496 100644
--- a/tests/compiler/dart2js_native/native_method_with_keyword_name_test.dart
+++ b/tests/compiler/dart2js_native/native_method_with_keyword_name_test.dart
@@ -12,7 +12,7 @@
   int delete() native;
 }
 
-A makeA() native { return new A(); }
+A makeA() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_null_closure_frog_test.dart b/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
index 69f9e0c..6ee572e 100644
--- a/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
@@ -17,7 +17,7 @@
   invoke() native;
 }
 
-makeA() native { return new A(); }
+makeA() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_property_frog_test.dart b/tests/compiler/dart2js_native/native_property_frog_test.dart
index 04cca4d..a897596 100644
--- a/tests/compiler/dart2js_native/native_property_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_property_frog_test.dart
@@ -25,7 +25,7 @@
   set Z(int value) { JS('void', '#._z = #', this, value); }
 }
 
-A makeA() native { return new A(); }
+A makeA() native;
 
 void setup() native """
 function A() {}
diff --git a/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart b/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
index 1f529c9..4c0b5f6 100644
--- a/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_use_native_name_in_table_frog_test.dart
@@ -17,8 +17,8 @@
 class B extends A {
 }
 
-A makeA() native { return new A(); }
-B makeB() native { return new B(); }
+A makeA() native;
+B makeB() native;
 
 void setup() native """
 function inherits(child, parent) {
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index 9e3b7aa..3e27f11 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -34,6 +34,39 @@
 
 symbol_test/01: Fail, Pass # bug 11669
 
+# const Symbol('void') should be allowed.
+[ $compiler == dart2analyzer ]
+symbol_reserved_word_test/01: CompileTimeError
+
+# #void should be a valid symbol.
+[ $compiler == none || $compiler == dart2js || $compiler == dart2dart || $compiler == dartanalyzer || $compiler == dart2analyzer ]
+symbol_reserved_word_test/02: CompileTimeError # bug 20191
+
+[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
+symbol_reserved_word_test/02: RuntimeError # bug 20191 / dartium/drt cannot detect CompileTimeErrors
+
+# new Symbol('void') should be allowed.
+[ $compiler == dart2js ]
+symbol_reserved_word_test/03: RuntimeError # bug 19972
+
+# With the exception of 'void', const Symbol() should not accept reserved
+# words.
+[ $compiler == none || $compiler == dart2js || $compiler == dart2dart]
+symbol_reserved_word_test/04: MissingCompileTimeError # bug 11669, 19972
+symbol_reserved_word_test/07: MissingCompileTimeError # bug 11669, 19972
+symbol_reserved_word_test/10: MissingCompileTimeError # bug 11669, 19972
+
+[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
+symbol_reserved_word_test/04: Fail # bug 11669, 19972 / dartium/drt cannot detect CompileTimeErrors
+symbol_reserved_word_test/07: Fail # bug 11669, 19972 / dartium/drt cannot detect CompileTimeErrors
+symbol_reserved_word_test/10: Fail # bug 11669, 19972 / dartium/drt cannot detect CompileTimeErrors
+
+# With the exception of 'void', new Symbol() should not accept reserved words.
+[ $compiler == none || $compiler == dart2dart ]
+symbol_reserved_word_test/06: RuntimeError # bug 11669
+symbol_reserved_word_test/09: RuntimeError # bug 11669
+symbol_reserved_word_test/12: RuntimeError # bug 11669
+
 [ $compiler == none && $runtime != dartium && $runtime != drt && $runtime != ContentShellOnAndroid ]
 symbol_test/02: MissingCompileTimeError # bug 11669
 symbol_test/03: MissingCompileTimeError # bug 11669
diff --git a/tests/corelib/hash_map2_internal_test.dart b/tests/corelib/hash_map2_internal_test.dart
new file mode 100644
index 0000000..73a1c77
--- /dev/null
+++ b/tests/corelib/hash_map2_internal_test.dart
@@ -0,0 +1,293 @@
+// 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.
+
+// This copy of hash_map2_test exercises the internal Map implementation. 
+// VMOptions=--use_internal_hash_map
+
+// Tests of hash map behavior, with focus in iteration and concurrent
+// modification errors.
+
+library hash_map2_test;
+import "package:expect/expect.dart";
+import 'dart:collection';
+
+testMap(Map newMap(), Map newMapFrom(Map map)) {
+  Map gen(int from, int to) {
+    Map map = new LinkedHashMap();
+    for (int i = from; i < to; i++) map[i] = i;
+    return map;
+  }
+
+  bool odd(int n) => (n & 1) == 1;
+  bool even(int n) => (n & 1) == 0;
+  void addAll(Map toMap, Map fromMap) {
+    fromMap.forEach((k, v) { toMap[k] = v; });
+  }
+
+  {  // Test growing to largish capacity.
+    Map map = newMap();
+
+    for (int i = 0; i < 256; i++) {
+      map[i] = i;
+    }
+    addAll(map, gen(256, 512));
+    addAll(map, newMapFrom(gen(512, 1000)));
+    Expect.equals(1000, map.length);
+
+    // Remove half.
+    for (int i = 0; i < 1000; i += 2) map.remove(i);
+    Expect.equals(500, map.length);
+    Expect.isFalse(map.keys.any(even));
+    Expect.isTrue(map.keys.every(odd));
+
+    // Re-add all.
+    addAll(map, gen(0, 1000));
+    Expect.equals(1000, map.length);
+  }
+
+  {  // Test having many deleted elements.
+    Map map = newMap();
+    map[0] = 0;
+    for (int i = 0; i < 1000; i++) {
+      map[i + 1] = i + 1;
+      map.remove(i);
+      Expect.equals(1, map.length);
+    }
+  }
+
+  {  // Test having many elements with same hashCode
+    Map map = newMap();
+    for (int i = 0; i < 1000; i++) {
+      map[new BadHashCode()] = 0;
+    }
+    Expect.equals(1000, map.length);
+  }
+
+  {  // Check concurrent modification
+    Map map = newMap()..[0] = 0..[1] = 1;
+
+    {  // Test adding before a moveNext.
+      Iterator iter = map.keys.iterator;
+      iter.moveNext();
+      map[1] = 9;  // Updating existing key isn't a modification.
+      iter.moveNext();
+      map[2] = 2;
+      Expect.throws(iter.moveNext, (e) => e is Error);
+    }
+
+    {  // Test adding after last element.
+      Iterator iter = map.keys.iterator;
+      Expect.equals(3, map.length);
+      iter.moveNext();
+      iter.moveNext();
+      iter.moveNext();
+      map[3] = 3;
+      Expect.throws(iter.moveNext, (e) => e is Error);
+    }
+
+    {  // Test removing during iteration.
+      Iterator iter = map.keys.iterator;
+      iter.moveNext();
+      map.remove(1000);  // Not a modification if it's not there.
+      iter.moveNext();
+      int n = iter.current;
+      map.remove(n);
+      // Removing doesn't change current.
+      Expect.equals(n, iter.current);
+      Expect.throws(iter.moveNext, (e) => e is Error);
+    }
+
+    {  // Test removing after last element.
+      Iterator iter = map.keys.iterator;
+      Expect.equals(3, map.length);
+      iter.moveNext();
+      iter.moveNext();
+      iter.moveNext();
+      int n = iter.current;
+      map.remove(n);
+      // Removing doesn't change current.
+      Expect.equals(n, iter.current);
+      Expect.throws(iter.moveNext, (e) => e is Error);
+    }
+
+    {  // Test that updating value of existing key doesn't cause concurrent
+       // modification error.
+      Iterator iter = map.keys.iterator;
+      Expect.equals(2, map.length);
+      iter.moveNext();
+      int n = iter.current;
+      map[n] = n * 2;
+      iter.moveNext();
+      Expect.equals(map[iter.current], iter.current);
+    }
+
+    {  // Test that modification during putIfAbsent is not an error.
+      map.putIfAbsent(4, () {
+        map[5] = 5;
+        map[4] = -1;
+        return 4;
+      });
+      Expect.equals(4, map[4]);
+      Expect.equals(5, map[5]);
+    }
+
+    {  // Check adding many existing keys isn't considered modification.
+      Map map2 = newMap();
+      for (var key in map.keys) {
+        map2[key] = map[key] + 1;
+      }
+      Iterator iter = map.keys.iterator;
+      addAll(map, map2);
+      // Shouldn't throw.
+      iter.moveNext();
+    }
+  }
+
+  {  // Regression test for bug in putIfAbsent where adding an element
+     // that make the table grow, can be lost.
+    Map map = newMap();
+    map.putIfAbsent("S", () => 0);
+    map.putIfAbsent("T", () => 0);
+    map.putIfAbsent("U", () => 0);
+    map.putIfAbsent("C", () => 0);
+    map.putIfAbsent("a", () => 0);
+    map.putIfAbsent("b", () => 0);
+    map.putIfAbsent("n", () => 0);
+    Expect.isTrue(map.containsKey("n"));
+  }
+
+  {  // Check that putIfAbsent works just as well as put.
+    Map map = newMap();
+    for (int i = 0; i < 128; i++) {
+      map.putIfAbsent(i, () => i);
+      Expect.isTrue(map.containsKey(i));
+      map.putIfAbsent(i >> 1, () => -1);  // Never triggers.
+    }
+    for (int i = 0; i < 128; i++) {
+      Expect.equals(i, map[i]);
+    }
+  }
+
+  {  // Check that updating existing elements is not a modification.
+     // This must be the case even if the underlying data structure is
+     // nearly full.
+     for (int i = 1; i < 128; i++) {
+        // Create maps of different sizes, some of which should be
+        // at a limit of the underlying data structure.
+        Map map = newMapFrom(gen(0, i));
+
+        // ForEach-iteration.
+        map.forEach((key, v) {
+          Expect.equals(key, map[key]);
+          map[key] = key + 1;
+          map.remove(1000);  // Removing something not there.
+          map.putIfAbsent(key, () => Expect.fail("SHOULD NOT BE ABSENT"));
+          // Doesn't cause ConcurrentModificationError.
+        });
+
+        // for-in iteration.
+        for (int key in map.keys) {
+          Expect.equals(key + 1, map[key]);
+          map[key] = map[key] + 1;
+          map.remove(1000);  // Removing something not there.
+          map.putIfAbsent(key, () => Expect.fail("SHOULD NOT BE ABSENT"));
+          // Doesn't cause ConcurrentModificationError.
+        }
+
+        // Raw iterator.
+        Iterator iter = map.keys.iterator;
+        for (int key = 0; key < i; key++) {
+          Expect.equals(key + 2, map[key]);
+          map[key] = key + 3;
+          map.remove(1000);  // Removing something not there.
+          map.putIfAbsent(key, () => Expect.fail("SHOULD NOT BE ABSENT"));
+          // Doesn't cause ConcurrentModificationError on the moveNext.
+        }
+        iter.moveNext();  // Should not throw.
+
+        // Remove a lot of elements, which can cause a re-tabulation.
+        for (int key = 1; key < i; key++) {
+          Expect.equals(key + 3, map[key]);
+          map.remove(key);
+        }
+        iter = map.keys.iterator;
+        map[0] = 2;
+        iter.moveNext();  // Should not throw.
+     }
+  }
+
+
+  {  // Check that null can be in the map.
+    Map map = newMap();
+    map[null] = 0;
+    Expect.equals(1, map.length);
+    Expect.isTrue(map.containsKey(null));
+    Expect.isNull(map.keys.first);
+    Expect.isNull(map.keys.last);
+    map[null] = 1;
+    Expect.equals(1, map.length);
+    Expect.isTrue(map.containsKey(null));
+    map.remove(null);
+    Expect.isTrue(map.isEmpty);
+    Expect.isFalse(map.containsKey(null));
+
+    // Created using map.from.
+    map = newMapFrom(new Map()..[null] = 0);
+    Expect.equals(1, map.length);
+    Expect.isTrue(map.containsKey(null));
+    Expect.isNull(map.keys.first);
+    Expect.isNull(map.keys.last);
+    map[null] = 1;
+    Expect.equals(1, map.length);
+    Expect.isTrue(map.containsKey(null));
+    map.remove(null);
+    Expect.isTrue(map.isEmpty);
+    Expect.isFalse(map.containsKey(null));
+
+    Map fromMap = new Map();
+    fromMap[1] = 0;
+    fromMap[2] = 0;
+    fromMap[3] = 0;
+    fromMap[null] = 0;
+    fromMap[4] = 0;
+    fromMap[5] = 0;
+    fromMap[6] = 0;
+    Expect.equals(7, fromMap.length);
+
+    // map that grows with null in it.
+    map = newMapFrom(fromMap);
+    Expect.equals(7, map.length);
+    for (int i = 7; i < 128; i++) {
+      map[i] = 0;
+    }
+    Expect.equals(128, map.length);
+    Expect.isTrue(map.containsKey(null));
+    map[null] = 1;
+    Expect.equals(128, map.length);
+    Expect.isTrue(map.containsKey(null));
+    map.remove(null);
+    Expect.equals(127, map.length);
+    Expect.isFalse(map.containsKey(null));
+  }
+}
+
+void main() {
+  Expect.isTrue(new HashMap<int, String>() is Map<int, String>);
+  Expect.isTrue(new LinkedHashMap<int, String>() is Map<int, String>);
+  Expect.isTrue(new HashMap<String, int>.from({}) is Map<String, int>);
+  Expect.isTrue(new LinkedHashMap<String, int>.from({}) is Map<String, int>);
+  Expect.isTrue(<String, int>{} is Map<String, int>);
+  Expect.isTrue(const <String, int>{} is Map<String, int>);
+
+  testMap(() => new HashMap(), (m) => new HashMap.from(m));
+  testMap(() => new LinkedHashMap(), (m) => new LinkedHashMap.from(m));
+}
+
+
+class BadHashCode {
+  static int idCounter = 0;
+  final int id;
+  BadHashCode() : id = idCounter++;
+  int get hashCode => 42;
+}
diff --git a/tests/corelib/hash_map_internal_test.dart b/tests/corelib/hash_map_internal_test.dart
new file mode 100644
index 0000000..8d80012
--- /dev/null
+++ b/tests/corelib/hash_map_internal_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This copy of hash_map_test exercises the internal Map implementation. 
+// VMOptions=--use_internal_hash_map
+
+import "package:expect/expect.dart";
+
+// Test program for the HashMap class.
+
+class HashMapTest {
+
+  static testMain() {
+    var m = new Map();
+    Expect.equals(0, m.length);
+    Expect.equals(true, m.isEmpty);
+    m["one"] = 1;
+    Expect.equals(1, m.length);
+    Expect.equals(false, m.isEmpty);
+    Expect.equals(1, m["one"]);
+  }
+}
+
+main() {
+  HashMapTest.testMain();
+}
diff --git a/tests/corelib/symbol_reserved_word_test.dart b/tests/corelib/symbol_reserved_word_test.dart
new file mode 100644
index 0000000..7a61aab
--- /dev/null
+++ b/tests/corelib/symbol_reserved_word_test.dart
@@ -0,0 +1,124 @@
+// Copyright (c) 2014, 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";
+
+void checkBadSymbol(String s) {
+  Expect.throws(() => new Symbol(s), (e) => e is ArgumentError);
+}
+
+main() {
+  var x;
+
+  // 'void' is allowed as a symbol name.
+  x = const Symbol('void');     /// 01: ok
+  x = #void;                    /// 02: ok
+  x = new Symbol('void');       /// 03: ok
+
+  // However, it is not allowed as a part of a symbol name.
+  x = const Symbol('void.foo'); /// 04: compile-time error
+  x = #void.foo;                /// 05: compile-time error
+  checkBadSymbol('void.foo');   /// 06: ok
+  x = const Symbol('foo.void'); /// 07: compile-time error
+  x = #foo.void;                /// 08: compile-time error
+  checkBadSymbol('foo.void');   /// 09: ok
+
+  // All other reserved words are disallowed.
+  x = const Symbol('assert');   /// 10: compile-time error
+  x = const Symbol('break');    /// 10: continued
+  x = const Symbol('case');     /// 10: continued
+  x = const Symbol('catch');    /// 10: continued
+  x = const Symbol('class');    /// 10: continued
+  x = const Symbol('const');    /// 10: continued
+  x = const Symbol('continue'); /// 10: continued
+  x = const Symbol('default');  /// 10: continued
+  x = const Symbol('do');       /// 10: continued
+  x = const Symbol('else');     /// 10: continued
+  x = const Symbol('enum');     /// 10: continued
+  x = const Symbol('extends');  /// 10: continued
+  x = const Symbol('false');    /// 10: continued
+  x = const Symbol('final');    /// 10: continued
+  x = const Symbol('finally');  /// 10: continued
+  x = const Symbol('for');      /// 10: continued
+  x = const Symbol('if');       /// 10: continued
+  x = const Symbol('in');       /// 10: continued
+  x = const Symbol('is');       /// 10: continued
+  x = const Symbol('new');      /// 10: continued
+  x = const Symbol('null');     /// 10: continued
+  x = const Symbol('rethrow');  /// 10: continued
+  x = const Symbol('return');   /// 10: continued
+  x = const Symbol('super');    /// 10: continued
+  x = const Symbol('switch');   /// 10: continued
+  x = const Symbol('this');     /// 10: continued
+  x = const Symbol('throw');    /// 10: continued
+  x = const Symbol('true');     /// 10: continued
+  x = const Symbol('try');      /// 10: continued
+  x = const Symbol('var');      /// 10: continued
+  x = const Symbol('while');    /// 10: continued
+  x = const Symbol('with');     /// 10: continued
+  x = #assert;                  /// 11: compile-time error
+  x = #break;                   /// 11: continued
+  x = #case;                    /// 11: continued
+  x = #catch;                   /// 11: continued
+  x = #class;                   /// 11: continued
+  x = #const;                   /// 11: continued
+  x = #continue;                /// 11: continued
+  x = #default;                 /// 11: continued
+  x = #do;                      /// 11: continued
+  x = #else;                    /// 11: continued
+  x = #enum;                    /// 11: continued
+  x = #extends;                 /// 11: continued
+  x = #false;                   /// 11: continued
+  x = #final;                   /// 11: continued
+  x = #finally;                 /// 11: continued
+  x = #for;                     /// 11: continued
+  x = #if;                      /// 11: continued
+  x = #in;                      /// 11: continued
+  x = #is;                      /// 11: continued
+  x = #new;                     /// 11: continued
+  x = #null;                    /// 11: continued
+  x = #rethrow;                 /// 11: continued
+  x = #return;                  /// 11: continued
+  x = #super;                   /// 11: continued
+  x = #switch;                  /// 11: continued
+  x = #this;                    /// 11: continued
+  x = #throw;                   /// 11: continued
+  x = #true;                    /// 11: continued
+  x = #try;                     /// 11: continued
+  x = #var;                     /// 11: continued
+  x = #while;                   /// 11: continued
+  x = #with;                    /// 11: continued
+  checkBadSymbol('assert');     /// 12: ok
+  checkBadSymbol('break');      /// 12: continued
+  checkBadSymbol('case');       /// 12: continued
+  checkBadSymbol('catch');      /// 12: continued
+  checkBadSymbol('class');      /// 12: continued
+  checkBadSymbol('const');      /// 12: continued
+  checkBadSymbol('continue');   /// 12: continued
+  checkBadSymbol('default');    /// 12: continued
+  checkBadSymbol('do');         /// 12: continued
+  checkBadSymbol('else');       /// 12: continued
+  checkBadSymbol('enum');       /// 12: continued
+  checkBadSymbol('extends');    /// 12: continued
+  checkBadSymbol('false');      /// 12: continued
+  checkBadSymbol('final');      /// 12: continued
+  checkBadSymbol('finally');    /// 12: continued
+  checkBadSymbol('for');        /// 12: continued
+  checkBadSymbol('if');         /// 12: continued
+  checkBadSymbol('in');         /// 12: continued
+  checkBadSymbol('is');         /// 12: continued
+  checkBadSymbol('new');        /// 12: continued
+  checkBadSymbol('null');       /// 12: continued
+  checkBadSymbol('rethrow');    /// 12: continued
+  checkBadSymbol('return');     /// 12: continued
+  checkBadSymbol('super');      /// 12: continued
+  checkBadSymbol('switch');     /// 12: continued
+  checkBadSymbol('this');       /// 12: continued
+  checkBadSymbol('throw');      /// 12: continued
+  checkBadSymbol('true');       /// 12: continued
+  checkBadSymbol('try');        /// 12: continued
+  checkBadSymbol('var');        /// 12: continued
+  checkBadSymbol('while');      /// 12: continued
+  checkBadSymbol('with');       /// 12: continued
+}
diff --git a/tests/html/cross_domain_iframe_script.html b/tests/html/cross_domain_iframe_script.html
new file mode 100644
index 0000000..9b8ce84
--- /dev/null
+++ b/tests/html/cross_domain_iframe_script.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+
+<html>
+  <head>
+  	<meta charset="utf-8">
+    <title>cross_domain_iframe_script</title>
+  </head>
+
+  <body>
+    <script type="application/javascript"
+            src="/root_dart/tests/html/cross_domain_iframe_script.js">
+    </script>
+  </body>
+</html>
diff --git a/tests/html/cross_domain_iframe_script.js b/tests/html/cross_domain_iframe_script.js
new file mode 100644
index 0000000..9dcdc75
--- /dev/null
+++ b/tests/html/cross_domain_iframe_script.js
@@ -0,0 +1 @@
+window.parent.postMessage('foobar', '*');
\ No newline at end of file
diff --git a/tests/html/cross_domain_iframe_test.dart b/tests/html/cross_domain_iframe_test.dart
new file mode 100644
index 0000000..0a234f8
--- /dev/null
+++ b/tests/html/cross_domain_iframe_test.dart
@@ -0,0 +1,29 @@
+// 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 'dart:html';
+
+import 'package:unittest/unittest.dart';
+
+main() {
+  test('cross_domain_iframe', () {
+    var uri = Uri.parse(window.location.href);
+
+    var crossOriginPort = int.parse(uri.queryParameters['crossOriginPort']);
+    var crossOrigin = '${uri.scheme}://${uri.host}:$crossOriginPort';
+    var crossOriginUrl =
+        '$crossOrigin/root_dart/tests/html/cross_domain_iframe_script.html';
+
+    var iframe = new IFrameElement();
+    iframe.src = crossOriginUrl;
+    document.body.append(iframe);
+
+    window.onMessage.where((MessageEvent event) {
+      return event.origin == crossOrigin;
+    }).first.then(expectAsync((MessageEvent event) {
+      expect(event.data, equals('foobar'));
+      expect(event.source, isNotNull);
+    }));
+  });
+}
diff --git a/tests/html/html.status b/tests/html/html.status
index 1036688..bf8def6 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -405,7 +405,6 @@
 element_types_test/supported_embed: Fail
 element_types_test/supported_keygen: Fail
 element_types_test/supported_object: Fail
-element_types_test/supported_track: Fail
 fileapi_test/supported: Fail
 indexeddb_1_test/supportsDatabaseNames: Fail
 input_element_test/supported_date: Fail
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 687e9ab..dd021be 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -49,7 +49,6 @@
 mirrors/initializing_formals_test/03: CompileTimeError # Issue 12164
 mirrors/instance_members_test: RuntimeError # Issue 14633
 mirrors/instantiate_abstract_class_test: RuntimeError # Issue 6490
-mirrors/invoke_test: RuntimeError # Issue 11954
 mirrors/invoke_call_on_closure_test: RuntimeError # 6490
 mirrors/invoke_call_through_getter_test/named: RuntimeError # Issue 12863. When updating the status, remove the "///" in the test.
 mirrors/invoke_call_through_getter_previously_accessed_test/named: RuntimeError # Issue 12863. When updating the status, remove the "///" in the test.
@@ -58,7 +57,6 @@
 mirrors/invoke_named_test/none: RuntimeError # Issue 12863
 mirrors/invoke_private_test: CompileTimeError # Issue 12164
 mirrors/invoke_private_wrong_library_test: CompileTimeError # Issue 12164
-mirrors/invoke_throws_test: RuntimeError # Issue 11954
 mirrors/library_declarations_test/none: RuntimeError # Issue 13439, Issue 13733
 mirrors/library_exports_shown_test: RuntimeError # Issue 6490
 mirrors/library_exports_hidden_test: RuntimeError # Issue 6490
@@ -109,7 +107,6 @@
 mirrors/type_variable_owner_test/01: RuntimeError # Issue 12785
 mirrors/variable_is_const_test/none: RuntimeError # Issue 14671
 mirrors/variable_is_const_test/01: MissingCompileTimeError # Issue 5519
-mirrors/list_constructor_test/01: RuntimeError # Issue 13523
 mirrors/raw_type_test/01: RuntimeError # http://dartbug.com/6490
 mirrors/mirrors_reader_test: Slow, RuntimeError # Issue 16589
 
@@ -117,7 +114,8 @@
 typed_data/setRange_2_test: Fail # Safari doesn't fully implement spec for TypedArray.set
 typed_data/setRange_3_test: Fail # Safari doesn't fully implement spec for TypedArray.set
 typed_data/setRange_4_test: Fail # Safari doesn't fully implement spec for TypedArray.set
-typed_data/int32x4_test: Fail # Safari has an optimization bug (nightlies are already fine).
+typed_data/int32x4_test: Fail, Pass # Safari has an optimization bug (nightlies are already fine).
+typed_data/float32x4_test: Fail, Pass # Safari has an optimization bug (nightlies are already fine).
 mirrors/null_test: Fail # http://dartbug.com/16831
 convert/json_test: Fail # https://bugs.webkit.org/show_bug.cgi?id=134920
 
@@ -179,6 +177,7 @@
 
 [ $compiler == dart2js && $checked ]
 convert/utf85_test: Pass, Slow # Issue 12029.
+mirrors/list_constructor_test/01: RuntimeError # Issue 19635.
 
 [ $compiler == dart2js ]
 convert/chunked_conversion_utf88_test: Slow, Pass
@@ -323,7 +322,7 @@
 convert/utf85_test: Skip # Pass, Slow Issue 20111.
 
 # These tests use "const Symbol('void')".
-[ $compiler == dartanalyzer || $compiler == dart2analyzer ]
+[ $compiler == dart2analyzer ]
 mirrors/basic_types_in_dart_core_test: CompileTimeError
 mirrors/function_type_mirror_test: CompileTimeError
 mirrors/method_mirror_returntype_test: CompileTimeError
diff --git a/tests/lib/mirrors/new_instance_optional_arguments_test.dart b/tests/lib/mirrors/new_instance_optional_arguments_test.dart
new file mode 100644
index 0000000..61fe800
--- /dev/null
+++ b/tests/lib/mirrors/new_instance_optional_arguments_test.dart
@@ -0,0 +1,115 @@
+// Copyright (c) 2014, 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 mirror_test;
+
+@MirrorsUsed(targets: "mirror_test")
+import 'dart:mirrors';
+
+import 'package:expect/expect.dart';
+
+class A {
+  var req1, opt1, opt2;
+  A.a0([opt1]) : this.opt1 = opt1;
+  A.b0([opt1, opt2]) : this.opt1 = opt1, this.opt2 = opt2;
+  A.c0([opt1 = 499]) : this.opt1 = opt1;
+  A.d0([opt1 = 499, opt2 = 42]) : this.opt1 = opt1, this.opt2 = opt2;
+  A.a1(req1, [opt1]) : this.req1 = req1, this.opt1 = opt1;
+  A.b1(req1, [opt1, opt2])
+      : this.req1 = req1, this.opt1 = opt1, this.opt2 = opt2;
+  A.c1(req1, [opt1 = 499]) : this.req1 = req1, this.opt1 = opt1;
+  A.d1(req1, [opt1 = 499, opt2 = 42])
+      : this.req1 = req1, this.opt1 = opt1, this.opt2 = opt2;
+}
+
+main() {
+  ClassMirror cm = reflectClass(A);
+
+  var o;
+  o = cm.newInstance(#a0, []).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(null, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#b0, []).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(null, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#c0, []).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(499, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#d0, []).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(499, o.opt1);
+  Expect.equals(42, o.opt2);
+
+  o = cm.newInstance(#a0, [77]).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#b0, [77]).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#c0, [77]).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#d0, [77]).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(42, o.opt2);
+
+  o = cm.newInstance(#b0, [77, 11]).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(11, o.opt2);
+  o = cm.newInstance(#d0, [77, 11]).reflectee;
+  Expect.equals(null, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(11, o.opt2);
+
+  o = cm.newInstance(#a1, [123]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(null, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#b1, [123]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(null, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#c1, [123]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(499, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#d1, [123]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(499, o.opt1);
+  Expect.equals(42, o.opt2);
+
+  o = cm.newInstance(#a1, [123, 77]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#b1, [123, 77]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#c1, [123, 77]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(null, o.opt2);
+  o = cm.newInstance(#d1, [123, 77]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(42, o.opt2);
+
+  o = cm.newInstance(#b1, [123, 77, 11]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(11, o.opt2);
+  o = cm.newInstance(#d1, [123, 77, 11]).reflectee;
+  Expect.equals(123, o.req1);
+  Expect.equals(77, o.opt1);
+  Expect.equals(11, o.opt2);
+}
diff --git a/tests/standalone/int_list_test.dart b/tests/standalone/int_list_test.dart
new file mode 100644
index 0000000..c3510ff
--- /dev/null
+++ b/tests/standalone/int_list_test.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// Dart Mint representations and type propagation issue.
+// Testing Int32List and Uint32List loads.
+//
+// VMOptions=--optimization-counter-threshold=5 --no-use-osr
+
+import 'dart:typed_data';
+import "package:expect/expect.dart";
+
+main() {
+  var a = new Uint32List(100);
+  a[2] = 3;
+  var res = sumIt1(a, 2);
+  Expect.equals(3 * 10, res);
+  res = sumIt1(a, 2);
+  Expect.equals(3 * 10, res);
+  a = new Int32List(100);
+  a[2] = 3;
+  res = sumIt2(a, 2);
+  Expect.equals(3 * 10, res);
+  res = sumIt2(a, 2);
+  Expect.equals(3 * 10, res);
+}
+
+sumIt1(Uint32List a, int n) {
+  var sum = 0;
+  for (int i = 0; i < 10; i++) {
+    sum += a[n];
+  }
+  return sum;
+}
+
+sumIt2(Int32List a, int n) {
+  var sum = 0;
+  for (int i = 0; i < 10; i++) {
+    sum += a[n];
+  }
+  return sum;
+}
diff --git a/tests/standalone/issue14236_test.dart b/tests/standalone/issue14236_test.dart
index ea088c9..f52c05a 100644
--- a/tests/standalone/issue14236_test.dart
+++ b/tests/standalone/issue14236_test.dart
Binary files differ
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 3e81112..9311794 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -13,6 +13,9 @@
 
 javascript_compatibility_errors_test/none: Fail, OK  # Not possible to exclude or annotate with '/// none:'
 
+[ $runtime == vm && ($arch == simarm || $arch == ia32) && $mode == debug]
+int_list_test: Crash # Issue 20190
+
 [ $runtime == vm ]
 package/package_isolate_test: Fail # Issue 12474
 
diff --git a/tools/VERSION b/tools/VERSION
index 9934d77..3fb57ac 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 1
 MINOR 6
 PATCH 0
-PRERELEASE 5
-PRERELEASE_PATCH 1
+PRERELEASE 6
+PRERELEASE_PATCH 0
diff --git a/tools/android_link.py b/tools/android_link.py
index a00030c..9f4ef7b 100755
--- a/tools/android_link.py
+++ b/tools/android_link.py
@@ -11,7 +11,6 @@
                [linker args]
 """
 
-import optparse
 import os
 import subprocess
 import sys
@@ -69,7 +68,7 @@
     sys.exit(0)
 
   # Set up path to the Android NDK.
-  CheckDirExists(THIRD_PARTY_ROOT, 'third party tools');
+  CheckDirExists(THIRD_PARTY_ROOT, 'third party tools')
   android_tools = os.path.join(THIRD_PARTY_ROOT, 'android_tools')
   CheckDirExists(android_tools, 'Android tools')
   android_ndk_root = os.path.join(android_tools, 'ndk')
diff --git a/tools/archive_crash.py b/tools/archive_crash.py
index ce2fe02..e7e290b 100755
--- a/tools/archive_crash.py
+++ b/tools/archive_crash.py
@@ -19,19 +19,19 @@
 
 GCS_FOLDER = 'dart-crashes'
 
-def CreateTarball(dir, tarname):
-  print 'Creating tar file: %s' % (tarname)
+def CreateTarball(input_dir, tarname):
+  print 'Creating tar file: %s' % tarname
   tar = tarfile.open(tarname, mode='w:gz')
-  tar.add(dir)
+  tar.add(input_dir)
   tar.close()
 
 def CopyToGCS(filename):
   gs_location = 'gs://%s/%s/' % (GCS_FOLDER, uuid.uuid4())
   cmd = ['gsutil', 'cp', filename, gs_location]
-  print 'Running command: %s' % (cmd)
+  print 'Running command: %s' % cmd
   subprocess.check_call(cmd)
   archived_filename = '%s%s' % (gs_location, filename.split('/').pop())
-  print 'Dump now available in %s' % (archived_filename) 
+  print 'Dump now available in %s' % archived_filename
 
 def Main():
   if utils.GuessOS() != 'linux':
@@ -41,7 +41,7 @@
   num_dumps = 0
   for v in os.listdir('/tmp'):
     if v.startswith('coredump'):
-      fullpath = '/tmp/%s' % (v)
+      fullpath = '/tmp/%s' % v
       if os.path.isdir(fullpath):
         num_dumps += 1
         tarname = '%s.tar.gz' % fullpath
@@ -49,7 +49,7 @@
         CopyToGCS(tarname)
         os.unlink(tarname)
         shutil.rmtree(fullpath)
-  print 'Found %s core dumps' % (num_dumps)
+  print 'Found %s core dumps' % num_dumps
 
 if __name__ == '__main__':
   sys.exit(Main())
diff --git a/tools/bots/functional_testing.py b/tools/bots/functional_testing.py
index 80756f6..327281f 100644
--- a/tools/bots/functional_testing.py
+++ b/tools/bots/functional_testing.py
@@ -78,7 +78,7 @@
       return
     else:
       builddir = os.path.join(bot_utils.DART_DIR,
-                              utils.GetBuildDir(HOST_OS, HOST_OS),
+                              utils.GetBuildDir(HOST_OS),
                               'functional_testing')
       shutil.rmtree(builddir, ignore_errors=True)
       os.makedirs(builddir)
@@ -90,6 +90,6 @@
     FTMaster(config)
   else:
     FTSlave(config)
-  
+
 if __name__ == '__main__':
   bot.RunBot(SrcConfig, FTSteps, build_step=None)
diff --git a/tools/bots/linux_distribution_support.py b/tools/bots/linux_distribution_support.py
index ee97f61..6717b95 100644
--- a/tools/bots/linux_distribution_support.py
+++ b/tools/bots/linux_distribution_support.py
@@ -99,7 +99,7 @@
 
   version = utils.GetVersion()
   builddir = os.path.join(bot_utils.DART_DIR,
-                          utils.GetBuildDir(HOST_OS, HOST_OS),
+                          utils.GetBuildDir(HOST_OS),
                           'src_and_installation')
 
   if not os.path.exists(builddir):
diff --git a/tools/build.py b/tools/build.py
index 81c9ca4..2b2ab88 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -8,7 +8,6 @@
 import optparse
 import os
 import re
-import shutil
 import subprocess
 import sys
 import time
@@ -70,10 +69,10 @@
   return result
 
 
-def ProcessOsOption(os):
-  if os == 'host':
+def ProcessOsOption(os_name):
+  if os_name == 'host':
     return HOST_OS
-  return os
+  return os_name
 
 
 def ProcessOptions(options, args):
@@ -96,26 +95,26 @@
     if not arch in archs:
       print "Unknown arch %s" % arch
       return False
-  options.os = [ProcessOsOption(os) for os in options.os]
-  for os in options.os:
-    if not os in ['android', 'freebsd', 'linux', 'macos', 'win32']:
-      print "Unknown os %s" % os
+  options.os = [ProcessOsOption(os_name) for os_name in options.os]
+  for os_name in options.os:
+    if not os_name in ['android', 'freebsd', 'linux', 'macos', 'win32']:
+      print "Unknown os %s" % os_name
       return False
-    if os != HOST_OS:
-      if os != 'android':
-        print "Unsupported target os %s" % os
+    if os_name != HOST_OS:
+      if os_name != 'android':
+        print "Unsupported target os %s" % os_name
         return False
       if not HOST_OS in ['linux']:
         print ("Cross-compilation to %s is not supported on host os %s."
-               % (os, HOST_OS))
+               % (os_name, HOST_OS))
         return False
       if not arch in ['ia32', 'arm', 'mips']:
         print ("Cross-compilation to %s is not supported for architecture %s."
-               % (os, arch))
+               % (os_name, arch))
         return False
       # We have not yet tweaked the v8 dart build to work with the Android
       # NDK/SDK, so don't try to build it.
-      if args == []:
+      if not args:
         print "For android builds you must specify a target, such as 'runtime'."
         return False
   return True
@@ -146,7 +145,6 @@
 
   return None
 
-
 def SetTools(arch, target_os, options):
   toolsOverride = None
 
@@ -185,7 +183,7 @@
     raise Exception('Unsupported target architecture %s' % target_arch)
 
   # Set up path to the Android NDK.
-  CheckDirExists(THIRD_PARTY_ROOT, 'third party tools');
+  CheckDirExists(THIRD_PARTY_ROOT, 'third party tools')
   android_tools = os.path.join(THIRD_PARTY_ROOT, 'android_tools')
   CheckDirExists(android_tools, 'Android tools')
   android_ndk_root = os.path.join(android_tools, 'ndk')
@@ -242,9 +240,9 @@
 
   """
 
-  def is_empty_chunk(chunk):
+  def is_empty_chunk(input):
     empty_chunk = ['', 'Check dependencies', '']
-    return not chunk or (len(chunk) == 4 and chunk[1:] == empty_chunk)
+    return not input or (len(input) == 4 and input[1:] == empty_chunk)
 
   def unbuffered(callable):
     # Use iter to disable buffering in for-in.
@@ -322,7 +320,7 @@
 
   # Display a notification if build time exceeded DART_BUILD_NOTIFICATION_DELAY.
   notification_delay = float(
-    os.getenv('DART_BUILD_NOTIFICATION_DELAY', default=sys.float_info.max))
+    os.getenv('DART_BUILD_NOTIFICATION_DELAY', sys.float_info.max))
   if (time.time() - start) < notification_delay:
     return
 
@@ -426,7 +424,7 @@
             'BUILDTYPE=' + build_config,
             ]
     if target_os != HOST_OS:
-      args += ['builddir_name=' + utils.GetBuildDir(HOST_OS, target_os)]
+      args += ['builddir_name=' + utils.GetBuildDir(HOST_OS)]
     if options.verbose:
       args += ['V=1']
 
@@ -534,7 +532,8 @@
             if BuildCrossSdk(options, target_os, mode, arch) != 0:
               return 1
           else:
-            if BuildOneConfig(options, target, target_os, mode, arch, cross_build) != 0:
+            if BuildOneConfig(options, target, target_os,
+                              mode, arch, cross_build) != 0:
               return 1
 
   return 0
diff --git a/tools/compile_java/compile_java.py b/tools/compile_java/compile_java.py
index bc35bf1..d33b430 100644
--- a/tools/compile_java/compile_java.py
+++ b/tools/compile_java/compile_java.py
@@ -2,7 +2,7 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-# This python script compiles a set of java files and puts them all into a 
+# This python script compiles a set of java files and puts them all into a
 # single .jar file.
 
 import os
@@ -13,7 +13,7 @@
 
 # Filters out all arguments until the next '--' argument
 # occurs.
-def ListArgCallback(option, opt_str, value, parser):
+def ListArgCallback(option, value, parser):
    if value is None:
      value = []
 
@@ -45,7 +45,7 @@
   javaFilesTempFile = os.fdopen(tempFileDescriptor, "w")
   try:
     if srcDirectories:
-      def findJavaFiles(arg, dirName, names):
+      def findJavaFiles(dirName, names):
         for fileName in names:
           (base, ext) = os.path.splitext(fileName)
           if ext == '.java':
@@ -63,11 +63,9 @@
     javaFilesTempFile.close()
 
     # Prepare javac command.
-    command = [javac]
-
     # Use a large enough heap to be able to compile all of the classes in one
     # big compilation step.
-    command.append('-J-Xmx256m')
+    command = [javac, '-J-Xmx256m']
 
     if buildConfig == 'Debug':
       command.append('-g')
@@ -102,16 +100,16 @@
     os.remove(javaFilesTempFileName)
 
 def copyProperties(propertyFiles, classOutputDir):
-  for file in propertyFiles:
-    if not os.path.isfile(file):
-      sys.stderr.write('property file not found: ' + file + '\n')
+  for property_file in propertyFiles:
+    if not os.path.isfile(property_file):
+      sys.stderr.write('property file not found: ' + property_file + '\n')
       return False
 
   if not os.path.exists(classOutputDir):
     sys.stderr.write('classes dir not found: ' + classOutputDir + '\n')
     return False
 
-  if propertyFiles == []:
+  if not propertyFiles:
     return True
 
   command = ['cp'] + propertyFiles + [classOutputDir]
@@ -136,7 +134,7 @@
   return True
 
 
-def main(args):
+def main():
   try:
     # Parse input.
     parser = OptionParser()
@@ -180,7 +178,7 @@
       sys.stderr.write('--jarFileName not specified\n')
       return -1
     if len(options.sourceDirs) > 0 and options.sourceList:
-      sys.stderr.write("--sourceDir and --sourceList cannot be both specified");
+      sys.stderr.write("--sourceDir and --sourceList cannot be both specified")
       return -1
 
     # Compile and put into .jar file.
@@ -201,4 +199,4 @@
     return -1
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv))
+  sys.exit(main())
diff --git a/tools/compiler_scripts/generate_source_list.py b/tools/compiler_scripts/generate_source_list.py
index d0dfa5b..2966d40 100644
--- a/tools/compiler_scripts/generate_source_list.py
+++ b/tools/compiler_scripts/generate_source_list.py
@@ -94,7 +94,7 @@
   def generate(self):
     self._list_files()
 
-    file_name = self.output + '.gypi';
+    file_name = self.output + '.gypi'
     gypi = self._make_output(file_name)
     gypi.write("{\n  'variables': {\n")
     self._print_gypi_files(gypi, self.name + '_sources', self.sources)
@@ -110,7 +110,7 @@
     ant.write("</project>\n")
     self._close(file_name, ant)
 
-    file_name = self.output + '.txt';
+    file_name = self.output + '.txt'
     txt = self._make_output(file_name)
     self._print_txt_files(txt, self.sources)
     self._close(file_name, txt)
diff --git a/tools/copy_dart.py b/tools/copy_dart.py
index 6bd5725..5bd464c 100755
--- a/tools/copy_dart.py
+++ b/tools/copy_dart.py
@@ -6,10 +6,9 @@
 
 import fileinput
 import sys
-import shutil
 import os
 import re
-from os.path import abspath, basename, dirname, exists, isabs, join
+from os.path import basename, dirname, exists, isabs, join
 from glob import glob
 
 re_directive = re.compile(
@@ -76,7 +75,7 @@
 
 def main(outdir = None, *inputs):
   if not outdir or not inputs:
-    print "Usage: %s OUTDIR INPUTS" % args[0]
+    print "Usage: %s OUTDIR INPUTS" % sys.argv[0]
     print "  OUTDIR is the war directory to copy to"
     print "  INPUTS is a list of files or patterns used to specify the input"
     print "   .dart files"
@@ -124,7 +123,7 @@
         else:
           f.write("library %s;\n\n" % basename(lib))
         for importfile in library.imports:
-          f.write("import %s;\n" % (importfile))
+          f.write("import %s;\n" % importfile)
         f.write('%s' % (''.join(library.code)))
         mergefiles([normjoin(dirname(lib), s) for s in library.sources], f)
 
@@ -132,7 +131,7 @@
         m = re.match(r'[\'"]([^\'"]+)[\'"](\s+as\s+\w+)?.*$', suffix)
         uri = m.group(1)
         if not uri.startswith('dart:'):
-          worklist.append(normjoin(dirname(lib), uri));
+          worklist.append(normjoin(dirname(lib), uri))
 
   return 0
 
diff --git a/tools/create_debian_packages.py b/tools/create_debian_packages.py
index 3b344c6..1c754c4 100755
--- a/tools/create_debian_packages.py
+++ b/tools/create_debian_packages.py
@@ -10,12 +10,10 @@
 # binary packages.
 
 import optparse
-import platform
 import sys
 import tarfile
 import subprocess
 import utils
-import os
 from os.path import join, exists, abspath
 from shutil import copyfile
 
@@ -67,17 +65,17 @@
 
     # Build source package.
     print "Building source package"
-    RunBuildPackage(['-S', '-us', '-uc'], join(temp_dir, tarroot));
+    RunBuildPackage(['-S', '-us', '-uc'], join(temp_dir, tarroot))
 
     # Build 32-bit binary package.
-    if ('ia32' in arch):
+    if 'ia32' in arch:
       print "Building i386 package"
-      RunBuildPackage(['-B', '-ai386', '-us', '-uc'], join(temp_dir, tarroot));
+      RunBuildPackage(['-B', '-ai386', '-us', '-uc'], join(temp_dir, tarroot))
 
     # Build 64-bit binary package.
-    if ('x64' in arch):
+    if 'x64' in arch:
       print "Building amd64 package"
-      RunBuildPackage(['-B', '-aamd64', '-us', '-uc'], join(temp_dir, tarroot));
+      RunBuildPackage(['-B', '-aamd64', '-us', '-uc'], join(temp_dir, tarroot))
 
     # Copy the Debian package files to the build directory.
     debbase = 'dart_%s' % version
@@ -95,10 +93,10 @@
 
     for name in source_package:
       copyfile(join(temp_dir, name), join(out_dir, name))
-    if ('ia32' in arch):
+    if 'ia32' in arch:
       for name in i386_package:
         copyfile(join(temp_dir, name), join(out_dir, name))
-    if ('x64' in arch):
+    if 'x64' in arch:
       for name in amd64_package:
         copyfile(join(temp_dir, name), join(out_dir, name))
 
@@ -115,11 +113,11 @@
   arch = options.arch.split(',')
 
   if not options.out_dir:
-    out_dir = join(DART_DIR, utils.GetBuildDir(HOST_OS, HOST_OS))
+    out_dir = join(DART_DIR, utils.GetBuildDir(HOST_OS))
 
   if not tar_filename:
     tar_filename = join(DART_DIR,
-                        utils.GetBuildDir(HOST_OS, HOST_OS),
+                        utils.GetBuildDir(HOST_OS),
                         'dart-%s.tar.gz' % utils.GetVersion())
 
   BuildDebianPackage(tar_filename, out_dir, arch)
diff --git a/tools/create_editor.py b/tools/create_editor.py
index f5c890a..74fa133 100644
--- a/tools/create_editor.py
+++ b/tools/create_editor.py
@@ -84,7 +84,7 @@
   # Add -d64 to give better error messages to user in 64 bit mode.
   lines[lines.index('-vmargs\n')] = '-vmargs\n-d64\n'
   f = open(iniFilePath, 'w')
-  f.writelines(lines);
+  f.writelines(lines)
   f.close()
 
 
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index 620e572..20b98f3 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -48,19 +48,19 @@
 # ......(more will come here)
 
 
-import glob
 import optparse
 import os
 import re
 import sys
 import subprocess
-import tempfile
+
 import utils
 
+
 HOST_OS = utils.GuessOS()
 
 # TODO(dgrove): Only import modules following Google style guide.
-from os.path import basename, dirname, join, realpath, exists, isdir
+from os.path import basename, dirname, join, realpath, exists
 
 # TODO(dgrove): Only import modules following Google style guide.
 from shutil import copyfile, copymode, copytree, ignore_patterns, rmtree, move
@@ -76,8 +76,8 @@
 
 
 def ReplaceInFiles(paths, subs):
-  '''Reads a series of files, applies a series of substitutions to each, and
-     saves them back out. subs should by a list of (pattern, replace) tuples.'''
+  """Reads a series of files, applies a series of substitutions to each, and
+     saves them back out. subs should by a list of (pattern, replace) tuples."""
   for path in paths:
     contents = open(path).read()
     for pattern, replace in subs:
@@ -94,8 +94,8 @@
 
 
 def CopyShellScript(src_file, dest_dir):
-  '''Copies a shell/batch script to the given destination directory. Handles
-     using the appropriate platform-specific file extension.'''
+  """Copies a shell/batch script to the given destination directory. Handles
+     using the appropriate platform-specific file extension."""
   file_extension = ''
   if HOST_OS == 'win32':
     file_extension = '.bat'
@@ -119,7 +119,7 @@
              join(sdk_root, 'bin', 'snapshots', snapshot))
 
 
-def Main(argv):
+def Main():
   # Pull in all of the gypi files which will be munged into the sdk.
   HOME = dirname(dirname(realpath(__file__)))
 
@@ -258,4 +258,4 @@
   move(SDK_tmp, SDK)
 
 if __name__ == '__main__':
-  sys.exit(Main(sys.argv))
+  sys.exit(Main())
diff --git a/tools/create_tarball.py b/tools/create_tarball.py
index 1604ef7..66479dd 100755
--- a/tools/create_tarball.py
+++ b/tools/create_tarball.py
@@ -25,10 +25,11 @@
 import optparse
 import sys
 import tarfile
+from os import listdir
+from os.path import join, split, abspath
+
 import utils
 
-from os import listdir, makedirs
-from os.path import join, exists, split, dirname, abspath
 
 HOST_OS = utils.GuessOS()
 DART_DIR = abspath(join(__file__, '..', '..'))
@@ -115,7 +116,7 @@
   debian_dir = 'tools/linux_dist_support/debian'
   # Don't include the build directory in the tarball (ignored paths
   # are relative to DART_DIR).
-  builddir = utils.GetBuildDir(HOST_OS, HOST_OS)
+  builddir = utils.GetBuildDir(HOST_OS)
   ignoredPaths.append(builddir)
 
   print 'Creating tarball: %s' % tarfilename
@@ -128,9 +129,9 @@
 
     with utils.TempDir() as temp_dir:
       # Generate and add debian/copyright
-      copyright = join(temp_dir, 'copyright')
-      GenerateCopyright(copyright)
-      tar.add(copyright, arcname='%s/debian/copyright' % versiondir)
+      copyright_file = join(temp_dir, 'copyright')
+      GenerateCopyright(copyright_file)
+      tar.add(copyright_file, arcname='%s/debian/copyright' % versiondir)
 
       # Generate and add debian/changelog
       change_log = join(temp_dir, 'changelog')
@@ -158,7 +159,7 @@
   tar_filename = options.tar_filename
   if not tar_filename:
     tar_filename = join(DART_DIR,
-                        utils.GetBuildDir(HOST_OS, HOST_OS),
+                        utils.GetBuildDir(HOST_OS),
                         'dart-%s.tar.gz' % utils.GetVersion())
 
   CreateTarball(tar_filename)
diff --git a/tools/create_windows_installer.py b/tools/create_windows_installer.py
index 04df575..64fe994 100644
--- a/tools/create_windows_installer.py
+++ b/tools/create_windows_installer.py
@@ -1,392 +1,391 @@
-#!/usr/bin/env python

-#

-# 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.

-

-# A script to generate a windows installer for the editor bundle.

-# As input the script takes a zip file, a version and the location

-# to store the resulting msi file in.

-#

-# Usage: ./tools/create_windows_installer.py --version <version>

-#            --zip_file_location <zip_file> --msi_location <output>

-#            [--wix_bin <wix_bin_location>]

-#            [--print_wxs]

-#

-# This script assumes that wix is either in path or passed in as --wix_bin.

-# You can get wix from http://wixtoolset.org/.

-

-import optparse

-import os

-import shutil

-import subprocess

-import sys

-import utils

-import zipfile

-

-# This should _never_ change, please don't change this value.

-UPGRADE_CODE = '7bacdc33-2e76-4f36-a206-ea58220c0b44'

-

-# The content of the xml

-xml_content = []

-

-# The components we want to add to our feature.

-feature_components = []

-

-# Indentation level, each level is indented 2 spaces

-current_indentation = 0

-

-def GetOptions():

-  options = optparse.OptionParser(usage='usage: %prog [options]')

-  options.add_option("--zip_file_location",

-      help='Where the zip file including the editor is located.')

-  options.add_option("--input_directory",

-      help='Directory where all the files needed is located.')

-  options.add_option("--msi_location",

-      help='Where to store the resulting msi.')

-  options.add_option("--version",

-      help='The version specified as Major.Minor.Build.Patch.')

-  options.add_option("--wix_bin",

-      help='The location of the wix binary files.')

-  options.add_option("--print_wxs", action="store_true", dest="print_wxs",

-                    default=False,

-                    help="Prints the generated wxs to stdout.")

-  (options, args) = options.parse_args()

-  if len(args) > 0:

-    raise Exception("This script takes no arguments, only options")

-  ValidateOptions(options)

-  return options

-

-def ValidateOptions(options):

-  if not options.version:

-    raise Exception('You must supply a version')

-  if options.zip_file_location and options.input_directory:

-    raise Exception('Please pass either zip_file_location or input_directory')

-  if not options.zip_file_location and not options.input_directory:

-    raise Exception('Please pass either zip_file_location or input_directory')

-  if (options.zip_file_location and

-      not os.path.isfile(options.zip_file_location)):

-    raise Exception('Passed in zip file not found')

-  if (options.input_directory and

-      not os.path.isdir(options.input_directory)):

-    raise Exception('Passed in directory not found')

-

-def GetInputDirectory(options, temp_dir):

-  if options.zip_file_location:

-    ExtractZipFile(options.zip_file_location, temp_dir)

-    return os.path.join(temp_dir, 'dart')

-  return options.input_directory

-

-# We combine the build and patch into a single entry since

-# the windows installer does _not_ consider a change in Patch

-# to require a new install.

-# In addition to that, the limits on the size are:

-# Major: 256

-# Minor: 256

-# Patch: 65536

-# To circumvent this we create the version like this:

-#   Major.Minor.X

-# from "major.minor.patch-prerelease.prerelease_patch"

-# where X is "patch<<10 + prerelease<<5 + prerelease_patch"

-# Example version 1.2.4-dev.2.3 will go to 1.2.4163

-def GetMicrosoftProductVersion(version):

-  version_parts = version.split('.')

-  if len(version_parts) is not 5:

-    raise Exception(

-      "Version string (%s) does not follow specification" % version)

-  (major, minor, patch, prerelease, prerelease_patch) = map(int, version_parts)

-

-  if major > 255 or minor > 255:

-    raise Exception('Major/Minor can not be above 256')

-  if patch > 63:

-    raise Exception('Patch can not be above 63')

-  if prerelease > 31:

-    raise Exception('Prerelease can not be above 31')

-  if prerelease_patch > 31:

-    raise Exception('PrereleasePatch can not be above 31')

-

-  combined = (patch << 10) + (prerelease << 5) + prerelease_patch

-  return '%s.%s.%s' % (major, minor, combined)

-

-# Append using the current indentation level

-def Append(data, new_line=True):

-  str = (('  ' * current_indentation) +

-         data +

-         ('\n' if new_line else ''))

-  xml_content.append(str)

-

-# Append without any indentation at the current position

-def AppendRaw(data, new_line=True):

-  xml_content.append(data + ('\n' if new_line else ''))

-

-def AppendComment(comment):

-  Append('<!--%s-->' % comment)

-

-def AppendBlankLine():

-  Append('')

-

-def GetContent():

-  return ''.join(xml_content)

-

-def XmlHeader():

-  Append('<?xml version="1.0" encoding="UTF-8"?>')

-

-def TagIndent(str, indentation_string):

-  return ' ' * len(indentation_string) + str

-

-def IncreaseIndentation():

-  global current_indentation

-  current_indentation += 1

-

-def DecreaseIndentation():

-  global current_indentation

-  current_indentation -= 1

-

-class WixAndProduct(object):

-  def __init__(self, version):

-    self.version = version

-    self.product_name = 'Dart Editor'

-    self.manufacturer = 'Google Inc.'

-    self.upgrade_code = UPGRADE_CODE

-

-  def __enter__(self):

-    self.start_wix()

-    self.start_product()

-

-  def __exit__(self, *_):

-    self.close_product()

-    self.close_wix()

-

-  def get_product_id(self):

-    # This needs to change on every install to guarantee that

-    # we get a full uninstall + reinstall

-    # We let wix choose. If we need to do patch releases later on

-    # we need to retain the value over several installs.

-    return '*'

-

-  def start_product(self):

-    product = '<Product '

-    Append(product, new_line=False)

-    AppendRaw('Id="%s"' % self.get_product_id())

-    Append(TagIndent('Version="%s"' % self.version, product))

-    Append(TagIndent('Name="%s"' % self.product_name, product))

-    Append(TagIndent('UpgradeCode="%s"' % self.upgrade_code,

-                     product))

-    Append(TagIndent('Language="1033"', product))

-    Append(TagIndent('Manufacturer="%s"' % self.manufacturer,

-                     product),

-           new_line=False)

-    AppendRaw('>')

-    IncreaseIndentation()

-

-  def close_product(self):

-    DecreaseIndentation()

-    Append('</Product>')

-

-  def start_wix(self):

-    Append('<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">')

-    IncreaseIndentation()

-

-  def close_wix(self):

-    DecreaseIndentation()

-    Append('</Wix>')

-

-class Directory(object):

-  def __init__(self, id, name=None):

-    self.id = id

-    self.name = name

-

-  def __enter__(self):

-    directory = '<Directory '

-    Append(directory, new_line=False)

-    AppendRaw('Id="%s"' % self.id, new_line=self.name is not None)

-    if self.name:

-      Append(TagIndent('Name="%s"' % self.name, directory), new_line=False)

-    AppendRaw('>')

-    IncreaseIndentation()

-

-  def __exit__(self, *_):

-    DecreaseIndentation()

-    Append('</Directory>')

-

-class Component(object):

-  def __init__(self, id):

-    self.id = 'CMP_%s' % id

-

-  def __enter__(self):

-    component = '<Component '

-    Append(component, new_line=False)

-    AppendRaw('Id="%s"' % self.id)

-    Append(TagIndent('Guid="*">', component))

-    IncreaseIndentation()

-

-  def __exit__(self, *_):

-    DecreaseIndentation()

-    Append('</Component>')

-    feature_components.append(self.id)

-

-class Feature(object):

-  def __enter__(self):

-    feature = '<Feature '

-    Append(feature, new_line=False)

-    AppendRaw('Id="MainFeature"')

-    Append(TagIndent('Title="Dart Editor"', feature))

-    # Install by default

-    Append(TagIndent('Level="1">', feature))

-    IncreaseIndentation()

-

-  def __exit__(self, *_):

-    DecreaseIndentation()

-    Append('</Feature>')

-

-def Package():

-  package = '<Package '

-  Append(package, new_line=False)

-  AppendRaw('InstallerVersion="301"')

-  Append(TagIndent('Compressed="yes" />', package))

-

-def MediaTemplate():

-  Append('<MediaTemplate EmbedCab="yes" />')

-

-def File(name, id):

-  file = '<File '

-  Append(file, new_line=False)

-  AppendRaw('Id="FILE_%s"' % id)

-  Append(TagIndent('Source="%s"' % name, file))

-  Append(TagIndent('KeyPath="yes" />', file))

-

-def Shortcut(id, name, ref):

-  shortcut = '<Shortcut '

-  Append(shortcut, new_line=False)

-  AppendRaw('Id="%s"' % id)

-  Append(TagIndent('Name="%s"' % name, shortcut))

-  Append(TagIndent('Target="%s" />' % ref, shortcut))

-

-def RemoveFolder(id):

-  remove = '<RemoveFolder '

-  Append(remove, new_line=False)

-  AppendRaw('Id="%s"' % id)

-  Append(TagIndent('On="uninstall" />', remove))

-

-def RegistryEntry(location):

-  registry = '<RegistryValue '

-  Append(registry, new_line=False)

-  AppendRaw('Root="HKCU"')

-  Append(TagIndent('Key="Software\\Microsoft\\%s"' % location, registry))

-  Append(TagIndent('Name="installed"', registry))

-  Append(TagIndent('Type="integer"', registry))

-  Append(TagIndent('Value="1"', registry))

-  Append(TagIndent('KeyPath="yes" />', registry))

-

-

-def MajorUpgrade():

-  upgrade = '<MajorUpgrade '

-  Append(upgrade, new_line=False)

-  down_message = 'You already have a never version installed.'

-  AppendRaw('DowngradeErrorMessage="%s" />' % down_message)

-

-

-# This is a very simplistic id generation.

-# Unfortunately there is no easy way to generate good names,

-# since there is a 72 character limit, and we have way longer

-# paths. We don't really have an issue with files and ids across

-# releases since we do full installs.

-counter = 0

-def FileToId(name):

-  global counter

-  counter += 1

-  return '%s' % counter

-

-def ListFiles(path):

-  for entry in os.listdir(path):

-    full_path = os.path.join(path, entry)

-    id = FileToId(full_path)

-    if os.path.isdir(full_path):

-      with Directory('DIR_%s' % id, entry):

-        ListFiles(full_path)

-    elif os.path.isfile(full_path):

-      # We assume 1 file per component, a File is always a KeyPath.

-      # A KeyPath on a file makes sure that we can always repair and

-      # remove that file in a consistent manner. A component

-      # can only have one child with a KeyPath.

-      with Component(id):

-        File(full_path, id)

-

-def ComponentRefs():

-  for component in feature_components:

-    Append('<ComponentRef Id="%s" />' % component)

-

-def ExtractZipFile(zip, temp_dir):

-  print 'Extracting files'

-  f = zipfile.ZipFile(zip)

-  f.extractall(temp_dir)

-  f.close()

-

-def GenerateInstaller(wxs_content, options, temp_dir):

-  wxs_file = os.path.join(temp_dir, 'installer.wxs')

-  wixobj_file = os.path.join(temp_dir, 'installer.wixobj')

-  print 'Saving wxs output to: %s' % wxs_file

-  with open(wxs_file, 'w') as f:

-    f.write(wxs_content)

-

-  candle_bin = 'candle.exe'

-  light_bin = 'light.exe'

-  if options.wix_bin:

-    candle_bin = os.path.join(options.wix_bin, 'candle.exe')

-    light_bin = os.path.join(options.wix_bin, 'light.exe')

-  print 'Calling candle on %s' % wxs_file

-  subprocess.check_call('%s %s -o %s' % (candle_bin, wxs_file,

-                                         wixobj_file))

-  print 'Calling light on %s' % wixobj_file

-  subprocess.check_call('%s %s -o %s' % (light_bin, wixobj_file,

-                                         options.msi_location))

-  print 'Created msi file to %s' % options.msi_location

-

-

-def Main(argv):

-  if sys.platform != 'win32':

-    raise Exception("This script can only be run on windows")

-  options = GetOptions()

-  version = GetMicrosoftProductVersion(options.version)

-  with utils.TempDir('installer') as temp_dir:

-    input_location = GetInputDirectory(options, temp_dir)

-    print "Generating wix XML"

-    XmlHeader()

-    with WixAndProduct(version):

-      AppendBlankLine()

-      Package()

-      MediaTemplate()

-      AppendComment('We always do a major upgrade, at least for now')

-      MajorUpgrade()

-

-      AppendComment('Directory structure')

-      with Directory('TARGETDIR', 'SourceDir'):

-        with Directory('ProgramFilesFolder'):

-          with Directory('RootInstallDir', 'Dart Editor'):

-            AppendComment("Add all files and directories")

-            print 'Installing files and directories in xml'

-            ListFiles(input_location)

-        AppendBlankLine()

-        AppendComment("Create shortcuts")

-        with Directory('ProgramMenuFolder'):

-          with Directory('ShortcutFolder', 'Dart Editor'):

-            with Component('shortcut'):

-              # When generating a shortcut we need an entry with

-              # a KeyPath (RegistryEntry) below - to be able to remove

-              # the shortcut again. The RemoveFolder tag is needed

-              # to clean up everything

-              Shortcut('editor_shortcut', 'Dart Editor',

-                       '[RootInstallDir]DartEditor.exe')

-              RemoveFolder('RemoveShortcuts')

-              RegistryEntry('DartEditor')

-      with Feature():

-        # We have only one feature and that consist of all the

-        # files=components we have listed above"

-        ComponentRefs()

-    xml = GetContent()

-    if options.print_wxs:

-      print xml

-    GenerateInstaller(xml, options, temp_dir)

-

-if __name__ == '__main__':

-  sys.exit(Main(sys.argv))

+#!/usr/bin/env python
+#
+# Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# A script to generate a windows installer for the editor bundle.
+# As input the script takes a zip file, a version and the location
+# to store the resulting msi file in.
+#
+# Usage: ./tools/create_windows_installer.py --version <version>
+#            --zip_file_location <zip_file> --msi_location <output>
+#            [--wix_bin <wix_bin_location>]
+#            [--print_wxs]
+#
+# This script assumes that wix is either in path or passed in as --wix_bin.
+# You can get wix from http://wixtoolset.org/.
+
+import optparse
+import os
+import subprocess
+import sys
+import utils
+import zipfile
+
+# This should _never_ change, please don't change this value.
+UPGRADE_CODE = '7bacdc33-2e76-4f36-a206-ea58220c0b44'
+
+# The content of the xml
+xml_content = []
+
+# The components we want to add to our feature.
+feature_components = []
+
+# Indentation level, each level is indented 2 spaces
+current_indentation = 0
+
+def GetOptions():
+  options = optparse.OptionParser(usage='usage: %prog [options]')
+  options.add_option("--zip_file_location",
+      help='Where the zip file including the editor is located.')
+  options.add_option("--input_directory",
+      help='Directory where all the files needed is located.')
+  options.add_option("--msi_location",
+      help='Where to store the resulting msi.')
+  options.add_option("--version",
+      help='The version specified as Major.Minor.Build.Patch.')
+  options.add_option("--wix_bin",
+      help='The location of the wix binary files.')
+  options.add_option("--print_wxs", action="store_true", dest="print_wxs",
+                    default=False,
+                    help="Prints the generated wxs to stdout.")
+  (options, args) = options.parse_args()
+  if len(args) > 0:
+    raise Exception("This script takes no arguments, only options")
+  ValidateOptions(options)
+  return options
+
+def ValidateOptions(options):
+  if not options.version:
+    raise Exception('You must supply a version')
+  if options.zip_file_location and options.input_directory:
+    raise Exception('Please pass either zip_file_location or input_directory')
+  if not options.zip_file_location and not options.input_directory:
+    raise Exception('Please pass either zip_file_location or input_directory')
+  if (options.zip_file_location and
+      not os.path.isfile(options.zip_file_location)):
+    raise Exception('Passed in zip file not found')
+  if (options.input_directory and
+      not os.path.isdir(options.input_directory)):
+    raise Exception('Passed in directory not found')
+
+def GetInputDirectory(options, temp_dir):
+  if options.zip_file_location:
+    ExtractZipFile(options.zip_file_location, temp_dir)
+    return os.path.join(temp_dir, 'dart')
+  return options.input_directory
+
+# We combine the build and patch into a single entry since
+# the windows installer does _not_ consider a change in Patch
+# to require a new install.
+# In addition to that, the limits on the size are:
+# Major: 256
+# Minor: 256
+# Patch: 65536
+# To circumvent this we create the version like this:
+#   Major.Minor.X
+# from "major.minor.patch-prerelease.prerelease_patch"
+# where X is "patch<<10 + prerelease<<5 + prerelease_patch"
+# Example version 1.2.4-dev.2.3 will go to 1.2.4163
+def GetMicrosoftProductVersion(version):
+  version_parts = version.split('.')
+  if len(version_parts) is not 5:
+    raise Exception(
+      "Version string (%s) does not follow specification" % version)
+  (major, minor, patch, prerelease, prerelease_patch) = map(int, version_parts)
+
+  if major > 255 or minor > 255:
+    raise Exception('Major/Minor can not be above 256')
+  if patch > 63:
+    raise Exception('Patch can not be above 63')
+  if prerelease > 31:
+    raise Exception('Prerelease can not be above 31')
+  if prerelease_patch > 31:
+    raise Exception('PrereleasePatch can not be above 31')
+
+  combined = (patch << 10) + (prerelease << 5) + prerelease_patch
+  return '%s.%s.%s' % (major, minor, combined)
+
+# Append using the current indentation level
+def Append(data, new_line=True):
+  str = (('  ' * current_indentation) +
+         data +
+         ('\n' if new_line else ''))
+  xml_content.append(str)
+
+# Append without any indentation at the current position
+def AppendRaw(data, new_line=True):
+  xml_content.append(data + ('\n' if new_line else ''))
+
+def AppendComment(comment):
+  Append('<!--%s-->' % comment)
+
+def AppendBlankLine():
+  Append('')
+
+def GetContent():
+  return ''.join(xml_content)
+
+def XmlHeader():
+  Append('<?xml version="1.0" encoding="UTF-8"?>')
+
+def TagIndent(str, indentation_string):
+  return ' ' * len(indentation_string) + str
+
+def IncreaseIndentation():
+  global current_indentation
+  current_indentation += 1
+
+def DecreaseIndentation():
+  global current_indentation
+  current_indentation -= 1
+
+class WixAndProduct(object):
+  def __init__(self, version):
+    self.version = version
+    self.product_name = 'Dart Editor'
+    self.manufacturer = 'Google Inc.'
+    self.upgrade_code = UPGRADE_CODE
+
+  def __enter__(self):
+    self.start_wix()
+    self.start_product()
+
+  def __exit__(self, *_):
+    self.close_product()
+    self.close_wix()
+
+  def get_product_id(self):
+    # This needs to change on every install to guarantee that
+    # we get a full uninstall + reinstall
+    # We let wix choose. If we need to do patch releases later on
+    # we need to retain the value over several installs.
+    return '*'
+
+  def start_product(self):
+    product = '<Product '
+    Append(product, new_line=False)
+    AppendRaw('Id="%s"' % self.get_product_id())
+    Append(TagIndent('Version="%s"' % self.version, product))
+    Append(TagIndent('Name="%s"' % self.product_name, product))
+    Append(TagIndent('UpgradeCode="%s"' % self.upgrade_code,
+                     product))
+    Append(TagIndent('Language="1033"', product))
+    Append(TagIndent('Manufacturer="%s"' % self.manufacturer,
+                     product),
+           new_line=False)
+    AppendRaw('>')
+    IncreaseIndentation()
+
+  def close_product(self):
+    DecreaseIndentation()
+    Append('</Product>')
+
+  def start_wix(self):
+    Append('<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">')
+    IncreaseIndentation()
+
+  def close_wix(self):
+    DecreaseIndentation()
+    Append('</Wix>')
+
+class Directory(object):
+  def __init__(self, id, name=None):
+    self.id = id
+    self.name = name
+
+  def __enter__(self):
+    directory = '<Directory '
+    Append(directory, new_line=False)
+    AppendRaw('Id="%s"' % self.id, new_line=self.name is not None)
+    if self.name:
+      Append(TagIndent('Name="%s"' % self.name, directory), new_line=False)
+    AppendRaw('>')
+    IncreaseIndentation()
+
+  def __exit__(self, *_):
+    DecreaseIndentation()
+    Append('</Directory>')
+
+class Component(object):
+  def __init__(self, id):
+    self.id = 'CMP_%s' % id
+
+  def __enter__(self):
+    component = '<Component '
+    Append(component, new_line=False)
+    AppendRaw('Id="%s"' % self.id)
+    Append(TagIndent('Guid="*">', component))
+    IncreaseIndentation()
+
+  def __exit__(self, *_):
+    DecreaseIndentation()
+    Append('</Component>')
+    feature_components.append(self.id)
+
+class Feature(object):
+  def __enter__(self):
+    feature = '<Feature '
+    Append(feature, new_line=False)
+    AppendRaw('Id="MainFeature"')
+    Append(TagIndent('Title="Dart Editor"', feature))
+    # Install by default
+    Append(TagIndent('Level="1">', feature))
+    IncreaseIndentation()
+
+  def __exit__(self, *_):
+    DecreaseIndentation()
+    Append('</Feature>')
+
+def Package():
+  package = '<Package '
+  Append(package, new_line=False)
+  AppendRaw('InstallerVersion="301"')
+  Append(TagIndent('Compressed="yes" />', package))
+
+def MediaTemplate():
+  Append('<MediaTemplate EmbedCab="yes" />')
+
+def File(name, id):
+  file = '<File '
+  Append(file, new_line=False)
+  AppendRaw('Id="FILE_%s"' % id)
+  Append(TagIndent('Source="%s"' % name, file))
+  Append(TagIndent('KeyPath="yes" />', file))
+
+def Shortcut(id, name, ref):
+  shortcut = '<Shortcut '
+  Append(shortcut, new_line=False)
+  AppendRaw('Id="%s"' % id)
+  Append(TagIndent('Name="%s"' % name, shortcut))
+  Append(TagIndent('Target="%s" />' % ref, shortcut))
+
+def RemoveFolder(id):
+  remove = '<RemoveFolder '
+  Append(remove, new_line=False)
+  AppendRaw('Id="%s"' % id)
+  Append(TagIndent('On="uninstall" />', remove))
+
+def RegistryEntry(location):
+  registry = '<RegistryValue '
+  Append(registry, new_line=False)
+  AppendRaw('Root="HKCU"')
+  Append(TagIndent('Key="Software\\Microsoft\\%s"' % location, registry))
+  Append(TagIndent('Name="installed"', registry))
+  Append(TagIndent('Type="integer"', registry))
+  Append(TagIndent('Value="1"', registry))
+  Append(TagIndent('KeyPath="yes" />', registry))
+
+
+def MajorUpgrade():
+  upgrade = '<MajorUpgrade '
+  Append(upgrade, new_line=False)
+  down_message = 'You already have a never version installed.'
+  AppendRaw('DowngradeErrorMessage="%s" />' % down_message)
+
+
+# This is a very simplistic id generation.
+# Unfortunately there is no easy way to generate good names,
+# since there is a 72 character limit, and we have way longer
+# paths. We don't really have an issue with files and ids across
+# releases since we do full installs.
+counter = 0
+def FileToId(name):
+  global counter
+  counter += 1
+  return '%s' % counter
+
+def ListFiles(path):
+  for entry in os.listdir(path):
+    full_path = os.path.join(path, entry)
+    id = FileToId(full_path)
+    if os.path.isdir(full_path):
+      with Directory('DIR_%s' % id, entry):
+        ListFiles(full_path)
+    elif os.path.isfile(full_path):
+      # We assume 1 file per component, a File is always a KeyPath.
+      # A KeyPath on a file makes sure that we can always repair and
+      # remove that file in a consistent manner. A component
+      # can only have one child with a KeyPath.
+      with Component(id):
+        File(full_path, id)
+
+def ComponentRefs():
+  for component in feature_components:
+    Append('<ComponentRef Id="%s" />' % component)
+
+def ExtractZipFile(zip, temp_dir):
+  print 'Extracting files'
+  f = zipfile.ZipFile(zip)
+  f.extractall(temp_dir)
+  f.close()
+
+def GenerateInstaller(wxs_content, options, temp_dir):
+  wxs_file = os.path.join(temp_dir, 'installer.wxs')
+  wixobj_file = os.path.join(temp_dir, 'installer.wixobj')
+  print 'Saving wxs output to: %s' % wxs_file
+  with open(wxs_file, 'w') as f:
+    f.write(wxs_content)
+
+  candle_bin = 'candle.exe'
+  light_bin = 'light.exe'
+  if options.wix_bin:
+    candle_bin = os.path.join(options.wix_bin, 'candle.exe')
+    light_bin = os.path.join(options.wix_bin, 'light.exe')
+  print 'Calling candle on %s' % wxs_file
+  subprocess.check_call('%s %s -o %s' % (candle_bin, wxs_file,
+                                         wixobj_file))
+  print 'Calling light on %s' % wixobj_file
+  subprocess.check_call('%s %s -o %s' % (light_bin, wixobj_file,
+                                         options.msi_location))
+  print 'Created msi file to %s' % options.msi_location
+
+
+def Main(argv):
+  if sys.platform != 'win32':
+    raise Exception("This script can only be run on windows")
+  options = GetOptions()
+  version = GetMicrosoftProductVersion(options.version)
+  with utils.TempDir('installer') as temp_dir:
+    input_location = GetInputDirectory(options, temp_dir)
+    print "Generating wix XML"
+    XmlHeader()
+    with WixAndProduct(version):
+      AppendBlankLine()
+      Package()
+      MediaTemplate()
+      AppendComment('We always do a major upgrade, at least for now')
+      MajorUpgrade()
+
+      AppendComment('Directory structure')
+      with Directory('TARGETDIR', 'SourceDir'):
+        with Directory('ProgramFilesFolder'):
+          with Directory('RootInstallDir', 'Dart Editor'):
+            AppendComment("Add all files and directories")
+            print 'Installing files and directories in xml'
+            ListFiles(input_location)
+        AppendBlankLine()
+        AppendComment("Create shortcuts")
+        with Directory('ProgramMenuFolder'):
+          with Directory('ShortcutFolder', 'Dart Editor'):
+            with Component('shortcut'):
+              # When generating a shortcut we need an entry with
+              # a KeyPath (RegistryEntry) below - to be able to remove
+              # the shortcut again. The RemoveFolder tag is needed
+              # to clean up everything
+              Shortcut('editor_shortcut', 'Dart Editor',
+                       '[RootInstallDir]DartEditor.exe')
+              RemoveFolder('RemoveShortcuts')
+              RegistryEntry('DartEditor')
+      with Feature():
+        # We have only one feature, and it consists of all the
+        # files=components we have listed above"
+        ComponentRefs()
+    xml = GetContent()
+    if options.print_wxs:
+      print xml
+    GenerateInstaller(xml, options, temp_dir)
+
+if __name__ == '__main__':
+  sys.exit(Main(sys.argv))
diff --git a/tools/dom/scripts/dartdomgenerator.py b/tools/dom/scripts/dartdomgenerator.py
index e57e678..d9e1837 100755
--- a/tools/dom/scripts/dartdomgenerator.py
+++ b/tools/dom/scripts/dartdomgenerator.py
@@ -200,7 +200,7 @@
   systems = options.systems.split(',')
 
   output_dir = options.output_dir or os.path.join(
-      current_dir, '..', '..', utils.GetBuildDir(utils.GuessOS(), None),
+      current_dir, '..', '..', utils.GetBuildDir(utils.GuessOS()),
       'generated')
 
   dart2js_output_dir = None
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index c5fb8a0..556c2d4 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -679,7 +679,7 @@
 
   def NativeSpec(self):
     native_spec = MakeNativeSpec(self._interface.javascript_binding_name)
-    return ' native "%s"' % native_spec
+    return '@Native("%s")\n' % native_spec
 
   def ImplementationTemplate(self):
     template_file = ('impl_%s.darttemplate' %
diff --git a/tools/dom/src/dart2js_Conversions.dart b/tools/dom/src/dart2js_Conversions.dart
index 41b624e..e56d389 100644
--- a/tools/dom/src/dart2js_Conversions.dart
+++ b/tools/dom/src/dart2js_Conversions.dart
@@ -20,10 +20,10 @@
   if (e == null) {
     return null;
   }
-  // Assume it's a Window if it contains the setInterval property.  It may be
+  // Assume it's a Window if it contains the postMessage property.  It may be
   // from a different frame - without a patched prototype - so we cannot
   // rely on Dart type checking.
-  if (JS('bool', r'"setInterval" in #', e)) {
+  if (JS('bool', r'"postMessage" in #', e)) {
     var window = _DOMWindowCrossFrame._createSafe(e);
     // If it's a native window.
     if (window is EventTarget) {
diff --git a/tools/dom/templates/dart2js_impl.darttemplate b/tools/dom/templates/dart2js_impl.darttemplate
index 938f2a9..fb30e0b 100644
--- a/tools/dom/templates/dart2js_impl.darttemplate
+++ b/tools/dom/templates/dart2js_impl.darttemplate
@@ -5,5 +5,5 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS {
 $!MEMBERS}
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index d5d4f86..a8ef59f 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -51,7 +51,7 @@
 import 'dart:web_sql';
 import 'dart:_js_helper' show
     convertDartClosureToJS, Creates, JavaScriptIndexingBehavior,
-    JSName, Null, Returns,
+    JSName, Native, Null, Returns,
     findDispatchTagForInterceptorClass, setNativeSubclassDispatchRecord,
     makeLeafDispatchRecord;
 import 'dart:_interceptors' show
@@ -116,7 +116,8 @@
 
 // Workaround for tags like <cite> that lack their own Element subclass --
 // Dart issue 1990.
-class HtmlElement extends Element native "HTMLElement" {
+@Native("HTMLElement")
+class HtmlElement extends Element {
   factory HtmlElement() { throw new UnsupportedError("Not supported"); }
 
   /**
@@ -130,7 +131,8 @@
 // EntryArray type was removed, so explicitly adding it to allow support for
 // older Chrome versions.
 // Issue #12573.
-abstract class _EntryArray implements List<Entry> native "EntryArray" {}
+@Native("EntryArray")
+abstract class _EntryArray implements List<Entry> {}
 
 /**
  * Spawn a DOM isolate using the given URI in the same window.
diff --git a/tools/dom/templates/html/dart2js/impl_AudioBufferSourceNode.darttemplate b/tools/dom/templates/html/dart2js/impl_AudioBufferSourceNode.darttemplate
index 4ea4878..7773f8f 100644
--- a/tools/dom/templates/html/dart2js/impl_AudioBufferSourceNode.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_AudioBufferSourceNode.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   // TODO(efortuna): Remove these methods when Chrome stable also uses start
   // instead of noteOn.
diff --git a/tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate b/tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate
index 2f1edac..c1c7292 100644
--- a/tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_KeyboardEvent.darttemplate
@@ -12,7 +12,7 @@
  *
  * * [KeyboardEvent](https://developer.mozilla.org/en/DOM/KeyboardEvent) at MDN.
  */
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   /** 
    * Programmatically create a KeyboardEvent. 
diff --git a/tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate b/tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate
index 28da4bb..80ecea1 100644
--- a/tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_MouseEvent.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
       {Window view, int detail: 0, int screenX: 0, int screenY: 0,
       int clientX: 0, int clientY: 0, int button: 0, bool canBubble: true,
diff --git a/tools/dom/templates/html/dart2js/impl_RTCIceCandidate.darttemplate b/tools/dom/templates/html/dart2js/impl_RTCIceCandidate.darttemplate
index b6a33d6..06b5456 100644
--- a/tools/dom/templates/html/dart2js/impl_RTCIceCandidate.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_RTCIceCandidate.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(Map dictionary) {
     // TODO(efortuna): Remove this check if when you can actually construct with
     // the unprefixed RTCIceCandidate in Firefox (currently both are defined,
diff --git a/tools/dom/templates/html/dart2js/impl_RTCSessionDescription.darttemplate b/tools/dom/templates/html/dart2js/impl_RTCSessionDescription.darttemplate
index 9592eb5..9ca8ceb 100644
--- a/tools/dom/templates/html/dart2js/impl_RTCSessionDescription.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_RTCSessionDescription.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(Map dictionary) {
     // TODO(efortuna): Remove this check if when you can actually construct with
     // the unprefixed RTCIceCandidate in Firefox (currently both are defined,
diff --git a/tools/dom/templates/html/dart2js/impl_SpeechRecognition.darttemplate b/tools/dom/templates/html/dart2js/impl_SpeechRecognition.darttemplate
index 4ca8626..23e9af7 100644
--- a/tools/dom/templates/html/dart2js/impl_SpeechRecognition.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_SpeechRecognition.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
   factory SpeechRecognition() {
     return JS('SpeechRecognition',
diff --git a/tools/dom/templates/html/dart2js/impl_URL.darttemplate b/tools/dom/templates/html/dart2js/impl_URL.darttemplate
index 569da56..d8c8a75 100644
--- a/tools/dom/templates/html/dart2js/impl_URL.darttemplate
+++ b/tools/dom/templates/html/dart2js/impl_URL.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   static String createObjectUrl(blob_OR_source_OR_stream) =>
       JS('String',
diff --git a/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate b/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
index 4b90d8b..43a18e5 100644
--- a/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
@@ -85,7 +85,7 @@
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, Returns, JSName, Null;
+import 'dart:_js_helper' show Creates, Returns, JSName, Native, Null;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 
diff --git a/tools/dom/templates/html/dart2js/svg_dart2js.darttemplate b/tools/dom/templates/html/dart2js/svg_dart2js.darttemplate
index 3e4e168..7fc18ae 100644
--- a/tools/dom/templates/html/dart2js/svg_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/svg_dart2js.darttemplate
@@ -17,7 +17,7 @@
 import 'dart:_internal' hide deprecated;
 import 'dart:html';
 import 'dart:html_common';
-import 'dart:_js_helper' show Creates, Returns, JSName;
+import 'dart:_js_helper' show Creates, Returns, JSName, Native;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor;
 
diff --git a/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
index 3cc0897..5aef22c 100644
--- a/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
@@ -14,7 +14,7 @@
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, JSName, Returns, convertDartClosureToJS;
+import 'dart:_js_helper' show Creates, JSName, Native, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor;
 
diff --git a/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
index 804f0bc..107c1f6 100644
--- a/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
@@ -13,7 +13,7 @@
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, JSName, Null, Returns, convertDartClosureToJS;
+import 'dart:_js_helper' show Creates, JSName, Native, Null, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 
diff --git a/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
index c6c9bcf..4555e4d 100644
--- a/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
@@ -19,7 +19,7 @@
 import 'dart:_internal' hide deprecated;
 import 'dart:html';
 import 'dart:html_common';
-import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName;
+import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName, Native;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor;
 
diff --git a/tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate b/tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate
index 6ab8501..a18fb29 100644
--- a/tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate
+++ b/tools/dom/templates/html/dartium/impl_KeyboardEvent.darttemplate
@@ -4,7 +4,7 @@
 part of $LIBRARYNAME;
 
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   factory $CLASSNAME(String type,
       {Window view, bool canBubble: true, bool cancelable: true,
diff --git a/tools/dom/templates/html/dartium/impl_MouseEvent.darttemplate b/tools/dom/templates/html/dartium/impl_MouseEvent.darttemplate
index a1a3862..02bc4fb 100644
--- a/tools/dom/templates/html/dartium/impl_MouseEvent.darttemplate
+++ b/tools/dom/templates/html/dartium/impl_MouseEvent.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
       {Window view, int detail: 0, int screenX: 0, int screenY: 0,
       int clientX: 0, int clientY: 0, int button: 0, bool canBubble: true,
diff --git a/tools/dom/templates/html/impl/impl_AbstractWorker.darttemplate b/tools/dom/templates/html/impl/impl_AbstractWorker.darttemplate
index e23390d..d019184 100644
--- a/tools/dom/templates/html/impl/impl_AbstractWorker.darttemplate
+++ b/tools/dom/templates/html/impl/impl_AbstractWorker.darttemplate
@@ -5,5 +5,5 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)abstract class $CLASSNAME$EXTENDS$MIXINS implements EventTarget$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)abstract class $CLASSNAME$EXTENDS$MIXINS implements EventTarget {
 $!MEMBERS}
diff --git a/tools/dom/templates/html/impl/impl_AudioContext.darttemplate b/tools/dom/templates/html/impl/impl_AudioContext.darttemplate
index 1d0f91e..603c643 100644
--- a/tools/dom/templates/html/impl/impl_AudioContext.darttemplate
+++ b/tools/dom/templates/html/impl/impl_AudioContext.darttemplate
@@ -4,7 +4,7 @@
 
 part of web_audio;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 $if DART2JS
   factory AudioContext() => JS('AudioContext',
diff --git a/tools/dom/templates/html/impl/impl_AudioNode.darttemplate b/tools/dom/templates/html/impl/impl_AudioNode.darttemplate
index e61a6f4..43db4b3 100644
--- a/tools/dom/templates/html/impl/impl_AudioNode.darttemplate
+++ b/tools/dom/templates/html/impl/impl_AudioNode.darttemplate
@@ -4,7 +4,7 @@
 
 part of web_audio;
 
-$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
   @DomName('AudioNode.connect')
   void connectNode(AudioNode destination, [int output = 0, int input = 0]) =>
diff --git a/tools/dom/templates/html/impl/impl_Blob.darttemplate b/tools/dom/templates/html/impl/impl_Blob.darttemplate
index c77cdb0..3542811 100644
--- a/tools/dom/templates/html/impl/impl_Blob.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Blob.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 $if DART2JS
   factory Blob(List blobParts, [String type, String endings]) {
@@ -27,4 +27,3 @@
   static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); }
 $endif
 }
-
diff --git a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
index c7d1075..046591b 100644
--- a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
@@ -4,8 +4,8 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS) class $CLASSNAME $EXTENDS with 
-    $(CLASSNAME)Base $IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS) class $CLASSNAME $EXTENDS with 
+    $(CLASSNAME)Base $IMPLEMENTS {
   factory $CLASSNAME() => new CssStyleDeclaration.css('');
 
   factory $CLASSNAME.css(String css) {
diff --git a/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate b/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
index a5964c0..1068fdc 100644
--- a/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 
   /**
@@ -355,4 +355,3 @@
   @deprecated
   double get backingStorePixelRatio => 1.0;
 }
-
diff --git a/tools/dom/templates/html/impl/impl_ClientRect.darttemplate b/tools/dom/templates/html/impl/impl_ClientRect.darttemplate
index 0c31179..22f115e 100644
--- a/tools/dom/templates/html/impl/impl_ClientRect.darttemplate
+++ b/tools/dom/templates/html/impl/impl_ClientRect.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements Rectangle$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements Rectangle$IMPLEMENTS {
 
   // NOTE! All code below should be common with RectangleBase.
    String toString() {
diff --git a/tools/dom/templates/html/impl/impl_Comment.darttemplate b/tools/dom/templates/html/impl/impl_Comment.darttemplate
index df0d378..dc6e574 100644
--- a/tools/dom/templates/html/impl/impl_Comment.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Comment.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS {
 $if DART2JS
   factory Comment([String data]) {
     if (data != null) {
diff --git a/tools/dom/templates/html/impl/impl_CompositionEvent.darttemplate b/tools/dom/templates/html/impl/impl_CompositionEvent.darttemplate
index a6f6e68..5db4acd 100644
--- a/tools/dom/templates/html/impl/impl_CompositionEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CompositionEvent.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
       {bool canBubble: false, bool cancelable: false, Window view,
       String data}) {
diff --git a/tools/dom/templates/html/impl/impl_CustomEvent.darttemplate b/tools/dom/templates/html/impl/impl_CustomEvent.darttemplate
index 01197ca..29feca9 100644
--- a/tools/dom/templates/html/impl/impl_CustomEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CustomEvent.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   $if DART2JS
     @Creates('Null')  // Set from Dart code; does not instantiate a native type.
   $endif
diff --git a/tools/dom/templates/html/impl/impl_DOMException.darttemplate b/tools/dom/templates/html/impl/impl_DOMException.darttemplate
index ac6c8d4..db97f86 100644
--- a/tools/dom/templates/html/impl/impl_DOMException.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DOMException.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   static const String INDEX_SIZE = 'IndexSizeError';
   static const String HIERARCHY_REQUEST = 'HierarchyRequestError';
diff --git a/tools/dom/templates/html/impl/impl_DataTransferItemList.darttemplate b/tools/dom/templates/html/impl/impl_DataTransferItemList.darttemplate
index b43806f..54acce1 100644
--- a/tools/dom/templates/html/impl/impl_DataTransferItemList.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DataTransferItemList.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS {
 $!MEMBERS
 
   DataTransferItem operator[] (int index) {
diff --git a/tools/dom/templates/html/impl/impl_DeviceOrientationEvent.darttemplate b/tools/dom/templates/html/impl/impl_DeviceOrientationEvent.darttemplate
index 821c56f..6f452c9 100644
--- a/tools/dom/templates/html/impl/impl_DeviceOrientationEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DeviceOrientationEvent.darttemplate
@@ -5,7 +5,7 @@
 // WARNING: Do not edit - generated code.
 
 part of $LIBRARYNAME;
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
       {bool canBubble: true, bool cancelable: true, num alpha: 0, num beta: 0,
       num gamma: 0, bool absolute: false}) {
diff --git a/tools/dom/templates/html/impl/impl_DirectoryEntry.darttemplate b/tools/dom/templates/html/impl/impl_DirectoryEntry.darttemplate
index 9c18b2d..a3649f7 100644
--- a/tools/dom/templates/html/impl/impl_DirectoryEntry.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DirectoryEntry.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   /**
    * Create a new directory with the specified `path`. If `exclusive` is true,
@@ -44,4 +44,3 @@
   }
 $!MEMBERS
 }
-
diff --git a/tools/dom/templates/html/impl/impl_Document.darttemplate b/tools/dom/templates/html/impl/impl_Document.darttemplate
index d96f6c8..6767115 100644
--- a/tools/dom/templates/html/impl/impl_Document.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Document.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME extends Node $NATIVESPEC
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME extends Node
 {
 
 $!MEMBERS
diff --git a/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate b/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
index 86db4ea..42cc56f 100644
--- a/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME() => document.createDocumentFragment();
 
   factory $CLASSNAME.html(String html,
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index a676fa0..f1cf507 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -316,7 +316,7 @@
 }
 
 @DocsEditable()
-$(ANNOTATIONS)abstract class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)abstract class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   /**
    * Creates an HTML element from a valid fragment of HTML.
diff --git a/tools/dom/templates/html/impl/impl_Event.darttemplate b/tools/dom/templates/html/impl/impl_Event.darttemplate
index 2abce62..e4c6e4e 100644
--- a/tools/dom/templates/html/impl/impl_Event.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Event.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   // In JS, canBubble and cancelable are technically required parameters to
   // init*Event. In practice, though, if they aren't provided they simply
   // default to false (since that's Boolean(undefined)).
diff --git a/tools/dom/templates/html/impl/impl_EventSource.darttemplate b/tools/dom/templates/html/impl/impl_EventSource.darttemplate
index 996a883..ed29c88 100644
--- a/tools/dom/templates/html/impl/impl_EventSource.darttemplate
+++ b/tools/dom/templates/html/impl/impl_EventSource.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String title, {withCredentials: false}) {
     var parsedOptions = {
       'withCredentials': withCredentials,
diff --git a/tools/dom/templates/html/impl/impl_EventTarget.darttemplate b/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
index 88ad1c1..d1a23cf 100644
--- a/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
+++ b/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
@@ -90,7 +90,7 @@
  * Use the [on] property to add, and remove events
  * for compile-time type checks and a more concise API.
  */
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   // Custom element created callback.
   EventTarget._created();
diff --git a/tools/dom/templates/html/impl/impl_FileReader.darttemplate b/tools/dom/templates/html/impl/impl_FileReader.darttemplate
index 182f1d8..0a6ddc9 100644
--- a/tools/dom/templates/html/impl/impl_FileReader.darttemplate
+++ b/tools/dom/templates/html/impl/impl_FileReader.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   @DomName('FileReader.result')
   @DocsEditable()
diff --git a/tools/dom/templates/html/impl/impl_Geolocation.darttemplate b/tools/dom/templates/html/impl/impl_Geolocation.darttemplate
index e15ffa0..5518815 100644
--- a/tools/dom/templates/html/impl/impl_Geolocation.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Geolocation.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   @DomName('Geolocation.getCurrentPosition')
   Future<Geoposition> getCurrentPosition({bool enableHighAccuracy,
@@ -103,5 +103,3 @@
   int get timestamp => JS('int', '#.timestamp', _ptr);
 }
 $endif
-
-
diff --git a/tools/dom/templates/html/impl/impl_GlobalEventHandlers.darttemplate b/tools/dom/templates/html/impl/impl_GlobalEventHandlers.darttemplate
index 82862da..d1b4f83 100644
--- a/tools/dom/templates/html/impl/impl_GlobalEventHandlers.darttemplate
+++ b/tools/dom/templates/html/impl/impl_GlobalEventHandlers.darttemplate
@@ -5,5 +5,5 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME extends EventTarget$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME extends EventTarget {
 $!MEMBERS}
diff --git a/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
index 9e965e9..3d49d69 100644
--- a/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements CanvasImageSource$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements CanvasImageSource$IMPLEMENTS {
 $!MEMBERS
   /** An API for drawing on this canvas. */
 $if DART2JS
diff --git a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
index 1cfbdcb..70f50ce 100644
--- a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 
 $if DART2JS
diff --git a/tools/dom/templates/html/impl/impl_HTMLImageElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLImageElement.darttemplate
index ecd9514..244ea4b 100644
--- a/tools/dom/templates/html/impl/impl_HTMLImageElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLImageElement.darttemplate
@@ -4,6 +4,6 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements CanvasImageSource$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements CanvasImageSource$IMPLEMENTS {
 $!MEMBERS
 }
diff --git a/tools/dom/templates/html/impl/impl_HTMLInputElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLInputElement.darttemplate
index fe9ae78..4919649 100644
--- a/tools/dom/templates/html/impl/impl_HTMLInputElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLInputElement.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements
     HiddenInputElement,
     SearchInputElement,
     TextInputElement,
@@ -25,8 +25,7 @@
     SubmitButtonInputElement,
     ImageButtonInputElement,
     ResetButtonInputElement,
-    ButtonInputElement
-    $NATIVESPEC {
+    ButtonInputElement {
 
   factory InputElement({String type}) {
     var e = document.createElement("input");
@@ -596,4 +595,3 @@
 abstract class ButtonInputElement implements InputElementBase {
   factory ButtonInputElement() => new InputElement(type: 'button');
 }
-
diff --git a/tools/dom/templates/html/impl/impl_HTMLLinkElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLLinkElement.darttemplate
index fb38c2c..437c70d 100644
--- a/tools/dom/templates/html/impl/impl_HTMLLinkElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLLinkElement.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS {
 $!MEMBERS
 
     /// Checks if HTML imports are supported on the current platform.
diff --git a/tools/dom/templates/html/impl/impl_HTMLOptionElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLOptionElement.darttemplate
index 8a19e25..99dc73c 100644
--- a/tools/dom/templates/html/impl/impl_HTMLOptionElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLOptionElement.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory OptionElement({String data: '', String value : '', bool selected: false}) {
     return new OptionElement._(data, value, null, selected);
   }
diff --git a/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
index b677b61..25510dc 100644
--- a/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLSelectElement.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 
   // Override default options, since IE returns SelectElement itself and it
diff --git a/tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate
index c7c3212..fabbbdf 100644
--- a/tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLTableElement.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   @DomName('HTMLTableElement.tBodies')
   List<TableSectionElement> get tBodies =>
diff --git a/tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate
index d2dbc9e..d09f45f 100644
--- a/tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLTableRowElement.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   @DomName('HTMLTableRowElement.cells')
   List<TableCellElement> get cells =>
diff --git a/tools/dom/templates/html/impl/impl_HTMLTableSectionElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLTableSectionElement.darttemplate
index e15a540..a0023e1 100644
--- a/tools/dom/templates/html/impl/impl_HTMLTableSectionElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLTableSectionElement.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   @DomName('HTMLTableSectionElement.rows')
   List<TableRowElement> get rows =>
diff --git a/tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate
index 98c7199..7d546fe 100644
--- a/tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate
@@ -7,7 +7,7 @@
 part of $LIBRARYNAME;
 
 @Experimental()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 
   /**
diff --git a/tools/dom/templates/html/impl/impl_HTMLVideoElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLVideoElement.darttemplate
index ecd9514..244ea4b 100644
--- a/tools/dom/templates/html/impl/impl_HTMLVideoElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLVideoElement.darttemplate
@@ -4,6 +4,6 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements CanvasImageSource$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements CanvasImageSource$IMPLEMENTS {
 $!MEMBERS
 }
diff --git a/tools/dom/templates/html/impl/impl_HashChangeEvent.darttemplate b/tools/dom/templates/html/impl/impl_HashChangeEvent.darttemplate
index 133ccd2..b9fd424 100644
--- a/tools/dom/templates/html/impl/impl_HashChangeEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HashChangeEvent.darttemplate
@@ -5,7 +5,7 @@
 // WARNING: Do not edit - generated code.
 
 part of $LIBRARYNAME;
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
       {bool canBubble: true, bool cancelable: true, String oldUrl,
       String newUrl}) {
diff --git a/tools/dom/templates/html/impl/impl_History.darttemplate b/tools/dom/templates/html/impl/impl_History.darttemplate
index 5a6b2d5..a548b00 100644
--- a/tools/dom/templates/html/impl/impl_History.darttemplate
+++ b/tools/dom/templates/html/impl/impl_History.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   /**
    * Checks if the State APIs are supported on the current platform.
diff --git a/tools/dom/templates/html/impl/impl_IDBCursor.darttemplate b/tools/dom/templates/html/impl/impl_IDBCursor.darttemplate
index 70689f8..2c43c5c1 100644
--- a/tools/dom/templates/html/impl/impl_IDBCursor.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBCursor.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   @DomName('IDBCursor.delete')
   Future delete() {
    try {
diff --git a/tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate b/tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate
index 31d47ec..c89c29a 100644
--- a/tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBDatabase.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   @DomName('IDBDatabase.createObjectStore')
   @DocsEditable()
   ObjectStore createObjectStore(String name,
diff --git a/tools/dom/templates/html/impl/impl_IDBFactory.darttemplate b/tools/dom/templates/html/impl/impl_IDBFactory.darttemplate
index c702826..6218e29 100644
--- a/tools/dom/templates/html/impl/impl_IDBFactory.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBFactory.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   /**
    * Checks to see if Indexed DB is supported on the current platform.
    */
diff --git a/tools/dom/templates/html/impl/impl_IDBIndex.darttemplate b/tools/dom/templates/html/impl/impl_IDBIndex.darttemplate
index 03af72c..e9dbcb5 100644
--- a/tools/dom/templates/html/impl/impl_IDBIndex.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBIndex.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   @DomName('IDBIndex.count')
   Future<int> count([key_OR_range]) {
    try {
diff --git a/tools/dom/templates/html/impl/impl_IDBKeyRange.darttemplate b/tools/dom/templates/html/impl/impl_IDBKeyRange.darttemplate
index 19ecce2..28439a4 100644
--- a/tools/dom/templates/html/impl/impl_IDBKeyRange.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBKeyRange.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   @DomName('IDBKeyRange.only')
   factory KeyRange.only(/*Key*/ value) =>
       _KeyRangeFactoryProvider.create$(CLASSNAME)_only(value);
diff --git a/tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate b/tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate
index 4b62232..1363056 100644
--- a/tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   @DomName('IDBObjectStore.add')
   Future add(value, [key]) {
diff --git a/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate b/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
index 39133b0..4eb6bec 100644
--- a/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   /**
    * Provides a Future which will be completed once the transaction has
diff --git a/tools/dom/templates/html/impl/impl_ImageData.darttemplate b/tools/dom/templates/html/impl/impl_ImageData.darttemplate
index c233337..dd04dee 100644
--- a/tools/dom/templates/html/impl/impl_ImageData.darttemplate
+++ b/tools/dom/templates/html/impl/impl_ImageData.darttemplate
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 part of $LIBRARYNAME;
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $if DARTIUM
   List<int> __data;
 
diff --git a/tools/dom/templates/html/impl/impl_Location.darttemplate b/tools/dom/templates/html/impl/impl_Location.darttemplate
index 5242f8a..d663fcd 100644
--- a/tools/dom/templates/html/impl/impl_Location.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Location.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 
 $if DART2JS
diff --git a/tools/dom/templates/html/impl/impl_MediaStream.darttemplate b/tools/dom/templates/html/impl/impl_MediaStream.darttemplate
index bc11e19..0df739b 100644
--- a/tools/dom/templates/html/impl/impl_MediaStream.darttemplate
+++ b/tools/dom/templates/html/impl/impl_MediaStream.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 
   /**
diff --git a/tools/dom/templates/html/impl/impl_MessageEvent.darttemplate b/tools/dom/templates/html/impl/impl_MessageEvent.darttemplate
index c439664..cf3c4e4 100644
--- a/tools/dom/templates/html/impl/impl_MessageEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_MessageEvent.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
       {bool canBubble: false, bool cancelable: false, Object data,
       String origin, String lastEventId,
diff --git a/tools/dom/templates/html/impl/impl_MutationEvent.darttemplate b/tools/dom/templates/html/impl/impl_MutationEvent.darttemplate
index 5460640..c4a30c6 100644
--- a/tools/dom/templates/html/impl/impl_MutationEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_MutationEvent.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
       {bool canBubble: false, bool cancelable: false, Node relatedNode,
       String prevValue, String newValue, String attrName, int attrChange: 0}) {
@@ -16,6 +16,3 @@
   }
 $!MEMBERS
 }
-
-
-
diff --git a/tools/dom/templates/html/impl/impl_MutationObserver.darttemplate b/tools/dom/templates/html/impl/impl_MutationObserver.darttemplate
index 203068c..4208322 100644
--- a/tools/dom/templates/html/impl/impl_MutationObserver.darttemplate
+++ b/tools/dom/templates/html/impl/impl_MutationObserver.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
   /**
    * Checks to see if the mutation observer API is supported on the current
diff --git a/tools/dom/templates/html/impl/impl_Navigator.darttemplate b/tools/dom/templates/html/impl/impl_Navigator.darttemplate
index 2cb5ddd..e9d2d44 100644
--- a/tools/dom/templates/html/impl/impl_Navigator.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Navigator.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
 $if DART2JS
   @DomName('Navigator.language')
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index a58eefc..85f7e12 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -185,7 +185,7 @@
 }
 
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   // Custom element created callback.
   Node._created() : super._created();
diff --git a/tools/dom/templates/html/impl/impl_NodeIterator.darttemplate b/tools/dom/templates/html/impl/impl_NodeIterator.darttemplate
index c850360..258dac3 100644
--- a/tools/dom/templates/html/impl/impl_NodeIterator.darttemplate
+++ b/tools/dom/templates/html/impl/impl_NodeIterator.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory NodeIterator(Node root, int whatToShow) {
     return document._createNodeIterator(root, whatToShow, null);
   }
diff --git a/tools/dom/templates/html/impl/impl_Notification.darttemplate b/tools/dom/templates/html/impl/impl_Notification.darttemplate
index 6e573ce..03efd63 100644
--- a/tools/dom/templates/html/impl/impl_Notification.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Notification.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   factory $CLASSNAME(String title, {String titleDir: null, String body: null,
       String bodyDir: null, String tag: null, String iconUrl: null}) {
diff --git a/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate b/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
index 64474fd..9b8eea8 100644
--- a/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
+++ b/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $if DART2JS
   factory $CLASSNAME(Map rtcIceServers, [Map mediaConstraints]) {
     var constructorName = JS('RtcPeerConnection', 'window[#]',
diff --git a/tools/dom/templates/html/impl/impl_RadioNodeList.darttemplate b/tools/dom/templates/html/impl/impl_RadioNodeList.darttemplate
index 1534895..5d5569d 100644
--- a/tools/dom/templates/html/impl/impl_RadioNodeList.darttemplate
+++ b/tools/dom/templates/html/impl/impl_RadioNodeList.darttemplate
@@ -10,7 +10,7 @@
 // RadioNodeList is to get the selected value and it will be cleaner to
 // introduce a different API for that purpose.
 $else
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 }
 $endif
diff --git a/tools/dom/templates/html/impl/impl_Range.darttemplate b/tools/dom/templates/html/impl/impl_Range.darttemplate
index f152a33..3c1c080 100644
--- a/tools/dom/templates/html/impl/impl_Range.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Range.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME() => document.createRange();
 
   factory $CLASSNAME.fromPoint(Point point) =>
diff --git a/tools/dom/templates/html/impl/impl_SVGColor.darttemplate b/tools/dom/templates/html/impl/impl_SVGColor.darttemplate
index 7df86ab..053f229 100644
--- a/tools/dom/templates/html/impl/impl_SVGColor.darttemplate
+++ b/tools/dom/templates/html/impl/impl_SVGColor.darttemplate
@@ -7,6 +7,6 @@
 // Hack because the baseclass is private in dart:html, and we want to omit this
 // type entirely but can't.
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$IMPLEMENTS {
   _SVGColor.internal();
 }
diff --git a/tools/dom/templates/html/impl/impl_SVGElement.darttemplate b/tools/dom/templates/html/impl/impl_SVGElement.darttemplate
index c9c70a7..1d9f06e 100644
--- a/tools/dom/templates/html/impl/impl_SVGElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_SVGElement.darttemplate
@@ -30,7 +30,7 @@
   }
 }
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   static final _START_TAG_REGEXP = new RegExp('<(\\w+)');
 
   factory $CLASSNAME.tag(String tag) =>
diff --git a/tools/dom/templates/html/impl/impl_SVGSVGElement.darttemplate b/tools/dom/templates/html/impl/impl_SVGSVGElement.darttemplate
index 13eabab..6279a7e 100644
--- a/tools/dom/templates/html/impl/impl_SVGSVGElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_SVGSVGElement.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME() {
     final el = new SvgElement.tag("svg");
     // The SVG spec requires the version attribute to match the spec version
diff --git a/tools/dom/templates/html/impl/impl_Screen.darttemplate b/tools/dom/templates/html/impl/impl_Screen.darttemplate
index 15a947e..efffa28 100644
--- a/tools/dom/templates/html/impl/impl_Screen.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Screen.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   @DomName('Screen.availHeight')
   @DomName('Screen.availLeft')
diff --git a/tools/dom/templates/html/impl/impl_ShadowRoot.darttemplate b/tools/dom/templates/html/impl/impl_ShadowRoot.darttemplate
index 883faea..57a44bb 100644
--- a/tools/dom/templates/html/impl/impl_ShadowRoot.darttemplate
+++ b/tools/dom/templates/html/impl/impl_ShadowRoot.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 $if DART2JS
   static bool get supported =>
diff --git a/tools/dom/templates/html/impl/impl_Storage.darttemplate b/tools/dom/templates/html/impl/impl_Storage.darttemplate
index 82d1f0c..ff99d70 100644
--- a/tools/dom/templates/html/impl/impl_Storage.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Storage.darttemplate
@@ -29,8 +29,8 @@
  * [Maps](http://www.dartlang.org/docs/library-tour/#maps-aka-dictionaries-or-hashes)
  * section of the library tour.
  */
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS
-    implements Map<String, String> $NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS
+    implements Map<String, String> {
 
   void addAll(Map<String, String> other) {
     other.forEach((k, v) { this[k] = v; });
diff --git a/tools/dom/templates/html/impl/impl_StorageEvent.darttemplate b/tools/dom/templates/html/impl/impl_StorageEvent.darttemplate
index df91c56..9d546b3 100644
--- a/tools/dom/templates/html/impl/impl_StorageEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_StorageEvent.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
     {bool canBubble: false, bool cancelable: false, String key, String oldValue,
     String newValue, String url, Storage storageArea}) {
diff --git a/tools/dom/templates/html/impl/impl_Text.darttemplate b/tools/dom/templates/html/impl/impl_Text.darttemplate
index 7540799..8c53058 100644
--- a/tools/dom/templates/html/impl/impl_Text.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Text.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String data) => document._createTextNode(data);
 $!MEMBERS
 }
diff --git a/tools/dom/templates/html/impl/impl_TextEvent.darttemplate b/tools/dom/templates/html/impl/impl_TextEvent.darttemplate
index 765a280..e12cc8b 100644
--- a/tools/dom/templates/html/impl/impl_TextEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_TextEvent.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(String type,
     {bool canBubble: false, bool cancelable: false, Window view, String data}) {
     if (view == null) {
diff --git a/tools/dom/templates/html/impl/impl_Touch.darttemplate b/tools/dom/templates/html/impl/impl_Touch.darttemplate
index 1c14ff7..d629fd3 100644
--- a/tools/dom/templates/html/impl/impl_Touch.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Touch.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 
   @DomName('Touch.clientX')
diff --git a/tools/dom/templates/html/impl/impl_TouchEvent.darttemplate b/tools/dom/templates/html/impl/impl_TouchEvent.darttemplate
index c460c1ba..3ee2462 100644
--- a/tools/dom/templates/html/impl/impl_TouchEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_TouchEvent.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory $CLASSNAME(TouchList touches, TouchList targetTouches,
       TouchList changedTouches, String type,
       {Window view, int screenX: 0, int screenY: 0, int clientX: 0,
diff --git a/tools/dom/templates/html/impl/impl_TouchList.darttemplate b/tools/dom/templates/html/impl/impl_TouchList.darttemplate
index 06c7b67..56bcf1e 100644
--- a/tools/dom/templates/html/impl/impl_TouchList.darttemplate
+++ b/tools/dom/templates/html/impl/impl_TouchList.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS {
   /// NB: This constructor likely does not work as you might expect it to! This
   /// constructor will simply fail (returning null) if you are not on a device
   /// with touch enabled. See dartbug.com/8314.
diff --git a/tools/dom/templates/html/impl/impl_TreeWalker.darttemplate b/tools/dom/templates/html/impl/impl_TreeWalker.darttemplate
index 60733cc..4d5c94d 100644
--- a/tools/dom/templates/html/impl/impl_TreeWalker.darttemplate
+++ b/tools/dom/templates/html/impl/impl_TreeWalker.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   factory TreeWalker(Node root, int whatToShow) {
     return document._createTreeWalker(root, whatToShow, null);
   }
diff --git a/tools/dom/templates/html/impl/impl_UIEvent.darttemplate b/tools/dom/templates/html/impl/impl_UIEvent.darttemplate
index 91e96b2..223dc0a 100644
--- a/tools/dom/templates/html/impl/impl_UIEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_UIEvent.darttemplate
@@ -6,7 +6,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
   // In JS, canBubble and cancelable are technically required parameters to
   // init*Event. In practice, though, if they aren't provided they simply
   // default to false (since that's Boolean(undefined)).
diff --git a/tools/dom/templates/html/impl/impl_WebGLRenderingContext.darttemplate b/tools/dom/templates/html/impl/impl_WebGLRenderingContext.darttemplate
index bec16f9..8478e75 100644
--- a/tools/dom/templates/html/impl/impl_WebGLRenderingContext.darttemplate
+++ b/tools/dom/templates/html/impl/impl_WebGLRenderingContext.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $!MEMBERS
 
   /**
diff --git a/tools/dom/templates/html/impl/impl_WebKitCSSKeyframesRule.darttemplate b/tools/dom/templates/html/impl/impl_WebKitCSSKeyframesRule.darttemplate
index a0c7f90..3edff1d 100644
--- a/tools/dom/templates/html/impl/impl_WebKitCSSKeyframesRule.darttemplate
+++ b/tools/dom/templates/html/impl/impl_WebKitCSSKeyframesRule.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$MIXINS$IMPLEMENTS {
 $!MEMBERS
 
 $if DART2JS
diff --git a/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate b/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
index 9f0600b..64ca60f 100644
--- a/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
@@ -4,7 +4,7 @@
 
 part of $LIBRARYNAME;
 
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   factory WheelEvent(String type,
       {Window view, int deltaX: 0, int deltaY: 0,
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
index 94baa46..12ad45f 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -6,9 +6,10 @@
 
 @DocsEditable()
 $if DART2JS
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "Window,DOMWindow" {
+$(ANNOTATIONS)@Native("Window,DOMWindow")
+$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $else
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 $endif
 
   /**
diff --git a/tools/dom/templates/html/impl/impl_WindowEventHandlers.darttemplate b/tools/dom/templates/html/impl/impl_WindowEventHandlers.darttemplate
index 82862da..d1b4f83 100644
--- a/tools/dom/templates/html/impl/impl_WindowEventHandlers.darttemplate
+++ b/tools/dom/templates/html/impl/impl_WindowEventHandlers.darttemplate
@@ -5,5 +5,5 @@
 part of $LIBRARYNAME;
 
 @DocsEditable()
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME extends EventTarget$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME extends EventTarget {
 $!MEMBERS}
diff --git a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
index e8f64d5..96cfca9 100644
--- a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
+++ b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
@@ -51,7 +51,7 @@
   * * [JS XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest)
   * * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest)
  */
-$(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   /**
    * Creates a GET request for the specified [url].
diff --git a/tools/get_archive.py b/tools/get_archive.py
index 43cbcfd..385fabc 100755
--- a/tools/get_archive.py
+++ b/tools/get_archive.py
@@ -96,7 +96,7 @@
 
 
 def InRunhooks():
-  '''True if this script was called by "gclient runhooks" or "gclient sync"'''
+  """True if this script was called by "gclient runhooks" or "gclient sync\""""
   return 'runhooks' in sys.argv
 
 
@@ -132,22 +132,21 @@
   """
   osdict = {'Darwin':'mac', 'Linux':'lucid64', 'Windows':'win'}
 
-  def FindPermanentUrl(out, osname, revision_num):
+  def FindPermanentUrl(out, osname, the_revision_num):
     output_lines = out.split()
     latest = output_lines[-1]
-    if not revision_num:
-      revision_num = latest[latest.rindex('-') + 1 : latest.index('.')]
+    if not the_revision_num:
       latest = (permanent_prefix[:permanent_prefix.rindex('/')] % { 'osname' :
           osname, 'bot' : bot } + latest[latest.rindex('/'):])
     else:
-      latest = (permanent_prefix % { 'osname' : osname, 'num1' : revision_num,
-          'num2' : revision_num, 'bot' : bot })
+      latest = (permanent_prefix % { 'osname' : osname, 'num1' : the_revision_num,
+          'num2' : the_revision_num, 'bot' : bot })
       foundURL = False
       while not foundURL:
         # Test to ensure this URL exists because the dartium-archive builds can
         # have unusual numbering (a range of CL numbers) sometimes.
         result, out = Gsutil('ls', permanent_prefix % {'osname' : osname,
-            'num1': revision_num, 'num2': '*', 'bot': bot })
+            'num1': the_revision_num, 'num2': '*', 'bot': bot })
         if result == 0:
           # First try to find one with the the second number the same as the
           # requested number.
@@ -163,12 +162,12 @@
             # Unable to download this item (most likely because something went
             # wrong on the upload and the permissions are bad). Keep looking for
             # a different URL.
-            revision_num = int(revision_num) - 1
+            the_revision_num = int(the_revision_num) - 1
           shutil.rmtree(temp_dir)
         else:
           # Now try to find one with a nearby CL num.
-          revision_num = int(revision_num) - 1
-          if revision_num <= 0:
+          the_revision_num = int(the_revision_num) - 1
+          if the_revision_num <= 0:
             TooEarlyError()
     return latest
 
diff --git a/tools/gyp/configurations_android.gypi b/tools/gyp/configurations_android.gypi
index f8c630b..9a0c96d 100644
--- a/tools/gyp/configurations_android.gypi
+++ b/tools/gyp/configurations_android.gypi
@@ -68,7 +68,9 @@
         'cflags': [
           '-fdata-sections',
           '-ffunction-sections',
-          '-fno-omit-frame-pointer',
+          # Uncomment the following line and pass --profile-vm to enable
+          # profiling of C++ code within Observatory.
+          # '-fno-omit-frame-pointer',
           '-O3',
         ],
       },
diff --git a/tools/gyp/configurations_make.gypi b/tools/gyp/configurations_make.gypi
index 6ff4c5b..2b2943c 100644
--- a/tools/gyp/configurations_make.gypi
+++ b/tools/gyp/configurations_make.gypi
@@ -137,8 +137,9 @@
         'abstract': 1,
         'cflags': [
           '-O<(dart_debug_optimization_level)',
-          # The sampling profiler uses the frame pointer to walk the stack.
-          '-fno-omit-frame-pointer',
+          # Uncomment the following line and pass --profile-vm to enable
+          # profiling of C++ code within Observatory.
+          # '-fno-omit-frame-pointer',
           # Clang on Linux will still omit frame pointers from leaf functions
           # unless told otherwise:
           # '-mno-omit-leaf-frame-pointer',
@@ -149,8 +150,9 @@
         'abstract': 1,
         'cflags': [
           '-O3',
-          # The sampling profiler uses the frame pointer to walk the stack.
-          '-fno-omit-frame-pointer',
+          # Uncomment the following line and pass --profile-vm to enable
+          # profiling of C++ code within Observatory.
+          # '-fno-omit-frame-pointer',
           # Clang on Linux will still omit frame pointers from leaf functions
           # unless told otherwise:
           # '-mno-omit-leaf-frame-pointer',
diff --git a/tools/gyp/configurations_msvs.gypi b/tools/gyp/configurations_msvs.gypi
index 20d69be..4880913 100644
--- a/tools/gyp/configurations_msvs.gypi
+++ b/tools/gyp/configurations_msvs.gypi
@@ -39,7 +39,9 @@
             'DebugInformationFormat': '3',
             'ExceptionHandling': '0',
             'RuntimeTypeInfo': 'false',
-            'OmitFramePointers': 'false',
+            # Uncomment the following line and pass --profile-vm to enable
+            # profiling of C++ code within Observatory.
+            # 'OmitFramePointers': 'false',
             'RuntimeLibrary': '1',  # /MTd - Multi-threaded, static (debug)
           },
           'VCLinkerTool': {
@@ -69,7 +71,9 @@
             'FavorSizeOrSpeed': '0',
             'ExceptionHandling': '0',
             'RuntimeTypeInfo': 'false',
-            'OmitFramePointers': 'false',
+            # Uncomment the following line and pass --profile-vm to enable
+            # profiling of C++ code within Observatory.
+            # 'OmitFramePointers': 'false',
             'StringPooling': 'true',
             'RuntimeLibrary': '0',  # /MT - Multi-threaded, static
           },
diff --git a/tools/list_files.py b/tools/list_files.py
index e94443b..1b10b62 100644
--- a/tools/list_files.py
+++ b/tools/list_files.py
@@ -3,11 +3,11 @@
 # 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.
 
-'''Tool for listing files whose name match a pattern.
+"""Tool for listing files whose name match a pattern.
 
 Usage:
   python tools/list_files.py PATTERN DIRECTORY...
-'''
+"""
 
 import os
 import re
diff --git a/tools/list_pkg_directories.py b/tools/list_pkg_directories.py
index d64604b..c05b63a 100644
--- a/tools/list_pkg_directories.py
+++ b/tools/list_pkg_directories.py
@@ -3,13 +3,13 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-'''Tool for listing the directories under pkg, with their lib directories.
+"""Tool for listing the directories under pkg, with their lib directories.
 Used in pkg.gyp. Lists all of the directories in the directory passed in as an
 argument to this script which have a lib subdirectory.
 
 Usage:
   python tools/list_pkg_directories.py OPTIONS DIRECTORY
-'''
+"""
 
 import optparse
 import os
diff --git a/tools/make_links.py b/tools/make_links.py
index 0874ca8..b99ef6e 100644
--- a/tools/make_links.py
+++ b/tools/make_links.py
@@ -4,7 +4,7 @@
 # BSD-style license that can be found in the LICENSE file.
 
 
-'''Tool for creating symlinks from SOURCES to TARGET.
+"""Tool for creating symlinks from SOURCES to TARGET.
 
 For each SOURCE in SOURCES create a link from SOURCE to TARGET.  If a
 SOURCE ends with .../lib, the lib suffix is ignored when determining
@@ -15,7 +15,7 @@
 
 Usage:
   python tools/make_links.py OPTIONS TARGET SOURCES...
-'''
+"""
 
 import optparse
 import os
diff --git a/tools/make_version.py b/tools/make_version.py
index 476ecdf..54ce675 100644
--- a/tools/make_version.py
+++ b/tools/make_version.py
@@ -50,7 +50,7 @@
       sys.stderr.write('--input not specified\n')
       return -1
 
-    files = [ ]
+    files = []
     for arg in args:
       files.append(arg)
 
diff --git a/tools/only_in_release_mode.py b/tools/only_in_release_mode.py
index 089d30c..a2babfd 100644
--- a/tools/only_in_release_mode.py
+++ b/tools/only_in_release_mode.py
@@ -7,7 +7,7 @@
 """
 Wrapper around a build action that should only be executed in release mode.
 
-The mode is defined via an environment varible DART_BUILD_MODE.
+The mode is defined via an environment variable DART_BUILD_MODE.
 
 The arguments to the script are:
 
@@ -29,7 +29,7 @@
   outputs = sys.argv[1:separator_index]
   arguments = sys.argv[separator_index + 1:]
   arguments[0] = os.path.normpath(arguments[0])
-  mode = os.getenv('DART_BUILD_MODE', default='release')
+  mode = os.getenv('DART_BUILD_MODE', 'release')
   if mode != 'release':
     print >> sys.stderr, 'Not running %s in mode=%s' % (arguments, mode)
     for output in outputs:
diff --git a/tools/publish_pkg.py b/tools/publish_pkg.py
index 06cc3b4..dbc5b4f 100755
--- a/tools/publish_pkg.py
+++ b/tools/publish_pkg.py
@@ -13,7 +13,6 @@
 
 import os
 import os.path
-import re
 import shutil
 import sys
 import subprocess
@@ -33,13 +32,13 @@
     lines = pubspecFile.readlines()
 
   version = None
-  foundSdkContraint = False
+  foundSdkConstraint = False
   inDependencies = False
   for line in lines:
     if line.startswith('dependencies:'):
       inDependencies = True
     elif line.startswith('environment:'):
-      foundSdkContraint = True
+      foundSdkConstraint = True
     elif line[0].isalpha():
       inDependencies = False
     if line.startswith('version:'):
@@ -54,7 +53,7 @@
     print 'Error in %s: did not find package version.' % pubspec
     return -1
 
-  if not foundSdkContraint:
+  if not foundSdkConstraint:
     print 'Error in %s: did not find SDK version constraint.' % pubspec
     return -1
 
@@ -69,7 +68,7 @@
   if not os.path.exists(os.path.join(tmpDir, pkgName, 'LICENSE')):
     with open(os.path.join(tmpDir, pkgName, 'LICENSE'), 'w') as licenseFile:
       licenseFile.write(
-'''Copyright 2013, the Dart project authors. All rights reserved.
+'''Copyright 2014, the Dart project authors. All rights reserved.
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
 met:
@@ -95,7 +94,7 @@
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-''');
+''')
 
   print 'publishing version ' + version + ' of ' + argv[1] + ' to pub.\n'
 
diff --git a/tools/revert.py b/tools/revert.py
index ce3eff0..a602e10 100755
--- a/tools/revert.py
+++ b/tools/revert.py
@@ -22,7 +22,7 @@
                     '8..10, or 8:10).')
   args, _ = parser.parse_args()
   revision_range = args.rev_range
-  if revision_range == None:
+  if revision_range is None:
     maybe_fail('You must specify at least one revision number to revert.')
   if revision_range.find('-') > -1 or revision_range.find(':') > -1 or \
       revision_range.find('..') > -1:
@@ -82,7 +82,7 @@
     p = subprocess.Popen(['git', 'log', '-1'], stdout=subprocess.PIPE,
                          shell=(platform.system()=='Windows'))
     output, _ = p.communicate()
-    if find_git_info(output) == None:
+    if find_git_info(output) is None:
       return True
   return False
 
@@ -97,7 +97,7 @@
     print output
   if stderr and not suppress_output:
     print stderr
-  return (output, stderr)
+  return output, stderr
 
 def runs_git():
   """Returns True if we're standing in an svn-git repository."""
@@ -105,7 +105,7 @@
                        stderr=subprocess.PIPE,
                        shell=(platform.system()=='Windows'))
   output, err = p.communicate()
-  if err != None and 'is not a working copy' in err:
+  if err is not None and 'is not a working copy' in err:
     p = subprocess.Popen(['git', 'status'], stdout=subprocess.PIPE,
                          shell=(platform.system()=='Windows'))
     output, _ = p.communicate()
@@ -127,7 +127,7 @@
       revision_number = int(tokens[1].split('@')[1])
       if revision_number == rev_num:
         return current_commit_id
-      if rev_num == None:
+      if rev_num is None:
         return revision_number
 
 def revert(start, end, is_git):
@@ -157,16 +157,16 @@
       reverts = range(start, end + 1)
       reverts.reverse()
       commit_msg = '%s-%d"' % (commit_msg[:-1], end)
-    for revert in reverts:
-      git_commit_id = find_git_info(output, revert)
-      if git_commit_id == None:
+    for the_revert in reverts:
+      git_commit_id = find_git_info(output, the_revert)
+      if git_commit_id is None:
         maybe_fail('Error: Revision number not found. Is this earlier than your'
                    ' git checkout history?')
       _, err = run_cmd(['git', 'revert', '-n', git_commit_id])
       if 'error: could not revert' in err or 'unmerged' in err:
         command_sequence = ''
-        for revert in reverts:
-          git_commit_id = find_git_info(output, revert)
+        for a_revert in reverts:
+          git_commit_id = find_git_info(output, a_revert)
           command_sequence += 'git revert -n %s\n' % git_commit_id
         maybe_fail('There are conflicts while reverting. Please resolve these '
                    'after manually running:\n' + command_sequence + 'and then '
diff --git a/tools/task_kill.py b/tools/task_kill.py
index 9b905ee..654c2b6 100755
--- a/tools/task_kill.py
+++ b/tools/task_kill.py
@@ -12,12 +12,12 @@
 import optparse
 import os
 import signal
-import shutil
-import string
 import subprocess
 import sys
+
 import utils
 
+
 os_name = utils.GuessOS()
 
 POSIX_INFO = 'ps -p %s -o args'
@@ -118,13 +118,13 @@
   return results
 
 def GetPids(process_name):
-  if (os_name == "win32"):
+  if os_name == "win32":
     return GetPidsWindows(process_name)
   else:
     return GetPidsPosix(process_name)
 
 def PrintPidInfo(pid):
-  # We asume that the list command will return lines in the format:
+  # We assume that the list command will return lines in the format:
   # EXECUTABLE_PATH ARGS
   # There may be blank strings in the output
   p = subprocess.Popen(INFO_COMMAND[os_name] % pid,
@@ -146,7 +146,7 @@
 
 def KillPosix(pid):
   try:
-    os.kill(int(pid), signal.SIGKILL);
+    os.kill(int(pid), signal.SIGKILL)
   except:
     # Ignore this, the process is already dead from killing another process.
     pass
@@ -161,19 +161,19 @@
   p.communicate()
 
 def Kill(name):
-  if (name not in EXECUTABLE_NAMES[os_name]):
+  if name not in EXECUTABLE_NAMES[os_name]:
     return 0
   print("***************** Killing %s *****************" % name)
   platform_name = EXECUTABLE_NAMES[os_name][name]
   pids = GetPids(platform_name)
   for pid in pids:
-    PrintPidInfo(pid);
-    if (os_name == "win32"):
+    PrintPidInfo(pid)
+    if os_name == "win32":
       KillWindows(pid)
     else:
       KillPosix(pid)
     print("Killed pid: %s" % pid)
-  if (len(pids) == 0):
+  if len(pids) == 0:
     print("  No %s processes found." % name)
   return len(pids)
 
@@ -205,13 +205,13 @@
 def Main():
   options = GetOptions()
   status = 0
-  if (options.kill_dart):
-    status += KillDart();
-  if (options.kill_vc):
-    status += KillVCSystems();
-  if (options.kill_browsers):
+  if options.kill_dart:
+    status += KillDart()
+  if options.kill_vc:
+    status += KillVCSystems()
+  if options.kill_browsers:
     status += KillBrowsers()
-  if (options.kill_editor):
+  if options.kill_editor:
     status += KillEditor()
   return status
 
diff --git a/tools/test.py b/tools/test.py
index f7794c1..69b9ed8 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -4,7 +4,6 @@
 # BSD-style license that can be found in the LICENSE file.
 
 import os
-import platform
 import string
 import subprocess
 import sys
@@ -15,8 +14,6 @@
 def Main():
   args = sys.argv[1:]
   tools_dir = os.path.dirname(os.path.realpath(__file__))
-  current_directory = os.path.abspath('');
-  client = os.path.abspath(os.path.join(tools_dir, '..'));
   dart_script_name = 'test.dart'
   dart_test_script = string.join([tools_dir, dart_script_name], os.sep)
   command = [utils.DartBinary(), '--checked', dart_test_script] + args
diff --git a/tools/testing/webdriver_test_setup.py b/tools/testing/webdriver_test_setup.py
index 33a76c2..c68543b 100755
--- a/tools/testing/webdriver_test_setup.py
+++ b/tools/testing/webdriver_test_setup.py
@@ -109,7 +109,7 @@
         os_str = 'linux64'
     if self.project_name == 'chromedriver' and (
         os_str == 'mac' or os_str == 'win'):
-      os_str = os_str + '32'
+      os_str += '32'
     return os_str
 
   def run(self):
diff --git a/tools/utils.py b/tools/utils.py
index e2d917d..2e92723 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -11,8 +11,8 @@
 import re
 import shutil
 import subprocess
-import sys
 import tempfile
+import sys
 
 class Version(object):
   def __init__(self, channel, major, minor, patch, prerelease,
@@ -26,20 +26,20 @@
 
 # Try to guess the host operating system.
 def GuessOS():
-  id = platform.system()
-  if id == "Linux":
+  os_id = platform.system()
+  if os_id == "Linux":
     return "linux"
-  elif id == "Darwin":
+  elif os_id == "Darwin":
     return "macos"
-  elif id == "Windows" or id == "Microsoft":
+  elif os_id == "Windows" or os_id == "Microsoft":
     # On Windows Vista platform.system() can return "Microsoft" with some
     # versions of Python, see http://bugs.python.org/issue1082 for details.
     return "win32"
-  elif id == 'FreeBSD':
+  elif os_id == 'FreeBSD':
     return 'freebsd'
-  elif id == 'OpenBSD':
+  elif os_id == 'OpenBSD':
     return 'openbsd'
-  elif id == 'SunOS':
+  elif os_id == 'SunOS':
     return 'solaris'
   else:
     return None
@@ -47,22 +47,23 @@
 
 # Try to guess the host architecture.
 def GuessArchitecture():
-  id = platform.machine()
-  if id.startswith('arm'):
+  os_id = platform.machine()
+  if os_id.startswith('arm'):
     return 'arm'
-  elif id.startswith('aarch64'):
+  elif os_id.startswith('aarch64'):
     return 'arm64'
-  elif id.startswith('mips'):
+  elif os_id.startswith('mips'):
     return 'mips'
-  elif (not id) or (not re.match('(x|i[3-6])86', id) is None):
+  elif (not os_id) or (not re.match('(x|i[3-6])86', os_id) is None):
     return 'ia32'
-  elif id == 'i86pc':
+  elif os_id == 'i86pc':
     return 'ia32'
-  elif '64' in id:
+  elif '64' in os_id:
     return 'x64'
   else:
     guess_os = GuessOS()
-    print "Warning: Guessing architecture %s based on os %s\n" % (id, guess_os)
+    print "Warning: Guessing architecture %s based on os %s\n"\
+          % (os_id, guess_os)
     if guess_os == 'win32':
       return 'ia32'
     return None
@@ -97,7 +98,7 @@
   defaultExecutable = "devenv.com"
 
   if not IsWindows():
-    return (defaultPath, defaultExecutable)
+    return defaultPath, defaultExecutable
 
   keyNamesAndExecutables = [
     # Pair for non-Express editions.
@@ -122,7 +123,7 @@
       while True:
         try:
           subkeyName = _winreg.EnumKey(key, subkeyCounter)
-          subkeyCounter = subkeyCounter + 1
+          subkeyCounter += 1
         except WindowsError:
           # Reached end of enumeration. Moving on the next key.
           break
@@ -140,7 +141,7 @@
             if not isExpress and subkeyName == '10.0':
               # Stop search since if we found non-Express VS2010 version
               # installed, which is preferred version.
-              return (installDir, executable)
+              return installDir, executable
             else:
               version = float(subkeyName)
               # We prefer higher version of Visual Studio and given equal
@@ -172,7 +173,7 @@
 
 # Filters out all arguments until the next '--' argument
 # occurs.
-def ListArgCallback(option, opt_str, value, parser):
+def ListArgCallback(option, value, parser):
    if value is None:
      value = []
 
@@ -187,7 +188,7 @@
 
 # Filters out all argument until the first non '-' or the
 # '--' argument occurs.
-def ListDartArgCallback(option, opt_str, value, parser):
+def ListDartArgCallback(option, value, parser):
    if value is None:
      value = []
 
@@ -259,11 +260,11 @@
       cross_build = 'X'
     return '%s%s%s' % (GetBuildMode(mode), cross_build, arch.upper())
 
-def GetBuildDir(host_os, target_os):
+def GetBuildDir(host_os):
   return BUILD_ROOT[host_os]
 
 def GetBuildRoot(host_os, mode=None, arch=None, target_os=None):
-  build_root = GetBuildDir(host_os, target_os)
+  build_root = GetBuildDir(host_os)
   if mode:
     build_root = os.path.join(build_root, GetBuildConf(mode, arch, target_os))
   return build_root
@@ -320,8 +321,8 @@
   return os.environ.get(key, '')
 
 def ReadVersionFile():
-  def match_against(pattern, content):
-    match = re.search(pattern, content, flags=re.MULTILINE)
+  def match_against(pattern, file_content):
+    match = re.search(pattern, file_content, flags=re.MULTILINE)
     if match:
       return match.group(1)
     return None
@@ -415,7 +416,7 @@
   # Paths in test files are always specified using '/'
   # as the path separator. Replace with the actual
   # path separator before use.
-  if ('/' in path):
+  if '/' in path:
     split_path = path.split('/')
     path = os.sep.join(split_path)
     path = os.path.join(workspace, path)
@@ -439,7 +440,7 @@
     for match in matches:
       if len(match) > 0:
         result.append(
-            [RewritePathSeparator(o, workspace) for o in match.split(' ')]);
+            [RewritePathSeparator(o, workspace) for o in match.split(' ')])
       else:
         result.append([])
     return result
@@ -457,7 +458,7 @@
     if proc.wait() != 0:
       return None
     new = stdout.strip()
-    current = os.getenv('JAVA_HOME', default=new)
+    current = os.getenv('JAVA_HOME', new)
     if current != new:
       sys.stderr.write('Please set JAVA_HOME to %s\n' % new)
       os.putenv('JAVA_HOME', new)
@@ -474,14 +475,14 @@
     return False
   os.setsid()
   if os.fork() > 0:
-    os._exit(0)
+    exit(0)
     raise
   return True
 
 
-def PrintError(str):
+def PrintError(string):
   """Writes and flushes a string to stderr."""
-  sys.stderr.write(str)
+  sys.stderr.write(string)
   sys.stderr.write('\n')
 
 
@@ -493,7 +494,7 @@
     PrintError("os.unlink() " + str(e))
 
 
-def Main(argv):
+def Main():
   print "GuessOS() -> ", GuessOS()
   print "GuessArchitecture() -> ", GuessArchitecture()
   print "GuessCpus() -> ", GuessCpus()
@@ -541,7 +542,7 @@
   output = pipe.communicate()
   if pipe.returncode != 0:
     raise Exception('Execution failed: ' + str(output))
-  return (pipe.returncode, output)
+  return pipe.returncode, output
 
 
 def DartBinary():
@@ -595,4 +596,4 @@
 
 if __name__ == "__main__":
   import sys
-  Main(sys.argv)
+  Main()