Version 0.5.1.0 .

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

git-svn-id: http://dart.googlecode.com/svn/trunk@22072 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/.gitignore b/.gitignore
index 4da6b24..d82160d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,7 @@
 /*.sln
 /*.suo
 /*.target.mk
+*.host.mk
 /*.vcproj
 /*.vcxproj
 /*.vcxproj.filters
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index 03e009d..0f60a71 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -5628,7 +5628,7 @@
         && !Elements.isLibrarySource(source, "/crypto/crypto.dart")
         && !Elements.isLibrarySource(source, "/uri/uri.dart")
         && !Elements.isLibrarySource(source, "/utf/utf.dart")
-        && !Elements.isLibrarySource(source, "/typeddata/typeddata.dart")
+        && !Elements.isLibrarySource(source, "/typed_data/typed_data.dart")
         ) {
       super.reportError(position, errorCode);
     }
diff --git a/dart.gyp b/dart.gyp
index 6eea60b..1abc0ef 100644
--- a/dart.gyp
+++ b/dart.gyp
@@ -50,6 +50,7 @@
       'dependencies': [
         'runtime/dart-runtime.gyp:dart',
         'utils/compiler/compiler.gyp:dart2js',
+        'utils/pub/pub.gyp:pub',
         'analyzer',
         'compiler',
       ],
@@ -62,6 +63,7 @@
             'tools/create_sdk.py',
             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
             '<(SHARED_INTERMEDIATE_DIR)/utils_wrapper.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/pub.dart.snapshot',
             '<(PRODUCT_DIR)/analyzer/bin/dart_analyzer',
             '<(PRODUCT_DIR)/dartanalyzer/dartanalyzer.jar',
           ],
@@ -72,8 +74,7 @@
             'python',
             'tools/create_sdk.py',
             '--sdk_output_dir', '<(PRODUCT_DIR)/dart-sdk',
-            '--utils_snapshot_location',
-             '<(SHARED_INTERMEDIATE_DIR)/utils_wrapper.dart.snapshot'
+            '--snapshot_location', '<(SHARED_INTERMEDIATE_DIR)/'
           ],
           'message': 'Creating SDK.',
         },
diff --git a/pkg/analyzer_experimental/pubspec.yaml b/pkg/analyzer_experimental/pubspec.yaml
index 5cd79cb..616b361 100644
--- a/pkg/analyzer_experimental/pubspec.yaml
+++ b/pkg/analyzer_experimental/pubspec.yaml
@@ -1,5 +1,4 @@
 name: analyzer_experimental
-version: 0.1.5
 author: Dart Team <misc@dartlang.org>
 description: Experimental static analyzer for Dart.
 homepage: http://www.dartlang.org
diff --git a/pkg/args/lib/args.dart b/pkg/args/lib/args.dart
index 1337b46..be1a6ef 100644
--- a/pkg/args/lib/args.dart
+++ b/pkg/args/lib/args.dart
@@ -6,6 +6,19 @@
  * This library lets you define parsers for parsing raw command-line arguments
  * into a set of options and values using [GNU][] and [POSIX][] style options.
  *
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       args: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [args package on pub.dartlang.org](http://pub.dartlang.org/packages/args).
+ *
  * ## Defining options ##
  *
  * To use this library, you create an [ArgParser] object which will contain
@@ -209,6 +222,7 @@
  *
  * [posix]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
  * [gnu]: http://www.gnu.org/prep/standards/standards.html#Command_002dLine-Interfaces
+ * [pub]: http://pub.dartlang.org
  */
 library args;
 
diff --git a/pkg/http/lib/http.dart b/pkg/http/lib/http.dart
index 07457cd..dda24f24 100644
--- a/pkg/http/lib/http.dart
+++ b/pkg/http/lib/http.dart
@@ -4,6 +4,19 @@
 
 /// A composable, [Future]-based library for making HTTP requests.
 ///
+/// ## Installing ##
+///
+/// Use [pub][] to install this package. Add the following to your
+/// `pubspec.yaml` file.
+///
+///     dependencies:
+///       http: any
+///
+/// Then run `pub install`.
+///
+/// For more information, see the
+/// [http package on pub.dartlang.org](http://pub.dartlang.org/packages/http).
+///
 /// The easiest way to use this library is via the top-level functions. They
 /// allow you to make individual HTTP requests with minimal hassle:
 ///
@@ -50,10 +63,12 @@
 ///         return _inner.send(request);
 ///       }
 ///     }
+///
+/// [pub]: http://pub.dartlang.org
 library http;
 
 import 'dart:async';
-import 'dart:typeddata';
+import 'dart:typed_data';
 import 'dart:uri';
 
 import 'src/client.dart';
diff --git a/pkg/http/lib/src/base_client.dart b/pkg/http/lib/src/base_client.dart
index eb9fca7..df6e730 100644
--- a/pkg/http/lib/src/base_client.dart
+++ b/pkg/http/lib/src/base_client.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 import 'dart:io';
-import 'dart:typeddata';
+import 'dart:typed_data';
 import 'dart:uri';
 
 import 'base_request.dart';
diff --git a/pkg/http/lib/src/byte_stream.dart b/pkg/http/lib/src/byte_stream.dart
index f2c6a0b..eba08d4 100644
--- a/pkg/http/lib/src/byte_stream.dart
+++ b/pkg/http/lib/src/byte_stream.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 import 'dart:io';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 import 'utils.dart';
 
diff --git a/pkg/http/lib/src/client.dart b/pkg/http/lib/src/client.dart
index 302b8c7..bf214c4 100644
--- a/pkg/http/lib/src/client.dart
+++ b/pkg/http/lib/src/client.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 import 'dart:io';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 import 'base_client.dart';
 import 'base_request.dart';
diff --git a/pkg/http/lib/src/request.dart b/pkg/http/lib/src/request.dart
index 9d68508..20da3c1 100644
--- a/pkg/http/lib/src/request.dart
+++ b/pkg/http/lib/src/request.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 import 'dart:io';
-import 'dart:typeddata';
+import 'dart:typed_data';
 import 'dart:uri';
 
 import 'base_request.dart';
diff --git a/pkg/http/lib/src/response.dart b/pkg/http/lib/src/response.dart
index 2376f72..c036fe9 100644
--- a/pkg/http/lib/src/response.dart
+++ b/pkg/http/lib/src/response.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 import 'dart:io';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 import 'base_request.dart';
 import 'base_response.dart';
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index 26b8d0f..d99b9be 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -7,7 +7,7 @@
 import 'dart:async';
 import 'dart:crypto';
 import 'dart:io';
-import 'dart:typeddata';
+import 'dart:typed_data';
 import 'dart:uri';
 import 'dart:utf';
 
diff --git a/pkg/http/test/utils.dart b/pkg/http/test/utils.dart
index ab3f5f6..25bb92e 100644
--- a/pkg/http/test/utils.dart
+++ b/pkg/http/test/utils.dart
@@ -27,7 +27,7 @@
 
 /// Starts a new HTTP server.
 Future startServer() {
-  return SafeHttpServer.bind("127.0.0.1", 0).then((s) {
+  return SafeHttpServer.bind("localhost", 0).then((s) {
     _server = s;
     s.listen((request) {
       var path = request.uri.path;
@@ -108,8 +108,10 @@
 
 /// Stops the current HTTP server.
 void stopServer() {
-  _server.close();
-  _server = null;
+  if (_server != null) {
+    _server.close();
+    _server = null;
+  }
 }
 
 /// Removes eight spaces of leading indentation from a multiline string.
diff --git a/pkg/intl/lib/date_format.dart b/pkg/intl/lib/date_format.dart
index 88b54d66..bfc9244 100644
--- a/pkg/intl/lib/date_format.dart
+++ b/pkg/intl/lib/date_format.dart
@@ -16,11 +16,14 @@
  * date-time strings under certain locales. Date elements that vary across
  * locales include month name, weekname, field, order, etc.
  *
- * The actual date for the locales must be obtained. This can currently be done
- * in one of three ways, determined by which library you import. If you only
- * want to use en_US formatting you can use it directly, as a copy of that
- * locale is hard-coded into the formatter. In all other cases,
- * the [initializeDateFormatting] method must be called and will return a future
+ * Formatting dates in the default "en_US" format does not require any
+ * initialization. e.g.
+ *       print(new DateFormat.yMMMd().format(new Date.now()));
+ *
+ * But for other locales, the formatting data for the locale must be
+ * obtained. This can currently be done
+ * in one of three ways, determined by which library you import. In all cases,
+ * the "initializeDateFormatting" method must be called and will return a future
  * that is complete once the locale data is available. The result of the future
  * isn't important, but the data for that locale is available to the date
  * formatting and parsing once it completes.
@@ -28,7 +31,7 @@
  * The easiest option is that the data may be available locally, imported in a
  * library that contains data for all the locales.
  *       import 'package:intl/date_symbol_data_local.dart';
- *       initializeDateFormatting("en_US", null).then((_) => runMyCode());
+ *       initializeDateFormatting("fr_FR", null).then((_) => runMyCode());
  *
  * If we are running outside of a browser, we may want to read the data
  * from files in the file system.
@@ -473,7 +476,7 @@
    * A series of regular expressions used to parse a format string into its
    * component fields.
    */
-  static List<Pattern> _matchers = [
+  static List<RegExp> _matchers = [
       // Quoted String - anything between single quotes, with escaping
       //   of single quotes by doubling them.
       // e.g. in the pattern "hh 'o''clock'" will match 'o''clock'
diff --git a/pkg/intl/lib/extract_messages.dart b/pkg/intl/lib/extract_messages.dart
index fb57341..47bcbbbeb 100755
--- a/pkg/intl/lib/extract_messages.dart
+++ b/pkg/intl/lib/extract_messages.dart
@@ -32,6 +32,12 @@
 import 'package:intl/src/intl_message.dart';
 
 /**
+ * If this is true, print warnings for skipped messages. Otherwise, warnings
+ * are suppressed.
+ */
+bool suppressWarnings = false;
+
+/**
  * Parse the dart program represented in [sourceCode] and return a Map from
  * message names to [IntlMessage] instances. The [origin] is a string
  * describing where the source came from, and is used in error messages.
@@ -195,9 +201,9 @@
   void addIntlMessage(MethodInvocation node) {
     if (!looksLikeIntlMessage(node)) return;
     var reason = checkValidity(node);
-    if (!(reason == null)) {
+    if (reason != null && !suppressWarnings) {
       print("Skipping invalid Intl.message invocation\n    <$node>");
-      print("  reason: $reason");
+      print("    reason: $reason");
       reportErrorLocation(node);
       return;
     }
@@ -227,11 +233,11 @@
   }
 
   void reportErrorLocation(ASTNode node) {
-    if (origin != null) print("from $origin");
+    if (origin != null) print("    from $origin");
     LineInfo info = root.lineInfo;
     if (info != null) {
       LineInfo_Location line = info.getLocation(node.offset);
-      print("line: ${line.lineNumber}, column: ${line.columnNumber}");
+      print("    line: ${line.lineNumber}, column: ${line.columnNumber}");
     }
   }
 }
diff --git a/pkg/intl/lib/generate_localized.dart b/pkg/intl/lib/generate_localized.dart
index 26fb304..c40d1f6 100644
--- a/pkg/intl/lib/generate_localized.dart
+++ b/pkg/intl/lib/generate_localized.dart
@@ -47,6 +47,12 @@
 List<String> allLocales = [];
 
 /**
+ * If we have more than one set of messages to generate in a particular
+ * directory we may want to prefix some to distinguish them.
+ */
+String generatedFilePrefix = '';
+
+/**
  * 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
@@ -101,13 +107,15 @@
   result.write(entries.join(",\n"));
   result.write("\n  };\n}");
 
-  var output = new File(path.join(targetDir, "messages_$locale.dart"));
+  var output = new File(path.join(targetDir,
+      "${generatedFilePrefix}messages_$locale.dart"));
   output.writeAsStringSync(result.toString());
 }
 
 /**
- * This returns the mostly constant string used in [generated] for the
- * beginning of the file, parameterized by [locale].
+ * This returns the mostly constant string used in
+ * [generateIndividualMessageFile] for the beginning of the file,
+ * parameterized by [locale].
  */
 String prologue(String locale) => """
 /**
@@ -136,7 +144,7 @@
   var output = new StringBuffer();
   output.write(mainPrologue);
   for (var each in allLocales) {
-    var baseFile = 'messages_$each.dart';
+    var baseFile = '${generatedFilePrefix}messages_$each.dart';
     var file = importForGeneratedFile(baseFile);
     output.write("import '$file' as ${asLibraryName(each)};\n");
   }
@@ -172,7 +180,7 @@
 """;
 
 /**
- * Constant string used in [generateMainImportfile] as the end of the file.
+ * Constant string used in [generateMainImportFile] as the end of the file.
  */
 const closing = """
     default: return null;
diff --git a/pkg/intl/lib/intl.dart b/pkg/intl/lib/intl.dart
index 9a9c529..e0e32ee 100644
--- a/pkg/intl/lib/intl.dart
+++ b/pkg/intl/lib/intl.dart
@@ -7,12 +7,27 @@
  * message formatting and replacement, date and number formatting and parsing,
  * and utilities for working with Bidirectional text.
  *
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       intl: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [intl package on pub.dartlang.org](http://pub.dartlang.org/packages/intl).
+ *
  * For things that require locale or other data, there are multiple different
  * ways of making that data available, which may require importing different
  * libraries. See the class comments for more details.
  *
  * There is also a simple example application that can be found in the
  * `example/basic` directory.
+ *
+ * [pub]: http://pub.dartlang.org
  */
 library intl;
 
@@ -241,7 +256,7 @@
    *
    * In either case, the purpose of this is to delay calling [message_function]
    * until the proper locale has been set. This returns the result of calling
-   * [msg_function], which could be of an arbitrary type.
+   * [message_function], which could be of an arbitrary type.
    */
   static withLocale(String locale, Function message_function) {
     // We have to do this silliness because Locale is not known at compile time,
diff --git a/pkg/intl/lib/message_lookup_by_library.dart b/pkg/intl/lib/message_lookup_by_library.dart
index e3d1fb7..fde0551 100644
--- a/pkg/intl/lib/message_lookup_by_library.dart
+++ b/pkg/intl/lib/message_lookup_by_library.dart
@@ -6,7 +6,7 @@
  * Message/plural format library with locale support. This can have different
  * implementations based on the mechanism for finding the localized versions
  * of messages. This version expects them to be in a library named e.g.
- * 'messages_en_US'. The prefix is set in the [initializeMessages] call, which
+ * 'messages_en_US'. The prefix is set in the "initializeMessages" call, which
  * must be made for a locale before any lookups can be done.
  *
  * See Intl class comment or `tests/message_format_test.dart` for more examples.
diff --git a/pkg/intl/lib/number_format.dart b/pkg/intl/lib/number_format.dart
index 1745178..3f642ca 100644
--- a/pkg/intl/lib/number_format.dart
+++ b/pkg/intl/lib/number_format.dart
@@ -562,7 +562,7 @@
     return true;
   }
 
-  /** Variables used in [parseTrunk] and [parseTrunkCharacter]. */
+  /** Variables used in [_parseTrunk] and [parseTrunkCharacter]. */
   var decimalPos;
   var digitLeftCount;
   var zeroDigitCount;
diff --git a/pkg/intl/test/data_directory.dart b/pkg/intl/test/data_directory.dart
index de16e00..4a003bf 100644
--- a/pkg/intl/test/data_directory.dart
+++ b/pkg/intl/test/data_directory.dart
@@ -27,7 +27,7 @@
   /**
    * A helper function that returns false (indicating we should stop iterating)
    * if the argument to the previous call was 'intl' and also sets
-   * the outer scope [foundIntl].
+   * the outer scope [foundIntlDir].
    */
   bool checkForIntlDir(String each) {
     if (foundIntlDir) return false;
diff --git a/pkg/intl/test/date_time_format_test_core.dart b/pkg/intl/test/date_time_format_test_core.dart
index a4fb30d..7e007e4 100644
--- a/pkg/intl/test/date_time_format_test_core.dart
+++ b/pkg/intl/test/date_time_format_test_core.dart
@@ -124,7 +124,7 @@
  * Exercise all of the formats we have explicitly defined on a particular
  * locale. [expectedResults] is a map from ICU format names to the
  * expected result of formatting [date] according to that format in
- * [locale].
+ * [localeName].
  */
 testLocale(String localeName, Map expectedResults, DateTime date) {
   var intl = new Intl(localeName);
diff --git a/pkg/intl/test/message_extraction/extract_to_json.dart b/pkg/intl/test/message_extraction/extract_to_json.dart
index 7d719ee..5b6f316 100644
--- a/pkg/intl/test/message_extraction/extract_to_json.dart
+++ b/pkg/intl/test/message_extraction/extract_to_json.dart
@@ -25,10 +25,19 @@
 import 'dart:json' as json;
 import 'package:pathos/path.dart' as path;
 import 'package:intl/src/intl_message.dart';
-import 'find_output_directory.dart';
+import 'package:args/args.dart';
 
 main() {
   var args = new Options().arguments;
+  var targetDir;
+  var parser = new ArgParser();
+  parser.addFlag("suppress-warnings", defaultsTo: false,
+      callback: (x) => suppressWarnings = x);
+
+  void setTargetDir(value) => targetDir = value;
+
+  parser.addOption("output-dir", defaultsTo: '.', callback: setTargetDir);
+  parser.parse(args);
   if (args.length == 0) {
     print('Usage: extract_to_json [--output-dir=<dir>] [files.dart]');
     print('Accepts Dart files and produces intl_messages.json');
@@ -39,7 +48,6 @@
     var messages = parseFile(new File(arg));
     messages.forEach((k, v) => allMessages.add(toJson(v)));
   }
-  var targetDir = findOutputDirectory(args);
   var file = new File(path.join(targetDir, 'intl_messages.json'));
   file.writeAsStringSync(json.stringify(allMessages));
 }
diff --git a/pkg/intl/test/message_extraction/find_output_directory.dart b/pkg/intl/test/message_extraction/find_output_directory.dart
deleted file mode 100644
index bb62389..0000000
--- a/pkg/intl/test/message_extraction/find_output_directory.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * A shared library for finding the valu eof the --output-dir parameter
- * which all of these programs use.
- */
-library find_output_directory;
-
-const directiveName = '--output-dir=';
-
-_asString(list) => new String.fromCharCodes(list);
-
-findOutputDirectory(List<String> args) {
-  var directive = args.firstWhere(
-      (x) => x.contains(directiveName),
-      orElse: () => null);
-  if (directive == null) return '.';
-  var file = directive.codeUnits.skip(directiveName.length);
-  return _asString(file);
-}
-
diff --git a/pkg/intl/test/message_extraction/generate_from_json.dart b/pkg/intl/test/message_extraction/generate_from_json.dart
index 7bbb878..0759507 100644
--- a/pkg/intl/test/message_extraction/generate_from_json.dart
+++ b/pkg/intl/test/message_extraction/generate_from_json.dart
@@ -22,7 +22,7 @@
 import 'package:intl/generate_localized.dart';
 import 'dart:json' as json;
 import 'package:pathos/path.dart' as path;
-import 'find_output_directory.dart';
+import 'package:args/args.dart';
 
 /**
  * Keeps track of all the messages we have processed so far, keyed by message
@@ -31,19 +31,29 @@
 Map<String, IntlMessage> messages;
 
 main() {
+  var targetDir;
   var args = new Options().arguments;
+  var parser = new ArgParser();
+  parser.addFlag("suppress-warnings", defaultsTo: false,
+      callback: (x) => suppressWarnings = x);
+  parser.addOption("output-dir", defaultsTo: '.',
+      callback: (x) => targetDir = x);
+  parser.addOption("generated-file-prefix", defaultsTo: '',
+      callback: (x) => generatedFilePrefix = x);
+  parser.parse(args);
   if (args.length == 0) {
-    print('Usage: generate_from_json [--output-dir=<dir>] [originalFiles.dart]'
-        ' [translationFiles.json]');
+    print('Usage: generate_from_json [--output-dir=<dir>]'
+        ' [generated-file-prefix=<prefix>] file1.dart file2.dart ...'
+        ' outputFile.json');
     exit(0);
   }
 
-  var targetDir = findOutputDirectory(args);
-  var isDart = new RegExp(r'\.dart');
-  var isJson = new RegExp(r'\.json');
-  var dartFiles = args.where(isDart.hasMatch).toList();
-  var jsonFiles = args.where(isJson.hasMatch).toList();
+  var dartFiles = args.where((x) => x.endsWith("dart")).toList();
+  var jsonFiles = args.where((x) => x.endsWith(".json")).toList();
 
+  // We're re-parsing the original files to find the corresponding messages,
+  // so if there are warnings extracting the messages, suppress them.
+  suppressWarnings = true;
   var allMessages = dartFiles.map((each) => parseFile(new File(each)));
 
   messages = new Map();
@@ -51,11 +61,12 @@
     eachMap.forEach((key, value) => messages[key] = value);
   }
   for (var arg in jsonFiles) {
-    var file = new File(path.join(targetDir, arg));
-    var translations = generateLocaleFile(file, targetDir);
+    var file = new File(arg);
+    generateLocaleFile(file, targetDir);
   }
 
-  var mainImportFile = new File(path.join(targetDir, 'messages_all.dart'));
+  var mainImportFile = new File(path.join(targetDir,
+      '${generatedFilePrefix}messages_all.dart'));
   mainImportFile.writeAsStringSync(generateMainImportFile());
 }
 
diff --git a/pkg/intl/test/message_extraction/make_hardcoded_translation.dart b/pkg/intl/test/message_extraction/make_hardcoded_translation.dart
index 3f7977c..f936f11 100644
--- a/pkg/intl/test/message_extraction/make_hardcoded_translation.dart
+++ b/pkg/intl/test/message_extraction/make_hardcoded_translation.dart
@@ -13,7 +13,7 @@
 import 'dart:io';
 import 'dart:json' as json;
 import 'package:pathos/path.dart' as path;
-import 'find_output_directory.dart';
+import 'package:args/args.dart';
 
 /** A list of the French translations that we will produce. */
 var french = {
@@ -95,8 +95,11 @@
         '[originalFile.dart]');
     exit(0);
   }
+  var parser = new ArgParser();
+  parser.addOption("output-dir", defaultsTo: '.',
+      callback: (value) => targetDir = value);
+  parser.parse(args);
 
-  targetDir = findOutputDirectory(args);
   var fileArgs = args.where((x) => x.contains('.json'));
 
   var messages = json.parse(new File(fileArgs.first).readAsStringSync());
diff --git a/pkg/intl/test/message_extraction/message_extraction_test.dart b/pkg/intl/test/message_extraction/message_extraction_test.dart
index 92aa3e6..24f8fc5 100644
--- a/pkg/intl/test/message_extraction/message_extraction_test.dart
+++ b/pkg/intl/test/message_extraction/message_extraction_test.dart
@@ -48,8 +48,13 @@
  * Translate a file path into this test directory, regardless of the
  * working directory.
  */
-String dir([String s]) =>
-    path.join(intlDirectory, 'test', 'message_extraction', s);
+String dir([String s]) {
+  if (s != null && s.startsWith("--")) { // Don't touch command-line options.
+    return s;
+  } else {
+   return path.join(intlDirectory, 'test', 'message_extraction', s);
+  }
+}
 
 main() {
   test("Test round trip message extraction, translation, code generation, "
@@ -68,8 +73,8 @@
 
 void deleteGeneratedFiles() {
   var files = [dir('intl_messages.json'), dir('translation_fr.json'),
-      dir('messages_fr.dart'), dir('messages_de_DE.dart'),
-      dir('translation_de_DE.json'), dir('messages_all.dart')];
+      dir('foo_messages_fr.dart'), dir('foo_messages_de_DE.dart'),
+      dir('translation_de_DE.json'), dir('foo_messages_all.dart')];
   files.map((name) => new File(name)).forEach((x) {
     if (x.existsSync()) x.deleteSync();});
 }
@@ -107,7 +112,7 @@
 
 Future<ProcessResult> extractMessages(ProcessResult previousResult) => run(
     previousResult,
-    ['extract_to_json.dart', 'sample_with_messages.dart',
+    ['extract_to_json.dart', '--suppress-warnings', 'sample_with_messages.dart',
         'part_of_sample_with_messages.dart']);
 
 Future<ProcessResult> generateTranslationFiles(ProcessResult previousResult) =>
@@ -118,7 +123,8 @@
 Future<ProcessResult> generateCodeFromTranslation(ProcessResult previousResult)
     => run(
         previousResult,
-        ['generate_from_json.dart', 'sample_with_messages.dart',
+        ['generate_from_json.dart', '--generated-file-prefix=foo_',
+         'sample_with_messages.dart',
              'part_of_sample_with_messages.dart', 'translation_fr.json',
              'translation_de_DE.json' ]);
 
@@ -135,9 +141,8 @@
 
   var output = results.stdout;
   var lines = output.split("\n");
-  // If it looks like these are CRLF delimited, then use that. Wish strings
-  // just implemented last.
-  if (lines.first.codeUnits.last == "\r".codeUnits.first) {
+  // If it looks like these are CRLF delimited, then use that.
+  if (lines.first.endsWith("\r")) {
     lines = output.split("\r\n");
   }
   lineIterator = lines.iterator..moveNext();
diff --git a/pkg/intl/test/message_extraction/sample_with_messages.dart b/pkg/intl/test/message_extraction/sample_with_messages.dart
index ada1d79..a0e334c 100644
--- a/pkg/intl/test/message_extraction/sample_with_messages.dart
+++ b/pkg/intl/test/message_extraction/sample_with_messages.dart
@@ -13,7 +13,7 @@
 import "package:intl/message_lookup_by_library.dart";
 import "dart:async";
 import "package:intl/src/intl_helpers.dart";
-import "messages_all.dart";
+import "foo_messages_all.dart";
 
 part 'part_of_sample_with_messages.dart';
 
diff --git a/pkg/logging/lib/logging.dart b/pkg/logging/lib/logging.dart
index 222ff1e..94bf5f3 100644
--- a/pkg/logging/lib/logging.dart
+++ b/pkg/logging/lib/logging.dart
@@ -6,6 +6,22 @@
  * 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.
+ *
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       logging: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [logging package on pub.dartlang.org][pkg].
+ *
+ * [pub]: http://pub.dartlang.org
+ * [pkg]: http://pub.dartlang.org/packages/logging
  */
 library logging;
 
diff --git a/pkg/meta/lib/meta.dart b/pkg/meta/lib/meta.dart
index ba49c2b..c86e377 100644
--- a/pkg/meta/lib/meta.dart
+++ b/pkg/meta/lib/meta.dart
@@ -6,6 +6,21 @@
  * This library contains the definitions of annotations that provide additional
  * semantic information about the program being annotated. These annotations are
  * intended to be used by tools to provide a better user experience.
+ *
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       meta: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [meta package on pub.dartlang.org](http://pub.dartlang.org/packages/meta).
+ *
+ * [pub]: http://pub.dartlang.org
  */
 library meta;
 
diff --git a/pkg/oauth2/lib/oauth2.dart b/pkg/oauth2/lib/oauth2.dart
index 7fdb205..592589d 100644
--- a/pkg/oauth2/lib/oauth2.dart
+++ b/pkg/oauth2/lib/oauth2.dart
@@ -6,6 +6,19 @@
 /// behalf of a user, and making authorized HTTP requests with the user's OAuth2
 /// credentials.
 ///
+/// ## Installing ##
+///
+/// Use [pub][] to install this package. Add the following to your
+/// `pubspec.yaml` file.
+///
+///     dependencies:
+///       oauth2: any
+///
+/// Then run `pub install`.
+///
+/// For more information, see the
+/// [oauth2 package on pub.dartlang.org][pkg].
+///
 /// OAuth2 allows a client (the program using this library) to access and
 /// manipulate a resource that's owned by a resource owner (the end user) and
 /// lives on a remote server. The client directs the resource owner to an
@@ -100,6 +113,9 @@
 ///         }).then((file) => file.close()).then((_) => result);
 ///       });
 ///     }).then(print);
+///
+/// [pub]: http://pub.dartlang.org
+/// [pkg]: http://pub.dartlang.org/packages/oauth2
 library oauth2;
 
 export 'src/authorization_code_grant.dart';
diff --git a/pkg/pathos/lib/path.dart b/pkg/pathos/lib/path.dart
index 5136871..8d83077 100644
--- a/pkg/pathos/lib/path.dart
+++ b/pkg/pathos/lib/path.dart
@@ -3,6 +3,22 @@
 // BSD-style license that can be found in the LICENSE file.
 
 /// A comprehensive, cross-platform path manipulation library.
+///
+/// ## Installing ##
+///
+/// Use [pub][] to install this package. Add the following to your
+/// `pubspec.yaml` file.
+///
+///     dependencies:
+///       pathos: any
+///
+/// Then run `pub install`.
+///
+/// For more information, see the
+/// [pathos package on pub.dartlang.org][pkg].
+///
+/// [pub]: http://pub.dartlang.org
+/// [pkg]: http://pub.dartlang.org/packages/pathos
 library path;
 
 import 'dart:io' as io;
diff --git a/pkg/pkg.status b/pkg/pkg.status
index d638e12..af3a270 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -2,9 +2,6 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-serialization/test/*: Skip # http://dartbug.com/9894
-
-
 # Run this test manually to verify that the fixnum library produces
 # the same results as native ints on a set of directed and random inputs.
 # Skip it when running automated tests because it times out.  This
@@ -31,9 +28,8 @@
 webdriver/test/webdriver_test: Skip
 
 
-[ $compiler == dart2js && $runtime == drt ]
-unittest/test/unittest_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-
+[ $runtime == d8 || $runtime == jsshell ]
+unittest/test/unittest_test: Pass, Fail # http://dartbug.com/10109
 
 [$compiler == dart2dart]
 *: Skip
@@ -129,9 +125,6 @@
 unittest/test/mock_test: Fail
 unittest/test/mock_regexp_negative_test: Fail
 
-[ $compiler == dart2js && $csp && $runtime == drt ]
-unittest/test/unittest_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-
 [ $compiler == none && $runtime == drt ]
 dartdoc/test/dartdoc_test: Skip # See dartbug.com/4541.
 
diff --git a/pkg/scheduled_test/lib/scheduled_test.dart b/pkg/scheduled_test/lib/scheduled_test.dart
index 6e7b754..05beb14 100644
--- a/pkg/scheduled_test/lib/scheduled_test.dart
+++ b/pkg/scheduled_test/lib/scheduled_test.dart
@@ -7,6 +7,19 @@
 // TODO(nweiz): Port the non-Pub-specific scheduled test libraries from Pub.
 /// A package for writing readable tests of asynchronous behavior.
 ///
+/// ## Installing ##
+///
+/// Use [pub][] to install this package. Add the following to your
+/// `pubspec.yaml` file.
+///
+///     dependencies:
+///       scheduled_test: any
+///
+/// Then run `pub install`.
+///
+/// For more information, see the
+/// [scheduled_test package on pub.dartlang.org][pkg].
+///
 /// This package works by building up a queue of asynchronous tasks called a
 /// "schedule", then executing those tasks in order. This allows the tests to
 /// read like synchronous, linear code, despite executing asynchronously.
@@ -171,6 +184,9 @@
 /// If a single task might take a long time, you can also manually tell the
 /// [Schedule] that it's making progress by calling [Schedule.heartbeat], which
 /// will reset the timeout whenever it's called.
+///
+/// [pub]: http://pub.dartlang.org
+/// [pkg]: http://pub.dartlang.org/packages/scheduled_test
 library scheduled_test;
 
 import 'dart:async';
@@ -242,10 +258,11 @@
 /// Creates a new named group of tests. This has the same semantics as
 /// [unittest.group].
 void group(String description, void body()) {
+  _ensureInitialized();
+  _ensureSetUpForTopLevel();
   unittest.group(description, () {
     var wasInGroup = _inGroup;
     _inGroup = true;
-    _setUpScheduledTest();
     body();
     _inGroup = wasInGroup;
   });
@@ -295,20 +312,38 @@
 /// Registers callbacks for [unittest.setUp] and [unittest.tearDown] that set up
 /// and tear down the scheduled test infrastructure.
 void _setUpScheduledTest([void setUpFn()]) {
-  if (!_inGroup) _setUpForTopLevel = true;
-
-  unittest.setUp(() {
-    if (currentSchedule != null) {
-      throw new StateError('There seems to be another scheduled test '
-          'still running.');
-    }
-    _currentSchedule = new Schedule();
-    _setUpFn = setUpFn;
-  });
-
-  unittest.tearDown(() {
-    _currentSchedule = null;
-  });
+  if (!_inGroup) {
+    _setUpForTopLevel = true;
+    unittest.setUp(() {
+      if (currentSchedule != null) {
+        throw new StateError('There seems to be another scheduled test '
+            'still running.');
+      }
+      _currentSchedule = new Schedule();
+      if (_setUpFn != null) {
+        var parentFn = _setUpFn;
+        _setUpFn = () { parentFn(); setUpFn(); };
+      } else {
+        _setUpFn = setUpFn;
+      }
+    });
+ 
+    unittest.tearDown(() {
+      _currentSchedule = null;
+      _setUpFn = null;
+    });
+  } else {
+    unittest.setUp(() {
+      if (currentSchedule == null) {
+        throw new StateError('No schedule allocated.');
+      } else if (_setUpFn != null) {
+        var parentFn = _setUpFn;
+        _setUpFn = () { parentFn(); setUpFn(); };
+      } else {
+        _setUpFn = setUpFn;
+      }
+    });
+  }
 }
 
 /// Ensures that the global configuration for `scheduled_test` has been
diff --git a/pkg/scheduled_test/lib/src/schedule.dart b/pkg/scheduled_test/lib/src/schedule.dart
index ecdf4dd..d5eb9af 100644
--- a/pkg/scheduled_test/lib/src/schedule.dart
+++ b/pkg/scheduled_test/lib/src/schedule.dart
@@ -62,7 +62,6 @@
   ScheduleState get state => _state;
   ScheduleState _state = ScheduleState.SET_UP;
 
-  // TODO(nweiz): make this a read-only view once issue 8321 is fixed.
   /// Errors thrown by the task queues.
   ///
   /// When running tasks in [tasks], this will always be empty. If an error
@@ -74,11 +73,13 @@
   ///
   /// Any out-of-band callbacks that throw errors will also have those errors
   /// added to this list.
-  final errors = <ScheduleError>[];
+  List<ScheduleError> get errors =>
+      new UnmodifiableListView<ScheduleError>(_errors);
+  final _errors = <ScheduleError>[];
 
-  // TODO(nweiz): make this a read-only view once issue 8321 is fixed.
   /// Additional debugging info registered via [addDebugInfo].
-  final debugInfo = <String>[];
+  List<String> get debugInfo => new UnmodifiableListView<String>(_debugInfo);
+  final _debugInfo = <String>[];
 
   /// The task queue that's currently being run. One of [tasks], [onException],
   /// or [onComplete]. This starts as [tasks], and can only be `null` after the
@@ -212,7 +213,7 @@
   /// fails. Unlike [signalError], this won't cause the test to fail, nor will
   /// it short-circuit the current [TaskQueue]; it's just useful for providing
   /// additional information that may not fit cleanly into an existing error.
-  void addDebugInfo(String info) => debugInfo.add(info);
+  void addDebugInfo(String info) => _debugInfo.add(info);
 
   /// Notifies the schedule of an error that occurred in a task or out-of-band
   /// callback after the appropriate queue has timed out. If this schedule is
@@ -318,7 +319,7 @@
   /// [ScheduleError].
   void _addError(error) {
     if (error is ScheduleError && errors.contains(error)) return;
-    errors.add(new ScheduleError.from(this, error));
+    _errors.add(new ScheduleError.from(this, error));
   }
 }
 
@@ -346,9 +347,8 @@
 
 /// A queue of asynchronous tasks to execute in order.
 class TaskQueue {
-  // TODO(nweiz): make this a read-only view when issue 8321 is fixed.
   /// The tasks in the queue.
-  Iterable<Task> get contents => _contents;
+  List<Task> get contents => new UnmodifiableListView<Task>(_contents);
   final _contents = new Queue<Task>();
 
   /// The name of the queue, for debugging purposes.
@@ -377,10 +377,10 @@
   /// Whether to stop running after the current task.
   bool _aborted = false;
 
-  // TODO(nweiz): make this a read-only view when issue 8321 is fixed.
   /// The descriptions of all callbacks that are blocking the completion of
   /// [this].
-  Iterable<String> get pendingCallbacks => _pendingCallbacks;
+  List<String> get pendingCallbacks =>
+      new UnmodifiableListView<String>(_pendingCallbacks);
   final _pendingCallbacks = new Queue<String>();
 
   /// A completer that will be completed once [_pendingCallbacks] becomes empty
diff --git a/pkg/scheduled_test/lib/src/task.dart b/pkg/scheduled_test/lib/src/task.dart
index e77f531..2dfc127 100644
--- a/pkg/scheduled_test/lib/src/task.dart
+++ b/pkg/scheduled_test/lib/src/task.dart
@@ -27,10 +27,10 @@
   /// The queue to which this [Task] belongs.
   final TaskQueue queue;
 
-  // TODO(nweiz): make this a read-only view when issue 8321 is fixed.
   /// Child tasks that have been spawned while running this task. This will be
   /// empty if this task is a nested task.
-  final children = new Queue<Task>();
+  List<Task> get children => new UnmodifiableListView(_children);
+  final _children = new Queue<Task>();
 
   /// A [FutureGroup] that will complete once all current child tasks are
   /// finished running. This will be null if no child tasks are currently
@@ -110,7 +110,7 @@
   /// finished.
   Future runChild(fn(), String description) {
     var task = new Task._child(fn, description, this);
-    children.add(task);
+    _children.add(task);
     if (_childGroup == null || _childGroup.completed) {
       _childGroup = new FutureGroup();
     }
diff --git a/pkg/scheduled_test/test/scheduled_test/set_up_test.dart b/pkg/scheduled_test/test/scheduled_test/set_up_test.dart
index 0d83d20..5462f51 100644
--- a/pkg/scheduled_test/test/scheduled_test/set_up_test.dart
+++ b/pkg/scheduled_test/test/scheduled_test/set_up_test.dart
@@ -79,7 +79,7 @@
     test('test 2', () => expect(onExceptionRun, isTrue));
   }, passing: ['test 2']);
 
-  expectTestsPass("setUp doesn't apply to child groups", () {
+  expectTestsPass("setUp applies to child groups", () {
     var setUpRun = false;
     setUp(() {
       setUpRun = true;
@@ -94,7 +94,7 @@
 
     group('group', () {
       test('inner', () {
-        expect(setUpRun, isFalse);
+        expect(setUpRun, isTrue);
       });
     });
   });
@@ -140,4 +140,41 @@
       });
     });
   });
-}
\ No newline at end of file
+
+  expectTestsPass("setUp calls are chained", () {
+    var setUpOuterRun = false;
+    var setUpInnerRun = false;
+    group('outer group', () {
+      setUp(() {
+        setUpOuterRun = true;
+        currentSchedule.onComplete.schedule(() {
+          setUpOuterRun = false;
+        });
+      });
+      group('intermediate group with no setUp', () {
+        group('inner group', () {
+          setUp(() {
+            setUpInnerRun = true;
+            currentSchedule.onComplete.schedule(() {
+              setUpInnerRun = false;
+            });
+          });
+          test('inner', () {
+            expect(setUpOuterRun, isTrue);
+            expect(setUpInnerRun, isTrue);
+          });
+        });
+      });
+      test('outer', () {
+        expect(setUpOuterRun, isTrue);
+        expect(setUpInnerRun, isFalse);
+      });
+    });
+
+    test('top', () {
+      expect(setUpOuterRun, isFalse);
+      expect(setUpInnerRun, isFalse);
+    });
+  });
+
+}
diff --git a/pkg/serialization/lib/serialization.dart b/pkg/serialization/lib/serialization.dart
index 130be27..88c30e8 100644
--- a/pkg/serialization/lib/serialization.dart
+++ b/pkg/serialization/lib/serialization.dart
@@ -7,6 +7,19 @@
  * [Serialization] is defined in terms of [SerializationRule]s and supports
  * reading and writing to different formats.
  *
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       serialization: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [serialization package on pub.dartlang.org][pkg].
+ *
  * Setup
  * =====
  * A simple example of usage is
@@ -64,23 +77,25 @@
  *        }
  *      }
  *
- * The class needs four different methods. The [appliesTo] method tells us if
+ * The class needs four different methods. The [CustomRule.appliesTo]
+ * method tells us if
  * the rule should be used to write an object. In this example we use a test
  * based on runtimeType. We could also use an "is Address" test, but if Address
  * has subclasses that would find those as well, and we want a separate rule
- * for each. The [getState] method should
+ * for each. The [CustomRule.getState] method should
  * return all the state of the object that we want to recreate,
  * and should be either a Map or a List. If you want to write to human-readable
  * formats where it's useful to be able to look at the data as a map from
  * field names to values, then it's better to return it as a map. Otherwise it's
  * more efficient to return it as a list. You just need to be sure that the
- * [create] and [setState] methods interpret the same way as [getState] does.
+ * [CustomRule.create] and [CustomRule.setState] methods interpret the data the
+ * same way as [CustomRule.getState] does.
  *
- * The [create] method will create the new object and return it. While it's
+ * The [CustomRule.create] method will create the new object and return it. While it's
  * possible to create the object and set all its state in this one method, that
  * increases the likelihood of problems with cycles. So it's better to use the
- * minimum necessary information in [create] and do more of the work in
- * [setState].
+ * minimum necessary information in [CustomRule.create] and do more of the work
+ * in [CustomRule.setState].
  *
  * The other way to do this is not creating a subclass, but by using a
  * [ClosureRule] and giving it functions for how to create
@@ -133,7 +148,8 @@
  * isolate.
  *
  * We can write objects in different formats by passing a [Format] object to
- * the [write] method or by getting a [Writer] object. The available formats
+ * the [Serialization.write] method or by getting a [Writer] object.
+ * The available formats
  * include the default, a simple "flat" format that doesn't include field names,
  * and a simple JSON format that produces output more suitable for talking to
  * services that expect JSON in a predefined format. Examples of these are
@@ -149,7 +165,7 @@
  *
  * Reading
  * =======
- * To read objects, the corresponding [read] method can be used.
+ * To read objects, the corresponding [Serialization.read] method can be used.
  *
  *       Address input = serialization.read(input);
  *
@@ -158,13 +174,15 @@
  * rules to be different, but they need to be able to read the same
  * representation. For most practical purposes right now they should be the
  * same. The simplest way to achieve this is by having the serialization
- * variable [selfDescribing] be true. In that case the rules themselves are also
+ * variable [Serialization.selfDescribing] be true. In that case the rules
+ * themselves are also
  * stored along with the serialized data, and can be read back on the receiving
  * end. Note that this may not work for all rules or all formats. The
- * [selfDescribing] variable is true by default, but the [SimpleJsonFormat] does
- * not support it, since the point is to provide a representation in a form
+ * [Serialization.selfDescribing] variable is true by default, but the
+ * [SimpleJsonFormat] does not support it, since the point is to provide a
+ * representation in a form
  * other services might expect. Using CustomRule or ClosureRule also does not
- * yet work with the [selfDescribing] variable.
+ * yet work with the [Serialization.selfDescribing] variable.
  *
  * Named Objects
  * =============
@@ -174,13 +192,16 @@
  * take a [ClassMirror] in their constructor, and we cannot serialize those. So
  * when we read the rules, we must provide a Map<String, Object> which maps from
  * the simple name of classes we are interested in to a [ClassMirror]. This can
- * be provided either in the [namedObjects] variable of the Serialization,
+ * be provided either in the [Serialization.namedObjects],
  * or as an additional parameter to the reading and writing methods on the
  * [Reader] or [Writer] respectively.
  *
  *     new Serialization()
  *       ..addRuleFor(new Person(), constructorFields: ["name"])
  *       ..namedObjects['Person'] = reflect(new Person()).type;
+ *
+ * [pub]: http://pub.dartlang.org
+ * [pkg]: http://pub.dartlang.org/packages/serialization
  */
 library serialization;
 
@@ -319,6 +340,7 @@
     // it will always find the first one.
     addRule(new ListRuleEssential());
     addRule(new MapRule());
+    addRule(new SymbolRule());
   }
 
   /**
@@ -445,7 +467,8 @@
             'constructorFields', 'regularFields', []],
           fields: [])
       ..addRule(new NamedObjectRule())
-      ..addRule(new MirrorRule());
+      ..addRule(new MirrorRule())
+      ..addRule(new SymbolRule());
     meta.namedObjects = namedObjects;
     return meta;
   }
diff --git a/pkg/serialization/lib/src/basic_rule.dart b/pkg/serialization/lib/src/basic_rule.dart
index b3e3a95..dbf54ed 100644
--- a/pkg/serialization/lib/src/basic_rule.dart
+++ b/pkg/serialization/lib/src/basic_rule.dart
@@ -94,7 +94,7 @@
    */
   setFieldWith(String fieldName, SetWithFunction setWith) {
     fields.addAllByName([fieldName]);
-    _NamedField field = fields.named(fieldName);
+    _NamedField field = fields.named(_asSymbol(fieldName));
     Function setter = (setWith == null) ? field.defaultSetter : setWith;
     field.customSetter = setter;
   }
@@ -224,8 +224,8 @@
     return mirror.reflectee;
   }
 
-  /** For all [state] not required in the constructor, set it in the [object],
-   * resolving references in the context of [reader].
+  /** For all [rawState] not required in the constructor, set it in the
+   * [object], resolving references in the context of [reader].
    */
   inflateNonEssential(rawState, object, Reader reader) {
     InstanceMirror mirror = reflect(object);
@@ -284,7 +284,7 @@
   final _FieldList fieldList;
 
   /**
-   * Our position in the [contents] collection of [fieldList]. This is used
+   * Our position in the [fieldList._contents] collection. This is used
    * to index into the state, so it's extremely important.
    */
   int index;
@@ -310,9 +310,9 @@
    * [fieldList] models.
    */
   static bool _isReallyAField(value, _FieldList fieldList) {
-    if (!(value is String)) return false;
-    return hasField(value, fieldList.mirror) ||
-        hasGetter(value, fieldList.mirror);
+    var symbol = _asSymbol(value);
+    return hasField(symbol, fieldList.mirror) ||
+        hasGetter(symbol, fieldList.mirror);
   }
 
   /** Private constructor. */
@@ -332,7 +332,7 @@
   /**
    * Return true if this field is treated as essential state, either because
    * it is used in the constructor, or because it's been designated
-   * using [setFieldWith].
+   * using [BasicRule.setFieldWith].
    */
   bool get isEssential => usedInConstructor;
 
@@ -352,20 +352,32 @@
  */
 class _NamedField extends _Field {
   /** The name of the field (or getter) */
-  final name;
+  String _name;
+  Symbol nameSymbol;
 
-  /** The special way to set this value registered, if this has a value. */
+  /**
+   * If this is set, then it is used as a way to set the value rather than
+   * using the default mechanism.
+   */
   Function customSetter;
 
-  _NamedField._internal(this.name, fieldList) : super._internal(fieldList);
+  _NamedField._internal(fieldName, fieldList) : super._internal(fieldList) {
+    nameSymbol = _asSymbol(fieldName);
+    if (nameSymbol == null) {
+      throw new SerializationException("Invalid field name $fieldName");
+    }
+  }
 
-  operator ==(x) => x is _NamedField && (name == x.name);
+  String get name =>
+      _name == null ? _name = MirrorSystem.getName(nameSymbol) : _name;
+
+  operator ==(x) => x is _NamedField && (nameSymbol == x.nameSymbol);
   int get hashCode => name.hashCode;
 
   /**
    * Return true if this field is treated as essential state, either because
    * it is used in the constructor, or because it's been designated
-   * using [setFieldWith].
+   * using [BasicRule.setFieldWith].
    */
   bool get isEssential => super.isEssential || customSetter != null;
 
@@ -374,16 +386,15 @@
     setter(object, value);
   }
 
-  valueIn(InstanceMirror mirror) =>
-      deprecatedFutureValue(mirror.getFieldAsync(name)).reflectee;
+  valueIn(InstanceMirror mirror) => mirror.getField(nameSymbol).reflectee;
 
   /** Return the function to use to set our value. */
   Function get setter =>
       (customSetter != null) ? customSetter : defaultSetter;
 
-  /** Return a default setter function. */
+  /** The default setter function. */
   void defaultSetter(InstanceMirror object, value) {
-    object.setFieldAsync(name, reflect(value));
+    object.setField(nameSymbol, value);
   }
 
   String toString() => 'Field($name)';
@@ -421,8 +432,8 @@
  */
 class _FieldList extends IterableBase {
   /**
-   * All of our fields, indexed by name. Note that the names are not
-   * necessarily strings.
+   * All of our fields, indexed by name. Note that the names are
+   * typically Symbols, but can also be arbitrary constants.
    */
   Map<dynamic, _Field> allFields = new Map<dynamic, _Field>();
 
@@ -434,7 +445,7 @@
   List _constructorFields = const [];
 
   /** The list of fields to exclude if we are computing the list ourselves. */
-  List<String> _excludeFields = const [];
+  List<Symbol> _excludedFieldNames = const [];
 
   /** The mirror we will use to compute the fields. */
   final ClassMirror mirror;
@@ -448,15 +459,17 @@
   _FieldList(this.mirror);
 
   /** Look up a field by [name]. */
-  _Field named(String name) => allFields[name];
+  _Field named(name) => allFields[name];
 
   /** Set the fields to be used in the constructor. */
   set constructorFields(List fieldNames) {
     if (fieldNames == null || fieldNames.isEmpty) return;
     _constructorFields = [];
     for (var each in fieldNames) {
-      var field = new _Field(each, this)..usedInConstructor = true;
-      allFields[each] = field;
+      var symbol = _asSymbol(each);
+      var name = _Field._isReallyAField(symbol, this) ? symbol : each;
+      var field = new _Field(name, this)..usedInConstructor = true;
+      allFields[name] = field;
       _constructorFields.add(field);
     }
     invalidate();
@@ -478,7 +491,7 @@
     if (allFields.length > _constructorFields.length) {
       throw "You can't specify both excludeFields and regular fields";
     }
-    _excludeFields = fields;
+    _excludedFieldNames = fields.map((x) => new Symbol(x)).toList();
   }
 
   int get length => allFields.length;
@@ -487,14 +500,16 @@
   void addAllNotExplicitlyExcluded(Iterable<String> aCollection) {
     if (aCollection == null) return;
     var names = aCollection;
-    names = names.where((x) => !_excludeFields.contains(x));
+    names = names.where((x) => !_excludedFieldNames.contains(x));
     addAllByName(names);
   }
 
   /** Add all the fields with the given names without any special properties. */
   void addAllByName(Iterable<String> names) {
     for (var each in names) {
-      allFields.putIfAbsent(each, () => new _Field(each, this));
+      var symbol = _asSymbol(each);
+      var field = new _Field(symbol, this);
+      allFields.putIfAbsent(symbol, () => new _Field(symbol, this));
     }
     invalidate();
   }
@@ -562,7 +577,8 @@
     var fields = publicFields(mirror);
     var getters = publicGetters(mirror);
     var gettersWithSetters = getters.where( (each)
-        => mirror.setters["${each.simpleName}="] != null);
+        => mirror.setters[
+            new Symbol("${MirrorSystem.getName(each.simpleName)}=")] != null);
     var gettersThatMatchConstructor = getters.where((each)
         => (named(each.simpleName) != null) &&
             (named(each.simpleName).usedInConstructor)).toList();
@@ -590,11 +606,12 @@
 
   /** The name of the constructor to use, if not the default constructor.*/
   String name;
+  Symbol nameSymbol;
 
   /**
    * The indices of the fields used as constructor arguments. We will look
-   * these up in the state by number. These correspond to the index in the
-   * [contents] of the FieldList, which will be alphabetically sorted.
+   * these up in the state by number. The index is according to a list of the
+   * fields in alphabetical order by name.
    */
   List<int> fieldNumbers;
 
@@ -604,6 +621,7 @@
    */
   Constructor(this.type, this.name, this.fieldNumbers) {
     if (name == null) name = '';
+    nameSymbol = new Symbol(name);
     if (fieldNumbers == null) fieldNumbers = const [];
   }
 
@@ -614,9 +632,16 @@
   constructFrom(state, Reader r) {
     // TODO(alanknight): Handle named parameters
     Iterable inflated = fieldNumbers.map(
-        (x) => (x is int) ? reflect(r.inflateReference(state[x])) : reflect(x));
-    var result = type.newInstanceAsync(name, inflated.toList());
-    return deprecatedFutureValue(result);
+        (x) => (x is int) ? r.inflateReference(state[x]) : x);
+    var result;
+    try {
+      result = type.newInstance(nameSymbol, inflated.toList());
+    } on MirroredError catch (e) {
+      // Mirrored "compile-time" errors do not get treated as exceptions
+      // in the debugger, so explicitly re-throw. Issue dartbug.com/10054.
+      throw e;
+    }
+    return result;
   }
 }
 
@@ -637,3 +662,21 @@
 
   asMap() => _map;
 }
+
+/**
+ * Return a symbol corresponding to [value], which may be a String or a
+ * Symbol. If it is any other type, or if the string is an
+ * invalid symbol, return null;
+ */
+_asSymbol(value) {
+  if (value is Symbol) return value;
+  if (value is String) {
+    try {
+      return new Symbol(value);
+    } on ArgumentError {
+      return null;
+    };
+  } else {
+    return null;
+  }
+}
\ No newline at end of file
diff --git a/pkg/serialization/lib/src/format.dart b/pkg/serialization/lib/src/format.dart
index 4e57384..d42707d 100644
--- a/pkg/serialization/lib/src/format.dart
+++ b/pkg/serialization/lib/src/format.dart
@@ -82,7 +82,7 @@
  * with nesting of those.
  * Note that since the classes of objects aren't normally stored, this isn't
  * enough information to read back the objects. However, if the
- * If the [storeRoundTripData] field of the format is set to true, then this
+ * If the [storeRoundTripInfo] field of the format is set to true, then this
  * will store the rule number along with the data, allowing reconstruction.
  */
 class SimpleJsonFormat extends Format {
@@ -195,7 +195,7 @@
   }
 
   /**
-   * Convert nested references in [data] into [Reference] objects.
+   * Convert nested references in [input] into [Reference] objects.
    */
   recursivelyFixUp(input, Reader r, List result) {
     var data = input;
diff --git a/pkg/serialization/lib/src/mirrors_helpers.dart b/pkg/serialization/lib/src/mirrors_helpers.dart
index aeeb509..4058514 100644
--- a/pkg/serialization/lib/src/mirrors_helpers.dart
+++ b/pkg/serialization/lib/src/mirrors_helpers.dart
@@ -30,7 +30,8 @@
 
 /** Return true if the class has a field named [name]. Note that this
  * includes private fields, but excludes statics. */
-bool hasField(String name, ClassMirror mirror) {
+bool hasField(Symbol name, ClassMirror mirror) {
+  if (name == null) return false;
   var field = mirror.variables[name];
   if (field != null && !field.isStatic) return true;
   var superclass = mirror.superclass;
@@ -53,7 +54,8 @@
 }
 
 /** Return true if the class has a getter named [name] */
-bool hasGetter(String name, ClassMirror mirror) {
+bool hasGetter(Symbol name, ClassMirror mirror) {
+  if (name == null) return false;
   var getter = mirror.getters[name];
   if (getter != null && !getter.isStatic) return true;
   var superclass = mirror.superclass;
diff --git a/pkg/serialization/lib/src/reader_writer.dart b/pkg/serialization/lib/src/reader_writer.dart
index 2209f78..e25a3ec 100644
--- a/pkg/serialization/lib/src/reader_writer.dart
+++ b/pkg/serialization/lib/src/reader_writer.dart
@@ -211,7 +211,8 @@
   }
 
   /**
-   * Return true if the [namedObjects] collection has a reference to [object].
+   * Return true if the [Serialization.namedObjects] collection has a
+   * reference to [object].
    */
   // TODO(alanknight): Should the writer also have its own namedObjects
   // collection specific to the particular write, or is that just adding
@@ -219,7 +220,8 @@
   hasNameFor(object) => serialization._hasNameFor(object);
 
   /**
-   * Return the name we have for this object in the [namedObjects] collection.
+   * Return the name we have for this object in the [Serialization.namedObjects]
+   * collection.
    */
   nameFor(object) => serialization._nameFor(object);
 
@@ -278,7 +280,7 @@
 
   /**
    * The resulting objects, indexed according to the same scheme as
-   * [data], where each rule has a number, and rules keep track of the objects
+   * _data, where each rule has a number, and rules keep track of the objects
    * that they serialize, in order.
    */
   List<List> objects;
@@ -579,7 +581,7 @@
   /**
    * Convert the reference to a map in JSON format. This is specific to the
    * custom JSON format we define, and must be consistent with the
-   * [asReference] method.
+   * [Reader.asReference] method.
    */
   // TODO(alanknight): This is a hack both in defining a toJson specific to a
   // particular representation, and the use of a bogus sentinel "__Ref"
diff --git a/pkg/serialization/lib/src/serialization_rule.dart b/pkg/serialization/lib/src/serialization_rule.dart
index d63f07a..0fc6f3e 100644
--- a/pkg/serialization/lib/src/serialization_rule.dart
+++ b/pkg/serialization/lib/src/serialization_rule.dart
@@ -387,24 +387,25 @@
  * qualifiedName and attempts to look it up in both the namedObjects
  * collection, or if it's not found there, by looking it up in the mirror
  * system. When reading, the user is responsible for supplying the appropriate
- * values in [namedObjects] or in the [externals] paramter to
+ * values in [Serialization.namedObjects] or in the [externals] paramter to
  * [Serialization.read].
  */
 class MirrorRule extends NamedObjectRule {
   bool appliesTo(object, Writer writer) => object is DeclarationMirror;
-  nameFor(DeclarationMirror object, Writer writer) => object.qualifiedName;
+  nameFor(DeclarationMirror object, Writer writer) =>
+      MirrorSystem.getName(object.qualifiedName);
 
   inflateEssential(state, Reader r) {
     var qualifiedName = r.resolveReference(state.first);
     var lookupFull = r.objectNamed(qualifiedName, (x) => null);
     if (lookupFull != null) return lookupFull;
     var separatorIndex = qualifiedName.lastIndexOf(".");
-    var lib = qualifiedName.substring(0, separatorIndex);
+    var lib = new Symbol(qualifiedName.substring(0, separatorIndex));
     var type = qualifiedName.substring(separatorIndex + 1);
     var lookup = r.objectNamed(type, (x) => null);
     if (lookup != null) return lookup;
-    var libMirror = currentMirrorSystem().libraries[lib];
-    return libMirror.classes[type];
+    var libMirror = currentMirrorSystem().findLibrary(lib).first;
+    return libMirror.classes[new Symbol(type)];
   }
 }
 
@@ -469,6 +470,16 @@
   get hasVariableLengthEntries => true;
 }
 
+/** A hard-coded rule for serializing Symbols. */
+class SymbolRule extends CustomRule {
+  bool appliesTo(instance, _) => instance is Symbol;
+  getState(instance) => [MirrorSystem.getName(instance)];
+  create(state) => new Symbol(state[0]);
+  setState(symbol, state) {}
+  int get dataLength => 1;
+  bool get hasVariableLengthEntries => false;
+}
+
 /** Create a lazy list/map that will inflate its items on demand in [r]. */
 _lazy(l, Reader r) {
   if (l is List) return new _LazyList(l, r);
diff --git a/pkg/serialization/test/serialization_test.dart b/pkg/serialization/test/serialization_test.dart
index 2987fe0..47c8a6ae 100644
--- a/pkg/serialization/test/serialization_test.dart
+++ b/pkg/serialization/test/serialization_test.dart
@@ -123,9 +123,16 @@
     var stream = new Stream([3,4,5]);
     expect((stream..next()).next(), 4);
     expect(stream.position, 2);
+    // The Symbol class does not allow us to create symbols for private
+    // variables. However, the mirror system uses them. So we get the symbol
+    // we want from the mirror.
+    // TODO(alanknight): Either delete this test and decide we shouldn't
+    // attempt to access private variables or fix this properly.
+    var _collectionSym = reflect(stream).type.variables.keys.firstWhere(
+        (x) => MirrorSystem.getName(x) == "_collection");
     var s = new Serialization()
       ..addRuleFor(stream,
-          constructorFields: ['_collection']);
+          constructorFields: [_collectionSym]);
     var state = states(stream, s).first;
     // Define names for the variable offsets to make this more readable.
     var _collection = 0, position = 1;
@@ -211,7 +218,7 @@
     var w = new Writer(s);
     w.trace = new Trace(w);
     w.write(n1);
-    expect(w.states.length, 5); // prims, lists, essential lists, basic
+    expect(w.states.length, 6); // prims, lists, essential lists, basic, symbol
     var children = 0, name = 1, parent = 2;
     var nodeRule = s.rules.firstWhere((x) => x is BasicRule);
     List rootNode = w.states[nodeRule.number].where(
@@ -510,6 +517,15 @@
     expect(new Reader(s).asReference(map["person"]) is Reference, isTrue);
   });
 
+  test("MirrorRule with lookup by qualified name rather than named object", () {
+    var s = new Serialization()..addRule(new MirrorRule());
+    var m = reflectClass(Address);
+    var output = s.write(m);
+    var input = s.read(output);
+    expect(input is ClassMirror, isTrue);
+    expect(MirrorSystem.getName(input.simpleName), "Address");
+  });
+
 }
 
 /******************************************************************************
@@ -651,7 +667,7 @@
 
 /**
  * Run a round-trip test on a simple tree of nodes, using a serialization
- * that's returned by the [serializerSetup] function.
+ * that's returned by the [serializerSetUp] function.
  */
 runRoundTripTest(Function serializerSetUp) {
   Node n1 = new Node("1"), n2 = new Node("2"), n3 = new Node("3");
diff --git a/pkg/source_maps/lib/source_maps.dart b/pkg/source_maps/lib/source_maps.dart
index 4e24dea..1594827 100644
--- a/pkg/source_maps/lib/source_maps.dart
+++ b/pkg/source_maps/lib/source_maps.dart
@@ -4,6 +4,21 @@
 
 /// Source maps library.
 ///
+/// ## Installing ##
+///
+/// Use [pub][] to install this package. Add the following to your
+/// `pubspec.yaml` file.
+///
+///     dependencies:
+///       source_maps: any
+///
+/// Then run `pub install`.
+///
+/// For more information, see the
+/// [source_maps package on pub.dartlang.org][pkg].
+///
+/// ## Using ##
+///
 /// Create a source map using [SourceMapBuilder]. For example:
 ///     var json = (new SourceMapBuilder()
 ///         ..add(inputSpan1, outputSpan1)
@@ -17,6 +32,9 @@
 /// object. For example:
 ///     var mapping = parse(json);
 ///     mapping.spanFor(outputSpan1.line, outputSpan1.column)
+///
+/// [pub]: http://pub.dartlang.org
+/// [pkg]: http://pub.dartlang.org/packages/source_maps
 library source_maps;
 
 export "builder.dart";
diff --git a/pkg/stack_trace/lib/src/trace.dart b/pkg/stack_trace/lib/src/trace.dart
index fa0c313..54f99db 100644
--- a/pkg/stack_trace/lib/src/trace.dart
+++ b/pkg/stack_trace/lib/src/trace.dart
@@ -4,6 +4,7 @@
 
 library trace;
 
+import 'dart:collection';
 import 'dart:uri';
 import 'dart:math' as math;
 
@@ -13,7 +14,6 @@
 
 /// A stack trace, comprised of a list of stack frames.
 class Trace implements StackTrace {
-  // TODO(nweiz): make this read-only once issue 8321 is fixed.
   /// The stack frames that comprise this stack trace.
   final List<Frame> frames;
 
@@ -63,7 +63,7 @@
 
   /// Returns a new [Trace] comprised of [frames].
   Trace(Iterable<Frame> frames)
-      : frames = frames.toList();
+      : frames = new UnmodifiableListView<Frame>(frames.toList());
 
   // TODO(nweiz): Keep track of which [Frame]s are part of the partial stack
   // trace and only print them.
diff --git a/pkg/stack_trace/lib/src/utils.dart b/pkg/stack_trace/lib/src/utils.dart
index 790dec8..50ccab3 100644
--- a/pkg/stack_trace/lib/src/utils.dart
+++ b/pkg/stack_trace/lib/src/utils.dart
@@ -15,7 +15,14 @@
     throw new ArgumentError("Uri $uri must have scheme 'file:'.");
   }
   if (Platform.operatingSystem != 'windows') return uri.path;
-  return uri.path.replaceFirst("/", "").replaceAll("/", "\\");
+  if (uri.path.startsWith("/")) {
+    // Drive-letter paths look like "file:///C:/path/to/file". The replaceFirst
+    // removes the extra initial slash.
+    return uri.path.replaceFirst("/", "").replaceAll("/", "\\");
+  } else {
+    // Network paths look like "file://hostname/path/to/file".
+    return "\\\\${uri.path.replaceAll("/", "\\")}";
+  }
 }
 
 /// Converts a local path string to a `file:` [Uri].
@@ -23,7 +30,11 @@
   pathString = path.absolute(pathString);
   if (Platform.operatingSystem != 'windows') {
     return Uri.parse('file://$pathString');
+  } else if (path.rootPrefix(pathString).startsWith('\\\\')) {
+    // Network paths become "file://hostname/path/to/file".
+    return Uri.parse('file:${pathString.replaceAll("\\", "/")}');
   } else {
+    // Drive-letter paths become "file:///C:/path/to/file".
     return Uri.parse('file:///${pathString.replaceAll("\\", "/")}');
   }
 }
diff --git a/pkg/stack_trace/lib/stack_trace.dart b/pkg/stack_trace/lib/stack_trace.dart
index 5747b85..f031f95 100644
--- a/pkg/stack_trace/lib/stack_trace.dart
+++ b/pkg/stack_trace/lib/stack_trace.dart
@@ -2,6 +2,23 @@
 // 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.
 
+/**
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       stack_trace: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [stack_trace package on pub.dartlang.org][pkg].
+ *
+ * [pub]: http://pub.dartlang.org
+ * [pkg]: http://pub.dartlang.org/packages/stack_trace
+ */
 library stack_trace;
 
 export 'src/trace.dart';
diff --git a/pkg/unittest/lib/matcher.dart b/pkg/unittest/lib/matcher.dart
index 6584198..8110432 100644
--- a/pkg/unittest/lib/matcher.dart
+++ b/pkg/unittest/lib/matcher.dart
@@ -4,6 +4,22 @@
 /**
  * The matcher library provides a 3rd generation assertion mechanism, drawing
  * inspiration from [Hamcrest](http://code.google.com/p/hamcrest/).
+ *
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       matcher: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [matcher package on pub.dartlang.org][pkg].
+ *
+ * [pub]: http://pub.dartlang.org
+ * [pkg]: http://pub.dartlang.org/packages/matcher
  */
 library matcher;
 
diff --git a/pkg/unittest/lib/mock.dart b/pkg/unittest/lib/mock.dart
index 9ee6d8a..cacaec7 100644
--- a/pkg/unittest/lib/mock.dart
+++ b/pkg/unittest/lib/mock.dart
@@ -5,6 +5,21 @@
 /**
  * A simple mocking/spy library.
  *
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       mock: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [mock package on pub.dartlang.org](http://pub.dartlang.org/packages/mock).
+ *
+ * ## Using ##
+ *
  * To create a mock objects for some class T, create a new class using:
  *
  *     class MockT extends Mock implements T {};
@@ -87,6 +102,7 @@
  *       }
  *     }
  *
+ * [pub]: http://pub.dartlang.org
  */
 
 library mock;
diff --git a/pkg/unittest/lib/src/core_matchers.dart b/pkg/unittest/lib/src/core_matchers.dart
index e8606aa..980e7a0 100644
--- a/pkg/unittest/lib/src/core_matchers.dart
+++ b/pkg/unittest/lib/src/core_matchers.dart
@@ -177,9 +177,8 @@
         var aType = typeName(actual);
         var includeTypes = eType != aType;
         // If we have recursed, show the expected value too; if not,
-        // expect() will show it for us. As expect will not show type
-        // mismatches at the top level we handle those here too.
-        if (includeTypes || depth > 1) {
+        // expect() will show it for us.
+        if (depth > 0) {
           reason.add('expected ');
           if (includeTypes) {
             reason.add(eType).add(':');
@@ -191,6 +190,9 @@
           reason.add(aType).add(':');
         }
         reason.addDescriptionOf(actual);
+        if (includeTypes && depth == 0) {
+          reason.add(' (not type ').add(eType).add(')');
+        }
       }
     }
     if (reason != null && location.length > 0) {
@@ -706,8 +708,8 @@
   final String _featureName;
   final Matcher _matcher;
 
-  const CustomMatcher(this._featureDescription, this._featureName,
-      this._matcher);
+  CustomMatcher(this._featureDescription, this._featureName, matcher)
+      : this._matcher = wrapMatcher(matcher);
 
   /** Override this to extract the interesting feature.*/
   featureValueOf(actual) => actual;
diff --git a/pkg/unittest/lib/src/test_case.dart b/pkg/unittest/lib/src/test_case.dart
index 13d59f5..8e761f6 100644
--- a/pkg/unittest/lib/src/test_case.dart
+++ b/pkg/unittest/lib/src/test_case.dart
@@ -61,9 +61,9 @@
   Completer _testComplete;
 
   TestCase._internal(this.id, this.description, this.testFunction)
-  : currentGroup = _currentGroup,
-    setUp = _testSetup,
-    tearDown = _testTeardown;
+  : currentGroup = _currentContext.fullName,
+    setUp = _currentContext.testSetup,
+    tearDown = _currentContext.testTeardown;
 
   bool get isComplete => !enabled || result != null;
 
@@ -83,7 +83,10 @@
     --_callbackFunctionsOutstanding;
     if (f is Future) {
       return f.then((_) => _finishTest())
-       .catchError((error) => fail("${error}"));
+        .catchError((error) {
+          var stack = getAttachedStackTrace(error);
+          _registerException(this, error, stack);
+        });
     } else {
       _finishTest();
       return null;
@@ -118,7 +121,8 @@
           // a failed setUp. There is no right answer, but doing it
           // seems to be the more conservative approach, because
           // unittest will not stop at a test failure.
-          error("$description: Test setup failed: $e");
+          var stack = getAttachedStackTrace(e);
+          error("$description: Test setup failed: $e", "$stack");
         });
     } else {
       var f = _runTest();
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index 50d308b..b2abf069 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -5,9 +5,20 @@
 /**
  * A library for writing dart unit tests.
  *
- * To import this library, install the
- * [unittest package](http://pub.dartlang.org/packages/unittest) via the pub
- * package manager. See the [Getting Started](http://pub.dartlang.org/doc)
+ * ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       unittest: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [unittest package on pub.dartlang.org][pkg].
+ *
+ * See the [Getting Started](http://pub.dartlang.org/doc)
  * guide for more details.
  *
  * ##Concepts##
@@ -150,6 +161,8 @@
  *       });
  *     }
  *
+ * [pub]: http://pub.dartlang.org
+ * [pkg]: http://pub.dartlang.org/packages/unittest
  */
 library unittest;
 
@@ -192,24 +205,85 @@
 void logMessage(String message) =>
     _config.onLogMessage(currentTestCase, message);
 
-/**
- * Description text of the current test group. If multiple groups are nested,
- * this will contain all of their text concatenated.
- */
-String _currentGroup = '';
-
 /** Separator used between group names and test names. */
 String groupSep = ' ';
 
-// TODO(nweiz): present an unmodifiable view of this once issue 8321 is fixed.
+final List<TestCase> _testCases = new List<TestCase>();
+
 /** Tests executed in this suite. */
-final List<TestCase> testCases = new List<TestCase>();
+final List<TestCase> testCases = new UnmodifiableListView<TestCase>(_testCases);
 
-/** Setup function called before each test in a group */
-Function _testSetup;
+/**
+ * Setup and teardown functions for a group and its parents, the latter
+ * for chaining.
+ */
+class GroupContext {
+  final GroupContext parent;
 
-/** Teardown function called after each test in a group */
-Function _testTeardown;
+  /** Description text of the current test group. */
+  final String _name;
+
+  /** Setup function called before each test in a group. */
+  Function _testSetup;
+
+  get testSetup => _testSetup;
+
+  get parentSetup => (parent == null) ? null : parent.testSetup;
+
+  set testSetup(Function setup) {
+    var preSetup = parentSetup;
+    if (preSetup == null) {
+      _testSetup = setup;
+    } else {
+      _testSetup = () {
+        var f = preSetup();
+        if (f is Future) {
+          return f.then((_) => setup());
+        } else {
+          return setup();
+        }
+      };
+    }
+  }
+
+  /** Teardown function called after each test in a group. */
+  Function _testTeardown;
+
+  get testTeardown => _testTeardown;
+
+  get parentTeardown => (parent == null) ? null : parent.testTeardown;
+
+  set testTeardown(Function teardown) {
+    var postTeardown = parentTeardown;
+    if (postTeardown == null) {
+      _testTeardown = teardown;
+    } else {
+      _testTeardown = () {
+        var f = teardown();
+        if (f is Future) {
+          return f.then((_) => postTeardown());
+        } else {
+          return postTeardown();
+        }
+      };
+    }
+  }
+
+  String get fullName => (parent == null || parent == _rootContext)
+      ? _name
+      : "${parent.fullName}$groupSep$_name";
+
+  GroupContext([this.parent, this._name = '']) {
+    _testSetup = parentSetup;
+    _testTeardown = parentTeardown;
+  }
+}
+
+// We use a 'dummy' context for the top level to eliminate null
+// checks when querying the context. This allows us to easily
+//  support top-level setUp/tearDown functions as well.
+GroupContext _rootContext = new GroupContext();
+GroupContext _currentContext = _rootContext;
 
 int _currentTestCaseIndex = 0;
 
@@ -252,8 +326,8 @@
  */
 void test(String spec, TestFunction body) {
   ensureInitialized();
-  testCases.add(new TestCase._internal(testCases.length + 1, _fullSpec(spec),
-                                       body));
+  _testCases.add(new TestCase._internal(testCases.length + 1, _fullSpec(spec),
+                                        body));
 }
 
 /**
@@ -275,8 +349,9 @@
 
   ensureInitialized();
 
-  _soloTest = new TestCase._internal(testCases.length + 1, _fullSpec(spec), body);
-  testCases.add(_soloTest);
+  _soloTest = new TestCase._internal(testCases.length + 1, _fullSpec(spec),
+                                     body);
+  _testCases.add(_soloTest);
 }
 
 /** Sentinel value for [_SpreadArgsHelper]. */
@@ -292,10 +367,9 @@
   final int minExpectedCalls;
   final int maxExpectedCalls;
   final Function isDone;
-  final int testNum;
   final String id;
   int actualCalls = 0;
-  TestCase testCase;
+  final TestCase testCase;
   bool complete;
   static const sentinel = const _Sentinel();
 
@@ -307,19 +381,14 @@
             ? minExpected
             : maxExpected,
         this.isDone = isDone,
-        testNum = _currentTestCaseIndex,
+        this.testCase = currentTestCase,
         this.id = _makeCallbackId(id, callback) {
     ensureInitialized();
-    if (!(_currentTestCaseIndex >= 0 &&
-           _currentTestCaseIndex < testCases.length &&
-           testCases[_currentTestCaseIndex] != null)) {
-      print("No valid test, did you forget to run your test inside a call "
-          "to test()?");
+    if (testCase == null) {
+      throw new StateError("No valid test. Did you forget to run your test "
+          "inside a call to test()?");
     }
-    assert(_currentTestCaseIndex >= 0 &&
-           _currentTestCaseIndex < testCases.length &&
-           testCases[_currentTestCaseIndex] != null);
-    testCase = testCases[_currentTestCaseIndex];
+
     if (isDone != null || minExpected > 0) {
       testCase._callbackFunctionsOutstanding++;
       complete = false;
@@ -328,7 +397,7 @@
     }
   }
 
-  static _makeCallbackId(String id, Function callback) {
+  static String _makeCallbackId(String id, Function callback) {
     // Try to create a reasonable id.
     if (id != null) {
       return "$id ";
@@ -349,7 +418,7 @@
     return '';
   }
 
-  shouldCallBack() {
+  bool shouldCallBack() {
     ++actualCalls;
     if (testCase.isComplete) {
       // Don't run if the test is done. We don't throw here as this is not
@@ -369,7 +438,7 @@
     return true;
   }
 
-  after() {
+  void after() {
     if (!complete) {
       if (minExpectedCalls > 0 && actualCalls < minExpectedCalls) return;
       if (isDone != null && !isDone()) return;
@@ -381,31 +450,6 @@
     }
   }
 
-  invoke([arg0 = sentinel, arg1 = sentinel, arg2 = sentinel,
-          arg3 = sentinel, arg4 = sentinel]) {
-    return _guardAsync(() {
-      if (!shouldCallBack()) {
-        return;
-      } else if (arg0 == sentinel) {
-        return callback();
-      } else if (arg1 == sentinel) {
-        return callback(arg0);
-      } else if (arg2 == sentinel) {
-        return callback(arg0, arg1);
-      } else if (arg3 == sentinel) {
-        return callback(arg0, arg1, arg2);
-      } else if (arg4 == sentinel) {
-        return callback(arg0, arg1, arg2, arg3);
-      } else {
-        testCase.error(
-           'unittest lib does not support callbacks with more than'
-              ' 4 arguments.',
-           '');
-      }
-    },
-    after, testNum);
-  }
-
   invoke0() {
     return _guardAsync(
         () {
@@ -413,7 +457,7 @@
             return callback();
           }
         },
-        after, testNum);
+        after, testCase);
   }
 
   invoke1(arg1) {
@@ -423,7 +467,7 @@
             return callback(arg1);
           }
         },
-        after, testNum);
+        after, testCase);
   }
 
   invoke2(arg1, arg2) {
@@ -433,7 +477,7 @@
             return callback(arg1, arg2);
           }
         },
-        after, testNum);
+        after, testCase);
   }
 }
 
@@ -441,21 +485,6 @@
  * Indicate that [callback] is expected to be called a [count] number of times
  * (by default 1). The unittest framework will wait for the callback to run the
  * specified [count] times before it continues with the following test.  Using
- * [_expectAsync] will also ensure that errors that occur within [callback] are
- * tracked and reported. [callback] should take between 0 and 4 positional
- * arguments (named arguments are not supported here). [id] can be used
- * to provide more descriptive error messages if the callback is called more
- * often than expected.
- */
-Function _expectAsync(Function callback,
-                     {int count: 1, int max: 0, String id}) {
-  return new _SpreadArgsHelper(callback, count, max, null, id).invoke;
-}
-
-/**
- * Indicate that [callback] is expected to be called a [count] number of times
- * (by default 1). The unittest framework will wait for the callback to run the
- * specified [count] times before it continues with the following test.  Using
  * [expectAsync0] will also ensure that errors that occur within [callback] are
  * tracked and reported. [callback] should take 0 positional arguments (named
  * arguments are not supported). [id] can be used to provide more
@@ -489,20 +518,6 @@
 
 /**
  * Indicate that [callback] is expected to be called until [isDone] returns
- * true. The unittest framework checks [isDone] after each callback and only
- * when it returns true will it continue with the following test. Using
- * [expectAsyncUntil] will also ensure that errors that occur within
- * [callback] are tracked and reported. [callback] should take between 0 and
- * 4 positional arguments (named arguments are not supported). [id] can be
- * used to identify the callback in error messages (for example if it is called
- * after the test case is complete).
- */
-Function _expectAsyncUntil(Function callback, Function isDone, {String id}) {
-  return new _SpreadArgsHelper(callback, 0, -1, isDone, id).invoke;
-}
-
-/**
- * Indicate that [callback] is expected to be called until [isDone] returns
  * true. The unittest framework check [isDone] after each callback and only
  * when it returns true will it continue with the following test. Using
  * [expectAsyncUntil0] will also ensure that errors that occur within
@@ -537,19 +552,6 @@
  * function will be able to handle exceptions by directing them to the correct
  * test. This is thus similar to expectAsync0. Use it to wrap any callbacks that
  * might optionally be called but may never be called during the test.
- * [callback] should take between 0 and 4 positional arguments (named arguments
- * are not supported). [id] can be used to identify the callback in error
- * messages (for example if it is called after the test case is complete).
- */
-Function _protectAsync(Function callback, {String id}) {
-  return new _SpreadArgsHelper(callback, 0, -1, null, id).invoke;
-}
-
-/**
- * Wraps the [callback] in a new function and returns that function. The new
- * function will be able to handle exceptions by directing them to the correct
- * test. This is thus similar to expectAsync0. Use it to wrap any callbacks that
- * might optionally be called but may never be called during the test.
  * [callback] should take 0 positional arguments (named arguments are not
  * supported). [id] can be used to identify the callback in error
  * messages (for example if it is called after the test case is complete).
@@ -581,46 +583,27 @@
  */
 void group(String description, void body()) {
   ensureInitialized();
-  // Concatenate the new group.
-  final parentGroup = _currentGroup;
-  if (_currentGroup != '') {
-    // Add a space.
-    _currentGroup = '$_currentGroup$groupSep$description';
-  } else {
-    // The first group.
-    _currentGroup = description;
-  }
-
-  // Groups can be nested, so we need to preserve the current
-  // settings for test setup/teardown.
-  Function parentSetup = _testSetup;
-  Function parentTeardown = _testTeardown;
-
+  _currentContext = new GroupContext(_currentContext, description);
   try {
-    _testSetup = null;
-    _testTeardown = null;
     body();
   } catch (e, trace) {
     var stack = (trace == null) ? '' : ': ${trace.toString()}';
     _uncaughtErrorMessage = "${e.toString()}$stack";
   } finally {
     // Now that the group is over, restore the previous one.
-    _currentGroup = parentGroup;
-    _testSetup = parentSetup;
-    _testTeardown = parentTeardown;
+    _currentContext = _currentContext.parent;
   }
 }
 
 /**
  * Register a [setUp] function for a test [group]. This function will
- * be called before each test in the group is run. Note that if groups
- * are nested only the most locally scoped [setUpTest] function will be run.
+ * be called before each test in the group is run.
  * [setUp] and [tearDown] should be called within the [group] before any
  * calls to [test]. The [setupTest] function can be asynchronous; in this
  * case it must return a [Future].
  */
 void setUp(Function setupTest) {
-  _testSetup = setupTest;
+  _currentContext.testSetup = setupTest;
 }
 
 /**
@@ -632,12 +615,12 @@
  * case it must return a [Future].
  */
 void tearDown(Function teardownTest) {
-  _testTeardown = teardownTest;
+  _currentContext.testTeardown = teardownTest;
 }
 
 /** Advance to the next test case. */
 void _nextTestCase() {
-  _defer(() {
+  runAsync(() {
     _currentTestCaseIndex++;
     _nextBatch();
   });
@@ -656,19 +639,6 @@
   }
 }
 
-/**
- * Runs [callback] at the end of the event loop. Note that we don't wrap
- * the callback in guardAsync; this is for test framework functions which
- * should not be throwing unexpected exceptions that end up failing test
- * cases! Furthermore, we need the final exception to be thrown but not
- * caught by the test framework if any test cases failed. However, tests
- * that make use of a similar defer function *should* wrap the callback
- * (as we do in unitttest_test.dart).
- */
-_defer(void callback()) {
-  (new Future.value()).then((_) => callback());
-}
-
 void rerunTests() {
   _uncaughtErrorMessage = null;
   _initialized = true; // We don't want to reset the test array.
@@ -690,14 +660,13 @@
   } else if (testFilter is Function) {
     filterFunction = testFilter;
   }
-  testCases.retainWhere(filterFunction);
+  _testCases.retainWhere(filterFunction);
 }
 
 /** Runs all queued tests, one at a time. */
 void runTests() {
   _ensureInitialized(false);
   _currentTestCaseIndex = 0;
-  _currentGroup = '';
 
   // If we are soloing a test, remove all the others.
   if (_soloTest != null) {
@@ -706,7 +675,7 @@
 
   _config.onStart();
 
-  _defer(() {
+  runAsync(() {
     _nextBatch();
   });
 }
@@ -718,15 +687,15 @@
  * The value returned by [tryBody] (if any) is returned by [guardAsync].
  */
 guardAsync(Function tryBody) {
-  return _guardAsync(tryBody, null, _currentTestCaseIndex);
+  return _guardAsync(tryBody, null, currentTestCase);
 }
 
-_guardAsync(Function tryBody, Function finallyBody, int testNum) {
-  assert(testNum >= 0);
+_guardAsync(Function tryBody, Function finallyBody, TestCase testCase) {
+  assert(testCase != null);
   try {
     return tryBody();
   } catch (e, trace) {
-    _registerException(testNum, e, trace);
+    _registerException(testCase, e, trace);
   } finally {
     if (finallyBody != null) finallyBody();
   }
@@ -736,19 +705,19 @@
  * Registers that an exception was caught for the current test.
  */
 void registerException(e, [trace]) {
-  _registerException(_currentTestCaseIndex, e, trace);
+  _registerException(currentTestCase, e, trace);
 }
 
 /**
  * Registers that an exception was caught for the current test.
  */
-void _registerException(testNum, e, [trace]) {
+void _registerException(TestCase testCase, e, [trace]) {
   trace = trace == null ? '' : trace.toString();
   String message = (e is TestFailure) ? e.message : 'Caught $e';
-  if (testCases[testNum].result == null) {
-    testCases[testNum].fail(message, trace);
+  if (testCase.result == null) {
+    testCase.fail(message, trace);
   } else {
-    testCases[testNum].error(message, trace);
+    testCase.error(message, trace);
   }
 }
 
@@ -764,7 +733,7 @@
       break;
     }
     final testCase = testCases[_currentTestCaseIndex];
-    var f = _guardAsync(testCase._run, null, _currentTestCaseIndex);
+    var f = _guardAsync(testCase._run, null, testCase);
     if (f != null) {
       f.whenComplete(() {
         _nextTestCase(); // Schedule the next test.
@@ -796,8 +765,9 @@
 }
 
 String _fullSpec(String spec) {
-  if (spec == null) return '$_currentGroup';
-  return _currentGroup != '' ? '$_currentGroup$groupSep$spec' : spec;
+  var group = '${_currentContext.fullName}';
+  if (spec == null) return group;
+  return group != '' ? '$group$groupSep$spec' : spec;
 }
 
 /**
@@ -825,7 +795,7 @@
   if (configAutoStart && _config.autoStart) {
     // Immediately queue the suite up. It will run after a timeout (i.e. after
     // main() has returned).
-    _defer(runTests);
+    runAsync(runTests);
   }
 }
 
diff --git a/pkg/unittest/test/matchers_test.dart b/pkg/unittest/test/matchers_test.dart
index be286ea..4f1ae6e 100644
--- a/pkg/unittest/test/matchers_test.dart
+++ b/pkg/unittest/test/matchers_test.dart
@@ -30,7 +30,7 @@
 }
 
 class HasPrice extends CustomMatcher {
-  const HasPrice(matcher) :
+  HasPrice(matcher) :
     super("Widget with a price that is", "price", matcher);
   featureValueOf(actual) => actual.price;
 }
@@ -237,20 +237,25 @@
       shouldPass(b, hasLength(2));
     });
 
-    test('type mismatch', () {
-      var a = new DateTime.utc(2000);
-      var b = a.toString();
-      // We should get something like:
-      //    Expected: '2000-01-01 00:00:00.000Z'
-      //    but: expected String:'2000-01-01 00:00:00.000Z'
-      //    but was DateTime:<2000-01-01 00:00:00.000Z>.
-      // However, if minification is applied, then the type names
-      // will be shortened to two letters. The key thing is that
-      // there will be a "but: expected" part in the middle;
-      // this only happens with type mismatches or mismatches
-      // inside container types.
-      shouldFail(a, equals(b),
-          matches(new RegExp("^Expected.*but: expected .*but was.*\$")));
+    test('scalar type mismatch', () {
+      shouldFail('error', equals(5.1),
+          matches("^Expected: <5\.1>"
+                  "     but: was .*:'error' \\(not type .*\\)\.\$"));
+    });
+
+    test('nested type mismatch', () {
+      shouldFail(['error'], equals([5.1]),
+          matches(r"^Expected: <\[5\.1\]>"
+                  "     but: expected double:<5\.1> "
+                  "but was .*:'error' mismatch at position 0\.\$"));
+    });
+
+    test('doubly-nested type mismatch', () {
+      shouldFail([['error']], equals([[5.1]]),
+          matches(r"^Expected: <\[\[5\.1\]\]>"
+                  "     but: expected double:<5\.1> "
+                  "but was .*:'error' mismatch at position 0 "
+                  "mismatch at position 0\.\$"));
     });
   });
 
@@ -502,7 +507,7 @@
       shouldPass(d, orderedEquals([1, 2]));
       shouldFail(d, orderedEquals([2, 1]),
           "Expected: equals <[2, 1]> ordered "
-          "but: was <1> mismatch at position 0.");
+          "but: expected <2> but was <1> mismatch at position 0.");
     });
 
     test('unorderedEquals', () {
@@ -702,6 +707,7 @@
     test("Feature Matcher", () {
       var w = new Widget();
       w.price = 10;
+      shouldPass(w, new HasPrice(10));
       shouldPass(w, new HasPrice(greaterThan(0)));
       shouldFail(w, new HasPrice(greaterThan(10)),
           'Expected: Widget with a price that is a value greater than <10> '
diff --git a/pkg/unittest/test/unittest_test.dart b/pkg/unittest/test/unittest_test.dart
index 24ff29d..aa1bd97 100644
--- a/pkg/unittest/test/unittest_test.dart
+++ b/pkg/unittest/test/unittest_test.dart
@@ -68,6 +68,26 @@
   }
 }
 
+makeDelayedSetup(index, s) => () {
+  return new Future.delayed(new Duration(milliseconds:1), () {
+    s.write('l$index U ');
+  });
+};
+
+makeDelayedTeardown(index, s) => () {
+  return new Future.delayed(new Duration(milliseconds:1), () {
+    s.write('l$index D ');
+  });
+};
+
+makeImmediateSetup(index, s) => () {
+  s.write('l$index U ');
+};
+
+makeImmediateTeardown(index, s) => () {
+  s.write('l$index D ');
+};
+
 runTest() {
   port.receive((String testName, sendport) {
     var testConfig = new TestConfiguration(sendport);
@@ -292,8 +312,38 @@
       });
       test('foo6', () {
       });
+    } else if (testName == 'testCases immutable') {
+      test(testName, () {
+        expect(() => testCases.clear(), throwsUnsupportedError);
+        expect(() => testCases.removeLast(), throwsUnsupportedError);
+      });
     } else if (testName == 'runTests without tests') {
       runTests();
+    } else if (testName == 'nested groups setup/teardown') {
+      StringBuffer s = new StringBuffer();
+      group('level 1', () {
+        setUp(makeDelayedSetup(1, s));
+        group('level 2', () {
+          setUp(makeImmediateSetup(2, s));
+          tearDown(makeDelayedTeardown(2, s));
+          group('level 3', () {
+            group('level 4', () {
+              setUp(makeDelayedSetup(4, s));
+              tearDown(makeImmediateTeardown(4, s));
+              group('level 5', () {
+                setUp(makeImmediateSetup(5, s));
+                group('level 6', () {
+                  tearDown(makeDelayedTeardown(6, s));
+                  test('inner', () {});
+                });
+              });
+            });
+          });
+        });
+      });
+      test('after nest', () {
+        expect(s.toString(), "l1 U l2 U l4 U l5 U l6 D l4 D l2 D ");
+      });
     }
   });
 }
@@ -348,7 +398,12 @@
         'fail2:failure:'
         'error2:Callback called more times than expected (1).:'
         'foo6'),
-    'runTests without tests': buildStatusString(0, 0, 0, null)
+    'testCases immutable':
+        buildStatusString(1, 0, 0, 'testCases immutable'),
+    'runTests without tests': buildStatusString(0, 0, 0, null),
+    'nested groups setup/teardown':
+        buildStatusString(2, 0, 0,
+            'level 1 level 2 level 3 level 4 level 5 level 6 inner::after nest')
   };
 
   tests.forEach((String name, String expected) {
diff --git a/pkg/webdriver/lib/webdriver.dart b/pkg/webdriver/lib/webdriver.dart
index fbae2d3..724332d9 100644
--- a/pkg/webdriver/lib/webdriver.dart
+++ b/pkg/webdriver/lib/webdriver.dart
@@ -14,6 +14,21 @@
 /**
  * WebDriver bindings for Dart.
  *
+* ## Installing ##
+ *
+ * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
+ * file.
+ *
+ *     dependencies:
+ *       webdriver: any
+ *
+ * Then run `pub install`.
+ *
+ * For more information, see the
+ * [webdriver package on pub.dartlang.org][pkg].
+ *
+ * ## Using ##
+ *
  * These bindings are based on the WebDriver JSON wire protocol spec
  * (http://code.google.com/p/selenium/wiki/JsonWireProtocol). Not
  * all of these commands are implemented yet by WebDriver itself.
@@ -50,6 +65,9 @@
  *    }).then((_) {
  *      session = null;
  *    });
+ *
+ * [pub]: http://pub.dartlang.org
+ * [pkg]: http://pub.dartlang.org/packages/webdriver
  */
 
 void writeStringToFile(String fileName, String contents) {
diff --git a/pkg/yaml/lib/yaml.dart b/pkg/yaml/lib/yaml.dart
index 94e3d42..85861d5 100644
--- a/pkg/yaml/lib/yaml.dart
+++ b/pkg/yaml/lib/yaml.dart
@@ -4,6 +4,21 @@
 
 /// A parser for [YAML](http://www.yaml.org/).
 ///
+/// ## Installing ##
+///
+/// Use [pub][] to install this package. Add the following to your
+/// `pubspec.yaml` file.
+///
+///     dependencies:
+///       yaml: any
+///
+/// Then run `pub install`.
+///
+/// For more information, see the
+/// [yaml package on pub.dartlang.org][pkg].
+///
+/// ## Using ##
+///
 /// Use [loadYaml] to load a single document, or [loadYamlStream] to load a
 /// stream of documents. For example:
 ///
@@ -22,6 +37,9 @@
 ///       var doc = loadYaml("YAML: YAML Ain't Markup Language");
 ///       print(json.stringify(doc));
 ///     }
+///
+/// [pub]: http://pub.dartlang.org
+/// [pkg]: http://pub.dartlang.org/packages/yaml
 library yaml;
 
 import 'src/composer.dart';
diff --git a/runtime/bin/bin.gypi b/runtime/bin/bin.gypi
index b910a10..ffc22e2 100644
--- a/runtime/bin/bin.gypi
+++ b/runtime/bin/bin.gypi
@@ -4,19 +4,32 @@
 
 {
   'variables': {
-    'io_cc_file': '<(SHARED_INTERMEDIATE_DIR)/io_gen.cc',
-    'io_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/io_patch_gen.cc',
+    # We place most generated source files in LIB_DIR (rather than, say
+    # SHARED_INTERMEDIATE_DIR) because it is toolset specific. This avoids
+    # two problems. First, if a generated source file has architecture specific
+    # code, we'll get two different files in two different directories. Second,
+    # if a generated source file is needed to build a target with multiple
+    # toolsets, we avoid having duplicate Makefile targets.
+    'gen_source_dir': '<(LIB_DIR)',
+
+    'io_cc_file': '<(gen_source_dir)/io_gen.cc',
+    'io_patch_cc_file': '<(gen_source_dir)/io_patch_gen.cc',
     'builtin_in_cc_file': 'builtin_in.cc',
-    'builtin_cc_file': '<(SHARED_INTERMEDIATE_DIR)/builtin_gen.cc',
+    'builtin_cc_file': '<(gen_source_dir)/builtin_gen.cc',
     'snapshot_in_cc_file': 'snapshot_in.cc',
-    'snapshot_bin_file': '<(SHARED_INTERMEDIATE_DIR)/snapshot_gen.bin',
+    'snapshot_bin_file': '<(gen_source_dir)/snapshot_gen.bin',
+    'resources_cc_file': '<(gen_source_dir)/resources_gen.cc',
+
+    # The program that creates snapshot_gen.cc is only built and run on the
+    # host, but it must be available when dart is built for the target. Thus,
+    # we keep it in a shared location.
     'snapshot_cc_file': '<(SHARED_INTERMEDIATE_DIR)/snapshot_gen.cc',
-    'resources_cc_file': '<(SHARED_INTERMEDIATE_DIR)/resources_gen.cc',
   },
   'targets': [
     {
       'target_name': 'generate_builtin_cc_file',
       'type': 'none',
+      'toolsets':['target','host'],
       'includes': [
         'builtin_sources.gypi',
       ],
@@ -37,7 +50,7 @@
             '--output', '<(builtin_cc_file)',
             '--input_cc', '<(builtin_in_cc_file)',
             '--include', 'bin/builtin.h',
-            '--var_name', 'Builtin::builtin_source_',
+            '--var_name', 'dart::bin::Builtin::builtin_source_',
             '<@(_sources)',
           ],
           'message': 'Generating ''<(builtin_cc_file)'' file.'
@@ -47,8 +60,9 @@
     {
       'target_name': 'generate_io_cc_file',
       'type': 'none',
+      'toolsets':['target','host'],
       'variables': {
-        'io_dart': '<(SHARED_INTERMEDIATE_DIR)/io_gen.dart',
+        'io_dart': '<(gen_source_dir)/io_gen.dart',
       },
       'sources': [
         'io.dart',
@@ -89,7 +103,7 @@
             '--output', '<(io_cc_file)',
             '--input_cc', '<(builtin_in_cc_file)',
             '--include', 'bin/builtin.h',
-            '--var_name', 'Builtin::io_source_',
+            '--var_name', 'dart::bin::Builtin::io_source_',
             '<(io_dart)',
           ],
           'message': 'Generating ''<(io_cc_file)'' file.'
@@ -99,6 +113,7 @@
     {
       'target_name': 'generate_io_patch_cc_file',
       'type': 'none',
+      'toolsets':['target','host'],
       'includes': [
         'io_sources.gypi',
       ],
@@ -119,7 +134,7 @@
             '--output', '<(io_patch_cc_file)',
             '--input_cc', '<(builtin_in_cc_file)',
             '--include', 'bin/builtin.h',
-            '--var_name', 'Builtin::io_patch_',
+            '--var_name', 'dart::bin::Builtin::io_patch_',
             '<@(_sources)',
           ],
           'message': 'Generating ''<(io_patch_cc_file)'' file.'
@@ -129,6 +144,7 @@
     {
       'target_name': 'libdart_builtin',
       'type': 'static_library',
+      'toolsets':['target','host'],
       'dependencies': [
         'generate_builtin_cc_file',
         'generate_io_cc_file',
@@ -218,6 +234,7 @@
     {
       'target_name': 'libdart_withcore',
       'type': 'static_library',
+      'toolsets':['target','host'],
       'dependencies': [
         'libdart_lib_withcore',
         'libdart_vm',
@@ -243,6 +260,7 @@
       # Completely statically linked binary for generating snapshots.
       'target_name': 'gen_snapshot',
       'type': 'executable',
+      'toolsets':['host'],
       'dependencies': [
         'libdart_withcore',
         'libdart_builtin',
@@ -276,8 +294,9 @@
       # Generate snapshot bin file.
       'target_name': 'generate_snapshot_bin',
       'type': 'none',
+      'toolsets':['host'],
       'dependencies': [
-        'gen_snapshot',
+        'gen_snapshot#host',
       ],
       'actions': [
         {
@@ -305,8 +324,9 @@
       # Generate snapshot file.
       'target_name': 'generate_snapshot_file',
       'type': 'none',
+      'toolsets':['host'],
       'dependencies': [
-        'generate_snapshot_bin',
+        'generate_snapshot_bin#host',
       ],
       'actions': [
         {
@@ -365,7 +385,7 @@
         'libdart',
         'libdart_builtin',
         'libdart_io',
-        'generate_snapshot_file',
+        'generate_snapshot_file#host',
         'generate_resources_cc_file',
       ],
       'include_dirs': [
@@ -478,7 +498,7 @@
       ],
       'include_dirs': [
         '..',
-        '<(SHARED_INTERMEDIATE_DIR)',
+        '<(gen_source_dir)',
       ],
       'sources': [
         'run_vm_tests.cc',
diff --git a/runtime/bin/builtin.cc b/runtime/bin/builtin.cc
index 2af1339..a2d646c 100644
--- a/runtime/bin/builtin.cc
+++ b/runtime/bin/builtin.cc
@@ -10,6 +10,9 @@
 #include "bin/dartutils.h"
 #include "bin/io_natives.h"
 
+namespace dart {
+namespace bin {
+
 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
   /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
   { DartUtils::kBuiltinLibURL, builtin_source_, NULL, NULL, true },
@@ -64,3 +67,6 @@
   DART_CHECK_VALID(library);
   return library;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/builtin.h b/runtime/bin/builtin.h
index 4a33b6c..67fc9fb 100644
--- a/runtime/bin/builtin.h
+++ b/runtime/bin/builtin.h
@@ -12,6 +12,9 @@
 #include "platform/assert.h"
 #include "platform/globals.h"
 
+namespace dart {
+namespace bin {
+
 #define FUNCTION_NAME(name) Builtin_##name
 #define REGISTER_FUNCTION(name, count)                                         \
   { ""#name, FUNCTION_NAME(name), count },
@@ -59,5 +62,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Builtin);
 };
 
+}  // namespace bin
+}  // namespace dart
 
 #endif  // BIN_BUILTIN_H_
diff --git a/runtime/bin/builtin_gen_snapshot.cc b/runtime/bin/builtin_gen_snapshot.cc
index af68759..c76cd55 100644
--- a/runtime/bin/builtin_gen_snapshot.cc
+++ b/runtime/bin/builtin_gen_snapshot.cc
@@ -10,6 +10,9 @@
 #include "bin/dartutils.h"
 
 
+namespace dart {
+namespace bin {
+
 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
   /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
   { DartUtils::kBuiltinLibURL, builtin_source_, NULL, NULL, true },
@@ -65,3 +68,6 @@
   DART_CHECK_VALID(library);
   return library;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/builtin_natives.cc b/runtime/bin/builtin_natives.cc
index 555dfe5..86f9aee 100644
--- a/runtime/bin/builtin_natives.cc
+++ b/runtime/bin/builtin_natives.cc
@@ -12,6 +12,9 @@
 #include "platform/assert.h"
 
 
+namespace dart {
+namespace bin {
+
 // Lists the native functions implementing basic functionality in
 // standalone dart, such as printing, file I/O, and platform information.
 // Advanced I/O classes like sockets and process management are implemented
@@ -109,3 +112,6 @@
   Builtin::PrintString(stdout, Dart_GetNativeArgument(args, 0));
   Dart_ExitScope();
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/builtin_nolib.cc b/runtime/bin/builtin_nolib.cc
index 048aa86..6ca4a20 100644
--- a/runtime/bin/builtin_nolib.cc
+++ b/runtime/bin/builtin_nolib.cc
@@ -10,6 +10,10 @@
 #include "bin/dartutils.h"
 #include "bin/io_natives.h"
 
+
+namespace dart {
+namespace bin {
+
 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = {
   /* { url_, source_, patch_url_, patch_source_, has_natives_ } */
   { DartUtils::kBuiltinLibURL, NULL, NULL, NULL, true },
@@ -64,3 +68,6 @@
   DART_CHECK_VALID(library);
   return library;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/common.cc b/runtime/bin/common.cc
index 261557d..030fcfa 100644
--- a/runtime/bin/common.cc
+++ b/runtime/bin/common.cc
@@ -6,6 +6,9 @@
 #include "bin/isolate_data.h"
 #include "include/dart_api.h"
 
+namespace dart {
+namespace bin {
+
 void FUNCTION_NAME(Common_IsBuiltinList)(Dart_NativeArguments args) {
   Dart_EnterScope();
   Dart_Handle list = Dart_GetNativeArgument(args, 0);
@@ -54,3 +57,6 @@
   Dart_SetReturnValue(args, Dart_NewBoolean(builtin_array));
   Dart_ExitScope();
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/crypto.cc b/runtime/bin/crypto.cc
index af5886d..cd707dd 100644
--- a/runtime/bin/crypto.cc
+++ b/runtime/bin/crypto.cc
@@ -8,6 +8,9 @@
 #include "include/dart_api.h"
 
 
+namespace dart {
+namespace bin {
+
 void FUNCTION_NAME(Crypto_GetRandomBytes)(Dart_NativeArguments args) {
   Dart_EnterScope();
   Dart_Handle count_obj = Dart_GetNativeArgument(args, 0);
@@ -34,3 +37,6 @@
   delete[] buffer;
   Dart_ExitScope();
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/crypto.h b/runtime/bin/crypto.h
index b155972..1feaf9c 100644
--- a/runtime/bin/crypto.h
+++ b/runtime/bin/crypto.h
@@ -9,6 +9,9 @@
 #include "bin/utils.h"
 
 
+namespace dart {
+namespace bin {
+
 class Crypto {
  public:
   static bool GetRandomBytes(intptr_t count, uint8_t* buffer);
@@ -18,5 +21,8 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Crypto);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_CRYPTO_H_
 
diff --git a/runtime/bin/crypto_android.cc b/runtime/bin/crypto_android.cc
index 701a208..61b87a1 100644
--- a/runtime/bin/crypto_android.cc
+++ b/runtime/bin/crypto_android.cc
@@ -12,6 +12,9 @@
 #include "bin/crypto.h"
 
 
+namespace dart {
+namespace bin {
+
 bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
   intptr_t fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY));
   if (fd < 0) return false;
@@ -20,4 +23,7 @@
   return bytes_read == count;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/crypto_linux.cc b/runtime/bin/crypto_linux.cc
index 7ff6b6e..849fe71 100644
--- a/runtime/bin/crypto_linux.cc
+++ b/runtime/bin/crypto_linux.cc
@@ -12,6 +12,9 @@
 #include "bin/crypto.h"
 
 
+namespace dart {
+namespace bin {
+
 bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
   intptr_t fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY));
   if (fd < 0) return false;
@@ -20,4 +23,7 @@
   return bytes_read == count;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/crypto_macos.cc b/runtime/bin/crypto_macos.cc
index 0a44ff8..19745fc 100644
--- a/runtime/bin/crypto_macos.cc
+++ b/runtime/bin/crypto_macos.cc
@@ -12,6 +12,9 @@
 #include "bin/crypto.h"
 
 
+namespace dart {
+namespace bin {
+
 bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
   intptr_t fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY));
   if (fd < 0) return false;
@@ -20,4 +23,7 @@
   return bytes_read == count;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/crypto_win.cc b/runtime/bin/crypto_win.cc
index 8f4952f..01b82a9 100644
--- a/runtime/bin/crypto_win.cc
+++ b/runtime/bin/crypto_win.cc
@@ -10,6 +10,9 @@
 #include "bin/crypto.h"
 
 
+namespace dart {
+namespace bin {
+
 bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
   uint32_t num;
   intptr_t read = 0;
@@ -25,4 +28,7 @@
   return true;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 37cf816..3379b16 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -12,6 +12,9 @@
 #include "platform/assert.h"
 #include "platform/globals.h"
 
+namespace dart {
+namespace bin {
+
 const char* DartUtils::original_working_directory = NULL;
 const char* DartUtils::kDartScheme = "dart:";
 const char* DartUtils::kDartExtensionScheme = "dart-ext:";
@@ -391,6 +394,9 @@
     return Dart_LoadScriptFromSnapshot(text_buffer, len);
   } else {
     Dart_Handle source = Dart_NewStringFromUTF8(text_buffer, len);
+    if (Dart_IsError(source)) {
+      return source;
+    }
     return Dart_LoadScript(resolved_script_uri, source, 0, 0);
   }
 }
@@ -746,3 +752,6 @@
   result->SetAt(2, error_message);
   return result;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index 83457dc..074cc12 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -10,6 +10,9 @@
 #include "include/dart_api.h"
 #include "platform/globals.h"
 
+namespace dart {
+namespace bin {
+
 // Forward declarations.
 class File;
 
@@ -494,4 +497,7 @@
   DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_DARTUTILS_H_
diff --git a/runtime/bin/dbg_connection.cc b/runtime/bin/dbg_connection.cc
index 583d737..dc6dc84 100644
--- a/runtime/bin/dbg_connection.cc
+++ b/runtime/bin/dbg_connection.cc
@@ -18,6 +18,9 @@
 #include "include/dart_api.h"
 
 
+namespace dart {
+namespace bin {
+
 int DebuggerConnectionHandler::listener_fd_ = -1;
 dart::Monitor DebuggerConnectionHandler::handler_lock_;
 
@@ -180,7 +183,7 @@
 void DebuggerConnectionHandler::HandleMessages() {
   static JSONDebuggerCommand generic_debugger_commands[] = {
     { "interrupt", HandleInterruptCmd },
-    { "isolates", HandleIsolatesListCmd },
+    { "getIsolateIds", HandleIsolatesListCmd },
     { NULL, NULL }
   };
 
@@ -294,7 +297,11 @@
   // listen, accept connections from debuggers, read and handle/dispatch
   // debugger commands received on these connections.
   ASSERT(listener_fd_ == -1);
-  listener_fd_ = ServerSocket::CreateBindListen(address, port_number, 1);
+
+  OSError *os_error;
+  SocketAddresses* addresses = Socket::LookupAddress(address, -1, &os_error);
+  listener_fd_ = ServerSocket::CreateBindListen(
+      addresses->GetAt(0)->addr(), port_number, 1);
   DebuggerConnectionImpl::StartHandler(port_number);
 }
 
@@ -404,7 +411,11 @@
   MessageParser msg_parser(in_msg->buffer(), in_msg->buffer_len());
   int msg_id = msg_parser.MessageId();
   ASSERT(msg_id >= 0);
-  in_msg->SendErrorReply(msg_id, "isolate list command unimplemented");
+  dart::TextBuffer msg(64);
+  msg.Printf("{ \"id\": %d, \"result\": { \"isolateIds\": [", msg_id);
+  DbgMsgQueueList::ListIsolateIds(&msg);
+  msg.Printf("]}}");
+  in_msg->SendReply(&msg);
 }
 
 
@@ -438,3 +449,6 @@
   // Return true if a connection has been established.
   return singleton_handler != NULL;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/dbg_connection.h b/runtime/bin/dbg_connection.h
index 791ab13..37080fb 100644
--- a/runtime/bin/dbg_connection.h
+++ b/runtime/bin/dbg_connection.h
@@ -27,6 +27,9 @@
 #endif
 
 
+namespace dart {
+namespace bin {
+
 // Forward declarations.
 class DbgMessage;
 class MessageBuffer;
@@ -105,4 +108,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(DebuggerConnectionHandler);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_DBG_CONNECTION_H_
diff --git a/runtime/bin/dbg_connection_android.cc b/runtime/bin/dbg_connection_android.cc
index 0fc57ac..92fb7ca5 100644
--- a/runtime/bin/dbg_connection_android.cc
+++ b/runtime/bin/dbg_connection_android.cc
@@ -15,6 +15,10 @@
 #include "bin/log.h"
 #include "bin/socket.h"
 
+
+namespace dart {
+namespace bin {
+
 int DebuggerConnectionImpl::epoll_fd_ = -1;
 int DebuggerConnectionImpl::wakeup_fds_[2] = {-1, -1};
 
@@ -119,4 +123,7 @@
   return TEMP_FAILURE_RETRY(read(socket, buf, len));
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/dbg_connection_android.h b/runtime/bin/dbg_connection_android.h
index f762c73..c1c16c5 100644
--- a/runtime/bin/dbg_connection_android.h
+++ b/runtime/bin/dbg_connection_android.h
@@ -10,6 +10,9 @@
 #include <sys/socket.h>
 
 
+namespace dart {
+namespace bin {
+
 class DebuggerConnectionImpl {
  public:
   static void StartHandler(int port_number);
@@ -28,4 +31,7 @@
   static int epoll_fd_;
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_DBG_CONNECTION_ANDROID_H_
diff --git a/runtime/bin/dbg_connection_linux.cc b/runtime/bin/dbg_connection_linux.cc
index c278987f..020b8cb 100644
--- a/runtime/bin/dbg_connection_linux.cc
+++ b/runtime/bin/dbg_connection_linux.cc
@@ -15,6 +15,10 @@
 #include "bin/log.h"
 #include "bin/socket.h"
 
+
+namespace dart {
+namespace bin {
+
 int DebuggerConnectionImpl::epoll_fd_ = -1;
 int DebuggerConnectionImpl::wakeup_fds_[2] = {-1, -1};
 
@@ -119,4 +123,7 @@
   return TEMP_FAILURE_RETRY(read(socket, buf, len));
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/dbg_connection_linux.h b/runtime/bin/dbg_connection_linux.h
index 12b0395..94a9664 100644
--- a/runtime/bin/dbg_connection_linux.h
+++ b/runtime/bin/dbg_connection_linux.h
@@ -10,6 +10,9 @@
 #include <sys/socket.h>
 
 
+namespace dart {
+namespace bin {
+
 class DebuggerConnectionImpl {
  public:
   static void StartHandler(int port_number);
@@ -28,4 +31,7 @@
   static int epoll_fd_;
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_DBG_CONNECTION_LINUX_H_
diff --git a/runtime/bin/dbg_connection_macos.cc b/runtime/bin/dbg_connection_macos.cc
index a3e17fd..4fd2d1d 100644
--- a/runtime/bin/dbg_connection_macos.cc
+++ b/runtime/bin/dbg_connection_macos.cc
@@ -21,6 +21,9 @@
 #include "platform/utils.h"
 
 
+namespace dart {
+namespace bin {
+
 #define INVALID_FD -1
 
 int DebuggerConnectionImpl::kqueue_fd_ = INVALID_FD;
@@ -173,4 +176,7 @@
   return TEMP_FAILURE_RETRY(read(socket, buf, len));
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/dbg_connection_macos.h b/runtime/bin/dbg_connection_macos.h
index f6962ff..9665700 100644
--- a/runtime/bin/dbg_connection_macos.h
+++ b/runtime/bin/dbg_connection_macos.h
@@ -10,6 +10,9 @@
 #include <sys/socket.h>
 
 
+namespace dart {
+namespace bin {
+
 class DebuggerConnectionImpl {
  public:
   static void StartHandler(int port_number);
@@ -42,5 +45,7 @@
   static int kqueue_fd_;
 };
 
+}  // namespace bin
+}  // namespace dart
 
 #endif  // BIN_DBG_CONNECTION_MACOS_H_
diff --git a/runtime/bin/dbg_connection_win.cc b/runtime/bin/dbg_connection_win.cc
index a241c85..bd650a4 100644
--- a/runtime/bin/dbg_connection_win.cc
+++ b/runtime/bin/dbg_connection_win.cc
@@ -9,6 +9,10 @@
 
 #include "bin/eventhandler.h"
 
+
+namespace dart {
+namespace bin {
+
 void DebuggerConnectionImpl::ThreadEntry(uword args) {
   ListenSocket* listen_socket =
       reinterpret_cast<ListenSocket*>(DebuggerConnectionHandler::listener_fd_);
@@ -43,4 +47,7 @@
   return recv(client_socket->socket(), buf, len, 0);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/dbg_connection_win.h b/runtime/bin/dbg_connection_win.h
index 24ac711..2a9feb2 100644
--- a/runtime/bin/dbg_connection_win.h
+++ b/runtime/bin/dbg_connection_win.h
@@ -5,6 +5,9 @@
 #ifndef BIN_DBG_CONNECTION_WIN_H_
 #define BIN_DBG_CONNECTION_WIN_H_
 
+namespace dart {
+namespace bin {
+
 class DebuggerConnectionImpl {
  public:
   static void StartHandler(int port_number);
@@ -15,4 +18,7 @@
   static void ThreadEntry(uword args);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_DBG_CONNECTION_WIN_H_
diff --git a/runtime/bin/dbg_message.cc b/runtime/bin/dbg_message.cc
index 4d9422d..5713657 100644
--- a/runtime/bin/dbg_message.cc
+++ b/runtime/bin/dbg_message.cc
@@ -15,6 +15,10 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 bool MessageParser::IsValidMessage() const {
   if (buf_length_ == 0) {
     return false;
@@ -805,7 +809,7 @@
   msg.Printf("{ \"id\": %d, ", msg_id);
   msg.Printf("\"result\": { \"lines\": [");
   Dart_Handle elem;
-  bool num_elems = 0;
+  intptr_t num_elems = 0;
   for (intptr_t i = 0; i < info_len; i++) {
     elem = Dart_ListGetAt(info, i);
     if (Dart_IsNull(elem)) {
@@ -1160,6 +1164,21 @@
 }
 
 
+void DbgMsgQueueList::ListIsolateIds(dart::TextBuffer* msg) {
+  MutexLocker ml(&msg_queue_list_lock_);
+  if (list_ == NULL) {
+    return;  // No items in the list.
+  }
+  DbgMsgQueue* queue = list_;
+  msg->Printf("%"Pd64"", queue->isolate_id());
+  queue = queue->next();
+  while (queue != NULL) {
+    msg->Printf(",%"Pd64"", queue->isolate_id());
+    queue = queue->next();
+  }
+}
+
+
 void DbgMsgQueueList::BptResolvedHandler(Dart_IsolateId isolate_id,
                                          intptr_t bp_id,
                                          const Dart_CodeLocation& location) {
@@ -1231,3 +1250,6 @@
   }
   Dart_ExitScope();
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/dbg_message.h b/runtime/bin/dbg_message.h
index e30a421..85be1a5 100644
--- a/runtime/bin/dbg_message.h
+++ b/runtime/bin/dbg_message.h
@@ -15,6 +15,9 @@
 #include "platform/thread.h"
 
 
+namespace dart {
+namespace bin {
+
 // TODO(hausner): Need better error handling.
 #define ASSERT_NOT_ERROR(handle)          \
   ASSERT(!Dart_IsError(handle))
@@ -245,6 +248,9 @@
   static void IsolateEventHandler(Dart_IsolateId isolate_id,
                                   Dart_IsolateEvent kind);
 
+  // Print list of isolate ids of all message queues into text buffer.
+  static void ListIsolateIds(dart::TextBuffer* msg);
+
  private:
   static DbgMsgQueue* GetIsolateMsgQueueLocked(Dart_IsolateId isolate_id);
 
@@ -255,4 +261,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(DbgMsgQueueList);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_DBG_MESSAGE_H_
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc
index c218595..758df5a 100644
--- a/runtime/bin/directory.cc
+++ b/runtime/bin/directory.cc
@@ -10,6 +10,9 @@
 #include "platform/assert.h"
 
 
+namespace dart {
+namespace bin {
+
 // Forward declaration.
 static void DirectoryService(Dart_Port, Dart_Port, Dart_CObject*);
 
@@ -375,3 +378,6 @@
       args));
   return true;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/directory.h b/runtime/bin/directory.h
index 331b4c4..a8dde3d 100644
--- a/runtime/bin/directory.h
+++ b/runtime/bin/directory.h
@@ -11,6 +11,10 @@
 #include "platform/globals.h"
 #include "platform/thread.h"
 
+
+namespace dart {
+namespace bin {
+
 class DirectoryListing {
  public:
   virtual ~DirectoryListing() {}
@@ -114,5 +118,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Directory);
 };
 
+}  // namespace bin
+}  // namespace dart
 
 #endif  // BIN_DIRECTORY_H_
diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
index 58060d8..7c30274 100644
--- a/runtime/bin/directory_android.cc
+++ b/runtime/bin/directory_android.cc
@@ -17,6 +17,10 @@
 #include "bin/file.h"
 #include "bin/platform.h"
 
+
+namespace dart {
+namespace bin {
+
 class PathBuffer {
  public:
   PathBuffer() : length(0) {
@@ -515,4 +519,7 @@
   return (TEMP_FAILURE_RETRY(rename(path, new_path)) == 0);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/directory_linux.cc b/runtime/bin/directory_linux.cc
index 2f86f5b..67ac947 100644
--- a/runtime/bin/directory_linux.cc
+++ b/runtime/bin/directory_linux.cc
@@ -17,6 +17,10 @@
 #include "bin/file.h"
 #include "bin/platform.h"
 
+
+namespace dart {
+namespace bin {
+
 class PathBuffer {
  public:
   PathBuffer() : length(0) {
@@ -482,4 +486,7 @@
   return (TEMP_FAILURE_RETRY(rename(path, new_path)) == 0);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc
index ece3685..5c7b115 100644
--- a/runtime/bin/directory_macos.cc
+++ b/runtime/bin/directory_macos.cc
@@ -17,6 +17,10 @@
 #include "bin/file.h"
 #include "bin/platform.h"
 
+
+namespace dart {
+namespace bin {
+
 class PathBuffer {
  public:
   PathBuffer() : length(0) {
@@ -482,4 +486,7 @@
   return (TEMP_FAILURE_RETRY(rename(path, new_path)) == 0);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index 79c7b08..dc6cd69 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -13,6 +13,11 @@
 
 #include "bin/log.h"
 
+#undef DeleteFile
+
+namespace dart {
+namespace bin {
+
 class PathBuffer {
  public:
   PathBuffer() : length(0) {
@@ -524,4 +529,7 @@
   return (move_status != 0);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/eventhandler.cc b/runtime/bin/eventhandler.cc
index c1e88e7..94f0778 100644
--- a/runtime/bin/eventhandler.cc
+++ b/runtime/bin/eventhandler.cc
@@ -9,6 +9,9 @@
 #include "include/dart_api.h"
 
 
+namespace dart {
+namespace bin {
+
 static const int kNativeEventHandlerFieldIndex = 0;
 static const intptr_t kTimerId = -1;
 static const intptr_t kInvalidId = -2;
@@ -76,3 +79,6 @@
   event_handler->SendData(id, dart_port, data);
   Dart_ExitScope();
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/eventhandler.h b/runtime/bin/eventhandler.h
index c487c52..5d7832e 100644
--- a/runtime/bin/eventhandler.h
+++ b/runtime/bin/eventhandler.h
@@ -8,6 +8,9 @@
 #include "bin/builtin.h"
 #include "bin/isolate_data.h"
 
+namespace dart {
+namespace bin {
+
 // Flags used to provide information and actions to the eventhandler
 // when sending a message about a file descriptor. These flags should
 // be kept in sync with the constants in socket_impl.dart. For more
@@ -24,6 +27,8 @@
   kPipe = 17,
 };
 
+}  // namespace bin
+}  // namespace dart
 
 // The event handler delegation class is OS specific.
 #if defined(TARGET_OS_ANDROID)
@@ -38,6 +43,9 @@
 #error Unknown target os.
 #endif
 
+namespace dart {
+namespace bin {
+
 class EventHandler {
  public:
   void SendData(intptr_t id, Dart_Port dart_port, int64_t data) {
@@ -62,5 +70,7 @@
   EventHandlerImplementation delegate_;
 };
 
+}  // namespace bin
+}  // namespace dart
 
 #endif  // BIN_EVENTHANDLER_H_
diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc
index 2a708fd..9f7a8ee 100644
--- a/runtime/bin/eventhandler_android.cc
+++ b/runtime/bin/eventhandler_android.cc
@@ -24,6 +24,9 @@
 #include "platform/utils.h"
 
 
+namespace dart {
+namespace bin {
+
 static const int kInterruptMessageSize = sizeof(InterruptMessage);
 static const int kInfinityTimeout = -1;
 static const int kTimerId = -1;
@@ -425,4 +428,7 @@
   return dart::Utils::WordHash(fd + 1);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/eventhandler_android.h b/runtime/bin/eventhandler_android.h
index dfe2ff2..5196023 100644
--- a/runtime/bin/eventhandler_android.h
+++ b/runtime/bin/eventhandler_android.h
@@ -15,6 +15,10 @@
 
 #include "platform/hashmap.h"
 
+
+namespace dart {
+namespace bin {
+
 class InterruptMessage {
  public:
   intptr_t id;
@@ -118,5 +122,7 @@
   int epoll_fd_;
 };
 
+}  // namespace bin
+}  // namespace dart
 
 #endif  // BIN_EVENTHANDLER_ANDROID_H_
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 8cda7927..e2e2746 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -24,6 +24,9 @@
 #include "platform/utils.h"
 
 
+namespace dart {
+namespace bin {
+
 static const int kInterruptMessageSize = sizeof(InterruptMessage);
 static const int kInfinityTimeout = -1;
 static const int kTimerId = -1;
@@ -431,4 +434,7 @@
   return dart::Utils::WordHash(fd + 1);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/eventhandler_linux.h b/runtime/bin/eventhandler_linux.h
index e44e283..4c423f2 100644
--- a/runtime/bin/eventhandler_linux.h
+++ b/runtime/bin/eventhandler_linux.h
@@ -10,10 +10,15 @@
 #endif
 
 #include <unistd.h>
+#include <sys/epoll.h>
 #include <sys/socket.h>
 
 #include "platform/hashmap.h"
 
+
+namespace dart {
+namespace bin {
+
 class InterruptMessage {
  public:
   intptr_t id;
@@ -117,5 +122,7 @@
   int epoll_fd_;
 };
 
+}  // namespace bin
+}  // namespace dart
 
 #endif  // BIN_EVENTHANDLER_LINUX_H_
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
index 5972cfb..6823ef8 100644
--- a/runtime/bin/eventhandler_macos.cc
+++ b/runtime/bin/eventhandler_macos.cc
@@ -23,6 +23,9 @@
 #include "platform/utils.h"
 
 
+namespace dart {
+namespace bin {
+
 static const int kInterruptMessageSize = sizeof(InterruptMessage);
 static const int kInfinityTimeout = -1;
 static const int kTimerId = -1;
@@ -435,4 +438,7 @@
   return dart::Utils::WordHash(fd + 1);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/eventhandler_macos.h b/runtime/bin/eventhandler_macos.h
index cbc6040..4303586 100644
--- a/runtime/bin/eventhandler_macos.h
+++ b/runtime/bin/eventhandler_macos.h
@@ -10,10 +10,15 @@
 #endif
 
 #include <unistd.h>
+#include <sys/event.h>  // NOLINT
 #include <sys/socket.h>
 
 #include "platform/hashmap.h"
 
+
+namespace dart {
+namespace bin {
+
 class InterruptMessage {
  public:
   intptr_t id;
@@ -130,5 +135,7 @@
   int kqueue_fd_;
 };
 
+}  // namespace bin
+}  // namespace dart
 
 #endif  // BIN_EVENTHANDLER_MACOS_H_
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index 3ed6e3f..6a43dd5 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -20,6 +20,9 @@
 #include "platform/thread.h"
 
 
+namespace dart {
+namespace bin {
+
 static const int kBufferSize = 32 * 1024;
 
 static const int kInfinityTimeout = -1;
@@ -991,4 +994,7 @@
   SendData(kShutdownId, 0, 0);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/eventhandler_win.h b/runtime/bin/eventhandler_win.h
index 09044e0..30d229b 100644
--- a/runtime/bin/eventhandler_win.h
+++ b/runtime/bin/eventhandler_win.h
@@ -15,6 +15,9 @@
 #include "bin/builtin.h"
 
 
+namespace dart {
+namespace bin {
+
 // Forward declarations.
 class EventHandlerImplementation;
 class Handle;
@@ -392,5 +395,7 @@
   HANDLE completion_port_;
 };
 
+}  // namespace bin
+}  // namespace dart
 
 #endif  // BIN_EVENTHANDLER_WIN_H_
diff --git a/runtime/bin/extensions.cc b/runtime/bin/extensions.cc
index d8b13f9..71eaeac 100644
--- a/runtime/bin/extensions.cc
+++ b/runtime/bin/extensions.cc
@@ -12,6 +12,10 @@
 #include "bin/dartutils.h"
 #include "bin/file.h"
 
+
+namespace dart {
+namespace bin {
+
 Dart_Handle Extensions::LoadExtension(const char* extension_url,
                                       Dart_Handle parent_library) {
   char* library_path = strdup(extension_url);
@@ -62,3 +66,6 @@
   ASSERT(result[size - 1] == '\0');
   return result;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/extensions.h b/runtime/bin/extensions.h
index a233a25..6f3853c 100644
--- a/runtime/bin/extensions.h
+++ b/runtime/bin/extensions.h
@@ -8,6 +8,10 @@
 #include "include/dart_api.h"
 #include "platform/globals.h"
 
+
+namespace dart {
+namespace bin {
+
 class Extensions {
  public:
   // TODO(whesse): Make extension load from a relative path relative to
@@ -28,4 +32,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Extensions);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_EXTENSIONS_H_
diff --git a/runtime/bin/extensions_android.cc b/runtime/bin/extensions_android.cc
index b136736..72c757f 100644
--- a/runtime/bin/extensions_android.cc
+++ b/runtime/bin/extensions_android.cc
@@ -8,6 +8,10 @@
 #include "bin/extensions.h"
 #include <dlfcn.h>  // NOLINT
 
+
+namespace dart {
+namespace bin {
+
 void* Extensions::LoadExtensionLibrary(const char* library_path,
                                        const char* extension_name) {
   const char* strings[] = { library_path, "/lib",
@@ -25,4 +29,7 @@
   return result;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/extensions_linux.cc b/runtime/bin/extensions_linux.cc
index 8321efe..3920ade 100644
--- a/runtime/bin/extensions_linux.cc
+++ b/runtime/bin/extensions_linux.cc
@@ -8,6 +8,10 @@
 #include "bin/extensions.h"
 #include <dlfcn.h>  // NOLINT
 
+
+namespace dart {
+namespace bin {
+
 void* Extensions::LoadExtensionLibrary(const char* library_path,
                                        const char* extension_name) {
   const char* strings[] = { library_path, "/lib",
@@ -25,4 +29,7 @@
   return result;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/extensions_macos.cc b/runtime/bin/extensions_macos.cc
index 6d7842a..bfda5e7 100644
--- a/runtime/bin/extensions_macos.cc
+++ b/runtime/bin/extensions_macos.cc
@@ -8,6 +8,10 @@
 #include "bin/extensions.h"
 #include <dlfcn.h>  // NOLINT
 
+
+namespace dart {
+namespace bin {
+
 void* Extensions::LoadExtensionLibrary(const char* library_path,
                                        const char* extension_name) {
   const char* strings[] = { library_path, "/lib",
@@ -25,4 +29,7 @@
   return result;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/extensions_win.cc b/runtime/bin/extensions_win.cc
index 9e8a653..0f764d3 100644
--- a/runtime/bin/extensions_win.cc
+++ b/runtime/bin/extensions_win.cc
@@ -8,6 +8,10 @@
 #include "bin/extensions.h"
 #include "bin/utils.h"
 
+
+namespace dart {
+namespace bin {
+
 void* Extensions::LoadExtensionLibrary(const char* library_path,
                                        const char* extension_name) {
   const char* strings[] = { library_path, "/", extension_name, ".dll", NULL };
@@ -23,4 +27,7 @@
   return GetProcAddress(reinterpret_cast<HMODULE>(lib_handle), symbol);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/fdutils.h b/runtime/bin/fdutils.h
index 6771f21..da4fcf5 100644
--- a/runtime/bin/fdutils.h
+++ b/runtime/bin/fdutils.h
@@ -8,6 +8,10 @@
 #include "bin/builtin.h"
 #include "platform/globals.h"
 
+
+namespace dart {
+namespace bin {
+
 class FDUtils {
  public:
   static bool SetCloseOnExec(intptr_t fd);
@@ -41,4 +45,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(FDUtils);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_FDUTILS_H_
diff --git a/runtime/bin/fdutils_android.cc b/runtime/bin/fdutils_android.cc
index 18b4ec3..7a60387 100644
--- a/runtime/bin/fdutils_android.cc
+++ b/runtime/bin/fdutils_android.cc
@@ -13,6 +13,9 @@
 #include "bin/fdutils.h"
 
 
+namespace dart {
+namespace bin {
+
 bool FDUtils::SetCloseOnExec(intptr_t fd) {
   intptr_t status;
   status = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFD));
@@ -136,4 +139,7 @@
   return count;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/fdutils_linux.cc b/runtime/bin/fdutils_linux.cc
index 84c2194..a763c9b 100644
--- a/runtime/bin/fdutils_linux.cc
+++ b/runtime/bin/fdutils_linux.cc
@@ -13,6 +13,9 @@
 #include "bin/fdutils.h"
 
 
+namespace dart {
+namespace bin {
+
 bool FDUtils::SetCloseOnExec(intptr_t fd) {
   intptr_t status;
   status = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFD));
@@ -136,4 +139,7 @@
   return count;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/fdutils_macos.cc b/runtime/bin/fdutils_macos.cc
index 7087add..65f2832 100644
--- a/runtime/bin/fdutils_macos.cc
+++ b/runtime/bin/fdutils_macos.cc
@@ -13,6 +13,9 @@
 #include "bin/fdutils.h"
 
 
+namespace dart {
+namespace bin {
+
 bool FDUtils::SetCloseOnExec(intptr_t fd) {
   intptr_t status;
   status = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFD));
@@ -137,4 +140,7 @@
   return count;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index c9fc1b2..de9d1e9 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -12,8 +12,10 @@
 
 #include "include/dart_api.h"
 
-static const int kMSPerSecond = 1000;
+namespace dart {
+namespace bin {
 
+static const int kMSPerSecond = 1000;
 
 // Forward declaration.
 static void FileService(Dart_Port, Dart_Port, Dart_CObject*);
@@ -1169,3 +1171,6 @@
   }
   Dart_ExitScope();
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index 944fd6a..9e12463 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -16,6 +16,10 @@
 #include "platform/globals.h"
 #include "platform/thread.h"
 
+
+namespace dart {
+namespace bin {
+
 // Forward declaration.
 class FileHandle;
 
@@ -164,4 +168,7 @@
   DISALLOW_COPY_AND_ASSIGN(File);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_FILE_H_
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
index 2d7c99d..9bb5e1a 100644
--- a/runtime/bin/file_android.cc
+++ b/runtime/bin/file_android.cc
@@ -16,6 +16,10 @@
 #include "bin/builtin.h"
 #include "bin/log.h"
 
+
+namespace dart {
+namespace bin {
+
 class FileHandle {
  public:
   explicit FileHandle(int fd) : fd_(fd) { }
@@ -315,4 +319,7 @@
       File::kDifferent;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
index 8126ff9..26c047d 100644
--- a/runtime/bin/file_linux.cc
+++ b/runtime/bin/file_linux.cc
@@ -16,6 +16,10 @@
 #include "bin/builtin.h"
 #include "bin/log.h"
 
+
+namespace dart {
+namespace bin {
+
 class FileHandle {
  public:
   explicit FileHandle(int fd) : fd_(fd) { }
@@ -316,4 +320,7 @@
       File::kDifferent;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
index a5af904..0b99153 100644
--- a/runtime/bin/file_macos.cc
+++ b/runtime/bin/file_macos.cc
@@ -18,6 +18,10 @@
 #include "bin/fdutils.h"
 #include "bin/log.h"
 
+
+namespace dart {
+namespace bin {
+
 class FileHandle {
  public:
   explicit FileHandle(int fd) : fd_(fd) { }
@@ -324,4 +328,7 @@
       File::kDifferent;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/file_test.cc b/runtime/bin/file_test.cc
index 5765cf2..20c6bf7 100644
--- a/runtime/bin/file_test.cc
+++ b/runtime/bin/file_test.cc
@@ -8,6 +8,9 @@
 #include "vm/unit_test.h"
 
 
+namespace dart {
+namespace bin {
+
 // Helper method to be able to run the test from the runtime
 // directory, or the top directory.
 static const char* GetFileName(const char* name) {
@@ -56,3 +59,6 @@
   EXPECT_EQ(18, file->Position());
   delete file;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index 78074cc..6877fb3 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -17,6 +17,10 @@
 #include "bin/builtin.h"
 #include "bin/log.h"
 
+
+namespace dart {
+namespace bin {
+
 class FileHandle {
  public:
   explicit FileHandle(int fd) : fd_(fd) { }
@@ -551,4 +555,7 @@
   }
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/filter.cc b/runtime/bin/filter.cc
index 1a609c5..a423651 100644
--- a/runtime/bin/filter.cc
+++ b/runtime/bin/filter.cc
@@ -8,6 +8,10 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 const int kZlibFlagMemUsage = 8;
 const int kZLibFlagWindowBits = 15;
 const int kZLibFlagUseGZipHeader = 16;
@@ -304,3 +308,5 @@
   }
 }
 
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/filter.h b/runtime/bin/filter.h
index cc3a0a9..fcfaa0e 100644
--- a/runtime/bin/filter.h
+++ b/runtime/bin/filter.h
@@ -10,6 +10,10 @@
 
 #include "../third_party/zlib/zlib.h"
 
+
+namespace dart {
+namespace bin {
+
 class Filter {
  public:
   virtual ~Filter() {}
@@ -80,5 +84,7 @@
   DISALLOW_COPY_AND_ASSIGN(ZLibInflateFilter);
 };
 
-#endif  // BIN_FILTER_H_
+}  // namespace bin
+}  // namespace dart
 
+#endif  // BIN_FILTER_H_
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index ea69119..d5e0a5e 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -18,6 +18,10 @@
 
 #include "platform/globals.h"
 
+
+namespace dart {
+namespace bin {
+
 #define CHECK_RESULT(result)                                                   \
   if (Dart_IsError(result)) {                                                  \
     free(snapshot_buffer);                                                     \
@@ -296,6 +300,11 @@
     return ResolveUri(library_url_string, url_string);
   }
 
+  if (DartUtils::IsDartIOLibURL(url_string) && mapped_url_string == NULL) {
+    // No url mapping for dart:io. Load original version.
+    return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
+  }
+
   Dart_Handle resolved_url = url;
   if (mapped_url_string != NULL) {
     // Mapped urls are relative to working directory.
@@ -428,13 +437,8 @@
 static void SetupForGenericSnapshotCreation() {
   SetupForUriResolution();
 
-  // TODO(regis): Reenable this code for mips when possible.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
   Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary);
   VerifyLoaded(library);
-#endif
 }
 
 
@@ -528,3 +532,10 @@
   }
   return 0;
 }
+
+}  // namespace bin
+}  // namespace dart
+
+int main(int argc, char** argv) {
+  return dart::bin::main(argc, argv);
+}
diff --git a/runtime/bin/io.dart b/runtime/bin/io.dart
index 4b2e666..2bec045 100644
--- a/runtime/bin/io.dart
+++ b/runtime/bin/io.dart
@@ -14,6 +14,6 @@
 import 'dart:json' as JSON;
 import "dart:math";
 import "dart:nativewrappers";
-import "dart:typeddata";
+import "dart:typed_data";
 import "dart:uri";
 import "dart:utf";
diff --git a/runtime/bin/io_buffer.cc b/runtime/bin/io_buffer.cc
index b1bc958..65fe234 100644
--- a/runtime/bin/io_buffer.cc
+++ b/runtime/bin/io_buffer.cc
@@ -4,6 +4,10 @@
 
 #include "bin/io_buffer.h"
 
+
+namespace dart {
+namespace bin {
+
 Dart_Handle IOBuffer::Allocate(intptr_t size, uint8_t **buffer) {
   uint8_t* data = Allocate(size);
   Dart_Handle result = Dart_NewExternalTypedData(kUint8,
@@ -22,3 +26,6 @@
 uint8_t* IOBuffer::Allocate(intptr_t size) {
   return new uint8_t[size];
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/io_buffer.h b/runtime/bin/io_buffer.h
index 0c73164..06ce0a6 100644
--- a/runtime/bin/io_buffer.h
+++ b/runtime/bin/io_buffer.h
@@ -9,6 +9,10 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 class IOBuffer {
  public:
   // Allocate an IO buffer dart object (of type Uint8List) backed by
@@ -37,4 +41,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(IOBuffer);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_IO_BUFFER_H_
diff --git a/runtime/bin/io_natives.cc b/runtime/bin/io_natives.cc
index a5c6a9f..0b4cedd 100644
--- a/runtime/bin/io_natives.cc
+++ b/runtime/bin/io_natives.cc
@@ -13,6 +13,9 @@
 #include "platform/assert.h"
 
 
+namespace dart {
+namespace bin {
+
 // Lists the native functions implementing advanced dart:io classes.
 // Some classes, like File and Directory, list their implementations in
 // builtin_natives.cc instead.
@@ -91,3 +94,6 @@
   }
   return NULL;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/io_natives.h b/runtime/bin/io_natives.h
index 1745555..dac7fce 100644
--- a/runtime/bin/io_natives.h
+++ b/runtime/bin/io_natives.h
@@ -7,7 +7,14 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 Dart_NativeFunction IONativeLookup(Dart_Handle name,
                                    int argument_count);
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_IO_NATIVES_H_
diff --git a/runtime/bin/isolate_data.h b/runtime/bin/isolate_data.h
index 7824285..9b0806e 100644
--- a/runtime/bin/isolate_data.h
+++ b/runtime/bin/isolate_data.h
@@ -8,6 +8,10 @@
 #include "include/dart_api.h"
 #include "platform/globals.h"
 
+
+namespace dart {
+namespace bin {
+
 // Forward declaration.
 class EventHandler;
 
@@ -30,4 +34,7 @@
   DISALLOW_COPY_AND_ASSIGN(IsolateData);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_ISOLATE_DATA_H_
diff --git a/runtime/bin/log.h b/runtime/bin/log.h
index c495840..10629d5 100644
--- a/runtime/bin/log.h
+++ b/runtime/bin/log.h
@@ -9,6 +9,10 @@
 
 #include "platform/globals.h"
 
+
+namespace dart {
+namespace bin {
+
 class Log {
  public:
   // Print formatted output for debugging.
@@ -34,4 +38,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Log);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_LOG_H_
diff --git a/runtime/bin/log_android.cc b/runtime/bin/log_android.cc
index 5f878f2..e8d8e68 100644
--- a/runtime/bin/log_android.cc
+++ b/runtime/bin/log_android.cc
@@ -10,6 +10,10 @@
 #include <stdio.h>  // NOLINT
 #include <android/log.h>  // NOLINT
 
+
+namespace dart {
+namespace bin {
+
 // TODO(gram): We should be buffering the data and only outputting
 // it when we see a '\n'.
 
@@ -21,4 +25,7 @@
   __android_log_vprint(ANDROID_LOG_ERROR, "Dart", format, args);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/log_linux.cc b/runtime/bin/log_linux.cc
index 0b825af..f398c9e 100644
--- a/runtime/bin/log_linux.cc
+++ b/runtime/bin/log_linux.cc
@@ -9,6 +9,10 @@
 
 #include <stdio.h>  // NOLINT
 
+
+namespace dart {
+namespace bin {
+
 void Log::VPrint(const char* format, va_list args) {
   vfprintf(stdout, format, args);
   fflush(stdout);
@@ -19,4 +23,7 @@
   fflush(stdout);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/log_macos.cc b/runtime/bin/log_macos.cc
index 87c9075..3711245 100644
--- a/runtime/bin/log_macos.cc
+++ b/runtime/bin/log_macos.cc
@@ -9,6 +9,10 @@
 
 #include <stdio.h>  // NOLINT
 
+
+namespace dart {
+namespace bin {
+
 void Log::VPrint(const char* format, va_list args) {
   vfprintf(stdout, format, args);
   fflush(stdout);
@@ -19,4 +23,7 @@
   fflush(stderr);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/log_win.cc b/runtime/bin/log_win.cc
index 30c265d..9fb69cf 100644
--- a/runtime/bin/log_win.cc
+++ b/runtime/bin/log_win.cc
@@ -9,6 +9,10 @@
 
 #include <stdio.h>  // NOLINT
 
+
+namespace dart {
+namespace bin {
+
 void Log::VPrint(const char* format, va_list args) {
   vfprintf(stdout, format, args);
   fflush(stdout);
@@ -19,4 +23,7 @@
   fflush(stderr);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 41f2ba9..96ec295 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -23,11 +23,13 @@
 #include "bin/vmstats_impl.h"
 #include "platform/globals.h"
 
+namespace dart {
+namespace bin {
+
 // snapshot_buffer points to a snapshot if we link in a snapshot otherwise
 // it is initialized to NULL.
 extern const uint8_t* snapshot_buffer;
 
-
 // Global state that stores a pointer to the application script snapshot.
 static bool generate_script_snapshot = false;
 static File* snapshot_file = NULL;
@@ -862,3 +864,10 @@
 
   return Process::GlobalExitCode();
 }
+
+}  // namespace bin
+}  // namespace dart
+
+int main(int argc, char** argv) {
+  return dart::bin::main(argc, argv);
+}
diff --git a/runtime/bin/native_service.cc b/runtime/bin/native_service.cc
index 9d4c3e8..37506aa 100644
--- a/runtime/bin/native_service.cc
+++ b/runtime/bin/native_service.cc
@@ -8,6 +8,9 @@
 #include "bin/thread.h"
 
 
+namespace dart {
+namespace bin {
+
 NativeService::NativeService(const char* name,
                              Dart_NativeMessageHandler handler,
                              int number_of_ports)
@@ -38,3 +41,6 @@
   service_ports_index_ = (service_ports_index_ + 1) % service_ports_size_;
   return result;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/native_service.h b/runtime/bin/native_service.h
index 8bb4330..ff1b0bf 100644
--- a/runtime/bin/native_service.h
+++ b/runtime/bin/native_service.h
@@ -9,6 +9,10 @@
 #include "platform/globals.h"
 #include "platform/thread.h"
 
+
+namespace dart {
+namespace bin {
+
 // Utility class to set up a native service and allocate Dart native
 // ports to interact with it from Dart code. The number of native ports
 // allocated for each service is limited.
@@ -42,4 +46,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(NativeService);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_NATIVE_SERVICE_H_
diff --git a/runtime/bin/platform.cc b/runtime/bin/platform.cc
index 7e76c09..c47194e 100644
--- a/runtime/bin/platform.cc
+++ b/runtime/bin/platform.cc
@@ -6,6 +6,8 @@
 #include "bin/platform.h"
 #include "include/dart_api.h"
 
+namespace dart {
+namespace bin {
 
 void FUNCTION_NAME(Platform_NumberOfProcessors)(Dart_NativeArguments args) {
   Dart_EnterScope();
@@ -73,3 +75,6 @@
   }
   Dart_ExitScope();
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/platform.h b/runtime/bin/platform.h
index 9ee2172..54412ba 100644
--- a/runtime/bin/platform.h
+++ b/runtime/bin/platform.h
@@ -7,6 +7,10 @@
 
 #include "bin/builtin.h"
 
+
+namespace dart {
+namespace bin {
+
 class Platform {
  public:
   // Perform platform specific initialization.
@@ -35,4 +39,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Platform);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_PLATFORM_H_
diff --git a/runtime/bin/platform_android.cc b/runtime/bin/platform_android.cc
index 435f16b..e069d5a 100644
--- a/runtime/bin/platform_android.cc
+++ b/runtime/bin/platform_android.cc
@@ -12,6 +12,9 @@
 #include <unistd.h>  // NOLINT
 
 
+namespace dart {
+namespace bin {
+
 bool Platform::Initialize() {
   // Turn off the signal handler for SIGPIPE as it causes the process
   // to terminate on writing to a closed pipe. Without the signal
@@ -69,4 +72,7 @@
   delete[] env;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_linux.cc
index 48f6154..4a70ee5 100644
--- a/runtime/bin/platform_linux.cc
+++ b/runtime/bin/platform_linux.cc
@@ -12,6 +12,9 @@
 #include <unistd.h>  // NOLINT
 
 
+namespace dart {
+namespace bin {
+
 bool Platform::Initialize() {
   // Turn off the signal handler for SIGPIPE as it causes the process
   // to terminate on writing to a closed pipe. Without the signal
@@ -69,4 +72,7 @@
   delete[] env;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc
index d538eb7..e1b914b 100644
--- a/runtime/bin/platform_macos.cc
+++ b/runtime/bin/platform_macos.cc
@@ -13,6 +13,9 @@
 #include <unistd.h>  // NOLINT
 
 
+namespace dart {
+namespace bin {
+
 bool Platform::Initialize() {
   // Turn off the signal handler for SIGPIPE as it causes the process
   // to terminate on writing to a closed pipe. Without the signal
@@ -74,4 +77,7 @@
   delete[] env;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc
index a71a455..3ba9303 100644
--- a/runtime/bin/platform_win.cc
+++ b/runtime/bin/platform_win.cc
@@ -9,6 +9,10 @@
 #include "bin/log.h"
 #include "bin/socket.h"
 
+
+namespace dart {
+namespace bin {
+
 bool Platform::Initialize() {
   // Nothing to do on Windows.
   return true;
@@ -59,4 +63,7 @@
   delete[] env;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index c112e85..df53cd5 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -9,6 +9,10 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 static const int kProcessIdNativeField = 0;
 
 int Process::global_exit_code_ = 0;
@@ -260,3 +264,6 @@
   Dart_SetReturnValue(args, external_array);
   Dart_ExitScope();
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/process.h b/runtime/bin/process.h
index d0ac1bc..c0d8b8b 100644
--- a/runtime/bin/process.h
+++ b/runtime/bin/process.h
@@ -10,6 +10,9 @@
 #include "platform/globals.h"
 
 
+namespace dart {
+namespace bin {
+
 class Process {
  public:
   // Start a new process providing access to stdin, stdout, stderr and
@@ -59,4 +62,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Process);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_PROCESS_H_
diff --git a/runtime/bin/process_android.cc b/runtime/bin/process_android.cc
index f0bbb83..677097b 100644
--- a/runtime/bin/process_android.cc
+++ b/runtime/bin/process_android.cc
@@ -22,6 +22,9 @@
 #include "bin/thread.h"
 
 
+namespace dart {
+namespace bin {
+
 // ProcessInfo is used to map a process id to the file descriptor for
 // the pipe used to communicate the exit code of the process to Dart.
 // ProcessInfo objects are kept in the static singly-linked
@@ -570,4 +573,7 @@
   return static_cast<intptr_t>(getpid());
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index 9ff0ce7..838dc27 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -23,6 +23,10 @@
 
 extern char **environ;
 
+
+namespace dart {
+namespace bin {
+
 // ProcessInfo is used to map a process id to the file descriptor for
 // the pipe used to communicate the exit code of the process to Dart.
 // ProcessInfo objects are kept in the static singly-linked
@@ -566,4 +570,7 @@
   return static_cast<intptr_t>(getpid());
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index fb60ecd..0022a8b 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -22,6 +22,10 @@
 
 extern char **environ;
 
+
+namespace dart {
+namespace bin {
+
 // ProcessInfo is used to map a process id to the file descriptor for
 // the pipe used to communicate the exit code of the process to Dart.
 // ProcessInfo objects are kept in the static singly-linked
@@ -564,4 +568,7 @@
   return static_cast<intptr_t>(getpid());
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc
index 407dd37..1237f13 100644
--- a/runtime/bin/process_win.cc
+++ b/runtime/bin/process_win.cc
@@ -14,6 +14,10 @@
 #include "bin/thread.h"
 #include "bin/utils.h"
 
+
+namespace dart {
+namespace bin {
+
 static const int kReadHandle = 0;
 static const int kWriteHandle = 1;
 
@@ -663,4 +667,7 @@
   return static_cast<intptr_t>(GetCurrentProcessId());
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/resources.h b/runtime/bin/resources.h
index 6279bba..0f3f7c3 100644
--- a/runtime/bin/resources.h
+++ b/runtime/bin/resources.h
@@ -11,6 +11,9 @@
 #include "platform/assert.h"
 
 
+namespace dart {
+namespace bin {
+
 class Resources {
  public:
   static const int kNoSuchInstance = -1;
@@ -50,4 +53,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(Resources);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_RESOURCES_H_
diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
index e66ff35..4f7bd6b 100644
--- a/runtime/bin/secure_socket.cc
+++ b/runtime/bin/secure_socket.cc
@@ -30,6 +30,10 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 bool SSLFilter::library_initialized_ = false;
 dart::Mutex SSLFilter::mutex_;  // To protect library initialization.
 // The password is needed when creating secure server sockets.  It can
@@ -560,19 +564,17 @@
 
   // SetPeerAddress
   PRNetAddr host_address;
-  char host_entry_buffer[PR_NETDB_BUF_SIZE];
-  PRHostEnt host_entry;
-  PRStatus rv = PR_GetHostByName(host_name, host_entry_buffer,
-                                 PR_NETDB_BUF_SIZE, &host_entry);
-  if (rv != PR_SUCCESS) {
-    ThrowPRException("Failed PR_GetHostByName call");
+  PRAddrInfo* info = PR_GetAddrInfoByName(host_name,
+                                          PR_AF_UNSPEC,
+                                          PR_AI_ADDRCONFIG);
+  if (info == NULL) {
+    ThrowPRException("Failed PR_GetAddrInfoByName call");
   }
 
-  int index = PR_EnumerateHostEnt(0, &host_entry, port, &host_address);
-  if (index == -1 || index == 0) {
-    ThrowPRException("Failed PR_EnumerateHostEnt call");
-  }
+  PR_EnumerateAddrInfo(0, info, port, &host_address);
+
   memio_SetPeerName(filter_, &host_address);
+  PR_FreeAddrInfo(info);
 }
 
 
@@ -716,3 +718,6 @@
   }
   return bytes_processed;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/secure_socket.h b/runtime/bin/secure_socket.h
index 551fde0..536a77a 100644
--- a/runtime/bin/secure_socket.h
+++ b/runtime/bin/secure_socket.h
@@ -20,6 +20,10 @@
 #include "platform/globals.h"
 #include "platform/thread.h"
 
+
+namespace dart {
+namespace bin {
+
 static void ThrowException(const char* message) {
   Dart_Handle socket_io_exception =
       DartUtils::NewDartSocketIOException(message, Dart_Null());
@@ -120,4 +124,7 @@
   DISALLOW_COPY_AND_ASSIGN(SSLFilter);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_SECURE_SOCKET_H_
diff --git a/runtime/bin/snapshot_empty.cc b/runtime/bin/snapshot_empty.cc
index abc5522..f8c3f95 100644
--- a/runtime/bin/snapshot_empty.cc
+++ b/runtime/bin/snapshot_empty.cc
@@ -13,4 +13,11 @@
 #endif
 #include <stddef.h>
 
+
+namespace dart {
+namespace bin {
+
 const uint8_t* snapshot_buffer = NULL;
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/snapshot_in.cc b/runtime/bin/snapshot_in.cc
index b281cd5..2e2a497 100644
--- a/runtime/bin/snapshot_in.cc
+++ b/runtime/bin/snapshot_in.cc
@@ -13,6 +13,10 @@
 #endif
 #include <stddef.h>
 
+
+namespace dart {
+namespace bin {
+
 // The string on the next line will be filled in with the contents of the
 // generated snapshot binary file.
 // This string forms the content of a snapshot which is loaded in by dart.
@@ -20,3 +24,6 @@
   %s
 };
 const uint8_t* snapshot_buffer = snapshot_buffer_;
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index 3a35ea2..2593238 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -14,6 +14,10 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 static const int kSocketIdNativeField = 0;
 
 dart::Mutex Socket::mutex_;
@@ -21,19 +25,37 @@
 Dart_Port* Socket::service_ports_ = NULL;
 int Socket::service_ports_index_ = 0;
 
+
+static Dart_Handle GetSockAddr(Dart_Handle obj, RawAddr* addr) {
+  Dart_TypedData_Type data_type;
+  uint8_t* data = NULL;
+  intptr_t len;
+  Dart_Handle result = Dart_TypedDataAcquireData(
+      obj, &data_type, reinterpret_cast<void**>(&data), &len);
+  if (Dart_IsError(result)) return result;
+  memmove(reinterpret_cast<void *>(addr), data, len);
+  return Dart_Null();
+}
+
+
 void FUNCTION_NAME(Socket_CreateConnect)(Dart_NativeArguments args) {
   Dart_EnterScope();
   Dart_Handle socket_obj = Dart_GetNativeArgument(args, 0);
-  const char* host = DartUtils::GetStringValue(Dart_GetNativeArgument(args, 1));
+  Dart_Handle host_obj = Dart_GetNativeArgument(args, 1);
+  RawAddr addr;
+  Dart_Handle result = GetSockAddr(host_obj, &addr);
   int64_t port = 0;
-  if (DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 2), &port)) {
-    intptr_t socket = Socket::CreateConnect(host, port);
+  if (!Dart_IsError(result) &&
+      DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 2), &port)) {
+    intptr_t socket = Socket::CreateConnect(addr, port);
+    OSError error;
+    Dart_TypedDataReleaseData(host_obj);
     if (socket >= 0) {
       Dart_Handle err = Socket::SetSocketIdNativeField(socket_obj, socket);
       if (Dart_IsError(err)) Dart_PropagateError(err);
       Dart_SetReturnValue(args, Dart_True());
     } else {
-      Dart_SetReturnValue(args, DartUtils::NewDartOSError());
+      Dart_SetReturnValue(args, DartUtils::NewDartOSError(&error));
     }
   } else {
     OSError os_error(-1, "Invalid argument", OSError::kUnknown);
@@ -251,7 +273,8 @@
   if (Dart_IsError(err)) Dart_PropagateError(err);
   OSError os_error;
   intptr_t port = 0;
-  char host[INET_ADDRSTRLEN];
+  ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
+  char host[INET6_ADDRSTRLEN];
   if (Socket::GetRemotePeer(socket, host, &port)) {
     Dart_Handle list = Dart_NewList(2);
     Dart_ListSetAt(list, 0, Dart_NewStringFromCString(host));
@@ -310,17 +333,19 @@
 void FUNCTION_NAME(ServerSocket_CreateBindListen)(Dart_NativeArguments args) {
   Dart_EnterScope();
   Dart_Handle socket_obj = Dart_GetNativeArgument(args, 0);
-  Dart_Handle bind_address_obj = Dart_GetNativeArgument(args, 1);
+  Dart_Handle host_obj = Dart_GetNativeArgument(args, 1);
+  RawAddr addr;
+  Dart_Handle result = GetSockAddr(host_obj, &addr);
   Dart_Handle port_obj = Dart_GetNativeArgument(args, 2);
   Dart_Handle backlog_obj = Dart_GetNativeArgument(args, 3);
   int64_t port = 0;
   int64_t backlog = 0;
-  if (Dart_IsString(bind_address_obj) &&
+  if (!Dart_IsError(result) &&
       DartUtils::GetInt64Value(port_obj, &port) &&
       DartUtils::GetInt64Value(backlog_obj, &backlog)) {
-    const char* bind_address = DartUtils::GetStringValue(bind_address_obj);
-    intptr_t socket =
-        ServerSocket::CreateBindListen(bind_address, port, backlog);
+    intptr_t socket = ServerSocket::CreateBindListen(addr, port, backlog);
+    OSError error;
+    Dart_TypedDataReleaseData(host_obj);
     if (socket >= 0) {
       Dart_Handle err = Socket::SetSocketIdNativeField(socket_obj, socket);
       if (Dart_IsError(err)) Dart_PropagateError(err);
@@ -330,7 +355,7 @@
         OSError os_error(-1, "Invalid host", OSError::kUnknown);
         Dart_SetReturnValue(args, DartUtils::NewDartOSError(&os_error));
       } else {
-        Dart_SetReturnValue(args, DartUtils::NewDartOSError());
+        Dart_SetReturnValue(args, DartUtils::NewDartOSError(&error));
       }
     }
   } else {
@@ -366,15 +391,43 @@
 
 
 static CObject* LookupRequest(const CObjectArray& request) {
-  if (request.Length() == 2 && request[1]->IsString()) {
+  if (request.Length() == 3 &&
+      request[1]->IsString() &&
+      request[2]->IsInt32()) {
     CObjectString host(request[1]);
+    CObjectInt32 type(request[2]);
     CObject* result = NULL;
     OSError* os_error = NULL;
-    const char* ip_address =
-        Socket::LookupIPv4Address(host.CString(), &os_error);
-    if (ip_address != NULL) {
-      result = new CObjectString(CObject::NewString(ip_address));
-      free(const_cast<char*>(ip_address));
+    SocketAddresses* addresses =
+        Socket::LookupAddress(host.CString(), type.Value(), &os_error);
+    if (addresses != NULL) {
+      CObjectArray* array = new CObjectArray(
+          CObject::NewArray(addresses->count() + 1));
+      array->SetAt(0, new CObjectInt32(CObject::NewInt32(0)));
+      for (intptr_t i = 0; i < addresses->count(); i++) {
+        SocketAddress* addr = addresses->GetAt(i);
+        CObjectArray* entry = new CObjectArray(CObject::NewArray(3));
+
+        CObjectInt32* type = new CObjectInt32(
+            CObject::NewInt32(addr->GetType()));
+        entry->SetAt(0, type);
+
+        CObjectString* as_string = new CObjectString(CObject::NewString(
+            addr->as_string()));
+        entry->SetAt(1, as_string);
+
+        RawAddr raw = addr->addr();
+        CObjectUint8Array* data = new CObjectUint8Array(CObject::NewUint8Array(
+            SocketAddress::GetAddrLength(raw)));
+        memmove(data->Buffer(),
+                reinterpret_cast<void *>(&raw),
+                SocketAddress::GetAddrLength(raw));
+
+        entry->SetAt(2, data);
+        array->SetAt(i + 1, entry);
+      }
+      result = array;
+      delete addresses;
     } else {
       result = CObject::NewOSError(os_error);
       delete os_error;
@@ -480,3 +533,6 @@
 Dart_Handle Socket::GetSocketIdNativeField(Dart_Handle socket, intptr_t* id) {
   return Dart_GetNativeInstanceField(socket, kSocketIdNativeField, id);
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index b68b782..aa8d198 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -24,6 +24,93 @@
 #endif
 
 
+namespace dart {
+namespace bin {
+
+union RawAddr {
+  struct sockaddr_in in;
+  struct sockaddr_in6 in6;
+  struct sockaddr_storage ss;
+  struct sockaddr addr;
+};
+
+class SocketAddress {
+ public:
+  enum {
+    TYPE_ANY = -1,
+    TYPE_IPV4,
+    TYPE_IPV6,
+  };
+
+  explicit SocketAddress(struct addrinfo* addrinfo);
+
+  int GetType() {
+    if (addr_.ss.ss_family == AF_INET6) return TYPE_IPV6;
+    return TYPE_IPV4;
+  }
+
+  const char* as_string() const { return as_string_; }
+  const RawAddr& addr() const { return addr_; }
+
+  static intptr_t GetAddrLength(const RawAddr& addr) {
+    return addr.ss.ss_family == AF_INET6 ?
+        sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in);
+  }
+
+  static int16_t FromType(int type) {
+    if (type == TYPE_ANY) return AF_UNSPEC;
+    if (type == TYPE_IPV4) return AF_INET;
+    ASSERT(type == TYPE_IPV6 && "Invalid type");
+    return AF_INET6;
+  }
+
+  static void SetAddrPort(RawAddr* addr, intptr_t port) {
+    if (addr->ss.ss_family == AF_INET) {
+      addr->in.sin_port = htons(port);
+    } else {
+      addr->in6.sin6_port = htons(port);
+    }
+  }
+
+  static intptr_t GetAddrPort(RawAddr* addr) {
+    if (addr->ss.ss_family == AF_INET) {
+      return ntohs(addr->in.sin_port);
+    } else {
+      return ntohs(addr->in6.sin6_port);
+    }
+  }
+
+ private:
+  char as_string_[INET6_ADDRSTRLEN];
+  RawAddr addr_;
+
+  DISALLOW_COPY_AND_ASSIGN(SocketAddress);
+};
+
+class SocketAddresses {
+ public:
+  explicit SocketAddresses(intptr_t count)
+      : count_(count),
+        addresses_(new SocketAddress*[count_]) {}
+
+  ~SocketAddresses() {
+    for (intptr_t i = 0; i < count_; i++) {
+      delete addresses_[i];
+    }
+    delete[] addresses_;
+  }
+
+  intptr_t count() const { return count_; }
+  SocketAddress* GetAt(intptr_t i) const { return addresses_[i]; }
+  void SetAt(intptr_t i, SocketAddress* addr) { addresses_[i] = addr; }
+
+ private:
+  const intptr_t count_;
+  SocketAddress** addresses_;
+
+  DISALLOW_COPY_AND_ASSIGN(SocketAddresses);
+};
+
 class Socket {
  public:
   enum SocketRequest {
@@ -34,7 +121,8 @@
   static intptr_t Available(intptr_t fd);
   static int Read(intptr_t fd, void* buffer, intptr_t num_bytes);
   static int Write(intptr_t fd, const void* buffer, intptr_t num_bytes);
-  static intptr_t CreateConnect(const char* host, const intptr_t port);
+  static intptr_t CreateConnect(RawAddr addr,
+                                const intptr_t port);
   static intptr_t GetPort(intptr_t fd);
   static bool GetRemotePeer(intptr_t fd, char* host, intptr_t* port);
   static void GetError(intptr_t fd, OSError* os_error);
@@ -45,9 +133,10 @@
   static bool SetBlocking(intptr_t fd);
   static bool SetNoDelay(intptr_t fd, bool enabled);
 
-  // Perform a IPv4 hostname lookup. Returns the hostname string in
-  // IPv4 dotted-decimal format.
-  static const char* LookupIPv4Address(char* host, OSError** os_error);
+  // Perform a hostname lookup. Returns the SocketAddresses.
+  static SocketAddresses* LookupAddress(const char* host,
+                                        int type,
+                                        OSError** os_error);
 
   static Dart_Port GetServicePort();
 
@@ -76,7 +165,7 @@
   //
   //   -1: system error (errno set)
   //   -5: invalid bindAddress
-  static intptr_t CreateBindListen(const char* bindAddress,
+  static intptr_t CreateBindListen(RawAddr addr,
                                    intptr_t port,
                                    intptr_t backlog);
 
@@ -84,4 +173,7 @@
   DISALLOW_IMPLICIT_CONSTRUCTORS(ServerSocket);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_SOCKET_H_
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index 7e3871d..e4b99bd 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -17,18 +17,33 @@
 #include "bin/log.h"
 
 
+namespace dart {
+namespace bin {
+
+SocketAddress::SocketAddress(struct addrinfo* addrinfo) {
+  ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
+  RawAddr* raw = reinterpret_cast<RawAddr*>(addrinfo->ai_addr);
+  const char* result = inet_ntop(addrinfo->ai_family,
+                                 &raw->in.sin_addr,
+                                 as_string_,
+                                 INET6_ADDRSTRLEN);
+  if (result == NULL) as_string_[0] = 0;
+  memmove(reinterpret_cast<void *>(&addr_),
+          addrinfo->ai_addr,
+          addrinfo->ai_addrlen);
+}
+
+
 bool Socket::Initialize() {
   // Nothing to do on Android.
   return true;
 }
 
 
-intptr_t Socket::CreateConnect(const char* host, const intptr_t port) {
+intptr_t Socket::CreateConnect(RawAddr addr, const intptr_t port) {
   intptr_t fd;
-  struct hostent* server;
-  struct sockaddr_in server_address;
 
-  fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
+  fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
   if (fd < 0) {
     Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
     return -1;
@@ -37,24 +52,15 @@
   FDUtils::SetCloseOnExec(fd);
   Socket::SetNonBlocking(fd);
 
-  server = gethostbyname(host);
-  if (server == NULL) {
-    TEMP_FAILURE_RETRY(close(fd));
-    Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
-    return -1;
-  }
-
-  server_address.sin_family = AF_INET;
-  server_address.sin_port = htons(port);
-  bcopy(server->h_addr, &server_address.sin_addr.s_addr, server->h_length);
-  memset(&server_address.sin_zero, 0, sizeof(server_address.sin_zero));
+  SocketAddress::SetAddrPort(&addr, port);
   intptr_t result = TEMP_FAILURE_RETRY(
       connect(fd,
-              reinterpret_cast<struct sockaddr *>(&server_address),
-              sizeof(server_address)));
+              &addr.addr,
+              SocketAddress::GetAddrLength(addr)));
   if (result == 0 || errno == EINPROGRESS) {
     return fd;
   }
+  TEMP_FAILURE_RETRY(close(fd));
   return -1;
 }
 
@@ -92,38 +98,44 @@
 
 intptr_t Socket::GetPort(intptr_t fd) {
   ASSERT(fd >= 0);
-  struct sockaddr_in socket_address;
-  socklen_t size = sizeof(socket_address);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
   if (TEMP_FAILURE_RETRY(
           getsockname(fd,
-                      reinterpret_cast<struct sockaddr *>(&socket_address),
+                      &raw.addr,
                       &size))) {
     Log::PrintErr("Error getsockname: %s\n", strerror(errno));
     return 0;
   }
-  return ntohs(socket_address.sin_port);
+  return SocketAddress::GetAddrPort(&raw);
 }
 
 
 bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
   ASSERT(fd >= 0);
-  struct sockaddr_in socket_address;
-  socklen_t size = sizeof(socket_address);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
   if (TEMP_FAILURE_RETRY(
           getpeername(fd,
-                      reinterpret_cast<struct sockaddr *>(&socket_address),
+                      &raw.addr,
                       &size))) {
     Log::PrintErr("Error getpeername: %s\n", strerror(errno));
     return false;
   }
-  if (inet_ntop(socket_address.sin_family,
-                reinterpret_cast<const void *>(&socket_address.sin_addr),
+  const void* src;
+  if (raw.ss.ss_family == AF_INET6) {
+    src = reinterpret_cast<const void*>(&raw.in6.sin6_addr);
+  } else {
+    src = reinterpret_cast<const void*>(&raw.in.sin_addr);
+  }
+  if (inet_ntop(raw.ss.ss_family,
+                src,
                 host,
                 INET_ADDRSTRLEN) == NULL) {
     Log::PrintErr("Error inet_ntop: %s\n", strerror(errno));
     return false;
   }
-  *port = ntohs(socket_address.sin_port);
+  *port = SocketAddress::GetAddrPort(&raw);
   return true;
 }
 
@@ -145,12 +157,15 @@
 }
 
 
-const char* Socket::LookupIPv4Address(char* host, OSError** os_error) {
-  // Perform a name lookup for an IPv4 address.
+SocketAddresses* Socket::LookupAddress(const char* host,
+                                       int type,
+                                       OSError** os_error) {
+  // Perform a name lookup for a host name.
   struct addrinfo hints;
   memset(&hints, 0, sizeof(hints));
-  hints.ai_family = AF_INET;
+  hints.ai_family = SocketAddress::FromType(type);
   hints.ai_socktype = SOCK_STREAM;
+  hints.ai_flags = 0;
   hints.ai_protocol = IPPROTO_TCP;
   struct addrinfo* info = NULL;
   int status = getaddrinfo(host, 0, &hints, &info);
@@ -161,38 +176,30 @@
                             OSError::kGetAddressInfo);
     return NULL;
   }
-  // Convert the address into IPv4 dotted decimal notation.
-  char* buffer = reinterpret_cast<char*>(malloc(INET_ADDRSTRLEN));
-  sockaddr_in *sockaddr = reinterpret_cast<sockaddr_in *>(info->ai_addr);
-  const char* result = inet_ntop(AF_INET,
-                                 reinterpret_cast<void *>(&sockaddr->sin_addr),
-                                 buffer,
-                                 INET_ADDRSTRLEN);
-  if (result == NULL) {
-    free(buffer);
-    return NULL;
+  intptr_t count = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if (c->ai_family == AF_INET || c->ai_family == AF_INET6) count++;
   }
-  ASSERT(result == buffer);
-  return buffer;
+  SocketAddresses* addresses = new SocketAddresses(count);
+  intptr_t i = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if (c->ai_family == AF_INET || c->ai_family == AF_INET6) {
+      addresses->SetAt(i, new SocketAddress(c));
+      i++;
+    }
+  }
+  freeaddrinfo(info);
+  return addresses;
 }
 
 
-intptr_t ServerSocket::CreateBindListen(const char* host,
+intptr_t ServerSocket::CreateBindListen(RawAddr addr,
                                         intptr_t port,
                                         intptr_t backlog) {
   intptr_t fd;
-  struct sockaddr_in server_address;
 
-  in_addr_t s_addr = inet_addr(host);
-  if (s_addr == INADDR_NONE) {
-    return -5;
-  }
-
-  fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
-  if (fd < 0) {
-    Log::PrintErr("Error CreateBind: %s\n", strerror(errno));
-    return -1;
-  }
+  fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
+  if (fd < 0) return -1;
 
   FDUtils::SetCloseOnExec(fd);
 
@@ -200,22 +207,23 @@
   TEMP_FAILURE_RETRY(
       setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)));
 
-  server_address.sin_family = AF_INET;
-  server_address.sin_port = htons(port);
-  server_address.sin_addr.s_addr = s_addr;
-  memset(&server_address.sin_zero, 0, sizeof(server_address.sin_zero));
+  if (addr.ss.ss_family == AF_INET6) {
+    optval = 0;
+    TEMP_FAILURE_RETRY(
+        setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)));
+  }
 
+  SocketAddress::SetAddrPort(&addr, port);
   if (TEMP_FAILURE_RETRY(
           bind(fd,
-               reinterpret_cast<struct sockaddr *>(&server_address),
-               sizeof(server_address))) < 0) {
+               &addr.addr,
+               SocketAddress::GetAddrLength(addr))) < 0) {
     TEMP_FAILURE_RETRY(close(fd));
-    Log::PrintErr("Error Bind: %s\n", strerror(errno));
     return -1;
   }
 
-  if (TEMP_FAILURE_RETRY(listen(fd, backlog)) != 0) {
-    Log::PrintErr("Error Listen: %s\n", strerror(errno));
+  if (TEMP_FAILURE_RETRY(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
+    TEMP_FAILURE_RETRY(close(fd));
     return -1;
   }
 
@@ -285,4 +293,7 @@
                                        sizeof(on))) == 0;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index 23e492c..e881f5d 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -19,18 +19,33 @@
 #include "bin/socket.h"
 
 
+namespace dart {
+namespace bin {
+
+SocketAddress::SocketAddress(struct addrinfo* addrinfo) {
+  ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
+  RawAddr* raw = reinterpret_cast<RawAddr*>(addrinfo->ai_addr);
+  const char* result = inet_ntop(addrinfo->ai_family,
+                                 &raw->in.sin_addr,
+                                 as_string_,
+                                 INET6_ADDRSTRLEN);
+  if (result == NULL) as_string_[0] = 0;
+  memmove(reinterpret_cast<void *>(&addr_),
+          addrinfo->ai_addr,
+          addrinfo->ai_addrlen);
+}
+
+
 bool Socket::Initialize() {
   // Nothing to do on Linux.
   return true;
 }
 
 
-intptr_t Socket::CreateConnect(const char* host, const intptr_t port) {
+intptr_t Socket::CreateConnect(RawAddr addr, const intptr_t port) {
   intptr_t fd;
-  struct hostent server;
-  struct sockaddr_in server_address;
 
-  fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
+  fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
   if (fd < 0) {
     Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
     return -1;
@@ -39,28 +54,15 @@
   FDUtils::SetCloseOnExec(fd);
   Socket::SetNonBlocking(fd);
 
-  static const size_t kTempBufSize = 1024;
-  char temp_buf[kTempBufSize];
-  struct hostent *unused;
-  int err;
-  if (gethostbyname_r(
-          host, &server, temp_buf, kTempBufSize, &unused, &err) != 0) {
-    TEMP_FAILURE_RETRY(close(fd));
-    Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
-    return -1;
-  }
-
-  server_address.sin_family = AF_INET;
-  server_address.sin_port = htons(port);
-  bcopy(server.h_addr, &server_address.sin_addr.s_addr, server.h_length);
-  memset(&server_address.sin_zero, 0, sizeof(server_address.sin_zero));
+  SocketAddress::SetAddrPort(&addr, port);
   intptr_t result = TEMP_FAILURE_RETRY(
       connect(fd,
-              reinterpret_cast<struct sockaddr *>(&server_address),
-              sizeof(server_address)));
+              &addr.addr,
+              SocketAddress::GetAddrLength(addr)));
   if (result == 0 || errno == EINPROGRESS) {
     return fd;
   }
+  TEMP_FAILURE_RETRY(close(fd));
   return -1;
 }
 
@@ -98,38 +100,44 @@
 
 intptr_t Socket::GetPort(intptr_t fd) {
   ASSERT(fd >= 0);
-  struct sockaddr_in socket_address;
-  socklen_t size = sizeof(socket_address);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
   if (TEMP_FAILURE_RETRY(
           getsockname(fd,
-                      reinterpret_cast<struct sockaddr *>(&socket_address),
+                      &raw.addr,
                       &size))) {
     Log::PrintErr("Error getsockname: %s\n", strerror(errno));
     return 0;
   }
-  return ntohs(socket_address.sin_port);
+  return SocketAddress::GetAddrPort(&raw);
 }
 
 
 bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
   ASSERT(fd >= 0);
-  struct sockaddr_in socket_address;
-  socklen_t size = sizeof(socket_address);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
   if (TEMP_FAILURE_RETRY(
           getpeername(fd,
-                      reinterpret_cast<struct sockaddr *>(&socket_address),
+                      &raw.addr,
                       &size))) {
     Log::PrintErr("Error getpeername: %s\n", strerror(errno));
     return false;
   }
-  if (inet_ntop(socket_address.sin_family,
-                reinterpret_cast<const void *>(&socket_address.sin_addr),
+  const void* src;
+  if (raw.ss.ss_family == AF_INET6) {
+    src = reinterpret_cast<const void*>(&raw.in6.sin6_addr);
+  } else {
+    src = reinterpret_cast<const void*>(&raw.in.sin_addr);
+  }
+  if (inet_ntop(raw.ss.ss_family,
+                src,
                 host,
                 INET_ADDRSTRLEN) == NULL) {
     Log::PrintErr("Error inet_ntop: %s\n", strerror(errno));
     return false;
   }
-  *port = ntohs(socket_address.sin_port);
+  *port = SocketAddress::GetAddrPort(&raw);
   return true;
 }
 
@@ -161,12 +169,15 @@
 }
 
 
-const char* Socket::LookupIPv4Address(char* host, OSError** os_error) {
-  // Perform a name lookup for an IPv4 address.
+SocketAddresses* Socket::LookupAddress(const char* host,
+                                       int type,
+                                       OSError** os_error) {
+  // Perform a name lookup for a host name.
   struct addrinfo hints;
   memset(&hints, 0, sizeof(hints));
-  hints.ai_family = AF_INET;
+  hints.ai_family = SocketAddress::FromType(type);
   hints.ai_socktype = SOCK_STREAM;
+  hints.ai_flags = 0;
   hints.ai_protocol = IPPROTO_TCP;
   struct addrinfo* info = NULL;
   int status = getaddrinfo(host, 0, &hints, &info);
@@ -177,34 +188,29 @@
                             OSError::kGetAddressInfo);
     return NULL;
   }
-  // Convert the address into IPv4 dotted decimal notation.
-  char* buffer = reinterpret_cast<char*>(malloc(INET_ADDRSTRLEN));
-  sockaddr_in *sockaddr = reinterpret_cast<sockaddr_in *>(info->ai_addr);
-  const char* result = inet_ntop(AF_INET,
-                                 reinterpret_cast<void *>(&sockaddr->sin_addr),
-                                 buffer,
-                                 INET_ADDRSTRLEN);
-  if (result == NULL) {
-    free(buffer);
-    return NULL;
+  intptr_t count = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if (c->ai_family == AF_INET || c->ai_family == AF_INET6) count++;
   }
-  ASSERT(result == buffer);
-  return buffer;
+  SocketAddresses* addresses = new SocketAddresses(count);
+  intptr_t i = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if (c->ai_family == AF_INET || c->ai_family == AF_INET6) {
+      addresses->SetAt(i, new SocketAddress(c));
+      i++;
+    }
+  }
+  freeaddrinfo(info);
+  return addresses;
 }
 
 
-intptr_t ServerSocket::CreateBindListen(const char* host,
+intptr_t ServerSocket::CreateBindListen(RawAddr addr,
                                         intptr_t port,
                                         intptr_t backlog) {
   intptr_t fd;
-  struct sockaddr_in server_address;
 
-  in_addr_t s_addr = inet_addr(host);
-  if (s_addr == INADDR_NONE) {
-    return -5;
-  }
-
-  fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
+  fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
   if (fd < 0) return -1;
 
   FDUtils::SetCloseOnExec(fd);
@@ -213,15 +219,17 @@
   TEMP_FAILURE_RETRY(
       setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)));
 
-  server_address.sin_family = AF_INET;
-  server_address.sin_port = htons(port);
-  server_address.sin_addr.s_addr = s_addr;
-  memset(&server_address.sin_zero, 0, sizeof(server_address.sin_zero));
+  if (addr.ss.ss_family == AF_INET6) {
+    optval = 0;
+    TEMP_FAILURE_RETRY(
+        setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)));
+  }
 
+  SocketAddress::SetAddrPort(&addr, port);
   if (TEMP_FAILURE_RETRY(
           bind(fd,
-               reinterpret_cast<struct sockaddr *>(&server_address),
-               sizeof(server_address))) < 0) {
+               &addr.addr,
+               SocketAddress::GetAddrLength(addr))) < 0) {
     TEMP_FAILURE_RETRY(close(fd));
     return -1;
   }
@@ -297,4 +305,7 @@
                                        sizeof(on))) == 0;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index ff1e28e..bf17056 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -19,18 +19,33 @@
 #include "bin/socket.h"
 
 
+namespace dart {
+namespace bin {
+
+SocketAddress::SocketAddress(struct addrinfo* addrinfo) {
+  ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
+  RawAddr* raw = reinterpret_cast<RawAddr*>(addrinfo->ai_addr);
+  const char* result = inet_ntop(addrinfo->ai_family,
+                                 &raw->in.sin_addr,
+                                 as_string_,
+                                 INET6_ADDRSTRLEN);
+  if (result == NULL) as_string_[0] = 0;
+  memmove(reinterpret_cast<void *>(&addr_),
+          addrinfo->ai_addr,
+          addrinfo->ai_addrlen);
+}
+
+
 bool Socket::Initialize() {
   // Nothing to do on Mac OS.
   return true;
 }
 
 
-intptr_t Socket::CreateConnect(const char* host, const intptr_t port) {
+intptr_t Socket::CreateConnect(RawAddr addr, const intptr_t port) {
   intptr_t fd;
-  struct hostent* server;
-  struct sockaddr_in server_address;
 
-  fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
+  fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
   if (fd < 0) {
     Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
     return -1;
@@ -39,24 +54,15 @@
   FDUtils::SetCloseOnExec(fd);
   Socket::SetNonBlocking(fd);
 
-  server = gethostbyname(host);
-  if (server == NULL) {
-    VOID_TEMP_FAILURE_RETRY(close(fd));
-    Log::PrintErr("Error CreateConnect: %s\n", strerror(errno));
-    return -1;
-  }
-
-  server_address.sin_family = AF_INET;
-  server_address.sin_port = htons(port);
-  bcopy(server->h_addr, &server_address.sin_addr.s_addr, server->h_length);
-  memset(&server_address.sin_zero, 0, sizeof(server_address.sin_zero));
+  SocketAddress::SetAddrPort(&addr, port);
   intptr_t result = TEMP_FAILURE_RETRY(
       connect(fd,
-              reinterpret_cast<struct sockaddr *>(&server_address),
-              sizeof(server_address)));
+              &addr.addr,
+              SocketAddress::GetAddrLength(addr)));
   if (result == 0 || errno == EINPROGRESS) {
     return fd;
   }
+  VOID_TEMP_FAILURE_RETRY(close(fd));
   return -1;
 }
 
@@ -94,38 +100,44 @@
 
 intptr_t Socket::GetPort(intptr_t fd) {
   ASSERT(fd >= 0);
-  struct sockaddr_in socket_address;
-  socklen_t size = sizeof(socket_address);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
   if (TEMP_FAILURE_RETRY(
           getsockname(fd,
-                      reinterpret_cast<struct sockaddr *>(&socket_address),
+                      &raw.addr,
                       &size))) {
     Log::PrintErr("Error getsockname: %s\n", strerror(errno));
     return 0;
   }
-  return ntohs(socket_address.sin_port);
+  return SocketAddress::GetAddrPort(&raw);
 }
 
 
 bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
   ASSERT(fd >= 0);
-  struct sockaddr_in socket_address;
-  socklen_t size = sizeof(socket_address);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
   if (TEMP_FAILURE_RETRY(
           getpeername(fd,
-                      reinterpret_cast<struct sockaddr *>(&socket_address),
+                      &raw.addr,
                       &size))) {
     Log::PrintErr("Error getpeername: %s\n", strerror(errno));
     return false;
   }
-  if (inet_ntop(socket_address.sin_family,
-                reinterpret_cast<const void *>(&socket_address.sin_addr),
+  const void* src;
+  if (raw.ss.ss_family == AF_INET6) {
+    src = reinterpret_cast<const void*>(&raw.in6.sin6_addr);
+  } else {
+    src = reinterpret_cast<const void*>(&raw.in.sin_addr);
+  }
+  if (inet_ntop(raw.ss.ss_family,
+                src,
                 host,
                 INET_ADDRSTRLEN) == NULL) {
     Log::PrintErr("Error inet_ntop: %s\n", strerror(errno));
     return false;
   }
-  *port = ntohs(socket_address.sin_port);
+  *port = SocketAddress::GetAddrPort(&raw);
   return true;
 }
 
@@ -157,12 +169,15 @@
 }
 
 
-const char* Socket::LookupIPv4Address(char* host, OSError** os_error) {
-  // Perform a name lookup for an IPv4 address.
+SocketAddresses* Socket::LookupAddress(const char* host,
+                                       int type,
+                                       OSError** os_error) {
+  // Perform a name lookup for a host name.
   struct addrinfo hints;
   memset(&hints, 0, sizeof(hints));
-  hints.ai_family = AF_INET;
+  hints.ai_family = SocketAddress::FromType(type);
   hints.ai_socktype = SOCK_STREAM;
+  hints.ai_flags = 0;
   hints.ai_protocol = IPPROTO_TCP;
   struct addrinfo* info = NULL;
   int status = getaddrinfo(host, 0, &hints, &info);
@@ -173,34 +188,29 @@
                             OSError::kGetAddressInfo);
     return NULL;
   }
-  // Convert the address into IPv4 dotted decimal notation.
-  char* buffer = reinterpret_cast<char*>(malloc(INET_ADDRSTRLEN));
-  sockaddr_in *sockaddr = reinterpret_cast<sockaddr_in *>(info->ai_addr);
-  const char* result = inet_ntop(AF_INET,
-                                 reinterpret_cast<void *>(&sockaddr->sin_addr),
-                                 buffer,
-                                 INET_ADDRSTRLEN);
-  if (result == NULL) {
-    free(buffer);
-    return NULL;
+  intptr_t count = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if (c->ai_family == AF_INET || c->ai_family == AF_INET6) count++;
   }
-  ASSERT(result == buffer);
-  return buffer;
+  SocketAddresses* addresses = new SocketAddresses(count);
+  intptr_t i = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if (c->ai_family == AF_INET || c->ai_family == AF_INET6) {
+      addresses->SetAt(i, new SocketAddress(c));
+      i++;
+    }
+  }
+  freeaddrinfo(info);
+  return addresses;
 }
 
 
-intptr_t ServerSocket::CreateBindListen(const char* host,
+intptr_t ServerSocket::CreateBindListen(RawAddr addr,
                                         intptr_t port,
                                         intptr_t backlog) {
   intptr_t fd;
-  struct sockaddr_in server_address;
 
-  in_addr_t s_addr = inet_addr(host);
-  if (s_addr == INADDR_NONE) {
-    return -5;
-  }
-
-  fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
+  fd = TEMP_FAILURE_RETRY(socket(addr.ss.ss_family, SOCK_STREAM, 0));
   if (fd < 0) return -1;
 
   FDUtils::SetCloseOnExec(fd);
@@ -209,21 +219,23 @@
   VOID_TEMP_FAILURE_RETRY(
       setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)));
 
-  server_address.sin_family = AF_INET;
-  server_address.sin_port = htons(port);
-  server_address.sin_addr.s_addr = s_addr;
-  memset(&server_address.sin_zero, 0, sizeof(server_address.sin_zero));
+  if (addr.ss.ss_family == AF_INET6) {
+    optval = 0;
+    VOID_TEMP_FAILURE_RETRY(
+        setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof(optval)));
+  }
 
+  SocketAddress::SetAddrPort(&addr, port);
   if (TEMP_FAILURE_RETRY(
           bind(fd,
-               reinterpret_cast<struct sockaddr *>(&server_address),
-               sizeof(server_address))) < 0) {
+               &addr.addr,
+               SocketAddress::GetAddrLength(addr))) < 0) {
     VOID_TEMP_FAILURE_RETRY(close(fd));
     return -1;
   }
 
   if (TEMP_FAILURE_RETRY(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
-    TEMP_FAILURE_RETRY(close(fd));
+    VOID_TEMP_FAILURE_RETRY(close(fd));
     return -1;
   }
 
@@ -283,4 +295,7 @@
                                        sizeof(on))) == 0;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 67fbadf..daa59c6 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 patch class RawServerSocket  {
-  /* patch */ static Future<RawServerSocket> bind([String address = "127.0.0.1",
+  /* patch */ static Future<RawServerSocket> bind([address = "127.0.0.1",
                                                    int port = 0,
                                                    int backlog = 0]) {
     return _RawServerSocket.bind(address, port, backlog);
@@ -12,12 +12,36 @@
 
 
 patch class RawSocket {
-  /* patch */ static Future<RawSocket> connect(String host, int port) {
+  /* patch */ static Future<RawSocket> connect(host, int port) {
     return _RawSocket.connect(host, port);
   }
 }
 
 
+patch class InternetAddress {
+  /* patch */ static Future<List<InternetAddress>> lookup(
+      String host, {InternetAddressType type: InternetAddressType.IPv4}) {
+    return _NativeSocket.lookup(host, type: type);
+  }
+}
+
+class _InternetAddress implements InternetAddress {
+  final InternetAddressType type;
+  final String address;
+  final String host;
+  final Uint8List _sockaddr_storage;
+
+  _InternetAddress(InternetAddressType this.type,
+                   String this.address,
+                   String this.host,
+                   List<int> this._sockaddr_storage);
+
+  String toString() {
+    return "InternetAddress('$address', ${type.name})";
+  }
+}
+
+
 // The _NativeSocket class encapsulates an OS socket.
 class _NativeSocket extends NativeFieldWrapperClass1 {
   // Bit flags used when communicating between the eventhandler and
@@ -74,57 +98,95 @@
   // Holds the port of the socket, null if not known.
   int localPort;
 
-  // Holds the host or address used to connect or bind the socket.
-  String localHost;
+  // Holds the address used to connect or bind the socket.
+  InternetAddress address;
 
   // Native port for socket services.
   static SendPort socketService;
 
-  static Future<_NativeSocket> connect(String host, int port) {
-    var completer = new Completer();
+  static Future<List<InternetAddress>> lookup(
+      String host, {InternetAddressType type: InternetAddressType.IPv4}) {
     ensureSocketService();
-    socketService.call([HOST_NAME_LOOKUP, host]).then((response) {
-      if (isErrorResponse(response)) {
-        completer.completeError(
-            createError(response, "Failed host name lookup"));
-      } else {
-        var socket = new _NativeSocket.normal();
-        socket.localHost = host;
-        var result = socket.nativeCreateConnect(response, port);
-        if (result is OSError) {
-          completer.completeError(createError(result, "Connection failed"));
-        } else {
-          // Setup handlers for receiving the first write event which
-          // indicate that the socket is fully connected.
-          socket.setHandlers(
-              write: () {
-                socket.setListening(read: false, write: false);
-                completer.complete(socket);
-              },
-              error: (e) {
-                socket.close();
-                completer.completeError(createError(e, "Connection failed"));
-              }
-          );
-          socket.setListening(read: false, write: true);
-        }
-      }
-    });
-    return completer.future;
+    return socketService.call([HOST_NAME_LOOKUP, host, type._value])
+        .then((response) {
+          if (isErrorResponse(response)) {
+            throw createError(response, "Failed host name lookup");
+          } else {
+            return response.skip(1).map((result) {
+              var type = new InternetAddressType._from(result[0]);
+              return new _InternetAddress(type, result[1], host, result[2]);
+            }).toList();
+          }
+        });
   }
 
-  static Future<_NativeSocket> bind(String address,
+  static Future<_NativeSocket> connect(host, int port) {
+    return new Future.value(host)
+        .then((host) {
+          if (host is _InternetAddress) return host;
+          return lookup(host)
+              .then((list) {
+                if (list.length == 0) {
+                  throw createError(response, "Failed host name lookup");
+                }
+                return list[0];
+              });
+        })
+        .then((address) {
+          ensureSocketService();
+          var socket = new _NativeSocket.normal();
+          socket.address = address;
+          var result = socket.nativeCreateConnect(
+              address._sockaddr_storage, port);
+          if (result is OSError) {
+            throw createError(result, "Connection failed");
+          } else {
+            var completer = new Completer();
+            // Setup handlers for receiving the first write event which
+            // indicate that the socket is fully connected.
+            socket.setHandlers(
+                write: () {
+                  socket.setListening(read: false, write: false);
+                  completer.complete(socket);
+                },
+                error: (e) {
+                  socket.close();
+                  completer.completeError(createError(e, "Connection failed"));
+                }
+            );
+            socket.setListening(read: false, write: true);
+            return completer.future;
+          }
+        });
+  }
+
+  static Future<_NativeSocket> bind(host,
                                     int port,
                                     int backlog) {
-    var socket = new _NativeSocket.listen();
-    socket.localHost = address;
-    var result = socket.nativeCreateBindListen(address, port, backlog);
-    if (result is OSError) {
-      return new Future.error(
-          new SocketIOException("Failed to create server socket", result));
-    }
-    if (port != 0) socket.localPort = port;
-    return new Future.value(socket);
+    return new Future.value(host)
+        .then((host) {
+          if (host is _InternetAddress) return host;
+          return lookup(host)
+              .then((list) {
+                if (list.length == 0) {
+                  throw createError(response, "Failed host name lookup");
+                }
+                return list[0];
+              });
+        })
+        .then((address) {
+          var socket = new _NativeSocket.listen();
+          socket.address = address;
+          var result = socket.nativeCreateBindListen(address._sockaddr_storage,
+                                                     port,
+                                                     backlog);
+          if (result is OSError) {
+            throw new SocketIOException(
+                "Failed to create server socket", result);
+          }
+          if (port != 0) socket.localPort = port;
+          return socket;
+        });
   }
 
   _NativeSocket.normal() : typeFlags = TYPE_NORMAL_SOCKET {
@@ -194,6 +256,8 @@
   _NativeSocket accept() {
     var socket = new _NativeSocket.normal();
     if (nativeAccept(socket) != true) return null;
+    socket.localPort = localPort;
+    socket.address = address;
     return socket;
   }
 
@@ -206,8 +270,6 @@
     return nativeGetRemotePeer()[1];
   }
 
-  String get host => localHost;
-
   String get remoteHost {
     return nativeGetRemotePeer()[0];
   }
@@ -409,8 +471,9 @@
   nativeRead(int len) native "Socket_Read";
   nativeWrite(List<int> buffer, int offset, int bytes)
       native "Socket_WriteList";
-  nativeCreateConnect(String host, int port) native "Socket_CreateConnect";
-  nativeCreateBindListen(String address, int port, int backlog)
+  nativeCreateConnect(List<int> addr,
+                      int port) native "Socket_CreateConnect";
+  nativeCreateBindListen(List<int> addr, int port, int backlog)
       native "ServerSocket_CreateBindListen";
   nativeAccept(_NativeSocket socket) native "ServerSocket_Accept";
   int nativeGetPort() native "Socket_GetPort";
@@ -427,7 +490,7 @@
   final _NativeSocket _socket;
   StreamController<RawSocket> _controller;
 
-  static Future<_RawServerSocket> bind(String address,
+  static Future<_RawServerSocket> bind(address,
                                        int port,
                                        int backlog) {
     if (port < 0 || port > 0xFFFF)
@@ -503,7 +566,7 @@
   bool _readEventsEnabled = true;
   bool _writeEventsEnabled = true;
 
-  static Future<RawSocket> connect(String host, int port) {
+  static Future<RawSocket> connect(host, int port) {
     return _NativeSocket.connect(host, port)
         .then((socket) => new _RawSocket(socket));
   }
@@ -571,7 +634,7 @@
 
   int get remotePort => _socket.remotePort;
 
-  String get host => _socket.host;
+  InternetAddress get address => _socket.address;
 
   String get remoteHost => _socket.remoteHost;
 
@@ -621,7 +684,7 @@
 
 
 patch class ServerSocket {
-  /* patch */ static Future<ServerSocket> bind([String address = "127.0.0.1",
+  /* patch */ static Future<ServerSocket> bind([address = "127.0.0.1",
                                                 int port = 0,
                                                 int backlog = 0]) {
     return _ServerSocket.bind(address, port, backlog);
@@ -632,7 +695,7 @@
                     implements ServerSocket {
   final _socket;
 
-  static Future<_ServerSocket> bind(String address,
+  static Future<_ServerSocket> bind(address,
                                     int port,
                                     int backlog) {
     return _RawServerSocket.bind(address, port, backlog)
@@ -659,7 +722,7 @@
 
 
 patch class Socket {
-  /* patch */ static Future<Socket> connect(String host, int port) {
+  /* patch */ static Future<Socket> connect(host, int port) {
     return RawSocket.connect(host, port).then(
         (socket) => new _Socket(socket));
   }
@@ -771,6 +834,7 @@
   _SocketStreamConsumer _consumer;
   IOSink _sink;
   var _subscription;
+  var _detachReady;
 
   _Socket(RawSocket this._raw) {
     _controller = new StreamController<List<int>>(
@@ -851,6 +915,17 @@
   String get remoteHost => _raw.remoteHost;
   int get remotePort => _raw.remotePort;
 
+  Future _detachRaw() {
+    _detachReady = new Completer();
+    _sink.close();
+    return _detachReady.future.then((_) {
+      assert(_consumer.buffer == null);
+      var raw = _raw;
+      _raw = null;
+      return [raw, _subscription];
+    });
+  }
+
   // Ensure a subscription on the raw socket. Both the stream and the
   // consumer needs a subscription as they share the error and done
   // events from the raw socket.
@@ -938,9 +1013,13 @@
   }
 
   void _consumerDone() {
-    if (_raw != null) {
-      _raw.shutdown(SocketDirection.SEND);
-      _disableWriteEvent();
+    if (_detachReady != null) {
+      _detachReady.complete(null);
+    } else {
+      if (_raw != null) {
+        _raw.shutdown(SocketDirection.SEND);
+        _disableWriteEvent();
+      }
     }
   }
 }
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index 54f6639..12b76d8 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -11,6 +11,31 @@
 #include "bin/log.h"
 #include "bin/socket.h"
 
+
+namespace dart {
+namespace bin {
+
+SocketAddress::SocketAddress(struct addrinfo* addrinfo) {
+  ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
+  RawAddr* raw = reinterpret_cast<RawAddr*>(addrinfo->ai_addr);
+
+  // Clear the port before calling WSAAddressToString as WSAAddressToString
+  // includes the port in the formatted string.
+  DWORD len = INET6_ADDRSTRLEN;
+  int err = WSAAddressToStringA(&raw->addr,
+                                sizeof(RawAddr),
+                                NULL,
+                                as_string_,
+                                &len);
+
+  if (err != 0) {
+    as_string_[0] = 0;
+  }
+  memmove(reinterpret_cast<void *>(&addr_),
+          addrinfo->ai_addr,
+          addrinfo->ai_addrlen);
+}
+
 bool Socket::Initialize() {
   static bool socket_initialized = false;
   if (socket_initialized) return true;
@@ -47,36 +72,36 @@
 intptr_t Socket::GetPort(intptr_t fd) {
   ASSERT(reinterpret_cast<Handle*>(fd)->is_socket());
   SocketHandle* socket_handle = reinterpret_cast<SocketHandle*>(fd);
-  struct sockaddr_in socket_address;
-  socklen_t size = sizeof(socket_address);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
   if (getsockname(socket_handle->socket(),
-                  reinterpret_cast<struct sockaddr *>(&socket_address),
-                  &size)) {
-    Log::PrintErr("Error getsockname: %s\n", strerror(errno));
+                  &raw.addr,
+                  &size) == SOCKET_ERROR) {
+    Log::PrintErr("Error getsockname: %d\n", WSAGetLastError());
     return 0;
   }
-  return ntohs(socket_address.sin_port);
+  return SocketAddress::GetAddrPort(&raw);
 }
 
 
 bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
   ASSERT(reinterpret_cast<Handle*>(fd)->is_socket());
   SocketHandle* socket_handle = reinterpret_cast<SocketHandle*>(fd);
-  struct sockaddr_in socket_address;
-  socklen_t size = sizeof(socket_address);
+  RawAddr raw;
+  socklen_t size = sizeof(raw);
   if (getpeername(socket_handle->socket(),
-                  reinterpret_cast<struct sockaddr *>(&socket_address),
+                  &raw.addr,
                   &size)) {
-    Log::PrintErr("Error getpeername: %s\n", strerror(errno));
+    Log::PrintErr("Error getpeername: %d\n", WSAGetLastError());
     return false;
   }
-  *port = ntohs(socket_address.sin_port);
+  *port = SocketAddress::GetAddrPort(&raw);
   // Clear the port before calling WSAAddressToString as WSAAddressToString
   // includes the port in the formatted string.
-  socket_address.sin_port = 0;
-  DWORD len = INET_ADDRSTRLEN;
-  int err = WSAAddressToStringA(reinterpret_cast<LPSOCKADDR>(&socket_address),
-                                sizeof(socket_address),
+  SocketAddress::SetAddrPort(&raw, 0);
+  DWORD len = INET6_ADDRSTRLEN;
+  int err = WSAAddressToStringA(&raw.addr,
+                                sizeof(raw),
                                 NULL,
                                 host,
                                 &len);
@@ -87,8 +112,8 @@
   return true;
 }
 
-intptr_t Socket::CreateConnect(const char* host, const intptr_t port) {
-  SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
+intptr_t Socket::CreateConnect(RawAddr addr, const intptr_t port) {
+  SOCKET s = socket(addr.ss.ss_family, SOCK_STREAM, 0);
   if (s == INVALID_SOCKET) {
     return -1;
   }
@@ -105,29 +130,11 @@
     FATAL("Failed setting SO_LINGER on socket");
   }
 
-  // Perform a name lookup for an IPv4 address.
-  struct addrinfo hints;
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_family = AF_INET;
-  hints.ai_socktype = SOCK_STREAM;
-  hints.ai_protocol = IPPROTO_TCP;
-  struct addrinfo* result = NULL;
-  status = getaddrinfo(host, 0, &hints, &result);
-  if (status != NO_ERROR) {
-    return -1;
-  }
-
-  // Copy IPv4 address and set the port.
-  struct sockaddr_in server_address;
-  memcpy(&server_address,
-         reinterpret_cast<sockaddr_in *>(result->ai_addr),
-         sizeof(server_address));
-  server_address.sin_port = htons(port);
-  freeaddrinfo(result);  // Free data allocated by getaddrinfo.
+  SocketAddress::SetAddrPort(&addr, port);
   status = connect(
       s,
-      reinterpret_cast<struct sockaddr*>(&server_address),
-      sizeof(server_address));
+      &addr.addr,
+      SocketAddress::GetAddrLength(addr));
   if (status == SOCKET_ERROR) {
     DWORD rc = WSAGetLastError();
     closesocket(s);
@@ -192,13 +199,17 @@
 }
 
 
-const char* Socket::LookupIPv4Address(char* host, OSError** os_error) {
-  // Perform a name lookup for an IPv4 address.
+SocketAddresses* Socket::LookupAddress(const char* host,
+                                       int type,
+                                       OSError** os_error) {
   Initialize();
+
+  // Perform a name lookup for a host name.
   struct addrinfo hints;
   memset(&hints, 0, sizeof(hints));
-  hints.ai_family = AF_INET;
+  hints.ai_family = SocketAddress::FromType(type);
   hints.ai_socktype = SOCK_STREAM;
+  hints.ai_flags = 0;
   hints.ai_protocol = IPPROTO_TCP;
   struct addrinfo* info = NULL;
   int status = getaddrinfo(host, 0, &hints, &info);
@@ -209,35 +220,27 @@
     *os_error = new OSError();
     return NULL;
   }
-  // Convert the address into IPv4 dotted decimal notation.
-  char* buffer = reinterpret_cast<char*>(malloc(INET_ADDRSTRLEN));
-  sockaddr_in *sockaddr = reinterpret_cast<sockaddr_in *>(info->ai_addr);
-
-  // Clear the port before calling WSAAddressToString as WSAAddressToString
-  // includes the port in the formatted string.
-  DWORD len = INET_ADDRSTRLEN;
-  int err = WSAAddressToStringA(reinterpret_cast<LPSOCKADDR>(sockaddr),
-                                sizeof(sockaddr_in),
-                                NULL,
-                                buffer,
-                                &len);
-  if (err != 0) {
-    free(buffer);
-    return NULL;
+  intptr_t count = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if (c->ai_family == AF_INET || c->ai_family == AF_INET6) count++;
   }
-  return buffer;
+  SocketAddresses* addresses = new SocketAddresses(count);
+  intptr_t i = 0;
+  for (struct addrinfo* c = info; c != NULL; c = c->ai_next) {
+    if (c->ai_family == AF_INET || c->ai_family == AF_INET6) {
+      addresses->SetAt(i, new SocketAddress(c));
+      i++;
+    }
+  }
+  freeaddrinfo(info);
+  return addresses;
 }
 
 
-intptr_t ServerSocket::CreateBindListen(const char* host,
+intptr_t ServerSocket::CreateBindListen(RawAddr addr,
                                         intptr_t port,
                                         intptr_t backlog) {
-  unsigned long socket_addr = inet_addr(host);  // NOLINT
-  if (socket_addr == INADDR_NONE) {
-    return -5;
-  }
-
-  SOCKET s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+  SOCKET s = socket(addr.ss.ss_family, SOCK_STREAM, IPPROTO_TCP);
   if (s == INVALID_SOCKET) {
     return -1;
   }
@@ -255,14 +258,19 @@
     return -1;
   }
 
-  sockaddr_in addr;
-  memset(&addr, 0, sizeof(addr));
-  addr.sin_family = AF_INET;
-  addr.sin_addr.s_addr = socket_addr;
-  addr.sin_port = htons(port);
+  if (addr.ss.ss_family == AF_INET6) {
+    optval = false;
+    setsockopt(s,
+               IPPROTO_IPV6,
+               IPV6_V6ONLY,
+               reinterpret_cast<const char*>(&optval),
+               sizeof(optval));
+  }
+
+  SocketAddress::SetAddrPort(&addr, port);
   status = bind(s,
-                reinterpret_cast<struct sockaddr *>(&addr),
-                sizeof(addr));
+                &addr.addr,
+                SocketAddress::GetAddrLength(addr));
   if (status == SOCKET_ERROR) {
     DWORD rc = WSAGetLastError();
     closesocket(s);
@@ -321,4 +329,7 @@
                     sizeof(on)) == 0;
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/test_extension.cc b/runtime/bin/test_extension.cc
index c1da730..327f015 100644
--- a/runtime/bin/test_extension.cc
+++ b/runtime/bin/test_extension.cc
@@ -5,6 +5,10 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 Dart_NativeFunction ResolveName(Dart_Handle name, int argc);
 
 DART_EXPORT Dart_Handle test_extension_Init(Dart_Handle parent_library) {
@@ -50,3 +54,6 @@
   }
   return NULL;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/thread.h b/runtime/bin/thread.h
index a3c5a92..23091f0 100644
--- a/runtime/bin/thread.h
+++ b/runtime/bin/thread.h
@@ -8,6 +8,10 @@
 #include "platform/assert.h"
 #include "platform/thread.h"
 
+
+namespace dart {
+namespace bin {
+
 class MutexLocker  {
  public:
   explicit MutexLocker(dart::Mutex* mutex) : mutex_(mutex) {
@@ -55,4 +59,7 @@
   DISALLOW_COPY_AND_ASSIGN(MonitorLocker);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_THREAD_H_
diff --git a/runtime/bin/utils.h b/runtime/bin/utils.h
index c0aab6b..60beef1 100644
--- a/runtime/bin/utils.h
+++ b/runtime/bin/utils.h
@@ -11,6 +11,10 @@
 #include "include/dart_api.h"
 #include "platform/globals.h"
 
+
+namespace dart {
+namespace bin {
+
 class OSError {
  public:
   enum SubSystem {
@@ -85,4 +89,7 @@
   static void Sleep(int64_t millis);
 };
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_UTILS_H_
diff --git a/runtime/bin/utils_android.cc b/runtime/bin/utils_android.cc
index 180dc39..25022b5 100644
--- a/runtime/bin/utils_android.cc
+++ b/runtime/bin/utils_android.cc
@@ -12,6 +12,10 @@
 #include "bin/utils.h"
 #include "platform/assert.h"
 
+
+namespace dart {
+namespace bin {
+
 OSError::OSError() : sub_system_(kSystem), code_(0), message_(NULL) {
   set_sub_system(kSystem);
   set_code(errno);
@@ -91,4 +95,7 @@
   usleep(millis * 1000);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/utils_linux.cc b/runtime/bin/utils_linux.cc
index 3defd39..e8230c8 100644
--- a/runtime/bin/utils_linux.cc
+++ b/runtime/bin/utils_linux.cc
@@ -12,6 +12,10 @@
 #include "bin/utils.h"
 #include "platform/assert.h"
 
+
+namespace dart {
+namespace bin {
+
 OSError::OSError() : sub_system_(kSystem), code_(0), message_(NULL) {
   set_sub_system(kSystem);
   set_code(errno);
@@ -91,4 +95,7 @@
   usleep(millis * 1000);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc
index f717edd..69c738e 100644
--- a/runtime/bin/utils_macos.cc
+++ b/runtime/bin/utils_macos.cc
@@ -12,6 +12,10 @@
 #include "bin/utils.h"
 #include "platform/assert.h"
 
+
+namespace dart {
+namespace bin {
+
 OSError::OSError() : sub_system_(kSystem), code_(0), message_(NULL) {
   set_sub_system(kSystem);
   set_code(errno);
@@ -91,4 +95,7 @@
   usleep(millis * 1000);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/utils_win.cc b/runtime/bin/utils_win.cc
index 6c25d5b..b926dd7 100644
--- a/runtime/bin/utils_win.cc
+++ b/runtime/bin/utils_win.cc
@@ -11,6 +11,10 @@
 #include "bin/utils.h"
 #include "bin/log.h"
 
+
+namespace dart {
+namespace bin {
+
 static void FormatMessageIntoBuffer(DWORD code,
                                     wchar_t* buffer,
                                     int buffer_length) {
@@ -145,4 +149,7 @@
   ::Sleep(millis);
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/vmstats.h b/runtime/bin/vmstats.h
index 14716e8..6143b95 100644
--- a/runtime/bin/vmstats.h
+++ b/runtime/bin/vmstats.h
@@ -7,6 +7,10 @@
 
 #include "include/dart_api.h"
 
+
+namespace dart {
+namespace bin {
+
 /**
  * A VM status callback. Status plug-ins implement and register this
  * function using Dart_RegisterStatusPlugin. When Dart_GetVMStatus is
@@ -34,4 +38,7 @@
  */
 DART_EXPORT int Dart_RegisterVmStatusPlugin(Dart_VmStatusCallback callback);
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_VMSTATS_H_
diff --git a/runtime/bin/vmstats_impl.cc b/runtime/bin/vmstats_impl.cc
index d2e0af6..b73fe64 100644
--- a/runtime/bin/vmstats_impl.cc
+++ b/runtime/bin/vmstats_impl.cc
@@ -14,6 +14,10 @@
 #include "include/dart_debugger_api.h"
 #include "platform/json.h"
 
+
+namespace dart {
+namespace bin {
+
 #define BUFSIZE 8192
 #define RETRY_PAUSE 100  // milliseconds
 
@@ -55,15 +59,15 @@
   // TODO(tball): allow host to be specified.
   char* host = const_cast<char*>(DEFAULT_HOST);
   OSError* os_error;
-  const char* host_ip = Socket::LookupIPv4Address(host, &os_error);
-  if (host_ip == NULL) {
+  SocketAddresses* addresses = Socket::LookupAddress(host, -1, &os_error);
+  if (addresses == NULL) {
     Log::PrintErr("Failed IP lookup of VmStats host %s: %s\n",
                   host, os_error->message());
     return;
   }
-
   const intptr_t BACKLOG = 128;  // Default value from HttpServer.dart
-  int64_t address = ServerSocket::CreateBindListen(host_ip, port, BACKLOG);
+  int64_t address = ServerSocket::CreateBindListen(
+      addresses->GetAt(0)->addr(), port, BACKLOG);
   if (address < 0) {
     Log::PrintErr("Failed binding VmStats socket: %s:%d\n", host, port);
     return;
@@ -472,3 +476,6 @@
   }
   return NULL;
 }
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/vmstats_impl.h b/runtime/bin/vmstats_impl.h
index a348a7a..ed92e87 100644
--- a/runtime/bin/vmstats_impl.h
+++ b/runtime/bin/vmstats_impl.h
@@ -12,6 +12,10 @@
 #include "bin/isolate_data.h"
 #include "platform/thread.h"
 
+
+namespace dart {
+namespace bin {
+
 // VmStats is a HTTP singleton service that reports status information
 // of the running VM.
 
@@ -105,4 +109,8 @@
   DISALLOW_COPY_AND_ASSIGN(VmStatusService);
 };
 
+
+}  // namespace bin
+}  // namespace dart
+
 #endif  // BIN_VMSTATS_IMPL_H_
diff --git a/runtime/bin/vmstats_impl_android.cc b/runtime/bin/vmstats_impl_android.cc
index e460e70..5baa0d4 100644
--- a/runtime/bin/vmstats_impl_android.cc
+++ b/runtime/bin/vmstats_impl_android.cc
@@ -10,6 +10,9 @@
 #include <signal.h>  // NOLINT
 
 
+namespace dart {
+namespace bin {
+
 static void sig_handler(int sig, siginfo_t* siginfo, void*) {
   if (sig == SIGQUIT) {
     VmStats::DumpStack();
@@ -29,5 +32,8 @@
   }
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_ANDROID)
 
diff --git a/runtime/bin/vmstats_impl_linux.cc b/runtime/bin/vmstats_impl_linux.cc
index ae2277a..93efbf2 100644
--- a/runtime/bin/vmstats_impl_linux.cc
+++ b/runtime/bin/vmstats_impl_linux.cc
@@ -10,6 +10,9 @@
 #include <signal.h>  // NOLINT
 
 
+namespace dart {
+namespace bin {
+
 static void sig_handler(int sig, siginfo_t* siginfo, void*) {
   if (sig == SIGQUIT) {
     VmStats::DumpStack();
@@ -29,5 +32,7 @@
   }
 }
 
-#endif  // defined(TARGET_OS_LINUX)
+}  // namespace bin
+}  // namespace dart
 
+#endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/vmstats_impl_macos.cc b/runtime/bin/vmstats_impl_macos.cc
index 29686a1..23cf179 100644
--- a/runtime/bin/vmstats_impl_macos.cc
+++ b/runtime/bin/vmstats_impl_macos.cc
@@ -10,6 +10,9 @@
 #include <signal.h>  // NOLINT
 
 
+namespace dart {
+namespace bin {
+
 static void sig_handler(int sig, siginfo_t* siginfo, void*) {
   if (sig == SIGQUIT) {
     VmStats::DumpStack();
@@ -29,5 +32,7 @@
   }
 }
 
-#endif  // defined(TARGET_OS_MACOS)
+}  // namespace bin
+}  // namespace dart
 
+#endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/vmstats_impl_win.cc b/runtime/bin/vmstats_impl_win.cc
index 7ff384c..3157801 100644
--- a/runtime/bin/vmstats_impl_win.cc
+++ b/runtime/bin/vmstats_impl_win.cc
@@ -10,6 +10,9 @@
 #include <signal.h>  // NOLINT
 
 
+namespace dart {
+namespace bin {
+
 static void sig_handler(int sig) {
   if (sig == SIGBREAK) {
     VmStats::DumpStack();
@@ -23,4 +26,7 @@
   }
 }
 
+}  // namespace bin
+}  // namespace dart
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/dart-runtime.gyp b/runtime/dart-runtime.gyp
index db2f10f..7519576 100644
--- a/runtime/dart-runtime.gyp
+++ b/runtime/dart-runtime.gyp
@@ -11,8 +11,9 @@
     'third_party/jscre/jscre.gypi',
   ],
   'variables': {
+    'gen_source_dir': '<(LIB_DIR)',
     'version_in_cc_file': 'vm/version_in.cc',
-    'version_cc_file': '<(SHARED_INTERMEDIATE_DIR)/version.cc',
+    'version_cc_file': '<(gen_source_dir)/version.cc',
 
     # Disable the OpenGLUI embedder by default on desktop OSes.  Note,
     # to build this on the desktop, you need GLUT installed.
@@ -61,6 +62,7 @@
     {
       'target_name': 'generate_version_cc_file',
       'type': 'none',
+      'toolsets':['target','host'],
       'dependencies': [
         'libdart_dependency_helper',
       ],
@@ -94,8 +96,9 @@
     {
       'target_name': 'libdart_dependency_helper',
       'type': 'executable',
+      'toolsets':['target','host'],
       # The dependencies here are the union of the dependencies of libdart and
-      # libdart_withcore. 
+      # libdart_withcore.
       'dependencies': [
         'libdart_lib_withcore',
         'libdart_lib',
diff --git a/runtime/embedders/openglui/common/extension.cc b/runtime/embedders/openglui/common/extension.cc
index eb32a3d..3e1885e 100644
--- a/runtime/embedders/openglui/common/extension.cc
+++ b/runtime/embedders/openglui/common/extension.cc
@@ -875,9 +875,10 @@
 
       if (values != NULL) {
         Dart_CObject result;
-        result.type = Dart_CObject::kUint8Array;
-        result.value.as_byte_array.values = values;
-        result.value.as_byte_array.length = length;
+        result.type = Dart_CObject::kTypedData;
+        result.value.as_typed_data.type = Dart_CObject::kUint8Array;
+        result.value.as_typed_data.values = values;
+        result.value.as_typed_data.length = length;
         Dart_PostCObject(reply_port_id, &result);
         free(values);
         // It is OK that result is destroyed when function exits.
diff --git a/runtime/embedders/openglui/common/vm_glue.cc b/runtime/embedders/openglui/common/vm_glue.cc
index 77564e54..4836c8a 100644
--- a/runtime/embedders/openglui/common/vm_glue.cc
+++ b/runtime/embedders/openglui/common/vm_glue.cc
@@ -89,7 +89,7 @@
 }
 
 // Returns true on success, false on failure.
-bool VMGlue::CreateIsolateAndSetupHelper(const char* script_uri,
+Dart_Isolate VMGlue::CreateIsolateAndSetupHelper(const char* script_uri,
                                          const char* main,
                                          void* data,
                                          char** error) {
@@ -98,7 +98,7 @@
       Dart_CreateIsolate(script_uri, main, NULL, data, error);
   if (isolate == NULL) {
     LOGE("Couldn't create isolate: %s", *error);
-    return false;
+    return NULL;
   }
 
   LOGI("Entering scope");
@@ -110,10 +110,10 @@
   CHECK_RESULT(result);
 
   Dart_ExitScope();
-  return true;
+  return isolate;
 }
 
-bool VMGlue::CreateIsolateAndSetup(const char* script_uri,
+Dart_Isolate VMGlue::CreateIsolateAndSetup(const char* script_uri,
   const char* main,
   void* data, char** error) {
   return CreateIsolateAndSetupHelper(script_uri,
diff --git a/runtime/embedders/openglui/common/vm_glue.h b/runtime/embedders/openglui/common/vm_glue.h
index f340b56..8f84377 100644
--- a/runtime/embedders/openglui/common/vm_glue.h
+++ b/runtime/embedders/openglui/common/vm_glue.h
@@ -50,11 +50,11 @@
 
   static Dart_Handle CheckError(Dart_Handle);
 
-  static bool CreateIsolateAndSetupHelper(const char* script_uri,
+  static Dart_Isolate CreateIsolateAndSetupHelper(const char* script_uri,
                                           const char* main,
                                           void* data,
                                           char** error);
-  static bool CreateIsolateAndSetup(const char* script_uri,
+  static Dart_Isolate CreateIsolateAndSetup(const char* script_uri,
                                     const char* main,
                                     void* data, char** error);
   static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
diff --git a/runtime/embedders/openglui/openglui_embedder.gypi b/runtime/embedders/openglui/openglui_embedder.gypi
index dc66642..c3671ee 100644
--- a/runtime/embedders/openglui/openglui_embedder.gypi
+++ b/runtime/embedders/openglui/openglui_embedder.gypi
@@ -176,7 +176,7 @@
         'targets': [
           {
             'target_name': 'emulator_embedder',
-            'type': 'shared_library',
+            'type': 'static_library',
             'dependencies': [
               'skia-desktop',
               'libdart_lib_withcore',
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 5da6c6a..fcb839d 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -943,8 +943,8 @@
  *
  * The string encoding in the 'value.as_string' is UTF-8.
  *
- * All the different types from dart:typeddata are exposed as type
- * kTypedData. The specific type from dart:typeddata is in the type
+ * All the different types from dart:typed_data are exposed as type
+ * kTypedData. The specific type from dart:typed_data is in the type
  * field of the as_typed_data structure. The length in the
  * as_typed_data structure is always in bytes.
  */
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 1ebc5b7..bb68f0b 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -43,7 +43,7 @@
         "Cannot remove element of a non-extendable array");
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
     throw new UnsupportedError(
         "Cannot remove element of a non-extendable array");
   }
@@ -67,7 +67,7 @@
     if (start < 0 || start > this.length) {
       throw new RangeError.range(start, 0, this.length);
     }
-    if (end < 0 || end > this.length) {
+    if (end < start || end > this.length) {
       throw new RangeError.range(end, start, this.length);
     }
     int length = end - start;
@@ -310,7 +310,7 @@
         "Cannot modify an immutable array");
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
     throw new UnsupportedError(
         "Cannot modify an immutable array");
   }
diff --git a/runtime/lib/core_patch.dart b/runtime/lib/core_patch.dart
index 0a27429..3f7f5d2 100644
--- a/runtime/lib/core_patch.dart
+++ b/runtime/lib/core_patch.dart
@@ -3,6 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "dart:math";
-import "dart:typeddata";
+import "dart:typed_data";
 
 import "dart:_collection-dev" as _symbol_dev;
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart
index 37ab065..7d763e3 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -125,10 +125,14 @@
     }
     var args_mismatch = _existingArgumentNames != null;
     StringBuffer msg_buf = new StringBuffer(_developerMessage(args_mismatch));
+    String receiver_str = Error.safeToString(_receiver);
+    if ("Type: class '::'" == receiver_str) {
+      receiver_str = "top-level";
+    }
     if (!args_mismatch) {
       msg_buf.write(
           "NoSuchMethodError : method not found: '$_memberName'\n"
-          "Receiver: ${Error.safeToString(_receiver)}\n"
+          "Receiver: $receiver_str\n"
           "Arguments: [$actual_buf]");
     } else {
       String actualParameters = actual_buf.toString();
@@ -143,7 +147,7 @@
       msg_buf.write(
           "NoSuchMethodError: incorrect number of arguments passed to "
           "method named '$_memberName'\n"
-          "Receiver: ${Error.safeToString(_receiver)}\n"
+          "Receiver: $receiver_str\n"
           "Tried calling: $_memberName($actualParameters)\n"
           "Found: $_memberName($formalParameters)");
     }
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index 1ebe8c2..f65380b 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -43,13 +43,14 @@
     return result;
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
     for (int i = 0; i < this.length; i++) {
       if (this[i] == element) {
         removeAt(i);
-        return;
+        return true;
       }
     }
+    return false;
   }
 
   void insertAll(int index, Iterable<T> iterable) {
@@ -237,10 +238,10 @@
   }
 
   void forEach(f(T element)) {
-    // TODO(srdjan): Use IterableMixinWorkaround.forEach(this, f);
-    // Accessing the list directly improves DeltaBlue performance by 25%.
+    int initialLength = length;
     for (int i = 0; i < length; i++) {
       f(this[i]);
+      if (length != initialLength) throw new ConcurrentModificationError(this);
     }
   }
 
diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc
index f6133dd..d368415 100644
--- a/runtime/lib/integers.cc
+++ b/runtime/lib/integers.cc
@@ -189,15 +189,11 @@
     if (len > 0) {
       const char* cstr = value.ToCString();
       ASSERT(cstr != NULL);
-      // Dart differences from strtol:
-      // a) '+5' is not a valid integer (leading plus).
-      if (cstr[0] != '+') {
-        char* p_end = NULL;
-        const int64_t int_value = strtol(cstr, &p_end, 10);
-        if (p_end == (cstr + len)) {
-          if ((Smi::kMinValue <= int_value) && (int_value <= Smi::kMaxValue)) {
-            return Smi::New(int_value);
-          }
+      char* p_end = NULL;
+      const int64_t int_value = strtoll(cstr, &p_end, 10);
+      if (p_end == (cstr + len)) {
+        if ((int_value != LLONG_MIN) && (int_value != LLONG_MAX)) {
+          return Integer::New(int_value);
         }
       }
     }
diff --git a/runtime/lib/integers_patch.dart b/runtime/lib/integers_patch.dart
index de4abdb..05d47cf 100644
--- a/runtime/lib/integers_patch.dart
+++ b/runtime/lib/integers_patch.dart
@@ -6,7 +6,63 @@
 // VM implementation of int.
 
 patch class int {
-  static int _parse(String str) native "Integer_parse";
+
+  static bool _isWhitespace(int codePoint) {
+    return
+      (codePoint == 32) || // Space.
+      ((9 <= codePoint) && (codePoint <= 13)); // CR, LF, TAB, etc.
+  }
+
+  static int _tryParseSmi(String str) {
+    if (str.isEmpty) return null;
+    var ix = 0;
+    var endIx = str.length - 1;
+    // Find first and last non-whitespace.
+    while (ix <= endIx) {
+      if (!_isWhitespace(str.codeUnitAt(ix))) break;
+      ix++;
+    }
+    if (endIx < ix) {
+      return null;  // Empty.
+    }
+    while (endIx > ix) {
+      if (!_isWhitespace(str.codeUnitAt(endIx))) break;
+      endIx--;
+    }
+
+    var isNegative = false;
+    var c = str.codeUnitAt(ix);
+    // Check for leading '+' or '-'.
+    if ((c == 0x2b) || (c == 0x2d)) {
+      ix++;
+      isNegative = (c == 0x2d);
+      if (ix > endIx) {
+        return null;  // Empty.
+      }
+    }
+    if ((endIx - ix) >= 9) {
+      return null;  // May not fit into a Smi.
+    }
+    var result = 0;
+    for (int i = ix; i <= endIx; i++) {
+      var c = str.codeUnitAt(i) - 0x30;
+      if ((c > 9) || (c < 0)) {
+        return null;
+      }
+      result = result * 10 + c;
+    }
+    return isNegative ? -result : result;
+  }
+
+  static int _parse(String str) {
+    int res = _tryParseSmi(str);
+    if (res == null) {
+      res = _native_parse(str);
+    }
+    return res;
+  }
+
+  static int _native_parse(String str) native "Integer_parse";
 
   static int _throwFormatException(String source) {
     throw new FormatException(source);
diff --git a/runtime/lib/math_patch.dart b/runtime/lib/math_patch.dart
index d17d82e..5682bec 100644
--- a/runtime/lib/math_patch.dart
+++ b/runtime/lib/math_patch.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.
 
-import "dart:typeddata";
+import "dart:typed_data";
 
 // A VM patch of the dart:math library.
 patch num pow(num x, num exponent) {
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 31c1f4e..62c22e0 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -4,7 +4,6 @@
 
 #include "include/dart_api.h"
 #include "include/dart_debugger_api.h"
-#include "platform/json.h"
 #include "vm/dart_api_impl.h"
 #include "vm/bootstrap_natives.h"
 #include "vm/dart_entry.h"
@@ -272,7 +271,7 @@
   if (Dart_IsLibrary(target)) {
     Dart_Handle cls_name = NewString("_LazyLibraryMirror");
     Dart_Handle cls = Dart_GetClass(MirrorLib(), cls_name);
-    Dart_Handle args[] = { Dart_LibraryName(target) };
+    Dart_Handle args[] = { Dart_LibraryUrl(target) };
     return Dart_New(cls, Dart_Null(), ARRAY_SIZE(args), args);
   }
 
@@ -296,13 +295,13 @@
       Dart_Handle cls_name = NewString("_LazyTypeMirror");
       Dart_Handle cls = Dart_GetClass(MirrorLib(), cls_name);
       Dart_Handle lib = Dart_ClassGetLibrary(target);
-      Dart_Handle lib_name;
+      Dart_Handle lib_url;
       if (Dart_IsNull(lib)) {
-        lib_name = Dart_Null();
+        lib_url = Dart_Null();
       } else {
-        lib_name = Dart_LibraryName(lib);
+        lib_url = Dart_LibraryUrl(lib);
       }
-      Dart_Handle args[] = { lib_name, Dart_ClassName(target) };
+      Dart_Handle args[] = { lib_url, Dart_ClassName(target) };
       return Dart_New(cls, Dart_Null(), ARRAY_SIZE(args), args);
     }
   }
@@ -871,13 +870,11 @@
     if (Dart_IsError(lib)) {
       return lib;
     }
-    Dart_Handle lib_key = Dart_LibraryName(lib);
     Dart_Handle lib_mirror = CreateLibraryMirror(lib);
     if (Dart_IsError(lib_mirror)) {
       return lib_mirror;
     }
-    // TODO(turnidge): Check for duplicate library names.
-    result = MapAdd(map, lib_key, lib_mirror);
+    result = MapAdd(map, lib_url, lib_mirror);
   }
   return map;
 }
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 4546ab0..614e5589 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -62,14 +62,21 @@
   return buf.toString();
 }
 
-class _LocalMirrorSystemImpl implements MirrorSystem {
-  // TODO(ahe): [libraries] should be Map<Uri, LibraryMirror>.
+Map<Uri, LibraryMirror> _createLibrariesMap(Map<String, LibraryMirror> map) {
+    var result = new Map<Uri, LibraryMirror>();
+    map.forEach((String url, LibraryMirror mirror) {
+      result[Uri.parse(url)] = mirror;
+    });
+    return result;
+}
+
+class _LocalMirrorSystemImpl extends MirrorSystem {
   // Change parameter back to "this.libraries" when native code is changed.
   _LocalMirrorSystemImpl(Map<String, LibraryMirror> libraries, this.isolate)
-      : _functionTypes = new Map<String, FunctionTypeMirror>(),
-        this.libraries = _convertStringToSymbolMap(libraries);
+      : this.libraries = _createLibrariesMap(libraries),
+        _functionTypes = new Map<String, FunctionTypeMirror>();
 
-  final Map<Symbol, LibraryMirror> libraries;
+  final Map<Uri, LibraryMirror> libraries;
   final IsolateMirror isolate;
 
   TypeMirror _dynamicType = null;
@@ -401,12 +408,11 @@
 }
 
 class _LazyTypeMirror {
-  _LazyTypeMirror(String libraryName, String typeName)
-      : this.libraryName = _s(libraryName),
-        this.typeName = _s(typeName);
+  _LazyTypeMirror(String this.libraryUrl, String typeName)
+      : this.typeName = _s(typeName);
 
   TypeMirror resolve(MirrorSystem mirrors) {
-    if (libraryName == null) {
+    if (libraryUrl == null) {
       if (typeName == const Symbol('dynamic')) {
         return mirrors.dynamicType;
       } else if (typeName == const Symbol('void')) {
@@ -416,7 +422,7 @@
             "Mirror for type '$typeName' is not implemented");
       }
     }
-    var resolved = mirrors.libraries[libraryName].members[typeName];
+    var resolved = mirrors.libraries[Uri.parse(libraryUrl)].members[typeName];
     if (resolved == null) {
       throw new UnimplementedError(
           "Mirror for type '$typeName' is not implemented");
@@ -424,7 +430,7 @@
     return resolved;
   }
 
-  final Symbol libraryName;
+  final String libraryUrl;
   final Symbol typeName;
 }
 
@@ -758,24 +764,24 @@
 
 
 class _LazyLibraryMirror {
-  _LazyLibraryMirror(String libraryName)
-      : this.libraryName = _s(libraryName);
+  _LazyLibraryMirror(String this.libraryUrl);
 
   LibraryMirror resolve(MirrorSystem mirrors) {
-    return mirrors.libraries[libraryName];
+    return mirrors.libraries[Uri.parse(libraryUrl)];
   }
 
-  final Symbol libraryName;
+  final String libraryUrl;
 }
 
 class _LocalLibraryMirrorImpl extends _LocalObjectMirrorImpl
     implements LibraryMirror {
   _LocalLibraryMirrorImpl(ref,
                           String simpleName,
-                          this.url,
+                          String url,
                           Map<String, Mirror> members)
       : this.simpleName = _s(simpleName),
         this.members = _convertStringToSymbolMap(members),
+        this.uri = Uri.parse(url),
         super(ref);
 
   final Symbol simpleName;
@@ -797,7 +803,7 @@
         'LibraryMirror.location is not implemented');
   }
 
-  final String url;
+  final Uri uri;
   final Map<Symbol, Mirror> members;
 
   Map<Symbol, ClassMirror> _classes = null;
diff --git a/runtime/lib/simd128.cc b/runtime/lib/simd128.cc
index 25e8db7..81894fe 100644
--- a/runtime/lib/simd128.cc
+++ b/runtime/lib/simd128.cc
@@ -26,6 +26,15 @@
 }
 
 
+DEFINE_NATIVE_ENTRY(Float32x4_splat, 2) {
+  ASSERT(AbstractTypeArguments::CheckedHandle(
+      arguments->NativeArgAt(0)).IsNull());
+  GET_NON_NULL_NATIVE_ARGUMENT(Double, v, arguments->NativeArgAt(1));
+  float _v = v.value();
+  return Float32x4::New(_v, _v, _v, _v);
+}
+
+
 DEFINE_NATIVE_ENTRY(Float32x4_zero, 1) {
   ASSERT(AbstractTypeArguments::CheckedHandle(
       arguments->NativeArgAt(0)).IsNull());
diff --git a/runtime/lib/typeddata.cc b/runtime/lib/typed_data.cc
similarity index 92%
rename from runtime/lib/typeddata.cc
rename to runtime/lib/typed_data.cc
index 29e7af3..4a47d71 100644
--- a/runtime/lib/typeddata.cc
+++ b/runtime/lib/typed_data.cc
@@ -78,25 +78,32 @@
   return Integer::null();
 }
 
-
-#define COPY_DATA(type, dst, src)                                              \
-  const type& dst_array = type::Cast(dst);                                     \
-  const type& src_array = type::Cast(src);                                     \
-  intptr_t element_size_in_bytes = dst_array.ElementSizeInBytes();             \
-  intptr_t length_in_bytes = length.Value() * element_size_in_bytes;           \
-  intptr_t src_offset_in_bytes = src_start.Value() * element_size_in_bytes;    \
-  intptr_t dst_offset_in_bytes = dst_start.Value() * element_size_in_bytes;    \
-  SetRangeCheck(src_offset_in_bytes,                                           \
-                length_in_bytes,                                               \
-                src_array.LengthInBytes(),                                     \
-                element_size_in_bytes);                                        \
-  SetRangeCheck(dst_offset_in_bytes,                                           \
-                length_in_bytes,                                               \
-                dst_array.LengthInBytes(),                                     \
-                element_size_in_bytes);                                        \
-  type::Copy(dst_array, dst_offset_in_bytes,                                   \
-             src_array, src_offset_in_bytes,                                   \
-             length_in_bytes);
+template <typename DstType, typename SrcType>
+static RawBool* CopyData(const Instance& dst, const Instance& src,
+                         const Smi& dst_start, const Smi& src_start,
+                         const Smi& length) {
+  const DstType& dst_array = DstType::Cast(dst);
+  const SrcType& src_array = SrcType::Cast(src);
+  intptr_t element_size_in_bytes = dst_array.ElementSizeInBytes();
+  intptr_t dst_offset_in_bytes = dst_start.Value() * element_size_in_bytes;
+  intptr_t src_offset_in_bytes = src_start.Value() * element_size_in_bytes;
+  intptr_t length_in_bytes = length.Value() * element_size_in_bytes;
+  if (dst_array.ElementType() != src_array.ElementType()) {
+    return Bool::False().raw();
+  }
+  SetRangeCheck(src_offset_in_bytes,
+                length_in_bytes,
+                src_array.LengthInBytes(),
+                element_size_in_bytes);
+  SetRangeCheck(dst_offset_in_bytes,
+                length_in_bytes,
+                dst_array.LengthInBytes(),
+                element_size_in_bytes);
+  TypedData::Copy<DstType, SrcType>(dst_array, dst_offset_in_bytes,
+                                    src_array, src_offset_in_bytes,
+                                    length_in_bytes);
+  return Bool::True().raw();
+}
 
 DEFINE_NATIVE_ENTRY(TypedData_setRange, 5) {
   GET_NON_NULL_NATIVE_ARGUMENT(Instance, dst, arguments->NativeArgAt(0));
@@ -112,17 +119,22 @@
     args.SetAt(0, error);
     Exceptions::ThrowByType(Exceptions::kArgument, args);
   }
-  if ((dst.IsTypedData() || dst.IsExternalTypedData()) &&
-      (dst.clazz() == src.clazz())) {
-    if (dst.IsTypedData()) {
-      ASSERT(src.IsTypedData());
-      COPY_DATA(TypedData, dst, src);
-    } else {
-      ASSERT(src.IsExternalTypedData());
-      ASSERT(dst.IsExternalTypedData());
-      COPY_DATA(ExternalTypedData, dst, src);
+  if (dst.IsTypedData()) {
+    if (src.IsTypedData()) {
+      return CopyData<TypedData, TypedData>(
+          dst, src, dst_start, src_start, length);
+    } else if (src.IsExternalTypedData()) {
+      return CopyData<TypedData, ExternalTypedData>(
+          dst, src, dst_start, src_start, length);
     }
-    return Bool::True().raw();
+  } else if (dst.IsExternalTypedData()) {
+    if (src.IsTypedData()) {
+      return CopyData<ExternalTypedData, TypedData>(
+          dst, src, dst_start, src_start, length);
+    } else if (src.IsExternalTypedData()) {
+      return CopyData<ExternalTypedData, ExternalTypedData>(
+          dst, src, dst_start, src_start, length);
+    }
   }
   return Bool::False().raw();
 }
diff --git a/runtime/lib/typeddata.dart b/runtime/lib/typed_data.dart
similarity index 95%
rename from runtime/lib/typeddata.dart
rename to runtime/lib/typed_data.dart
index ddf79f4..9fb8f15 100644
--- a/runtime/lib/typeddata.dart
+++ b/runtime/lib/typed_data.dart
@@ -240,6 +240,9 @@
   /* patch */ factory Float32x4(double x, double y, double z, double w) {
     return new _Float32x4(x, y, z, w);
   }
+  /* patch */ factory Float32x4.splat(double v) {
+    return new _Float32x4.splat(v);
+  }
   /* patch */ factory Float32x4.zero() {
     return new _Float32x4.zero();
   }
@@ -373,6 +376,16 @@
         "Cannot add to a non-extendable array");
   }
 
+  void insert(int index, value) {
+    throw new UnsupportedError(
+        "Cannot insert into a non-extendable array");
+  }
+
+  void insertAll(int index, Iterable values) {
+    throw new UnsupportedError(
+        "Cannot insert into a non-extendable array");
+  }
+
   void sort([int compare(var a, var b)]) {
     return IterableMixinWorkaround.sortList(this, compare);
   }
@@ -395,7 +408,12 @@
         "Cannot remove from a non-extendable array");
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
+    throw new UnsupportedError(
+        "Cannot remove from a non-extendable array");
+  }
+
+  bool removeAt(int index) {
     throw new UnsupportedError(
         "Cannot remove from a non-extendable array");
   }
@@ -446,8 +464,8 @@
         "Cannot remove from a non-extendable array");
   }
 
-  List toList() {
-    return new List.from(this);
+  List toList({bool growable: true}) {
+    return new List.from(this, growable: growable);
   }
 
   Set toSet() {
@@ -2015,6 +2033,7 @@
 class _Float32x4 implements Float32x4 {
   factory _Float32x4(double x, double y, double z, double w)
       native "Float32x4_fromDoubles";
+  factory _Float32x4.splat(double v) native "Float32x4_splat";
   factory _Float32x4.zero() native "Float32x4_zero";
   Float32x4 operator +(Float32x4 other) {
     return _add(other);
@@ -2191,7 +2210,7 @@
 
 class _TypedListView extends _TypedListBase implements TypedData {
   _TypedListView(ByteBuffer _buffer, int _offset, int _length)
-    : _typeddata = _buffer,  // This assignment is type safe.
+    : _typedData = _buffer,  // This assignment is type safe.
       offsetInBytes = _offset,
       length = _length {
   }
@@ -2204,10 +2223,10 @@
   }
 
   ByteBuffer get buffer {
-    return _typeddata.buffer;
+    return _typedData.buffer;
   }
 
-  final TypedData _typeddata;
+  final TypedData _typedData;
   final int offsetInBytes;
   final int length;
 }
@@ -2232,7 +2251,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getInt8(offsetInBytes +
+    return _typedData._getInt8(offsetInBytes +
                                (index * Int8List.BYTES_PER_ELEMENT));
   }
 
@@ -2240,7 +2259,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT),
+    _typedData._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT),
                         _toInt8(value));
   }
 
@@ -2283,7 +2302,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getUint8(offsetInBytes +
+    return _typedData._getUint8(offsetInBytes +
                                 (index * Uint8List.BYTES_PER_ELEMENT));
   }
 
@@ -2291,7 +2310,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT),
+    _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT),
                          _toUint8(value));
   }
 
@@ -2335,7 +2354,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getUint8(offsetInBytes +
+    return _typedData._getUint8(offsetInBytes +
                                 (index * Uint8List.BYTES_PER_ELEMENT));
   }
 
@@ -2343,7 +2362,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT),
+    _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT),
                          _toClampedUint8(value));
   }
 
@@ -2386,7 +2405,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getInt16(offsetInBytes +
+    return _typedData._getInt16(offsetInBytes +
                                 (index * Int16List.BYTES_PER_ELEMENT));
   }
 
@@ -2394,7 +2413,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT),
+    _typedData._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT),
                          _toInt16(value));
   }
 
@@ -2437,7 +2456,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getUint16(offsetInBytes +
+    return _typedData._getUint16(offsetInBytes +
                                  (index * Uint16List.BYTES_PER_ELEMENT));
   }
 
@@ -2445,7 +2464,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT),
+    _typedData._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT),
                           _toUint16(value));
   }
 
@@ -2488,7 +2507,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getInt32(offsetInBytes +
+    return _typedData._getInt32(offsetInBytes +
                                 (index * Int32List.BYTES_PER_ELEMENT));
   }
 
@@ -2496,7 +2515,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT),
+    _typedData._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT),
                          _toInt32(value));
   }
 
@@ -2539,7 +2558,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getUint32(offsetInBytes +
+    return _typedData._getUint32(offsetInBytes +
                                  (index * Uint32List.BYTES_PER_ELEMENT));
   }
 
@@ -2547,7 +2566,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT),
+    _typedData._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT),
                           _toUint32(value));
   }
 
@@ -2590,7 +2609,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getInt64(offsetInBytes +
+    return _typedData._getInt64(offsetInBytes +
                                 (index * Int64List.BYTES_PER_ELEMENT));
   }
 
@@ -2598,7 +2617,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT),
+    _typedData._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT),
                          _toInt64(value));
   }
 
@@ -2641,7 +2660,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getUint64(offsetInBytes +
+    return _typedData._getUint64(offsetInBytes +
                                  (index * Uint64List.BYTES_PER_ELEMENT));
   }
 
@@ -2649,7 +2668,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT),
+    _typedData._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT),
                           _toUint64(value));
   }
 
@@ -2692,7 +2711,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getFloat32(offsetInBytes +
+    return _typedData._getFloat32(offsetInBytes +
                                   (index * Float32List.BYTES_PER_ELEMENT));
   }
 
@@ -2700,7 +2719,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setFloat32(offsetInBytes +
+    _typedData._setFloat32(offsetInBytes +
                            (index * Float32List.BYTES_PER_ELEMENT), value);
   }
 
@@ -2743,7 +2762,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getFloat64(offsetInBytes +
+    return _typedData._getFloat64(offsetInBytes +
                                   (index * Float64List.BYTES_PER_ELEMENT));
   }
 
@@ -2751,7 +2770,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setFloat64(offsetInBytes +
+    _typedData._setFloat64(offsetInBytes +
                           (index * Float64List.BYTES_PER_ELEMENT), value);
   }
 
@@ -2794,7 +2813,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    return _typeddata._getFloat32x4(offsetInBytes +
+    return _typedData._getFloat32x4(offsetInBytes +
                                   (index * Float32x4List.BYTES_PER_ELEMENT));
   }
 
@@ -2802,7 +2821,7 @@
     if (index < 0 || index >= length) {
       _throwRangeError(index, length);
     }
-    _typeddata._setFloat32x4(offsetInBytes +
+    _typedData._setFloat32x4(offsetInBytes +
                              (index * Float32x4List.BYTES_PER_ELEMENT), value);
   }
 
@@ -2828,7 +2847,7 @@
 
 class _ByteDataView implements ByteData {
   _ByteDataView(ByteBuffer _buffer, int _offsetInBytes, int _lengthInBytes)
-    : _typeddata = _buffer,  // _buffer is guaranteed to be a TypedData here.
+    : _typedData = _buffer,  // _buffer is guaranteed to be a TypedData here.
       _offset = _offsetInBytes,
       length = _lengthInBytes {
     _rangeCheck(_buffer.lengthInBytes, _offset, length);
@@ -2838,7 +2857,7 @@
   // Method(s) implementing TypedData interface.
 
   ByteBuffer get buffer {
-    return _typeddata.buffer;
+    return _typedData.buffer;
   }
 
   int get lengthInBytes {
@@ -2855,33 +2874,33 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getInt8(_offset + byteOffset);
+    return _typedData._getInt8(_offset + byteOffset);
   }
   void setInt8(int byteOffset, int value) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setInt8(_offset + byteOffset, _toInt8(value));
+    _typedData._setInt8(_offset + byteOffset, _toInt8(value));
   }
 
   int getUint8(int byteOffset) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    return _typeddata._getUint8(_offset + byteOffset);
+    return _typedData._getUint8(_offset + byteOffset);
   }
   void setUint8(int byteOffset, int value) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint8(_offset + byteOffset, _toUint8(value));
+    _typedData._setUint8(_offset + byteOffset, _toUint8(value));
   }
 
   int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    var result = _typeddata._getInt16(_offset + byteOffset);
+    var result = _typedData._getInt16(_offset + byteOffset);
     if (identical(endian, Endianness.HOST_ENDIAN)) {
       return result;
     }
@@ -2897,14 +2916,14 @@
     if (!identical(endian, Endianness.HOST_ENDIAN)) {
       set_value = _toEndianInt16(set_value, endian._littleEndian);
     }
-    _typeddata._setInt16(_offset + byteOffset, set_value);
+    _typedData._setInt16(_offset + byteOffset, set_value);
   }
 
   int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    var result = _typeddata._getUint16(_offset + byteOffset);
+    var result = _typedData._getUint16(_offset + byteOffset);
     if (identical(endian, Endianness.HOST_ENDIAN)) {
       return result;
     }
@@ -2920,14 +2939,14 @@
     if (!identical(endian, Endianness.HOST_ENDIAN)) {
       set_value = _toEndianUint16(set_value, endian._littleEndian);
     }
-    _typeddata._setUint16(_offset + byteOffset, set_value);
+    _typedData._setUint16(_offset + byteOffset, set_value);
   }
 
   int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    var result = _typeddata._getInt32(_offset + byteOffset);
+    var result = _typedData._getInt32(_offset + byteOffset);
     if (identical(endian, Endianness.HOST_ENDIAN)) {
       return result;
     }
@@ -2943,14 +2962,14 @@
     if (!identical(endian, Endianness.HOST_ENDIAN)) {
       set_value = _toEndianInt32(set_value, endian._littleEndian);
     }
-    _typeddata._setInt32(_offset + byteOffset, set_value);
+    _typedData._setInt32(_offset + byteOffset, set_value);
   }
 
   int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    var result = _typeddata._getUint32(_offset + byteOffset);
+    var result = _typedData._getUint32(_offset + byteOffset);
     if (identical(endian, Endianness.HOST_ENDIAN)) {
       return result;
     }
@@ -2966,14 +2985,14 @@
     if (!identical(endian, Endianness.HOST_ENDIAN)) {
       set_value = _toEndianUint32(set_value, endian._littleEndian);
     }
-    _typeddata._setUint32(_offset + byteOffset, set_value);
+    _typedData._setUint32(_offset + byteOffset, set_value);
   }
 
   int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    var result = _typeddata._getInt64(_offset + byteOffset);
+    var result = _typedData._getInt64(_offset + byteOffset);
     if (identical(endian, Endianness.HOST_ENDIAN)) {
       return result;
     }
@@ -2989,14 +3008,14 @@
     if (!identical(endian, Endianness.HOST_ENDIAN)) {
       set_value = _toEndianInt64(set_value, endian._littleEndian);
     }
-    _typeddata._setInt64(_offset + byteOffset, set_value);
+    _typedData._setInt64(_offset + byteOffset, set_value);
   }
 
   int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    var result = _typeddata._getUint64(_offset + byteOffset);
+    var result = _typedData._getUint64(_offset + byteOffset);
     if (identical(endian, Endianness.HOST_ENDIAN)) {
       return result;
     }
@@ -3012,7 +3031,7 @@
     if (!identical(endian, Endianness.HOST_ENDIAN)) {
       set_value = _toEndianUint64(set_value, endian._littleEndian);
     }
-    _typeddata._setUint64(_offset + byteOffset, set_value);
+    _typedData._setUint64(_offset + byteOffset, set_value);
   }
 
   double getFloat32(int byteOffset,
@@ -3020,7 +3039,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    var result = _typeddata._getFloat32(_offset + byteOffset);
+    var result = _typedData._getFloat32(_offset + byteOffset);
     if (identical(endian, Endianness.HOST_ENDIAN)) {
       return result;
     }
@@ -3036,7 +3055,7 @@
     if (!identical(endian, Endianness.HOST_ENDIAN)) {
       set_value = _toEndianFloat32(set_value, endian._littleEndian);
     }
-    _typeddata._setFloat32(_offset + byteOffset, set_value);
+    _typedData._setFloat32(_offset + byteOffset, set_value);
   }
 
   double getFloat64(int byteOffset,
@@ -3044,7 +3063,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    var result = _typeddata._getFloat64(_offset + byteOffset);
+    var result = _typedData._getFloat64(_offset + byteOffset);
     if (identical(endian, Endianness.HOST_ENDIAN)) {
       return result;
     }
@@ -3060,7 +3079,7 @@
     if (!identical(endian, Endianness.HOST_ENDIAN)) {
       set_value = _toEndianFloat64(set_value, endian._littleEndian);
     }
-    _typeddata._setFloat64(_offset + byteOffset, set_value);
+    _typedData._setFloat64(_offset + byteOffset, set_value);
   }
 
   Float32x4 getFloat32x4(int byteOffset,
@@ -3069,7 +3088,7 @@
       _throwRangeError(byteOffset, length);
     }
     // TODO(johnmccutchan) : Need to resolve this for endianity.
-    return _typeddata._getFloat32x4(_offset + byteOffset);
+    return _typedData._getFloat32x4(_offset + byteOffset);
   }
   void setFloat32x4(int byteOffset,
                     Float32x4 value,
@@ -3078,7 +3097,7 @@
       _throwRangeError(byteOffset, length);
     }
     // TODO(johnmccutchan) : Need to resolve this for endianity.
-    _typeddata._setFloat32x4(_offset + byteOffset, value);
+    _typedData._setFloat32x4(_offset + byteOffset, value);
 
   }
 
@@ -3103,7 +3122,7 @@
       native "ByteData_ToEndianFloat64";
 
 
-  final TypedData _typeddata;
+  final TypedData _typedData;
   final int _offset;
   final int length;
 }
diff --git a/runtime/lib/typeddata_sources.gypi b/runtime/lib/typed_data_sources.gypi
similarity index 74%
rename from runtime/lib/typeddata_sources.gypi
rename to runtime/lib/typed_data_sources.gypi
index fc5ba11..28d6a53 100644
--- a/runtime/lib/typeddata_sources.gypi
+++ b/runtime/lib/typed_data_sources.gypi
@@ -2,12 +2,12 @@
 # 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.
 
-# Sources visible via dart:typeddata library.
+# Sources visible via dart:typed_data library.
 
 {
   'sources': [
-    'typeddata.cc',
-    'typeddata.dart',
+    'typed_data.cc',
+    'typed_data.dart',
     'simd128.cc',
   ],
 }
diff --git a/runtime/platform/c99_support_win.h b/runtime/platform/c99_support_win.h
index 2859f0c..71ec127 100644
--- a/runtime/platform/c99_support_win.h
+++ b/runtime/platform/c99_support_win.h
@@ -65,4 +65,10 @@
   }
 }
 
+// Windows does not have strtoll defined.
+#if defined(_MSC_VER)
+#define strtoll _strtoi64
+#endif
+
+
 #endif  // PLATFORM_C99_SUPPORT_WIN_H_
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 2d566bb..f99e065 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -123,13 +123,34 @@
 #elif defined(_M_IX86) || defined(__i386__)
 #define HOST_ARCH_IA32 1
 #define ARCH_IS_32_BIT 1
+#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
+#define kFpuRegisterSize 8
+typedef double fpu_register_t;
+#else
 #define kFpuRegisterSize 16
 typedef simd128_value_t fpu_register_t;
+#endif
 #elif defined(__ARMEL__)
 #define HOST_ARCH_ARM 1
 #define ARCH_IS_32_BIT 1
 #define kFpuRegisterSize 8
 typedef double fpu_register_t;
+typedef struct {
+  union {
+    uint32_t u;
+    float    f;
+  } data_[4];
+} simd_value_t;
+#define simd_value_safe_load(addr)                                             \
+  (*reinterpret_cast<simd_value_t *>(addr))
+#define simd_value_safe_store(addr, value)                                     \
+  do {                                                                         \
+    reinterpret_cast<simd_value_t *>(addr)->data_[0] = value.data_[0];         \
+    reinterpret_cast<simd_value_t *>(addr)->data_[1] = value.data_[1];         \
+    reinterpret_cast<simd_value_t *>(addr)->data_[2] = value.data_[2];         \
+    reinterpret_cast<simd_value_t *>(addr)->data_[3] = value.data_[3];         \
+  } while (0)
+
 #elif defined(__MIPSEL__)
 #define HOST_ARCH_MIPS 1
 #define ARCH_IS_32_BIT 1
diff --git a/runtime/tests/vm/dart/byte_array_optimized_test.dart b/runtime/tests/vm/dart/byte_array_optimized_test.dart
index 80bba34..fafef82 100644
--- a/runtime/tests/vm/dart/byte_array_optimized_test.dart
+++ b/runtime/tests/vm/dart/byte_array_optimized_test.dart
@@ -6,7 +6,7 @@
 library byte_array_test;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 // This test exercises optimized [] and []= operators
 // on byte array views.
diff --git a/runtime/tests/vm/dart/byte_array_test.dart b/runtime/tests/vm/dart/byte_array_test.dart
index f57f551..0f3fe96 100644
--- a/runtime/tests/vm/dart/byte_array_test.dart
+++ b/runtime/tests/vm/dart/byte_array_test.dart
@@ -6,7 +6,7 @@
 library byte_array_test;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 class ByteArrayTest {
   static testInt8ListImpl(Int8List array) {
diff --git a/runtime/tests/vm/dart/isolate_mirror_local_test.dart b/runtime/tests/vm/dart/isolate_mirror_local_test.dart
index 772ce66..e7927c2 100644
--- a/runtime/tests/vm/dart/isolate_mirror_local_test.dart
+++ b/runtime/tests/vm/dart/isolate_mirror_local_test.dart
@@ -13,6 +13,7 @@
 import 'dart:async';
 import 'dart:isolate';
 import 'dart:mirrors';
+import 'dart:uri';
 
 ReceivePort exit_port;
 Set expectedTests;
@@ -115,7 +116,7 @@
                 lib_mirror.qualifiedName);
   Expect.equals(null, lib_mirror.owner);
   Expect.isFalse(lib_mirror.isPrivate);
-  Expect.isTrue(lib_mirror.url.contains('isolate_mirror_local_test.dart'));
+  Expect.isTrue(lib_mirror.uri.path.contains('isolate_mirror_local_test.dart'));
   // TODO(ahe): toString() test disabled for now as Symbols are 100% opaque.
   // Expect.equals("LibraryMirror on 'isolate_mirror_local_test'",
   //               lib_mirror.toString());
@@ -300,10 +301,10 @@
 
 void testLibrariesMap(Map libraries) {
   // Just look for a couple of well-known libs.
-  LibraryMirror core_lib = libraries[const Symbol('dart.core')];
+  LibraryMirror core_lib = libraries[Uri.parse('dart:core')];
   Expect.isTrue(core_lib is LibraryMirror);
 
-  LibraryMirror mirror_lib = libraries[const Symbol('dart.mirrors')];
+  LibraryMirror mirror_lib = libraries[Uri.parse('dart:mirrors')];
   Expect.isTrue(mirror_lib is LibraryMirror);
 
   // Lookup an interface from a library and make sure it is sane.
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 40077cf..6e71bf0 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -72,6 +72,7 @@
 # Tests missing code generation support.
 cc/CorelibCompileAll: Skip
 cc/Dart2JSCompileAll: Skip
+cc/Debug_InterruptIsolate: Skip
 # Tests needing Dart execution.
 dart/*: Skip
 
diff --git a/runtime/third_party/double-conversion/src/double-conversion.gypi b/runtime/third_party/double-conversion/src/double-conversion.gypi
index 8466d5d..aa474b8 100644
--- a/runtime/third_party/double-conversion/src/double-conversion.gypi
+++ b/runtime/third_party/double-conversion/src/double-conversion.gypi
@@ -5,6 +5,7 @@
     {
       'target_name': 'libdouble_conversion',
       'type': 'static_library',
+      'toolsets':['target','host'],
       'dependencies': [
       ],
       'include_dirs': [
diff --git a/runtime/third_party/jscre/jscre.gypi b/runtime/third_party/jscre/jscre.gypi
index 46ecb7e..acb6d8c 100644
--- a/runtime/third_party/jscre/jscre.gypi
+++ b/runtime/third_party/jscre/jscre.gypi
@@ -5,6 +5,7 @@
     {
       'target_name': 'libjscre',
       'type': 'static_library',
+      'toolsets':['target','host'],
       'dependencies': [
       ],
       'include_dirs': [
diff --git a/runtime/tools/create_resources.py b/runtime/tools/create_resources.py
index f657ea1..d2c0cea 100644
--- a/runtime/tools/create_resources.py
+++ b/runtime/tools/create_resources.py
@@ -62,7 +62,10 @@
 
 ''' % date.today().year
   cc_text += '#include "bin/resources.h"\n\n'
+  cc_text += 'namespace dart {\n'
+  cc_text += 'namespace bin {\n'
   cc_text += makeResources(root_dir, input_files)
+  cc_text += '}  // namespace bin\n} // namespace dart\n'
   open(output_file, 'w').write(cc_text)
   return True
 
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index f003889..49d0db2 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -40,19 +40,7 @@
 #if defined(USING_SIMULATOR)
   integer_division_supported_ = true;
 #else
-  Assembler assembler;
-  __ mrc(R0, 15, 0, 0, 2, 0);
-  __ Lsr(R0, R0, 24);
-  __ and_(R0, R0, ShifterOperand(0xf));
-  __ Ret();
-
-  const Code& code =
-      Code::Handle(Code::FinalizeCode("DetectCPUFeatures", &assembler));
-  Instructions& instructions = Instructions::Handle(code.instructions());
-  typedef int32_t (*DetectCPUFeatures)();
-  int32_t features =
-      reinterpret_cast<DetectCPUFeatures>(instructions.EntryPoint())();
-  integer_division_supported_ = features != 0;
+  integer_division_supported_ = false;
 #endif  // defined(USING_SIMULATOR)
 #if defined(DEBUG)
   initialized_ = true;
@@ -477,6 +465,13 @@
 }
 
 
+void Assembler::smull(Register rd_lo, Register rd_hi,
+                      Register rn, Register rm, Condition cond) {
+  // Assembler registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
+  EmitMulOp(cond, B23 | B22, rd_lo, rd_hi, rn, rm);
+}
+
+
 void Assembler::umull(Register rd_lo, Register rd_hi,
                       Register rn, Register rm, Condition cond) {
   // Assembler registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
@@ -1236,27 +1231,29 @@
 
 
 // Uses a code sequence that can easily be decoded.
-void Assembler::LoadWordFromPoolOffset(Register rd, int32_t offset) {
+void Assembler::LoadWordFromPoolOffset(Register rd,
+                                       int32_t offset,
+                                       Condition cond) {
   ASSERT(rd != PP);
   int32_t offset_mask = 0;
   if (Address::CanHoldLoadOffset(kLoadWord, offset, &offset_mask)) {
-    ldr(rd, Address(PP, offset));
+    ldr(rd, Address(PP, offset), cond);
   } else {
     int32_t offset_hi = offset & ~offset_mask;  // signed
     uint32_t offset_lo = offset & offset_mask;  // unsigned
     // Inline a simplified version of AddImmediate(rd, PP, offset_hi).
     ShifterOperand shifter_op;
     if (ShifterOperand::CanHold(offset_hi, &shifter_op)) {
-      add(rd, PP, shifter_op);
+      add(rd, PP, shifter_op, cond);
     } else {
       movw(rd, Utils::Low16Bits(offset_hi));
       const uint16_t value_high = Utils::High16Bits(offset_hi);
       if (value_high != 0) {
-        movt(rd, value_high);
+        movt(rd, value_high, cond);
       }
-      add(rd, PP, ShifterOperand(LR));
+      add(rd, PP, ShifterOperand(LR), cond);
     }
-    ldr(rd, Address(rd, offset_lo));
+    ldr(rd, Address(rd, offset_lo), cond);
   }
 }
 
@@ -1269,24 +1266,24 @@
 }
 
 
-void Assembler::LoadObject(Register rd, const Object& object) {
+void Assembler::LoadObject(Register rd, const Object& object, Condition cond) {
   // Smis and VM heap objects are never relocated; do not use object pool.
   if (object.IsSmi()) {
-    LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()));
+    LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()), cond);
   } else if (object.InVMHeap()) {
     // Make sure that class CallPattern is able to decode this load immediate.
     const int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
-    movw(rd, Utils::Low16Bits(object_raw));
+    movw(rd, Utils::Low16Bits(object_raw), cond);
     const uint16_t value_high = Utils::High16Bits(object_raw);
     if (value_high != 0) {
-      movt(rd, value_high);
+      movt(rd, value_high, cond);
     }
   } else {
     // Make sure that class CallPattern is able to decode this load from the
     // object pool.
     const int32_t offset =
         Array::data_offset() + 4*AddObject(object) - kHeapObjectTag;
-    LoadWordFromPoolOffset(rd, offset);
+    LoadWordFromPoolOffset(rd, offset, cond);
   }
 }
 
diff --git a/runtime/vm/assembler_arm.h b/runtime/vm/assembler_arm.h
index 7875246..7039d8b 100644
--- a/runtime/vm/assembler_arm.h
+++ b/runtime/vm/assembler_arm.h
@@ -393,6 +393,8 @@
            Condition cond = AL);
   void mls(Register rd, Register rn, Register rm, Register ra,
            Condition cond = AL);
+  void smull(Register rd_lo, Register rd_hi, Register rn, Register rm,
+             Condition cond = AL);
   void umull(Register rd_lo, Register rd_hi, Register rn, Register rm,
              Condition cond = AL);
 
@@ -552,7 +554,7 @@
 
   void LoadPoolPointer();
 
-  void LoadObject(Register rd, const Object& object);
+  void LoadObject(Register rd, const Object& object, Condition cond = AL);
   void PushObject(const Object& object);
   void CompareObject(Register rn, const Object& object);
 
@@ -573,7 +575,7 @@
   void LoadClass(Register result, Register object, Register scratch);
   void CompareClassId(Register object, intptr_t class_id, Register scratch);
 
-  void LoadWordFromPoolOffset(Register rd, int32_t offset);
+  void LoadWordFromPoolOffset(Register rd, int32_t offset, Condition cond = AL);
   void LoadFromOffset(LoadOperandType type,
                       Register reg,
                       Register base,
diff --git a/runtime/vm/assembler_arm_test.cc b/runtime/vm/assembler_arm_test.cc
index 93955a80..a7e8f2b 100644
--- a/runtime/vm/assembler_arm_test.cc
+++ b/runtime/vm/assembler_arm_test.cc
@@ -616,7 +616,7 @@
 }
 
 
-ASSEMBLER_TEST_GENERATE(LongMultiply, assembler) {
+ASSEMBLER_TEST_GENERATE(Multiply64To64, assembler) {
   __ Push(R4);
   __ Mov(IP, R0);
   __ mul(R4, R2, R1);
@@ -628,10 +628,25 @@
 }
 
 
-ASSEMBLER_TEST_RUN(LongMultiply, test) {
+ASSEMBLER_TEST_RUN(Multiply64To64, test) {
   EXPECT(test != NULL);
-  typedef int64_t (*LongMultiply)(int64_t operand0, int64_t operand1);
-  EXPECT_EQ(6, EXECUTE_TEST_CODE_INT64_LL(LongMultiply, test->entry(), -3, -2));
+  typedef int64_t (*Multiply64To64)(int64_t operand0, int64_t operand1);
+  EXPECT_EQ(6,
+            EXECUTE_TEST_CODE_INT64_LL(Multiply64To64, test->entry(), -3, -2));
+}
+
+
+ASSEMBLER_TEST_GENERATE(Multiply32To64, assembler) {
+  __ smull(R0, R1, R0, R2);
+  __ mov(PC, ShifterOperand(LR));
+}
+
+
+ASSEMBLER_TEST_RUN(Multiply32To64, test) {
+  EXPECT(test != NULL);
+  typedef int64_t (*Multiply32To64)(int64_t operand0, int64_t operand1);
+  EXPECT_EQ(6,
+            EXECUTE_TEST_CODE_INT64_LL(Multiply32To64, test->entry(), -3, -2));
 }
 
 
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index f293cb9..7442edc 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -8,7 +8,6 @@
 #include "vm/assembler.h"
 #include "vm/code_generator.h"
 #include "vm/heap.h"
-#include "vm/heap_trace.h"
 #include "vm/memory_region.h"
 #include "vm/runtime_entry.h"
 #include "vm/stub_code.h"
@@ -1911,7 +1910,6 @@
                                 Register value,
                                 bool can_value_be_smi) {
   ASSERT(object != value);
-  TraceStoreIntoObject(object, dest, value);
   movl(dest, value);
   Label done;
   if (can_value_be_smi) {
@@ -1933,7 +1931,6 @@
 void Assembler::StoreIntoObjectNoBarrier(Register object,
                                          const Address& dest,
                                          Register value) {
-  TraceStoreIntoObject(object, dest, value);
   movl(dest, value);
 #if defined(DEBUG)
   Label done;
@@ -1953,7 +1950,6 @@
   if (value.IsSmi() || value.InVMHeap()) {
     movl(dest, Immediate(reinterpret_cast<int32_t>(value.raw())));
   } else {
-    // No heap trace for an old object store.
     ASSERT(value.IsOld());
     AssemblerBuffer::EnsureCapacity ensured(&buffer_);
     EmitUint8(0xC7);
@@ -1964,23 +1960,6 @@
 }
 
 
-void Assembler::TraceStoreIntoObject(Register object,
-                                     const Address& dest,
-                                     Register value) {
-  if (HeapTrace::is_enabled()) {
-    pushal();
-    EnterCallRuntimeFrame(3 * kWordSize);
-    movl(Address(ESP, 0 * kWordSize), object);
-    leal(EAX, dest);
-    movl(Address(ESP, 1 * kWordSize), EAX);
-    movl(Address(ESP, 2 * kWordSize), value);
-    CallRuntime(kHeapTraceStoreRuntimeEntry);
-    LeaveCallRuntimeFrame();
-    popal();
-  }
-}
-
-
 void Assembler::LoadDoubleConstant(XmmRegister dst, double value) {
   // TODO(5410843): Need to have a code constants table.
   int64_t constant = bit_cast<int64_t, double>(value);
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index 4ed8c0e..d28f814 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -626,10 +626,6 @@
                                 const Address& dest,
                                 const Object& value);
 
-  void TraceStoreIntoObject(Register object,
-                            const Address& dest,
-                            Register value);
-
   void DoubleNegate(XmmRegister d);
   void FloatNegate(XmmRegister f);
 
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index e716dd5..bda9cd0 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -12,6 +12,7 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, trace_sim);
 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message.");
 
 
@@ -330,9 +331,9 @@
     addiu(SP, SP, Immediate(-4 * kWordSize));
     sw(ZR, Address(SP, 3 * kWordSize));  // PC marker is 0 in stubs.
     sw(RA, Address(SP, 2 * kWordSize));
-    sw(PP, Address(SP, 1 * kWordSize));
-    sw(FP, Address(SP, 0 * kWordSize));
-    mov(FP, SP);
+    sw(FP, Address(SP, 1 * kWordSize));
+    sw(PP, Address(SP, 0 * kWordSize));
+    addiu(FP, SP, Immediate(1 * kWordSize));
     // Setup pool pointer for this stub.
     Label next;
     bal(&next);
@@ -355,13 +356,14 @@
 
 
 void Assembler::LeaveStubFrame(bool uses_pp) {
-  mov(SP, FP);
   if (uses_pp) {
+    addiu(SP, FP, Immediate(-1 * kWordSize));
     lw(RA, Address(SP, 2 * kWordSize));
-    lw(PP, Address(SP, 1 * kWordSize));
-    lw(FP, Address(SP, 0 * kWordSize));
+    lw(FP, Address(SP, 1 * kWordSize));
+    lw(PP, Address(SP, 0 * kWordSize));
     addiu(SP, SP, Immediate(4 * kWordSize));
   } else {
+    mov(SP, FP);
     lw(RA, Address(SP, 1 * kWordSize));
     lw(FP, Address(SP, 0 * kWordSize));
     addiu(SP, SP, Immediate(3 * kWordSize));
@@ -448,6 +450,8 @@
       2 * kWordSize +  // FP and RA.
       kDartVolatileFpuRegCount * kWordSize;
 
+  TraceSimMsg("EnterCallRuntimeFrame");
+
   if (prologue_offset_ == -1) {
     prologue_offset_ = CodeSize();
   }
@@ -490,6 +494,8 @@
       2 * kWordSize +  // FP and RA.
       kDartVolatileFpuRegCount * kWordSize;
 
+  TraceSimMsg("LeaveCallRuntimeFrame");
+
   // SP might have been modified to reserve space for arguments
   // and ensure proper alignment of the stack frame.
   // We need to restore it before restoring registers.
@@ -543,6 +549,18 @@
   break_(Instr::kStopMessageCode);
 }
 
+
+void Assembler::TraceSimMsg(const char* message) {
+  //  Don't bother adding in the messages unless tracing is enabled.
+  if (FLAG_trace_sim) {
+    Label msg;
+    b(&msg);
+    Emit(reinterpret_cast<int32_t>(message));
+    Bind(&msg);
+    break_(Instr::kMsgMessageCode);
+  }
+}
+
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_MIPS
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 0eca796..6402b6e 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -191,6 +191,10 @@
 
   // Debugging and bringup support.
   void Stop(const char* message);
+
+  // TODO(zra): TraceSimMsg enables printing of helpful messages when
+  // --trace_sim is given. Eventually these calls will be changed to Comment.
+  void TraceSimMsg(const char* message);
   void Unimplemented(const char* message);
   void Untested(const char* message);
   void Unreachable(const char* message);
@@ -682,87 +686,91 @@
   }
 
   void BranchEqual(Register rd, int32_t value, Label* l) {
-    LoadImmediate(TMP1, value);
-    beq(rd, TMP1, l);
+    ASSERT(rd != CMPRES);
+    LoadImmediate(CMPRES, value);
+    beq(rd, CMPRES, l);
   }
 
   void BranchEqual(Register rd, const Object& object, Label* l) {
-    LoadObject(TMP1, object);
-    beq(rd, TMP1, l);
+    ASSERT(rd != CMPRES);
+    LoadObject(CMPRES, object);
+    beq(rd, CMPRES, l);
   }
 
   void BranchNotEqual(Register rd, int32_t value, Label* l) {
-    LoadImmediate(TMP1, value);
-    bne(rd, TMP1, l);
+    ASSERT(rd != CMPRES);
+    LoadImmediate(CMPRES, value);
+    bne(rd, CMPRES, l);
   }
 
   void BranchNotEqual(Register rd, const Object& object, Label* l) {
-    LoadObject(TMP1, object);
-    bne(rd, TMP1, l);
+    ASSERT(rd != CMPRES);
+    LoadObject(CMPRES, object);
+    bne(rd, CMPRES, l);
   }
 
   void BranchGreater(Register rd, int32_t value, Label* l) {
     if (Utils::IsInt(kImmBits, -value)) {
-      addiu(TMP1, rd, Immediate(-value));
-      bgtz(TMP1, l);
+      addiu(CMPRES, rd, Immediate(-value));
+      bgtz(CMPRES, l);
     } else {
-      LoadImmediate(TMP1, value);
-      subu(TMP1, rd, TMP1);
-      bgtz(TMP1, l);
+      LoadImmediate(CMPRES, value);
+      subu(CMPRES, rd, CMPRES);
+      bgtz(CMPRES, l);
     }
   }
 
   void BranchGreater(Register rd, Register rs, Label* l) {
-    subu(TMP1, rd, rs);
-    bgtz(TMP1, l);
+    subu(CMPRES, rd, rs);
+    bgtz(CMPRES, l);
   }
 
   void BranchGreaterEqual(Register rd, int32_t value, Label* l) {
     if (Utils::IsInt(kImmBits, -value)) {
-      addiu(TMP1, rd, Immediate(-value));
-      bgez(TMP1, l);
+      addiu(CMPRES, rd, Immediate(-value));
+      bgez(CMPRES, l);
     } else {
-      LoadImmediate(TMP1, value);
-      subu(TMP1, rd, TMP1);
-      bgez(TMP1, l);
+      LoadImmediate(CMPRES, value);
+      subu(CMPRES, rd, CMPRES);
+      bgez(CMPRES, l);
     }
   }
 
   void BranchGreaterEqual(Register rd, Register rs, Label* l) {
-    subu(TMP1, rd, rs);
-    bgez(TMP1, l);
+    subu(CMPRES, rd, rs);
+    bgez(CMPRES, l);
   }
 
   void BranchLess(Register rd, int32_t value, Label* l) {
     if (Utils::IsInt(kImmBits, -value)) {
-      addiu(TMP1, rd, Immediate(-value));
-      bltz(TMP1, l);
+      addiu(CMPRES, rd, Immediate(-value));
+      bltz(CMPRES, l);
     } else {
-      LoadImmediate(TMP1, value);
-      subu(TMP1, rd, TMP1);
-      bltz(TMP1, l);
+      LoadImmediate(CMPRES, value);
+      subu(CMPRES, rd, CMPRES);
+      bltz(CMPRES, l);
     }
   }
 
   void BranchLess(Register rd, Register rs, Label* l) {
-    subu(TMP1, rd, rs);
-    bltz(TMP1, l);
+    subu(CMPRES, rd, rs);
+    bltz(CMPRES, l);
   }
 
   void BranchLessEqual(Register rd, int32_t value, Label* l) {
     if (Utils::IsInt(kImmBits, -value)) {
-      addiu(TMP1, rd, Immediate(-value));
-      blez(TMP1, l);
+      addiu(CMPRES, rd, Immediate(-value));
+      blez(CMPRES, l);
     } else {
-      LoadImmediate(TMP1, value);
-      subu(TMP1, rd, TMP1);
-      blez(TMP1, l);
+      LoadImmediate(CMPRES, value);
+      subu(CMPRES, rd, CMPRES);
+      blez(CMPRES, l);
     }
   }
 
   void BranchLessEqual(Register rd, Register rs, Label* l) {
-    subu(TMP1, rd, rs);
-    blez(TMP1, l);
+    subu(CMPRES, rd, rs);
+    blez(CMPRES, l);
   }
 
   void Push(Register rt) {
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index ef35ba4..837e74b 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -12,6 +12,8 @@
 #include "vm/stack_frame.h"
 #include "vm/unit_test.h"
 
+using dart::bin::File;
+
 namespace dart {
 
 Benchmark* Benchmark::first_ = NULL;
@@ -400,7 +402,7 @@
       "import 'dart:math';\n"
       "import 'dart:isolate';\n"
       "import 'dart:mirrors';\n"
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "\n";
 
   // Start an Isolate, load a script and create a full snapshot.
@@ -426,7 +428,7 @@
       "import 'dart:math';\n"
       "import 'dart:isolate';\n"
       "import 'dart:mirrors';\n"
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "import 'dart:uri';\n"
       "import 'dart:utf';\n"
       "import 'dart:json';\n"
diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc
index d52fc5e..132478c 100644
--- a/runtime/vm/bootstrap.cc
+++ b/runtime/vm/bootstrap.cc
@@ -92,8 +92,8 @@
 
 
 RawScript* Bootstrap::LoadTypedDataScript(bool patch) {
-  const char* url = patch ? "dart:typeddata_patch" : "dart:typeddata";
-  const char* source = patch ? typeddata_patch_ : typeddata_source_;
+  const char* url = patch ? "dart:typed_data_patch" : "dart:typed_data";
+  const char* source = patch ? typed_data_patch_ : typed_data_source_;
   return LoadScript(url, source, patch);
 }
 
diff --git a/runtime/vm/bootstrap.h b/runtime/vm/bootstrap.h
index 020d819..93619a4 100644
--- a/runtime/vm/bootstrap.h
+++ b/runtime/vm/bootstrap.h
@@ -52,8 +52,8 @@
   static const char math_patch_[];
   static const char mirrors_source_[];
   static const char mirrors_patch_[];
-  static const char typeddata_source_[];
-  static const char typeddata_patch_[];
+  static const char typed_data_source_[];
+  static const char typed_data_patch_[];
   static const char uri_source_[];
   static const char utf_source_[];
 };
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index fe45457..0a460dd 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -170,6 +170,7 @@
   V(ByteData_ToEndianFloat32, 2)                                               \
   V(ByteData_ToEndianFloat64, 2)                                               \
   V(Float32x4_fromDoubles, 5)                                                  \
+  V(Float32x4_splat, 2)                                                        \
   V(Float32x4_zero, 1)                                                         \
   V(Float32x4_add, 2)                                                          \
   V(Float32x4_negate, 1)                                                       \
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 283a09b..673df7a 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -38,10 +38,6 @@
     const GrowableArray<intptr_t>& added_subclasses_to_cids) {
   ASSERT(FLAG_use_cha);
   if (added_subclasses_to_cids.is_empty()) return;
-  // TODO(regis): Reenable this code for mips when possible.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
   // Deoptimize all live frames.
   DeoptimizeIfOwner(added_subclasses_to_cids);
   // Switch all functions' code to unoptimized.
@@ -63,7 +59,6 @@
       }
     }
   }
-#endif
 }
 
 
@@ -1969,7 +1964,7 @@
     field ^= fields_array.At(0);
     ASSERT(field.Offset() == TypedDataView::data_offset());
     name ^= field.name();
-    expected_name ^= String::New("_typeddata");
+    expected_name ^= String::New("_typedData");
     ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
     field ^= fields_array.At(1);
     ASSERT(field.Offset() == TypedDataView::offset_in_bytes_offset());
@@ -1988,7 +1983,7 @@
   field ^= fields_array.At(0);
   ASSERT(field.Offset() == TypedDataView::data_offset());
   name ^= field.name();
-  expected_name ^= String::New("_typeddata");
+  expected_name ^= String::New("_typedData");
   ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
   field ^= fields_array.At(1);
   ASSERT(field.Offset() == TypedDataView::offset_in_bytes_offset());
diff --git a/runtime/vm/class_table.cc b/runtime/vm/class_table.cc
index 2d14cec..3b34490 100644
--- a/runtime/vm/class_table.cc
+++ b/runtime/vm/class_table.cc
@@ -5,7 +5,6 @@
 #include "vm/class_table.h"
 #include "vm/flags.h"
 #include "vm/freelist.h"
-#include "vm/heap_trace.h"
 #include "vm/object.h"
 #include "vm/raw_object.h"
 #include "vm/visitor.h"
@@ -50,9 +49,6 @@
     ASSERT(table_[index] == 0);
     ASSERT(index < capacity_);
     table_[index] = cls.raw();
-    if (HeapTrace::is_enabled()) {
-      Isolate::Current()->heap()->trace()->TraceRegisterClass(cls);
-    }
     // Add the vtable for this predefined class into the static vtable registry
     // if it has not been setup yet.
     cpp_vtable cls_vtable = cls.handle_vtable();
@@ -76,9 +72,6 @@
     ASSERT(top_ < capacity_);
     cls.set_id(top_);
     table_[top_] = cls.raw();
-    if (HeapTrace::is_enabled()) {
-      Isolate::Current()->heap()->trace()->TraceRegisterClass(cls);
-    }
     top_++;  // Increment next index.
   }
 }
diff --git a/runtime/vm/class_table.h b/runtime/vm/class_table.h
index 4391b4b..8fe8159 100644
--- a/runtime/vm/class_table.h
+++ b/runtime/vm/class_table.h
@@ -6,7 +6,6 @@
 #define VM_CLASS_TABLE_H_
 
 #include "platform/assert.h"
-#include "platform/globals.h"
 #include "vm/globals.h"
 
 namespace dart {
diff --git a/runtime/vm/code_descriptors_test.cc b/runtime/vm/code_descriptors_test.cc
index e4fc7b8..d9c5087 100644
--- a/runtime/vm/code_descriptors_test.cc
+++ b/runtime/vm/code_descriptors_test.cc
@@ -4,7 +4,6 @@
 
 #include "platform/assert.h"
 #include "vm/globals.h"
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
 
 #include "vm/ast.h"
 #include "vm/assembler.h"
@@ -284,4 +283,3 @@
 
 }  // namespace dart
 
-#endif  // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64)
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 6ae0afa..9df2cab 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -38,8 +38,14 @@
     "Trace IC miss in optimized code");
 DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code.");
 DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls");
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
 DEFINE_FLAG(int, optimization_counter_threshold, 3000,
     "Function's usage-counter value before it is optimized, -1 means never");
+#else
+// TODO(regis): Enable optimization on ARM and MIPS.
+DEFINE_FLAG(int, optimization_counter_threshold, -1,
+    "Function's usage-counter value before it is optimized, -1 means never");
+#endif
 DECLARE_FLAG(bool, enable_type_checks);
 DECLARE_FLAG(bool, trace_type_checks);
 DECLARE_FLAG(bool, report_usage_count);
@@ -92,9 +98,11 @@
   arguments.SetReturn(array);
   AbstractTypeArguments& element_type =
       AbstractTypeArguments::CheckedHandle(arguments.ArgAt(1));
-  // An Array is raw or takes only one type argument.
+  // An Array is raw or takes one type argument. However, its type argument
+  // vector may be longer than 1 due to a type optimization reusing the type
+  // argument vector of the instantiator.
   ASSERT(element_type.IsNull() ||
-         ((element_type.Length() == 1) && element_type.IsInstantiated()));
+         ((element_type.Length() >= 1) && element_type.IsInstantiated()));
   array.SetTypeArguments(element_type);  // May be null.
 }
 
@@ -116,40 +124,29 @@
   }
   AbstractTypeArguments& type_arguments =
       AbstractTypeArguments::CheckedHandle(arguments.ArgAt(1));
-  ASSERT(type_arguments.IsNull() ||
-         (type_arguments.Length() == cls.NumTypeArguments()));
   // If no instantiator is provided, set the type arguments and return.
   if (Object::Handle(arguments.ArgAt(2)).IsSmi()) {
     ASSERT(Smi::CheckedHandle(arguments.ArgAt(2)).Value() ==
            StubCode::kNoInstantiator);
+    // Unless null (for a raw type), the type argument vector may be longer than
+    // necessary due to a type optimization reusing the type argument vector of
+    // the instantiator.
+    ASSERT(type_arguments.IsNull() ||
+           (type_arguments.IsInstantiated() &&
+            (type_arguments.Length() >= cls.NumTypeArguments())));
     instance.SetTypeArguments(type_arguments);  // May be null.
     return;
   }
-  ASSERT(!type_arguments.IsInstantiated());
+  // A still uninstantiated type argument vector must have the correct length.
+  ASSERT(!type_arguments.IsInstantiated() &&
+         (type_arguments.Length() == cls.NumTypeArguments()));
   const AbstractTypeArguments& instantiator =
       AbstractTypeArguments::CheckedHandle(arguments.ArgAt(2));
   ASSERT(instantiator.IsNull() || instantiator.IsInstantiated());
-  if (instantiator.IsNull()) {
-    type_arguments =
-        InstantiatedTypeArguments::New(type_arguments, instantiator);
-  } else if (instantiator.IsTypeArguments()) {
-    // Code inlined in the caller should have optimized the case where the
-    // instantiator is a TypeArguments and can be used as type argument vector.
-    ASSERT(!type_arguments.IsUninstantiatedIdentity() ||
-           (instantiator.Length() != type_arguments.Length()));
-    type_arguments =
-        InstantiatedTypeArguments::New(type_arguments, instantiator);
-  } else {
-    // If possible, use the instantiator as the type argument vector.
-    if (type_arguments.IsUninstantiatedIdentity() &&
-        (instantiator.Length() == type_arguments.Length())) {
-      type_arguments = instantiator.raw();
-    } else {
-      type_arguments =
-          InstantiatedTypeArguments::New(type_arguments, instantiator);
-    }
-  }
-  ASSERT(type_arguments.IsInstantiated());
+  // Code inlined in the caller should have optimized the case where the
+  // instantiator can be reused as type argument vector.
+  ASSERT(instantiator.IsNull() || !type_arguments.IsUninstantiatedIdentity());
+  type_arguments = InstantiatedTypeArguments::New(type_arguments, instantiator);
   instance.SetTypeArguments(type_arguments);
 }
 
@@ -179,38 +176,28 @@
   ASSERT(cls.HasTypeArguments());
   AbstractTypeArguments& type_arguments =
       AbstractTypeArguments::CheckedHandle(arguments.ArgAt(1));
-  ASSERT(type_arguments.IsNull() ||
-         (type_arguments.Length() == cls.NumTypeArguments()));
   if (Object::Handle(arguments.ArgAt(2)).IsSmi()) {
     ASSERT(Smi::CheckedHandle(arguments.ArgAt(2)).Value() ==
            StubCode::kNoInstantiator);
+    // Unless null (for a raw type), the type argument vector may be longer than
+    // necessary due to a type optimization reusing the type argument vector of
+    // the instantiator.
+    ASSERT(type_arguments.IsNull() ||
+           (type_arguments.IsInstantiated() &&
+            (type_arguments.Length() >= cls.NumTypeArguments())));
   } else {
-    ASSERT(!type_arguments.IsInstantiated());
+    // A still uninstantiated type argument vector must have the correct length.
+    ASSERT(!type_arguments.IsInstantiated() &&
+           (type_arguments.Length() == cls.NumTypeArguments()));
     const AbstractTypeArguments& instantiator =
         AbstractTypeArguments::CheckedHandle(arguments.ArgAt(2));
     ASSERT(instantiator.IsNull() || instantiator.IsInstantiated());
     Error& malformed_error = Error::Handle();
-    if (instantiator.IsNull()) {
-      type_arguments = type_arguments.InstantiateFrom(instantiator,
-                                                      &malformed_error);
-    } else if (instantiator.IsTypeArguments()) {
-      // Code inlined in the caller should have optimized the case where the
-      // instantiator is a TypeArguments and can be used as type argument
-      // vector.
-      ASSERT(!type_arguments.IsUninstantiatedIdentity() ||
-             (instantiator.Length() != type_arguments.Length()));
-      type_arguments = type_arguments.InstantiateFrom(instantiator,
-                                                      &malformed_error);
-    } else {
-      // If possible, use the instantiator as the type argument vector.
-      if (type_arguments.IsUninstantiatedIdentity() &&
-          (instantiator.Length() == type_arguments.Length())) {
-        type_arguments = instantiator.raw();
-      } else {
-        type_arguments = type_arguments.InstantiateFrom(instantiator,
-                                                        &malformed_error);
-      }
-    }
+    // Code inlined in the caller should have optimized the case where the
+    // instantiator can be reused as type argument vector.
+  ASSERT(instantiator.IsNull() || !type_arguments.IsUninstantiatedIdentity());
+    type_arguments = type_arguments.InstantiateFrom(instantiator,
+                                                    &malformed_error);
     if (!malformed_error.IsNull()) {
       // Throw a dynamic type error.
       const intptr_t location = GetCallerLocation();
@@ -241,11 +228,8 @@
   ASSERT(!type_arguments.IsNull() && !type_arguments.IsInstantiated());
   ASSERT(instantiator.IsNull() || instantiator.IsInstantiated());
   // Code inlined in the caller should have optimized the case where the
-  // instantiator can be used as type argument vector.
-  ASSERT(instantiator.IsNull() ||
-         !type_arguments.IsUninstantiatedIdentity() ||
-         !instantiator.IsTypeArguments() ||
-         (instantiator.Length() != type_arguments.Length()));
+  // instantiator can be reused as type argument vector.
+  ASSERT(instantiator.IsNull() || !type_arguments.IsUninstantiatedIdentity());
   type_arguments = InstantiatedTypeArguments::New(type_arguments, instantiator);
   ASSERT(type_arguments.IsInstantiated());
   arguments.SetReturn(type_arguments);
@@ -1689,22 +1673,6 @@
 END_LEAF_RUNTIME_ENTRY
 
 
-DEFINE_LEAF_RUNTIME_ENTRY(void,
-                          HeapTraceStore,
-                          RawObject* object,
-                          uword field_addr,
-                          RawObject* value) {
-  if (!(object->IsHeapObject() && value->IsHeapObject())) {
-    return;
-  }
-  HeapTrace* heap_trace = Isolate::Current()->heap()->trace();
-  heap_trace->TraceStoreIntoObject(RawObject::ToAddr(object),
-                                   field_addr,
-                                   RawObject::ToAddr(value));
-}
-END_LEAF_RUNTIME_ENTRY
-
-
 double DartModulo(double left, double right) {
   double remainder = fmod_ieee(left, right);
   if (remainder == 0.0) {
diff --git a/runtime/vm/code_generator.h b/runtime/vm/code_generator.h
index 82ecc2d..8b0a59c 100644
--- a/runtime/vm/code_generator.h
+++ b/runtime/vm/code_generator.h
@@ -30,7 +30,6 @@
 DECLARE_RUNTIME_ENTRY(CloneContext);
 DECLARE_RUNTIME_ENTRY(Deoptimize);
 DECLARE_RUNTIME_ENTRY(FixCallersTarget);
-DECLARE_LEAF_RUNTIME_ENTRY(void, HeapTraceStore, RawObject*, uword, RawObject*);
 DECLARE_RUNTIME_ENTRY(InlineCacheMissHandlerOneArg);
 DECLARE_RUNTIME_ENTRY(InlineCacheMissHandlerTwoArgs);
 DECLARE_RUNTIME_ENTRY(InlineCacheMissHandlerThreeArgs);
diff --git a/runtime/vm/code_generator_test.cc b/runtime/vm/code_generator_test.cc
index 86b5ff9..d88e130 100644
--- a/runtime/vm/code_generator_test.cc
+++ b/runtime/vm/code_generator_test.cc
@@ -43,11 +43,6 @@
 CODEGEN_TEST2_RUN(SimpleStaticCallCodegen, SmiReturnCodegen, Smi::New(3))
 
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
-
 // Helper to allocate and return a LocalVariable.
 static LocalVariable* NewTestLocalVariable(const char* name) {
   const String& variable_name = String::ZoneHandle(Symbols::New(name));
@@ -563,6 +558,4 @@
   EXPECT_EQ(cls.raw(), result.clazz());
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 }  // namespace dart
diff --git a/runtime/vm/code_patcher_mips.cc b/runtime/vm/code_patcher_mips.cc
index 1268dc7..d355a14 100644
--- a/runtime/vm/code_patcher_mips.cc
+++ b/runtime/vm/code_patcher_mips.cc
@@ -33,7 +33,8 @@
                                       const Code& code,
                                       uword new_target) {
   ASSERT(code.ContainsInstructionAt(return_address));
-  UNIMPLEMENTED();
+  CallPattern call(return_address, code);
+  call.SetTargetAddress(new_target);
 }
 
 
diff --git a/runtime/vm/constants_mips.h b/runtime/vm/constants_mips.h
index 198ab77..0668062 100644
--- a/runtime/vm/constants_mips.h
+++ b/runtime/vm/constants_mips.h
@@ -5,6 +5,8 @@
 #ifndef VM_CONSTANTS_MIPS_H_
 #define VM_CONSTANTS_MIPS_H_
 
+#include "platform/assert.h"
+
 namespace dart {
 
 enum Register {
@@ -152,11 +154,11 @@
 
 // Exception object is passed in this register to the catch handlers when an
 // exception is thrown.
-const Register kExceptionObjectReg = A0;
+const Register kExceptionObjectReg = V0;
 
 // Stack trace object is passed in this register to the catch handlers when
 // an exception is thrown.
-const Register kStackTraceObjectReg = A1;
+const Register kStackTraceObjectReg = V1;
 
 
 typedef uint32_t RegList;
@@ -400,6 +402,7 @@
   static const int32_t kNopInstruction = 0;
   static const int32_t kStopMessageCode = 1;
   static const int32_t kRedirectCode = 2;
+  static const int32_t kMsgMessageCode = 3;
 
   // Get the raw instruction bits.
   inline int32_t InstructionBits() const {
@@ -411,6 +414,25 @@
     *reinterpret_cast<int32_t*>(this) = value;
   }
 
+  inline void SetImmInstrBits(Opcode op, Register rs, Register rt,
+                              uint16_t imm) {
+    SetInstructionBits(
+        op << kOpcodeShift |
+        rs << kRsShift |
+        rt << kRtShift |
+        imm << kImmShift);
+  }
+
+  inline void SetSpecialInstrBits(SpecialFunction f,
+                                  Register rs, Register rt, Register rd) {
+    SetInstructionBits(
+        SPECIAL << kOpcodeShift |
+        f << kFunctionShift |
+        rs << kRsShift |
+        rt << kRtShift |
+        rd << kRdShift);
+  }
+
   // Read one particular bit out of the instruction bits.
   inline int32_t Bit(int nr) const {
     return (InstructionBits() >> nr) & 1;
@@ -501,6 +523,21 @@
   // Use the At(pc) function to create references to Instr.
   static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); }
 
+#if defined(DEBUG)
+  inline void AssertIsImmInstr(Opcode op, Register rs, Register rt,
+                              int32_t imm) {
+    ASSERT((OpcodeField() == op) && (RsField() == rs) && (RtField() == rt) &&
+           (SImmField() == imm));
+  }
+
+  inline void AssertIsSpecialInstr(SpecialFunction f, Register rs, Register rt,
+                                   Register rd) {
+    ASSERT((OpcodeField() == SPECIAL) && (FunctionField() == f) &&
+           (RsField() == rs) && (RtField() == rt) &&
+           (RdField() == rd));
+  }
+#endif  // defined(DEBUG)
+
  private:
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(Instr);
diff --git a/runtime/vm/custom_isolate_test.cc b/runtime/vm/custom_isolate_test.cc
index 2064066..70fb4c7 100644
--- a/runtime/vm/custom_isolate_test.cc
+++ b/runtime/vm/custom_isolate_test.cc
@@ -15,11 +15,6 @@
 
 namespace dart {
 
-// Only ia32, x64, and arm can run execution tests.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 static void native_echo(Dart_NativeArguments args);
 static void CustomIsolateImpl_start(Dart_NativeArguments args);
 static Dart_NativeFunction NativeLookup(Dart_Handle name, int argc);
@@ -344,6 +339,4 @@
   delete event_queue;
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 }  // namespace dart
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 5f32e3f..1351152 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -27,7 +27,6 @@
 
 DEFINE_FLAG(bool, heap_profile_initialize, false,
             "Writes a heap profile on isolate initialization.");
-DECLARE_FLAG(bool, heap_trace);
 DECLARE_FLAG(bool, print_bootstrap);
 DECLARE_FLAG(bool, print_class_table);
 DECLARE_FLAG(bool, trace_isolates);
@@ -134,9 +133,6 @@
   Isolate::SetInterruptCallback(interrupt);
   Isolate::SetUnhandledExceptionCallback(unhandled);
   Isolate::SetShutdownCallback(shutdown);
-  if (FLAG_heap_trace) {
-    HeapTrace::InitOnce(file_open, file_write, file_close);
-  }
   return NULL;
 }
 
@@ -220,15 +216,8 @@
   Object::VerifyBuiltinVtables();
 
   StubCode::Init(isolate);
-  // TODO(regis): Reenable this code for mips when possible.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
   isolate->megamorphic_cache_table()->InitMissHandler();
-#endif
-  if (FLAG_heap_trace) {
-    isolate->heap()->trace()->Init(isolate);
-  }
+
   isolate->heap()->EnableGrowthControl();
   isolate->set_init_callback_data(data);
   Api::SetupAcquiredError(isolate);
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 15958e4..be450c9 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -2442,7 +2442,7 @@
                                          const String& constructor_name,
                                          intptr_t num_args) {
   const Library& lib =
-      Library::Handle(isolate->object_store()->typeddata_library());
+      Library::Handle(isolate->object_store()->typed_data_library());
   ASSERT(!lib.IsNull());
   const Class& cls =
       Class::Handle(isolate, lib.LookupClassAllowPrivate(Symbols::ByteData()));
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index a5c682e..1f939b5 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -17,8 +17,9 @@
 
 DECLARE_FLAG(bool, enable_type_checks);
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 TEST_CASE(ErrorHandleBasics) {
   const char* kScriptChars =
@@ -166,7 +167,7 @@
   EXPECT_SUBSTRING("myException", Dart_GetError(result));
 }
 
-#endif
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 
 TEST_CASE(Dart_Error) {
@@ -215,8 +216,9 @@
 }
 
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 TEST_CASE(ObjectEquals) {
   bool equal = false;
@@ -237,7 +239,7 @@
   EXPECT(!equal);
 }
 
-#endif
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 
 TEST_CASE(InstanceValues) {
@@ -336,8 +338,9 @@
 }
 
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 TEST_CASE(NumberValues) {
   // TODO(antonm): add various kinds of ints (smi, mint, bigint).
@@ -371,7 +374,7 @@
   EXPECT(!Dart_IsNumber(result));
 }
 
-#endif
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 
 TEST_CASE(IntegerValues) {
@@ -636,8 +639,9 @@
 }
 
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 static void ExternalStringCallbackFinalizer(void* peer) {
   *static_cast<int*>(peer) *= 2;
@@ -905,7 +909,7 @@
 
 TEST_CASE(ByteDataAccess) {
   const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "class Expect {\n"
       "  static equals(a, b) {\n"
       "    if (a != b) {\n"
@@ -967,7 +971,7 @@
   // TODO(asiva): Once we have getInt16LE and getInt16BE support use the
   // appropriate getter instead of the host endian format used now.
   const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "class Expect {\n"
       "  static equals(a, b) {\n"
       "    if (a != b) {\n"
@@ -1086,7 +1090,7 @@
 
 TEST_CASE(TypedDataDirectAccess1) {
   const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "class Expect {\n"
       "  static equals(a, b) {\n"
       "    if (a != b) {\n"
@@ -1133,7 +1137,7 @@
 
 TEST_CASE(TypedDataViewDirectAccess) {
   const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "class Expect {\n"
       "  static equals(a, b) {\n"
       "    if (a != b) {\n"
@@ -1172,7 +1176,7 @@
 
 TEST_CASE(ByteDataDirectAccess) {
   const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "class Expect {\n"
       "  static equals(a, b) {\n"
       "    if (a != b) {\n"
@@ -1377,7 +1381,7 @@
 
 TEST_CASE(Float32x4List) {
     const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "Float32x4List float32x4() {\n"
       "  return new Float32x4List(10);\n"
       "}\n";
@@ -1408,7 +1412,7 @@
 }
 
 
-#endif
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 
 // Unit test for entering a scope, creating a local handle and exiting
@@ -1543,8 +1547,9 @@
 };
 
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 TEST_CASE(WeakPersistentHandle) {
   Dart_Handle weak_new_ref = Dart_Null();
@@ -2409,7 +2414,7 @@
   EXPECT_EQ(7, global_epilogue_callback_status);
 }
 
-#endif
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 
 // Unit test for creating multiple scopes and local handles within them.
@@ -2581,8 +2586,9 @@
 }
 
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+#if defined(TARGET_ARCH_IA32) ||                                               \
+    defined(TARGET_ARCH_X64) ||                                                \
+    defined(TARGET_ARCH_ARM)
 
 TEST_CASE(ClassTypedefsEtc) {
   const char* kScriptChars =
@@ -7645,6 +7651,6 @@
   EXPECT_EQ(260, value);
 }
 
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
+#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 }  // namespace dart
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index 5df30aa..c28bd7c 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -244,7 +244,7 @@
       object->cls->internal.as_class.library_url->value.as_string;
   char* class_name =
       object->cls->internal.as_class.class_name->value.as_string;
-  if (strcmp("dart:typeddata", library_url) != 0) {
+  if (strcmp("dart:typed_data", library_url) != 0) {
     return Dart_CObject::kNumberOfTypedDataTypes;
   }
   int i = 0;
diff --git a/runtime/vm/dart_api_state.h b/runtime/vm/dart_api_state.h
index a20a940..e1ac24e 100644
--- a/runtime/vm/dart_api_state.h
+++ b/runtime/vm/dart_api_state.h
@@ -733,7 +733,6 @@
 
  private:
   ApiZone zone_;
-  ThreadLocalKey key_;
 };
 
 
diff --git a/runtime/vm/datastream.h b/runtime/vm/datastream.h
index 1aa299b..3b76466 100644
--- a/runtime/vm/datastream.h
+++ b/runtime/vm/datastream.h
@@ -8,6 +8,7 @@
 #include "platform/assert.h"
 #include "platform/utils.h"
 #include "vm/allocation.h"
+#include "vm/exceptions.h"
 #include "vm/globals.h"
 
 namespace dart {
@@ -148,7 +149,9 @@
     *buffer_ = reinterpret_cast<uint8_t*>(alloc_(NULL,
                                                  0,
                                                  initial_size_));
-    ASSERT(*buffer_ != NULL);
+    if (*buffer_ == NULL) {
+      Exceptions::ThrowOOM();
+    }
     current_ = *buffer_;
     current_size_ = initial_size_;
     end_ = *buffer_ + initial_size_;
@@ -243,7 +246,9 @@
     *buffer_ = reinterpret_cast<uint8_t*>(alloc_(*buffer_,
                                                  current_size_,
                                                  new_size));
-    ASSERT(*buffer_ != NULL);
+    if (*buffer_ == NULL) {
+      Exceptions::ThrowOOM();
+    }
     current_ = *buffer_ + position;
     current_size_ = new_size;
     end_ = *buffer_ + new_size;
diff --git a/runtime/vm/debugger_api_impl.cc b/runtime/vm/debugger_api_impl.cc
index 6656ba2..43a80d4 100644
--- a/runtime/vm/debugger_api_impl.cc
+++ b/runtime/vm/debugger_api_impl.cc
@@ -111,47 +111,43 @@
   Isolate* isolate = Isolate::Current();
   ASSERT(isolate != NULL);
   ASSERT(isolate->debugger() != NULL);
+  Dart_EnterScope();
   Dart_IsolateId isolate_id = isolate->debugger()->GetIsolateId();
   if (event->type == Debugger::kBreakpointReached) {
     if (legacy_bp_handler != NULL) {
       Dart_StackTrace stack_trace =
           reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
       (*legacy_bp_handler)(isolate_id, NULL, stack_trace);
-      return;
+    } else if (paused_event_handler != NULL) {
+      Dart_CodeLocation location;
+      ActivationFrame* top_frame = event->top_frame;
+      location.script_url = Api::NewHandle(isolate, top_frame->SourceUrl());
+      const Library& lib = Library::Handle(top_frame->Library());
+      location.library_id = lib.index();
+      location.token_pos = top_frame->TokenPos();
+      (*paused_event_handler)(isolate_id, location);
     }
-    if (paused_event_handler == NULL) {
-      return;
-    }
-    Dart_CodeLocation location;
-    ActivationFrame* top_frame = event->top_frame;
-    location.script_url = Api::NewHandle(isolate, top_frame->SourceUrl());
-    const Library& lib = Library::Handle(top_frame->Library());
-    location.library_id = lib.index();
-    location.token_pos = top_frame->TokenPos();
-    (*paused_event_handler)(isolate_id, location);
   } else if (event->type == Debugger::kBreakpointResolved) {
-    if (bp_resolved_handler == NULL) {
-      return;
+    if (bp_resolved_handler != NULL) {
+      SourceBreakpoint* bpt = event->breakpoint;
+      ASSERT(bpt != NULL);
+      Dart_CodeLocation location;
+      Library& library = Library::Handle(isolate);
+      Script& script = Script::Handle(isolate);
+      intptr_t token_pos;
+      bpt->GetCodeLocation(&library, &script, &token_pos);
+      location.script_url = Api::NewHandle(isolate, script.url());
+      location.library_id = library.index();
+      location.token_pos = token_pos;
+      (*bp_resolved_handler)(isolate_id, bpt->id(), location);
     }
-    SourceBreakpoint* bpt = event->breakpoint;
-    ASSERT(bpt != NULL);
-    Dart_CodeLocation location;
-    Library& library = Library::Handle(isolate);
-    Script& script = Script::Handle(isolate);
-    intptr_t token_pos;
-    bpt->GetCodeLocation(&library, &script, &token_pos);
-    location.script_url = Api::NewHandle(isolate, script.url());
-    location.library_id = library.index();
-    location.token_pos = token_pos;
-    (*bp_resolved_handler)(isolate_id, bpt->id(), location);
   } else if (event->type == Debugger::kExceptionThrown) {
-    if (exc_thrown_handler == NULL) {
-      return;
+    if (exc_thrown_handler != NULL) {
+      Dart_Handle exception = Api::NewHandle(isolate, event->exception->raw());
+      Dart_StackTrace trace =
+      reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
+      (*exc_thrown_handler)(isolate_id, exception, trace);
     }
-    Dart_Handle exception = Api::NewHandle(isolate, event->exception->raw());
-    Dart_StackTrace trace =
-        reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
-    (*exc_thrown_handler)(isolate_id, exception, trace);
   } else if (event->type == Debugger::kIsolateCreated) {
     if (isolate_event_handler != NULL) {
       (*isolate_event_handler)(event->isolate_id, kCreated);
@@ -167,6 +163,7 @@
   } else {
     UNIMPLEMENTED();
   }
+  Dart_ExitScope();
 }
 
 
diff --git a/runtime/vm/debugger_api_impl_test.cc b/runtime/vm/debugger_api_impl_test.cc
index ad61b39..a10bbeb 100644
--- a/runtime/vm/debugger_api_impl_test.cc
+++ b/runtime/vm/debugger_api_impl_test.cc
@@ -10,9 +10,6 @@
 
 namespace dart {
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
-
 static bool breakpoint_hit = false;
 static int  breakpoint_hit_counter = 0;
 static Dart_Handle script_lib = NULL;
@@ -1533,6 +1530,4 @@
   EXPECT_EQ(1, breakpoint_hit_counter);
 }
 
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
-
 }  // namespace dart
diff --git a/runtime/vm/debugger_arm.cc b/runtime/vm/debugger_arm.cc
index 6a4b45c..67a9e97 100644
--- a/runtime/vm/debugger_arm.cc
+++ b/runtime/vm/debugger_arm.cc
@@ -5,30 +5,58 @@
 #include "vm/globals.h"
 #if defined(TARGET_ARCH_ARM)
 
+#include "vm/cpu.h"
 #include "vm/debugger.h"
+#include "vm/instructions.h"
+#include "vm/stub_code.h"
 
 namespace dart {
 
+// TODO(hausner): Handle captured variables.
 RawInstance* ActivationFrame::GetLocalVarValue(intptr_t slot_index) {
-  UNIMPLEMENTED();
-  return NULL;
+  uword var_address = fp() + slot_index * kWordSize;
+  return reinterpret_cast<RawInstance*>(
+             *reinterpret_cast<uword*>(var_address));
 }
 
 
 RawInstance* ActivationFrame::GetInstanceCallReceiver(
                  intptr_t num_actual_args) {
-  UNIMPLEMENTED();
-  return NULL;
+  ASSERT(num_actual_args > 0);  // At minimum we have a receiver on the stack.
+  // Stack pointer points to last argument that was pushed on the stack.
+  uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize);
+  return reinterpret_cast<RawInstance*>(
+             *reinterpret_cast<uword*>(receiver_addr));
 }
 
 
 void CodeBreakpoint::PatchFunctionReturn() {
-  UNIMPLEMENTED();
+  uword* code = reinterpret_cast<uword*>(pc_ - 3 * Instr::kInstrSize);
+  ASSERT(code[0] == 0xe8bd4c00);  // ldmia sp!, {pp, fp, lr}
+  ASSERT(code[1] == 0xe28dd004);  // add sp, sp, #4
+  ASSERT(code[2] == 0xe12fff1e);  // bx lr
+
+  // Smash code with call instruction and target address.
+  uword stub_addr = StubCode::BreakpointReturnEntryPoint();
+  uint16_t target_lo = stub_addr & 0xffff;
+  uint16_t target_hi = stub_addr >> 16;
+  uword movw = 0xe300c000 | ((target_lo >> 12) << 16) | (target_lo & 0xfff);
+  uword movt = 0xe340c000 | ((target_hi >> 12) << 16) | (target_hi & 0xfff);
+  uword blx =  0xe12fff3c;
+  code[0] = movw;  // movw ip, #target_lo
+  code[1] = movt;  // movt ip, #target_hi
+  code[2] = blx;    // blx ip
+  CPU::FlushICache(pc_ - 3 * Instr::kInstrSize, 3 * Instr::kInstrSize);
 }
 
 
 void CodeBreakpoint::RestoreFunctionReturn() {
-  UNIMPLEMENTED();
+  uword* code = reinterpret_cast<uword*>(pc_ - 3 * Instr::kInstrSize);
+  ASSERT((code[0] & 0xfff0f000) == 0xe300c000);
+  code[0] = 0xe8bd4c00;  // ldmia sp!, {pp, fp, lr}
+  code[1] = 0xe28dd004;  // add sp, sp, #4
+  code[2] = 0xe12fff1e;  // bx lr
+  CPU::FlushICache(pc_ - 3 * Instr::kInstrSize, 3 * Instr::kInstrSize);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/debugger_ia32.cc b/runtime/vm/debugger_ia32.cc
index bd3ccb4..bd443ef 100644
--- a/runtime/vm/debugger_ia32.cc
+++ b/runtime/vm/debugger_ia32.cc
@@ -46,7 +46,7 @@
   uword stub_addr = StubCode::BreakpointReturnEntryPoint();
   code[0] = 0xE8;
   *reinterpret_cast<uword*>(&code[1]) = stub_addr - pc_;
-  CPU::FlushICache(pc_, 5);
+  CPU::FlushICache(pc_ - 5, 5);
 }
 
 
@@ -58,7 +58,7 @@
   code[2] = 0x5D;  // pop ebp
   code[3] = 0xC3;  // ret
   code[4] = 0x90;  // nop
-  CPU::FlushICache(pc_, 5);
+  CPU::FlushICache(pc_ - 5, 5);
 }
 
 
diff --git a/runtime/vm/debugger_mips.cc b/runtime/vm/debugger_mips.cc
index 68acf9c..a234dcd 100644
--- a/runtime/vm/debugger_mips.cc
+++ b/runtime/vm/debugger_mips.cc
@@ -5,30 +5,86 @@
 #include "vm/globals.h"
 #if defined(TARGET_ARCH_MIPS)
 
+#include "vm/cpu.h"
 #include "vm/debugger.h"
+#include "vm/instructions.h"
+#include "vm/stub_code.h"
 
 namespace dart {
 
+// TODO(hausner): Handle captured variables.
 RawInstance* ActivationFrame::GetLocalVarValue(intptr_t slot_index) {
-  UNIMPLEMENTED();
-  return NULL;
+  uword var_address = fp() + slot_index * kWordSize;
+  return reinterpret_cast<RawInstance*>(
+             *reinterpret_cast<uword*>(var_address));
 }
 
 
 RawInstance* ActivationFrame::GetInstanceCallReceiver(
                  intptr_t num_actual_args) {
-  UNIMPLEMENTED();
-  return NULL;
+  ASSERT(num_actual_args > 0);  // At minimum we have a receiver on the stack.
+  // Stack pointer points to last argument that was pushed on the stack.
+  uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize);
+  return reinterpret_cast<RawInstance*>(
+             *reinterpret_cast<uword*>(receiver_addr));
 }
 
 
 void CodeBreakpoint::PatchFunctionReturn() {
-  UNIMPLEMENTED();
+  Instr* instr1 = Instr::At(pc_ - 6 * Instr::kInstrSize);
+  Instr* instr2 = Instr::At(pc_ - 5 * Instr::kInstrSize);
+  Instr* instr3 = Instr::At(pc_ - 4 * Instr::kInstrSize);
+  Instr* instr4 = Instr::At(pc_ - 3 * Instr::kInstrSize);
+  Instr* instr5 = Instr::At(pc_ - 2 * Instr::kInstrSize);
+  Instr* instr6 = Instr::At(pc_ - 1 * Instr::kInstrSize);
+
+#if defined(DEBUG)
+
+  instr1->AssertIsImmInstr(LW, SP, RA, 2 * kWordSize);
+  instr2->AssertIsImmInstr(LW, SP, FP, 1 * kWordSize);
+  instr3->AssertIsImmInstr(LW, SP, PP, 0 * kWordSize);
+  instr4->AssertIsImmInstr(ADDIU, SP, SP, 4 * kWordSize);
+  instr5->AssertIsSpecialInstr(JR, RA, ZR, ZR);
+  ASSERT(instr6->InstructionBits() == Instr::kNopInstruction);
+#endif  // defined(DEBUG)
+
+  // Smash code with call instruction and target address.
+  uword stub_addr = StubCode::BreakpointReturnEntryPoint();
+  uint16_t target_lo = stub_addr & 0xffff;
+  uint16_t target_hi = stub_addr >> 16;
+
+  // Unlike other architectures, the sequence we are patching in is shorter
+  // than the sequence we are replacing. We pad at the top with nops so that
+  // the end of the new sequence is lined up with the code descriptor.
+  instr1->SetInstructionBits(Instr::kNopInstruction);
+  instr2->SetInstructionBits(Instr::kNopInstruction);
+  instr3->SetImmInstrBits(LUI, ZR, TMP1, target_hi);
+  instr4->SetImmInstrBits(ORI, TMP1, TMP1, target_lo);
+  instr5->SetSpecialInstrBits(JALR, TMP1, ZR, RA);
+  instr6->SetInstructionBits(Instr::kNopInstruction);
+
+  CPU::FlushICache(pc_ - 6 * Instr::kInstrSize, 6 * Instr::kInstrSize);
 }
 
 
 void CodeBreakpoint::RestoreFunctionReturn() {
-  UNIMPLEMENTED();
+  Instr* instr1 = Instr::At(pc_ - 6 * Instr::kInstrSize);
+  Instr* instr2 = Instr::At(pc_ - 5 * Instr::kInstrSize);
+  Instr* instr3 = Instr::At(pc_ - 4 * Instr::kInstrSize);
+  Instr* instr4 = Instr::At(pc_ - 3 * Instr::kInstrSize);
+  Instr* instr5 = Instr::At(pc_ - 2 * Instr::kInstrSize);
+  Instr* instr6 = Instr::At(pc_ - 1 * Instr::kInstrSize);
+
+  ASSERT(instr3->OpcodeField() == LUI && instr3->RtField() == TMP1);
+
+  instr1->SetImmInstrBits(LW, SP, RA, 2 * kWordSize);
+  instr2->SetImmInstrBits(LW, SP, FP, 1 * kWordSize);
+  instr3->SetImmInstrBits(LW, SP, PP, 0 * kWordSize);
+  instr4->SetImmInstrBits(ADDIU, SP, SP, 4 * kWordSize);
+  instr5->SetSpecialInstrBits(JR, RA, ZR, ZR);
+  instr6->SetInstructionBits(Instr::kNopInstruction);
+
+  CPU::FlushICache(pc_ - 6 * Instr::kInstrSize, 6 * Instr::kInstrSize);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/debugger_x64.cc b/runtime/vm/debugger_x64.cc
index 6e64d85..c439640 100644
--- a/runtime/vm/debugger_x64.cc
+++ b/runtime/vm/debugger_x64.cc
@@ -49,7 +49,7 @@
   code[10] = 0x41;
   code[11] = 0xff;
   code[12] = 0xd3;
-  CPU::FlushICache(pc_, 5);
+  CPU::FlushICache(pc_ - 13, 13);
 }
 
 
@@ -69,7 +69,7 @@
   code[10] = 0x90;  // nop
   code[11] = 0x90;  // nop
   code[12] = 0x90;  // nop
-  CPU::FlushICache(pc_, 5);
+  CPU::FlushICache(pc_ - 13, 13);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/disassembler_arm.cc b/runtime/vm/disassembler_arm.cc
index 067f069..a9cc7f0 100644
--- a/runtime/vm/disassembler_arm.cc
+++ b/runtime/vm/disassembler_arm.cc
@@ -638,6 +638,11 @@
             Format(instr, "umull'cond's 'rd, 'rn, 'rm, 'rs");
             break;
           }
+          case 6: {
+            // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
+            Format(instr, "smull'cond's 'rd, 'rn, 'rm, 'rs");
+            break;
+          }
           default: {
             Unknown(instr);  // Not used.
             break;
diff --git a/runtime/vm/disassembler_mips.cc b/runtime/vm/disassembler_mips.cc
index bfa3438..81f35be 100644
--- a/runtime/vm/disassembler_mips.cc
+++ b/runtime/vm/disassembler_mips.cc
@@ -596,6 +596,10 @@
       Format(instr, "lh 'rt, 'imms('rs)");
       break;
     }
+    case LHU: {
+      Format(instr, "lhu 'rt, 'imms('rs)");
+      break;
+    }
     case LUI: {
       Format(instr, "lui 'rt, 'immu");
       break;
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index a5086cf..280bd6e 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -535,6 +535,22 @@
 }
 
 
+void Exceptions::ThrowOOM() {
+  Isolate* isolate = Isolate::Current();
+  const Instance& oom = Instance::Handle(
+      isolate, isolate->object_store()->out_of_memory());
+  Throw(oom);
+}
+
+
+void Exceptions::ThrowStackOverflow() {
+  Isolate* isolate = Isolate::Current();
+  const Instance& stack_overflow = Instance::Handle(
+      isolate, isolate->object_store()->stack_overflow());
+  Throw(stack_overflow);
+}
+
+
 RawObject* Exceptions::Create(ExceptionType type, const Array& arguments) {
   Library& library = Library::Handle();
   const String* class_name = NULL;
diff --git a/runtime/vm/exceptions.h b/runtime/vm/exceptions.h
index 6015369..e74a0db 100644
--- a/runtime/vm/exceptions.h
+++ b/runtime/vm/exceptions.h
@@ -63,6 +63,9 @@
   };
 
   static void ThrowByType(ExceptionType type, const Array& arguments);
+  static void ThrowOOM();
+  static void ThrowStackOverflow();
+
   // Returns a RawInstance if the exception is successfully created,
   // otherwise returns a RawError.
   static RawObject* Create(ExceptionType type, const Array& arguments);
diff --git a/runtime/vm/exceptions_test.cc b/runtime/vm/exceptions_test.cc
index 5ccec16..6586435 100644
--- a/runtime/vm/exceptions_test.cc
+++ b/runtime/vm/exceptions_test.cc
@@ -9,11 +9,6 @@
 
 namespace dart {
 
-// Only ia32, x64, and arm can run execution tests.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 
 #define FUNCTION_NAME(name) UnhandledExcp_##name
 #define REGISTER_FUNCTION(name, count)                                         \
@@ -133,6 +128,5 @@
       reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
   EXPECT_VALID(Dart_Invoke(lib, NewString("testMain"), 0, NULL));
 }
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
 
 }  // namespace dart
diff --git a/runtime/vm/flags.cc b/runtime/vm/flags.cc
index e18c43e..fdca04e 100644
--- a/runtime/vm/flags.cc
+++ b/runtime/vm/flags.cc
@@ -102,9 +102,12 @@
                           const char* name,
                           bool default_value,
                           const char* comment) {
-  ASSERT(Lookup(name) == NULL);
-
-  Flag* flag = new Flag(name, comment, addr, Flag::kBoolean);
+  Flag* flag = Lookup(name);
+  if (flag != NULL) {
+    ASSERT(flag->IsUnrecognized());
+    return default_value;
+  }
+  flag = new Flag(name, comment, addr, Flag::kBoolean);
   flag->next_ = Flags::flags_;
   Flags::flags_ = flag;
 
@@ -201,7 +204,7 @@
   if (flag == NULL) {
     // Collect unrecognized flags.
     char* new_flag = new char[name_len + 1];
-    strncpy(new_flag, name, name_len);
+    strncpy(new_flag, option, name_len);
     new_flag[name_len] = '\0';
     Flags::Register_bool(NULL, new_flag, true, NULL);
   } else {
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index cf08e61..76f6469 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -1917,6 +1917,7 @@
       case kTypedDataUint64ArrayCid:
       case kTypedDataFloat32ArrayCid:
       case kTypedDataFloat64ArrayCid:
+      case kTypedDataFloat32x4ArrayCid:
         return function_class.id();
       default:
         return kDynamicCid;  // Unknown.
@@ -2048,22 +2049,22 @@
 // List of recognized list factories in core lib:
 // (factory-name-symbol, result-cid, fingerprint).
 // TODO(srdjan): Store the values in the snapshot instead.
-// TODO(srdjan): Add Float32x4List.
 #define RECOGNIZED_LIST_FACTORY_LIST(V)                                        \
   V(ObjectArrayFactory, kArrayCid, 97987288)                                   \
   V(GrowableObjectArrayWithData, kGrowableObjectArrayCid, 816132033)           \
   V(GrowableObjectArrayFactory, kGrowableObjectArrayCid, 552407276)            \
-  V(Int8ListFactory, kTypedDataInt8ArrayCid, 2066002614)                       \
-  V(Uint8ListFactory, kTypedDataUint8ArrayCid, 1883551322)                     \
-  V(Uint8ClampedListFactory, kTypedDataUint8ClampedArrayCid, 244333676)        \
-  V(Int16ListFactory, kTypedDataInt16ArrayCid, 335889889)                      \
-  V(Uint16ListFactory, kTypedDataUint16ArrayCid, 1552801708)                   \
-  V(Int32ListFactory, kTypedDataInt32ArrayCid, 1615677219)                     \
-  V(Uint32ListFactory, kTypedDataUint32ArrayCid, 1239540305)                   \
-  V(Int64ListFactory, kTypedDataInt64ArrayCid, 993438946)                      \
-  V(Uint64ListFactory, kTypedDataUint64ArrayCid, 1830907325)                   \
-  V(Float64ListFactory, kTypedDataFloat64ArrayCid, 1236037424)                 \
-  V(Float32ListFactory, kTypedDataFloat32ArrayCid, 570814412)                  \
+  V(Int8ListFactory, kTypedDataInt8ArrayCid, 1299195009)                       \
+  V(Uint8ListFactory, kTypedDataUint8ArrayCid, 1493118613)                     \
+  V(Uint8ClampedListFactory, kTypedDataUint8ClampedArrayCid, 642014193)        \
+  V(Int16ListFactory, kTypedDataInt16ArrayCid, 1346619471)                     \
+  V(Uint16ListFactory, kTypedDataUint16ArrayCid, 1374024153)                   \
+  V(Int32ListFactory, kTypedDataInt32ArrayCid, 1583592980)                     \
+  V(Uint32ListFactory, kTypedDataUint32ArrayCid, 1940214615)                   \
+  V(Int64ListFactory, kTypedDataInt64ArrayCid, 108181413)                      \
+  V(Uint64ListFactory, kTypedDataUint64ArrayCid, 375587484)                    \
+  V(Float64ListFactory, kTypedDataFloat64ArrayCid, 919047725)                  \
+  V(Float32ListFactory, kTypedDataFloat32ArrayCid, 1038684997)                 \
+  V(Float32x4ListFactory, kTypedDataFloat32x4ArrayCid, 801641591)              \
 
 
 // Class that recognizes factories and returns corresponding result cid.
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index 5b0020b..acd4925 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -285,13 +285,86 @@
 }
 
 
+// Generates inlined check if 'type' is a type parameter or type itself
+// R0: instance (preserved).
 RawSubtypeTestCache* FlowGraphCompiler::GenerateUninstantiatedTypeTest(
     intptr_t token_pos,
     const AbstractType& type,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
-  UNIMPLEMENTED();
-  return NULL;
+  __ Comment("UninstantiatedTypeTest");
+  ASSERT(!type.IsInstantiated());
+  // Skip check if destination is a dynamic type.
+  if (type.IsTypeParameter()) {
+    const TypeParameter& type_param = TypeParameter::Cast(type);
+    // Load instantiator (or null) and instantiator type arguments on stack.
+    __ ldr(R1, Address(SP, 0));  // Get instantiator type arguments.
+    // R1: instantiator type arguments.
+    // Check if type argument is dynamic.
+    __ CompareImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+    __ b(is_instance_lbl, EQ);
+    // Can handle only type arguments that are instances of TypeArguments.
+    // (runtime checks canonicalize type arguments).
+    Label fall_through;
+    __ CompareClassId(R1, kTypeArgumentsCid, R2);
+    __ b(&fall_through, NE);
+    __ ldr(R2,
+        FieldAddress(R1, TypeArguments::type_at_offset(type_param.index())));
+    // R2: concrete type of type.
+    // Check if type argument is dynamic.
+    __ CompareObject(R2, Type::ZoneHandle(Type::DynamicType()));
+    __ b(is_instance_lbl, EQ);
+    __ CompareImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
+    __ b(is_instance_lbl, EQ);
+    const Type& object_type = Type::ZoneHandle(Type::ObjectType());
+    __ CompareObject(R2, object_type);
+    __ b(is_instance_lbl, EQ);
+
+    // For Smi check quickly against int and num interfaces.
+    Label not_smi;
+    __ tst(R0, ShifterOperand(kSmiTagMask));  // Value is Smi?
+    __ b(&not_smi, NE);
+    __ CompareObject(R2, Type::ZoneHandle(Type::IntType()));
+    __ b(is_instance_lbl, EQ);
+    __ CompareObject(R2, Type::ZoneHandle(Type::Number()));
+    __ b(is_instance_lbl, EQ);
+    // Smi must be handled in runtime.
+    __ b(&fall_through);
+
+    __ Bind(&not_smi);
+    // R1: instantiator type arguments.
+    // R0: instance.
+    const Register kInstanceReg = R0;
+    const Register kTypeArgumentsReg = R1;
+    const Register kTempReg = kNoRegister;
+    const SubtypeTestCache& type_test_cache =
+        SubtypeTestCache::ZoneHandle(
+            GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
+                                        kInstanceReg,
+                                        kTypeArgumentsReg,
+                                        kTempReg,
+                                        is_instance_lbl,
+                                        is_not_instance_lbl));
+    __ Bind(&fall_through);
+    return type_test_cache.raw();
+  }
+  if (type.IsType()) {
+    const Register kInstanceReg = R0;
+    const Register kTypeArgumentsReg = R1;
+    __ tst(kInstanceReg, ShifterOperand(kSmiTagMask));  // Is instance Smi?
+    __ b(is_not_instance_lbl, EQ);
+    __ ldr(kTypeArgumentsReg, Address(SP, 0));  // Instantiator type args.
+    // Uninstantiated type class is known at compile time, but the type
+    // arguments are determined at runtime by the instantiator.
+    const Register kTempReg = kNoRegister;
+    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
+                                       kInstanceReg,
+                                       kTypeArgumentsReg,
+                                       kTempReg,
+                                       is_instance_lbl,
+                                       is_not_instance_lbl);
+  }
+  return SubtypeTestCache::null();
 }
 
 
@@ -394,7 +467,7 @@
   // Assignable check is skipped in FlowGraphBuilder, not here.
   ASSERT(dst_type.IsMalformed() ||
          (!dst_type.IsDynamicType() && !dst_type.IsObjectType()));
-  // Preserve instantiator and its type arguments.
+  // Preserve instantiator (R2) and its type arguments (R1).
   __ PushList((1 << R1) | (1 << R2));
   // A null object is always assignable and is returned as result.
   Label is_assignable, runtime_call;
@@ -425,7 +498,7 @@
     __ bkpt(0);
 
     __ Bind(&is_assignable);  // For a null object.
-    // Restore instantiator and its type arguments.
+    // Restore instantiator (R2) and its type arguments (R1).
     __ PopList((1 << R1) | (1 << R2));
     return;
   }
@@ -436,12 +509,12 @@
                                         &is_assignable, &runtime_call);
 
   __ Bind(&runtime_call);
-  // Load instantiator and its type arguments.
+  // Load instantiator (R2) and its type arguments (R1).
   __ ldm(IA, SP,  (1 << R1) | (1 << R2));
   __ PushObject(Object::ZoneHandle());  // Make room for the result.
   __ Push(R0);  // Push the source object.
   __ PushObject(dst_type);  // Push the type of the destination.
-  // Push instantiator and its type arguments.
+  // Push instantiator (R2) and its type arguments (R1).
   __ PushList((1 << R1) | (1 << R2));
   __ PushObject(dst_name);  // Push the name of the destination.
   __ LoadObject(R0, test_cache);
@@ -453,7 +526,7 @@
   __ Pop(R0);
 
   __ Bind(&is_assignable);
-  // Restore instantiator and its type arguments.
+  // Restore instantiator (R2) and its type arguments (R1).
   __ PopList((1 << R1) | (1 << R2));
 }
 
@@ -1000,7 +1073,21 @@
     intptr_t deopt_id,
     intptr_t token_pos,
     LocationSummary* locs) {
-  UNIMPLEMENTED();
+  // Each ICData propagated from unoptimized to optimized code contains the
+  // function that corresponds to the Dart function of that IC call. Due
+  // to inlining in optimized code, that function may not correspond to the
+  // top-level function (parsed_function().function()) which could be
+  // reoptimized and which counter needs to be incremented.
+  // Pass the function explicitly, it is used in IC stub.
+  __ LoadObject(R6, parsed_function().function());
+  __ LoadObject(R4, arguments_descriptor);
+  __ LoadObject(R5, ic_data);
+  GenerateDartCall(deopt_id,
+                   token_pos,
+                   target_label,
+                   PcDescriptors::kIcCall,
+                   locs);
+  __ Drop(argument_count);
 }
 
 
@@ -1055,7 +1142,17 @@
 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg,
                                                     const Object& obj,
                                                     bool needs_number_check) {
-  UNIMPLEMENTED();
+  if (needs_number_check &&
+      (obj.IsMint() || obj.IsDouble() || obj.IsBigint())) {
+    __ Push(reg);
+    __ PushObject(obj);
+    __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel());
+    __ Drop(1);  // Discard constant.
+    __ Pop(reg);  // Restore 'reg'.
+    return;
+  }
+
+  __ CompareObject(reg, obj);
 }
 
 
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index dce40df..bc3d443 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -296,7 +296,7 @@
 }
 
 
-// Generates inlined check if 'type' is a type parameter or type itsef
+// Generates inlined check if 'type' is a type parameter or type itself
 // EAX: instance (preserved).
 // Clobbers EDX, EDI, ECX.
 RawSubtypeTestCache* FlowGraphCompiler::GenerateUninstantiatedTypeTest(
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 75cf6b3..110bc96 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -66,6 +66,7 @@
 void FlowGraphCompiler::GenerateBoolToJump(Register bool_register,
                                            Label* is_true,
                                            Label* is_false) {
+  __ TraceSimMsg("BoolToJump");
   Label fall_through;
   __ BranchEqual(bool_register, reinterpret_cast<intptr_t>(Object::null()),
                  &fall_through);
@@ -84,6 +85,7 @@
     Register temp_reg,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
+  __ TraceSimMsg("CallSubtypeTestStub");
   ASSERT(instance_reg == A0);
   ASSERT(temp_reg == kNoRegister);  // Unused on MIPS.
   const SubtypeTestCache& type_test_cache =
@@ -109,14 +111,67 @@
 }
 
 
+// Jumps to labels 'is_instance' or 'is_not_instance' respectively, if
+// type test is conclusive, otherwise fallthrough if a type test could not
+// be completed.
+// A0: instance being type checked (preserved).
+// Clobbers T0.
 RawSubtypeTestCache*
 FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest(
     intptr_t token_pos,
     const AbstractType& type,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
-  UNIMPLEMENTED();
-  return NULL;
+  __ Comment("InstantiatedTypeWithArgumentsTest");
+  ASSERT(type.IsInstantiated());
+  const Class& type_class = Class::ZoneHandle(type.type_class());
+  ASSERT(type_class.HasTypeArguments());
+  const Register kInstanceReg = A0;
+  // A Smi object cannot be the instance of a parameterized class.
+  __ andi(CMPRES, kInstanceReg, Immediate(kSmiTagMask));
+  __ beq(CMPRES, ZR, is_not_instance_lbl);
+  const AbstractTypeArguments& type_arguments =
+      AbstractTypeArguments::ZoneHandle(type.arguments());
+  const bool is_raw_type = type_arguments.IsNull() ||
+      type_arguments.IsRaw(type_arguments.Length());
+  if (is_raw_type) {
+    const Register kClassIdReg = T0;
+    // dynamic type argument, check only classes.
+    __ LoadClassId(kClassIdReg, kInstanceReg);
+    __ BranchEqual(kClassIdReg, type_class.id(), is_instance_lbl);
+    // List is a very common case.
+    if (type_class.IsListClass()) {
+      GenerateListTypeCheck(kClassIdReg, is_instance_lbl);
+    }
+    return GenerateSubtype1TestCacheLookup(
+        token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
+  }
+  // If one type argument only, check if type argument is Object or dynamic.
+  if (type_arguments.Length() == 1) {
+    const AbstractType& tp_argument = AbstractType::ZoneHandle(
+        type_arguments.TypeAt(0));
+    ASSERT(!tp_argument.IsMalformed());
+    if (tp_argument.IsType()) {
+      ASSERT(tp_argument.HasResolvedTypeClass());
+      // Check if type argument is dynamic or Object.
+      const Type& object_type = Type::Handle(Type::ObjectType());
+      if (object_type.IsSubtypeOf(tp_argument, NULL)) {
+        // Instance class test only necessary.
+        return GenerateSubtype1TestCacheLookup(
+            token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
+      }
+    }
+  }
+  // Regular subtype test cache involving instance's type arguments.
+  const Register kTypeArgumentsReg = kNoRegister;
+  const Register kTempReg = kNoRegister;
+  // A0: instance (must be preserved).
+  return GenerateCallSubtypeTestStub(kTestTypeTwoArgs,
+                                     kInstanceReg,
+                                     kTypeArgumentsReg,
+                                     kTempReg,
+                                     is_instance_lbl,
+                                     is_not_instance_lbl);
 }
 
 
@@ -124,6 +179,7 @@
                                       const GrowableArray<intptr_t>& class_ids,
                                       Label* is_equal_lbl,
                                       Label* is_not_equal_lbl) {
+  __ TraceSimMsg("CheckClassIds");
   for (intptr_t i = 0; i < class_ids.length(); i++) {
     __ BranchEqual(class_id_reg, class_ids[i], is_equal_lbl);
   }
@@ -141,6 +197,7 @@
     const AbstractType& type,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
+  __ TraceSimMsg("InstantiatedTypeNoArgumentsTest");
   __ Comment("InstantiatedTypeNoArgumentsTest");
   ASSERT(type.IsInstantiated());
   const Class& type_class = Class::Handle(type.type_class());
@@ -206,6 +263,7 @@
     const Class& type_class,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
+  __ TraceSimMsg("Subtype1TestCacheLookup");
   __ Comment("Subtype1TestCacheLookup");
   const Register kInstanceReg = A0;
   __ LoadClass(T0, kInstanceReg);
@@ -226,13 +284,83 @@
 }
 
 
+// Generates inlined check if 'type' is a type parameter or type itself
+// A0: instance (preserved).
 RawSubtypeTestCache* FlowGraphCompiler::GenerateUninstantiatedTypeTest(
     intptr_t token_pos,
     const AbstractType& type,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
-  UNIMPLEMENTED();
-  return NULL;
+  __ Comment("UninstantiatedTypeTest");
+  ASSERT(!type.IsInstantiated());
+  // Skip check if destination is a dynamic type.
+  if (type.IsTypeParameter()) {
+    const TypeParameter& type_param = TypeParameter::Cast(type);
+    // Load instantiator (or null) and instantiator type arguments on stack.
+    __ lw(A1, Address(SP, 0));  // Get instantiator type arguments.
+    // A1: instantiator type arguments.
+    // Check if type argument is dynamic.
+    __ BranchEqual(A1, reinterpret_cast<intptr_t>(Object::null()),
+                   is_instance_lbl);
+    // Can handle only type arguments that are instances of TypeArguments.
+    // (runtime checks canonicalize type arguments).
+    Label fall_through;
+    __ LoadClassId(T2, A1);
+    __ BranchNotEqual(T2, kTypeArgumentsCid, &fall_through);
+    __ lw(T2,
+        FieldAddress(A1, TypeArguments::type_at_offset(type_param.index())));
+    // R2: concrete type of type.
+    // Check if type argument is dynamic.
+    __ BranchEqual(T2, Type::ZoneHandle(Type::DynamicType()), is_instance_lbl);
+    __ BranchEqual(T2, reinterpret_cast<intptr_t>(Object::null()),
+                   is_instance_lbl);
+    const Type& object_type = Type::ZoneHandle(Type::ObjectType());
+    __ BranchEqual(T2, object_type, is_instance_lbl);
+
+    // For Smi check quickly against int and num interfaces.
+    Label not_smi;
+    __ andi(CMPRES, A0, Immediate(kSmiTagMask));
+    __ bne(CMPRES, ZR, &not_smi);  // Value is Smi?
+    __ BranchEqual(T2, Type::ZoneHandle(Type::IntType()), is_instance_lbl);
+    __ BranchEqual(T2, Type::ZoneHandle(Type::Number()), is_instance_lbl);
+
+    // Smi must be handled in runtime.
+    __ b(&fall_through);
+
+    __ Bind(&not_smi);
+    // T1: instantiator type arguments.
+    // A0: instance.
+    const Register kInstanceReg = A0;
+    const Register kTypeArgumentsReg = A1;
+    const Register kTempReg = kNoRegister;
+    const SubtypeTestCache& type_test_cache =
+        SubtypeTestCache::ZoneHandle(
+            GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
+                                        kInstanceReg,
+                                        kTypeArgumentsReg,
+                                        kTempReg,
+                                        is_instance_lbl,
+                                        is_not_instance_lbl));
+    __ Bind(&fall_through);
+    return type_test_cache.raw();
+  }
+  if (type.IsType()) {
+    const Register kInstanceReg = A0;
+    const Register kTypeArgumentsReg = A1;
+    __ andi(CMPRES, kInstanceReg, Immediate(kSmiTagMask));
+    __ beq(CMPRES, ZR, is_not_instance_lbl);  // Is instance Smi?
+    __ lw(kTypeArgumentsReg, Address(SP, 0));  // Instantiator type args.
+    // Uninstantiated type class is known at compile time, but the type
+    // arguments are determined at runtime by the instantiator.
+    const Register kTempReg = kNoRegister;
+    return GenerateCallSubtypeTestStub(kTestTypeThreeArgs,
+                                       kInstanceReg,
+                                       kTypeArgumentsReg,
+                                       kTempReg,
+                                       is_instance_lbl,
+                                       is_not_instance_lbl);
+  }
+  return SubtypeTestCache::null();
 }
 
 
@@ -250,6 +378,7 @@
     const AbstractType& type,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
+  __ TraceSimMsg("InlineInstanceof");
   __ Comment("InlineInstanceof");
   if (type.IsVoidType()) {
     // A non-null value is returned from a void function, which will result in a
@@ -330,6 +459,7 @@
                                                  const AbstractType& dst_type,
                                                  const String& dst_name,
                                                  LocationSummary* locs) {
+  __ TraceSimMsg("AssertAssignable");
   ASSERT(token_pos >= 0);
   ASSERT(!dst_type.IsNull());
   ASSERT(dst_type.IsFinalized());
@@ -355,10 +485,16 @@
     const Error& error = Error::Handle(dst_type.malformed_error());
     const String& error_message = String::ZoneHandle(
         Symbols::New(error.ToErrorCString()));
-    __ PushObject(Object::ZoneHandle());  // Make room for the result.
-    __ Push(A0);  // Push the source object.
-    __ PushObject(dst_name);  // Push the name of the destination.
-    __ PushObject(error_message);
+
+    __ addiu(SP, SP, Immediate(-4 * kWordSize));
+    __ LoadObject(TMP1, Object::ZoneHandle());
+    __ sw(TMP1, Address(SP, 3 * kWordSize));  // Make room for the result.
+    __ sw(A0, Address(SP, 2 * kWordSize));  // Push the source object.
+    __ LoadObject(TMP1, dst_name);
+    __ sw(TMP1, Address(SP, 1 * kWordSize));  // Push the destination name.
+    __ LoadObject(TMP1, error_message);
+    __ sw(TMP1, Address(SP, 0 * kWordSize));
+
     GenerateCallRuntime(token_pos,
                         deopt_id,
                         kMalformedTypeErrorRuntimeEntry,
@@ -380,25 +516,28 @@
                                         &is_assignable, &runtime_call);
 
   __ Bind(&runtime_call);
-  // Load instantiator and its type arguments.
+  // Load instantiator (A2) and its type arguments (A1).
   __ lw(A1, Address(SP, 0 * kWordSize));
   __ lw(A2, Address(SP, 1 * kWordSize));
-  __ addiu(SP, SP, Immediate(2 * kWordSize));
-  __ PushObject(Object::ZoneHandle());  // Make room for the result.
-  __ Push(A0);  // Push the source object.
-  __ PushObject(dst_type);  // Push the type of the destination.
-  // Push instantiator and its type arguments.
-  __ addiu(SP, SP, Immediate(-2 * kWordSize));
-  __ sw(A2, Address(SP, 1 * kWordSize));
-  __ sw(A1, Address(SP, 0 * kWordSize));
-  __ PushObject(dst_name);  // Push the name of the destination.
+
+  __ addiu(SP, SP, Immediate(-7 * kWordSize));
+  __ LoadObject(TMP1, Object::ZoneHandle());
+  __ sw(TMP1, Address(SP, 6 * kWordSize));  // Make room for the result.
+  __ sw(A0, Address(SP, 5 * kWordSize));  // Push the source object.
+  __ LoadObject(TMP1, dst_type);
+  __ sw(TMP1, Address(SP, 4 * kWordSize));  // Push the type of the destination.
+  __ sw(A2, Address(SP, 3 * kWordSize));  // Push instantiator.
+  __ sw(A1, Address(SP, 2 * kWordSize));  // Push type arguments.
+  __ LoadObject(TMP1, dst_name);
+  __ sw(TMP1, Address(SP, 1 * kWordSize));  // Push the name of the destination.
   __ LoadObject(T0, test_cache);
-  __ Push(T0);
+  __ sw(T0, Address(SP, 0 * kWordSize));
+
   GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, locs);
   // Pop the parameters supplied to the runtime entry. The result of the
   // type check runtime call is the checked value.
-  __ Drop(6);
-  __ Pop(A0);
+  __ lw(A0, Address(SP, 6 * kWordSize));
+  __ addiu(SP, SP, Immediate(7 * kWordSize));
 
   __ Bind(&is_assignable);
   // Restore instantiator and its type arguments.
@@ -442,6 +581,7 @@
 // Input parameters:
 //   S4: arguments descriptor array.
 void FlowGraphCompiler::CopyParameters() {
+  __ TraceSimMsg("CopyParameters");
   __ Comment("Copy parameters");
   const Function& function = parsed_function().function();
   LocalScope* scope = parsed_function().node_sequence()->scope();
@@ -482,12 +622,11 @@
   // Let T0 point to the last copied positional argument, i.e. to
   // fp[kFirstLocalSlotIndex - (num_pos_args - 1)].
   __ AddImmediate(T0, FP, (kFirstLocalSlotIndex + 1) * kWordSize);
-  __ sll(T3, T2, 1);  // T2 is a Smi.
-  __ subu(T0, T0, T3);
+  __ sll(T2, T2, 1);  // T2 is a Smi.
 
   Label loop, loop_condition;
   __ b(&loop_condition);
-  __ delay_slot()->SmiUntag(T2);
+  __ delay_slot()->subu(T0, T0, T2);
   // We do not use the final allocation index of the variable here, i.e.
   // scope->VariableAt(i)->index(), because captured variables still need
   // to be copied to the context that is not yet allocated.
@@ -573,7 +712,7 @@
     // Check that T0 now points to the null terminator in the array descriptor.
     __ lw(T3, Address(T0));
     __ BranchEqual(T3, reinterpret_cast<int32_t>(Object::null()),
-                &all_arguments_processed);
+                   &all_arguments_processed);
   } else {
     ASSERT(num_opt_pos_params > 0);
     __ lw(T2,
@@ -651,15 +790,18 @@
 
   // S4 : arguments descriptor array.
   __ lw(T2, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
-  __ SmiUntag(T2);
+  __ sll(T2, T2, 1);  // T2 is a Smi.
 
   __ LoadImmediate(T0, reinterpret_cast<intptr_t>(Object::null()));
   Label null_args_loop, null_args_loop_condition;
+
   __ b(&null_args_loop_condition);
   __ delay_slot()->addiu(T1, FP, Immediate(kLastParamSlotIndex * kWordSize));
+
   __ Bind(&null_args_loop);
   __ addu(T3, T1, T2);
   __ sw(T0, Address(T3));
+
   __ Bind(&null_args_loop_condition);
   __ addiu(T2, T2, Immediate(-kWordSize));
   __ bgez(T2, &null_args_loop);
@@ -667,16 +809,30 @@
 
 
 void FlowGraphCompiler::GenerateInlinedGetter(intptr_t offset) {
-  UNIMPLEMENTED();
+  // RA: return address.
+  // SP: receiver.
+  // Sequence node has one return node, its input is load field node.
+  __ lw(V0, Address(SP, 0 * kWordSize));
+  __ lw(V0, Address(V0, offset - kHeapObjectTag));
+  __ Ret();
 }
 
 
 void FlowGraphCompiler::GenerateInlinedSetter(intptr_t offset) {
-  UNIMPLEMENTED();
+  // RA: return address.
+  // SP+1: receiver.
+  // SP+0: value.
+  // Sequence node has one store node and one return NULL node.
+  __ lw(T0, Address(SP, 1 * kWordSize));  // Receiver.
+  __ lw(T1, Address(SP, 0 * kWordSize));  // Value.
+  __ StoreIntoObject(T0, FieldAddress(T0, offset), T1);
+  __ LoadImmediate(V0, reinterpret_cast<intptr_t>(Object::null()));
+  __ Ret();
 }
 
 
 void FlowGraphCompiler::EmitFrameEntry() {
+  __ TraceSimMsg("FrameEntry");
   const Function& function = parsed_function().function();
   if (CanOptimizeFunction() && function.is_optimizable()) {
     const bool can_optimize = !is_optimizing() || may_reoptimize();
@@ -786,6 +942,7 @@
     const bool check_arguments = function.IsClosureFunction();
 #endif
     if (check_arguments) {
+      __ TraceSimMsg("Check argument count");
       __ Comment("Check argument count");
       // Check that exactly num_fixed arguments are passed in.
       Label correct_num_arguments, wrong_num_arguments;
@@ -858,6 +1015,7 @@
   // In unoptimized code, initialize (non-argument) stack allocated slots to
   // null. This does not cover the saved_args_desc_var slot.
   if (!is_optimizing() && (num_locals > 0)) {
+    __ TraceSimMsg("Initialize spill slots");
     __ Comment("Initialize spill slots");
     const intptr_t slot_base = parsed_function().first_stack_local_index();
     __ LoadImmediate(T0, reinterpret_cast<intptr_t>(Object::null()));
@@ -898,6 +1056,7 @@
                                      const ExternalLabel* label,
                                      PcDescriptors::Kind kind,
                                      LocationSummary* locs) {
+  __ TraceSimMsg("Call");
   __ BranchLinkPatchable(label);
   AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
@@ -909,6 +1068,7 @@
                                          const ExternalLabel* label,
                                          PcDescriptors::Kind kind,
                                          LocationSummary* locs) {
+  __ TraceSimMsg("DartCall");
   __ BranchLinkPatchable(label);
   AddCurrentDescriptor(kind, deopt_id, token_pos);
   RecordSafepoint(locs);
@@ -931,6 +1091,7 @@
                                             intptr_t deopt_id,
                                             const RuntimeEntry& entry,
                                             LocationSummary* locs) {
+  __ TraceSimMsg("CallRuntime");
   __ CallRuntime(entry);
   AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
   RecordSafepoint(locs);
@@ -948,6 +1109,7 @@
                            token_pos);
     }
   }
+  __ TraceSimMsg("CallRuntime return");
 }
 
 
@@ -970,6 +1132,7 @@
                                          intptr_t deopt_id,
                                          intptr_t token_pos,
                                          LocationSummary* locs) {
+  __ TraceSimMsg("InstanceCall");
   __ LoadObject(S4, arguments_descriptor);
   __ LoadObject(S5, ic_data);
   GenerateDartCall(deopt_id,
@@ -977,6 +1140,7 @@
                    target_label,
                    PcDescriptors::kIcCall,
                    locs);
+  __ TraceSimMsg("InstanceCall return");
   __ Drop(argument_count);
 }
 
@@ -998,6 +1162,7 @@
                                        intptr_t deopt_id,
                                        intptr_t token_pos,
                                        LocationSummary* locs) {
+  __ TraceSimMsg("StaticCall");
   __ LoadObject(S4, arguments_descriptor);
   // Do not use the code from the function, but let the code be patched so that
   // we can record the outgoing edges to other code.
@@ -1021,13 +1186,17 @@
 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
                                                   Register right,
                                                   bool needs_number_check) {
+  __ TraceSimMsg("EqualityRegRegCompare");
   if (needs_number_check) {
-    __ Push(left);
-    __ Push(right);
+    __ addiu(SP, SP, Immediate(-2 * kWordSize));
+    __ sw(left, Address(SP, 1 * kWordSize));
+    __ sw(right, Address(SP, 0 * kWordSize));
     __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel());
+    __ TraceSimMsg("EqualityRegRegCompare return");
     // Stub returns result in CMPRES. If it is 0, then left and right are equal.
-    __ Pop(right);
-    __ Pop(left);
+    __ lw(right, Address(SP, 0 * kWordSize));
+    __ lw(left, Address(SP, 1 * kWordSize));
+    __ addiu(SP, SP, Immediate(2 * kWordSize));
   } else {
     __ subu(CMPRES, left, right);
   }
@@ -1041,6 +1210,7 @@
 
 
 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
+  __ TraceSimMsg("SaveLiveRegisters");
   // TODO(vegorov): consider saving only caller save (volatile) registers.
   const intptr_t fpu_registers = locs->live_registers()->fpu_registers();
   if (fpu_registers > 0) {
@@ -1068,6 +1238,7 @@
 void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
   // General purpose registers have the lowest register number at the
   // lowest address.
+  __ TraceSimMsg("RestoreLiveRegisters");
   const intptr_t cpu_registers = locs->live_registers()->cpu_registers();
   ASSERT((cpu_registers & ~kAllCpuRegistersList) == 0);
   const int register_count = Utils::CountOneBits(cpu_registers);
@@ -1172,6 +1343,7 @@
 
 
 void ParallelMoveResolver::EmitMove(int index) {
+  __ TraceSimMsg("ParallelMoveResolver::EmitMove");
   MoveOperands* move = moves_[index];
   const Location source = move->src();
   const Location destination = move->dest();
@@ -1228,6 +1400,7 @@
 
 
 void ParallelMoveResolver::EmitSwap(int index) {
+  __ TraceSimMsg("ParallelMoveResolver::EmitSwap");
   MoveOperands* move = moves_[index];
   const Location source = move->src();
   const Location destination = move->dest();
@@ -1303,18 +1476,21 @@
 
 void ParallelMoveResolver::MoveMemoryToMemory(const Address& dst,
                                               const Address& src) {
+  __ TraceSimMsg("ParallelMoveResolver::MoveMemoryToMemory");
   __ lw(TMP1, src);
   __ sw(TMP1, dst);
 }
 
 
 void ParallelMoveResolver::StoreObject(const Address& dst, const Object& obj) {
+  __ TraceSimMsg("ParallelMoveResolver::StoreObject");
   __ LoadObject(TMP1, obj);
   __ sw(TMP1, dst);
 }
 
 
 void ParallelMoveResolver::Exchange(Register reg, const Address& mem) {
+  __ TraceSimMsg("ParallelMoveResolver::Exchange ra");
   ASSERT(reg != TMP1);
   __ mov(TMP1, reg);
   __ lw(reg, mem);
@@ -1323,6 +1499,7 @@
 
 
 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
+  __ TraceSimMsg("ParallelMoveResolver::Exchange aa");
   ScratchRegisterScope ensure_scratch(this, TMP1);
   __ lw(ensure_scratch.reg(), mem1);
   __ lw(TMP1, mem2);
@@ -1332,22 +1509,26 @@
 
 
 void ParallelMoveResolver::SpillScratch(Register reg) {
+  __ TraceSimMsg("ParallelMoveResolver::SpillScratch");
   __ Push(reg);
 }
 
 
 void ParallelMoveResolver::RestoreScratch(Register reg) {
+  __ TraceSimMsg("ParallelMoveResolver::RestoreScratch");
   __ Pop(reg);
 }
 
 
 void ParallelMoveResolver::SpillFpuScratch(FpuRegister reg) {
+  __ TraceSimMsg("ParallelMoveResolver::SpillFpuScratch");
   __ AddImmediate(SP, -kDoubleSize);
   __ sdc1(reg, Address(SP));
 }
 
 
 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
+  __ TraceSimMsg("ParallelMoveResolver::RestoreFpuScratch");
   __ ldc1(reg, Address(SP));
   __ AddImmediate(SP, kDoubleSize);
 }
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 48d2624..d566fa1 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -295,7 +295,7 @@
 }
 
 
-// Generates inlined check if 'type' is a type parameter or type itsef
+// Generates inlined check if 'type' is a type parameter or type itself
 // RAX: instance (preserved).
 // Clobbers RDI, RDX, R10.
 RawSubtypeTestCache* FlowGraphCompiler::GenerateUninstantiatedTypeTest(
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index a021388..3170079 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -1393,6 +1393,23 @@
 }
 
 
+bool FlowGraphOptimizer::InlineFloat32x4Getter(InstanceCallInstr* call,
+                                               MethodRecognizer::Kind getter) {
+  AddCheckClass(call->ArgumentAt(0),
+                ICData::ZoneHandle(
+                    call->ic_data()->AsUnaryClassChecksForArgNr(0)),
+                call->deopt_id(),
+                call->env(),
+                call);
+  Float32x4ShuffleInstr* instr = new Float32x4ShuffleInstr(
+      getter,
+      new Value(call->ArgumentAt(0)),
+      call);
+  ReplaceCall(call, instr);
+  return true;
+}
+
+
 // Only unique implicit instance getters can be currently handled.
 bool FlowGraphOptimizer::TryInlineInstanceGetter(InstanceCallInstr* call) {
   ASSERT(call->HasICData());
@@ -1454,6 +1471,19 @@
       }
       InlineStringIsEmptyGetter(call);
       return true;
+    case MethodRecognizer::kFloat32x4ShuffleXXXX:
+    case MethodRecognizer::kFloat32x4ShuffleYYYY:
+    case MethodRecognizer::kFloat32x4ShuffleZZZZ:
+    case MethodRecognizer::kFloat32x4ShuffleWWWW:
+    case MethodRecognizer::kFloat32x4ShuffleX:
+    case MethodRecognizer::kFloat32x4ShuffleY:
+    case MethodRecognizer::kFloat32x4ShuffleZ:
+    case MethodRecognizer::kFloat32x4ShuffleW:
+      if (!ic_data.HasReceiverClassId(kFloat32x4Cid) ||
+          !ic_data.HasOneTarget()) {
+        return false;
+      }
+      return InlineFloat32x4Getter(call, recognized_kind);
     default:
       ASSERT(recognized_kind == MethodRecognizer::kUnknown);
   }
@@ -2077,6 +2107,21 @@
     MathSqrtInstr* sqrt =
         new MathSqrtInstr(new Value(call->ArgumentAt(0)), call);
     ReplaceCall(call, sqrt);
+  } else if (recognized_kind == MethodRecognizer::kFloat32x4Zero) {
+    Float32x4ZeroInstr* zero = new Float32x4ZeroInstr(call);
+    ReplaceCall(call, zero);
+  } else if (recognized_kind == MethodRecognizer::kFloat32x4Splat) {
+    Float32x4SplatInstr* splat =
+        new Float32x4SplatInstr(new Value(call->ArgumentAt(1)), call);
+    ReplaceCall(call, splat);
+  } else if (recognized_kind == MethodRecognizer::kFloat32x4Constructor) {
+    Float32x4ConstructorInstr* con =
+        new Float32x4ConstructorInstr(new Value(call->ArgumentAt(1)),
+                                      new Value(call->ArgumentAt(2)),
+                                      new Value(call->ArgumentAt(3)),
+                                      new Value(call->ArgumentAt(4)),
+                                      call);
+    ReplaceCall(call, con);
   }
 }
 
@@ -3063,52 +3108,216 @@
   // in the DominatorBasedCSE pass.
   // TODO(fschneider): Extend to other load instructions.
   return (def->IsLoadField() && def->AffectedBySideEffect())
-      || def->IsLoadIndexed();
+      || def->IsLoadIndexed()
+      || def->IsLoadStaticField()
+      || def->IsCurrentContext();
 }
 
 
-static intptr_t ComputeLoadOffsetInWords(Definition* defn) {
-  if (defn->IsLoadIndexed()) {
-    // We are assuming that LoadField is never used to load the first word.
-    return 0;
+// Alias represents a family of locations. It is used to capture aliasing
+// between stores and loads. Store can alias another load or store if and only
+// if they have the same alias.
+class Alias : public ValueObject {
+ public:
+  Alias(const Alias& other) : ValueObject(), alias_(other.alias_) { }
+
+  // All indexed load/stores alias each other.
+  // TODO(vegorov): incorporate type of array into alias to disambiguate
+  // different typed data and normal arrays.
+  static Alias Indexes() {
+    return Alias(kIndexesAlias);
   }
 
-  LoadFieldInstr* load_field = defn->AsLoadField();
-  if (load_field != NULL) {
-    const intptr_t idx = load_field->offset_in_bytes() / kWordSize;
-    ASSERT(idx > 0);
-    return idx;
+  // Field load/stores alias each other when field offset matches.
+  // TODO(vegorov): use field information to disambiguate load/stores into
+  // different fields that by accident share offset.
+  static Alias Field(intptr_t offset_in_bytes) {
+    const intptr_t idx = offset_in_bytes / kWordSize;
+    ASSERT(idx >= kFirstFieldAlias);
+    return Alias(idx * 2);
   }
 
-  UNREACHABLE();
-  return 0;
-}
-
-
-static bool IsInterferingStore(Instruction* instr,
-                               intptr_t* offset_in_words) {
-  if (instr->IsStoreIndexed()) {
-    // We are assuming that LoadField is never used to load the first word.
-    *offset_in_words = 0;
-    return true;
+  // Static field load/stores alias each other.
+  // AliasedSet assigns ids to static fields during optimization phase.
+  static Alias StaticField(intptr_t id) {
+    ASSERT(id >= kFirstFieldAlias);
+    return Alias(id * 2 + 1);
   }
 
-  StoreInstanceFieldInstr* store_instance_field = instr->AsStoreInstanceField();
-  if (store_instance_field != NULL) {
-    ASSERT(store_instance_field->field().Offset() != 0);
-    *offset_in_words = store_instance_field->field().Offset() / kWordSize;
-    return true;
+  // Current context load/stores alias each other.
+  static Alias CurrentContext() {
+    return Alias(kCurrentContextAlias);
   }
 
-  StoreVMFieldInstr* store_vm_field = instr->AsStoreVMField();
-  if (store_vm_field != NULL) {
-    ASSERT(store_vm_field->offset_in_bytes() != 0);
-    *offset_in_words = store_vm_field->offset_in_bytes() / kWordSize;
-    return true;
+  // Operation does not alias anything.
+  static Alias None() {
+    return Alias(kNoneAlias);
   }
 
-  return false;
-}
+  bool IsNone() const {
+    return alias_ == kNoneAlias;
+  }
+
+  // Convert this alias to a positive array index.
+  intptr_t ToIndex() const {
+    ASSERT(!IsNone());
+    return alias_ - kAliasBase;
+  }
+
+ private:
+  explicit Alias(intptr_t alias) : alias_(alias) { }
+
+  enum {
+    kNoneAlias = -2,
+    kCurrentContextAlias = -1,
+    kIndexesAlias = 0,
+    kFirstFieldAlias = kIndexesAlias + 1,
+    kAliasBase = kCurrentContextAlias
+  };
+
+  const intptr_t alias_;
+};
+
+
+// Set mapping alias to a list of loads sharing this alias.
+class AliasedSet : public ZoneAllocated {
+ public:
+  explicit AliasedSet(intptr_t max_expr_id)
+      : max_expr_id_(max_expr_id),
+        sets_(),
+        field_ids_(),
+        max_field_id_(0) { }
+
+  Alias ComputeAliasForLoad(Definition* defn) {
+    if (defn->IsLoadIndexed()) {
+      // We are assuming that LoadField is never used to load the first word.
+      return Alias::Indexes();
+    }
+
+    LoadFieldInstr* load_field = defn->AsLoadField();
+    if (load_field != NULL) {
+      return Alias::Field(load_field->offset_in_bytes());
+    }
+
+    if (defn->IsCurrentContext()) {
+      return Alias::CurrentContext();
+    }
+
+    LoadStaticFieldInstr* load_static_field = defn->AsLoadStaticField();
+    if (load_static_field != NULL) {
+      return Alias::StaticField(GetFieldId(load_static_field->field()));
+    }
+
+    UNREACHABLE();
+    return Alias::None();
+  }
+
+  Alias ComputeAliasForStore(Instruction* instr) {
+    if (instr->IsStoreIndexed()) {
+      return Alias::Indexes();
+    }
+
+    StoreInstanceFieldInstr* store_instance_field =
+        instr->AsStoreInstanceField();
+    if (store_instance_field != NULL) {
+      return Alias::Field(store_instance_field->field().Offset());
+    }
+
+    StoreVMFieldInstr* store_vm_field = instr->AsStoreVMField();
+    if (store_vm_field != NULL) {
+      return Alias::Field(store_vm_field->offset_in_bytes());
+    }
+
+    if (instr->IsStoreContext() || instr->IsChainContext()) {
+      return Alias::CurrentContext();
+    }
+
+    StoreStaticFieldInstr* store_static_field = instr->AsStoreStaticField();
+    if (store_static_field != NULL) {
+      return Alias::StaticField(GetFieldId(store_static_field->field()));
+    }
+
+    return Alias::None();
+  }
+
+  bool Contains(const Alias alias) {
+    const intptr_t idx = alias.ToIndex();
+    return (idx < sets_.length()) && (sets_[idx] != NULL);
+  }
+
+  BitVector* Get(const Alias alias) {
+    ASSERT(Contains(alias));
+    return sets_[alias.ToIndex()];
+  }
+
+  void Add(const Alias alias, intptr_t ssa_index) {
+    const intptr_t idx = alias.ToIndex();
+
+    while (sets_.length() <= idx) {
+      sets_.Add(NULL);
+    }
+
+    if (sets_[idx] == NULL) {
+      sets_[idx] = new BitVector(max_expr_id_);
+    }
+
+    sets_[idx]->Add(ssa_index);
+  }
+
+  intptr_t max_expr_id() const { return max_expr_id_; }
+  bool IsEmpty() const { return max_expr_id_ == 0; }
+
+ private:
+  const intptr_t max_expr_id_;
+
+  // Maps alias index to a set of ssa indexes corresponding to loads with the
+  // given alias.
+  GrowableArray<BitVector*> sets_;
+
+  // Get id assigned to the given field. Assign a new id if the field is seen
+  // for the first time.
+  intptr_t GetFieldId(const Field& field) {
+    intptr_t id = field_ids_.Lookup(&field);
+    if (id == 0) {
+      id = ++max_field_id_;
+      field_ids_.Insert(FieldIdPair(&field, id));
+    }
+    return id;
+  }
+
+  class FieldIdPair {
+   public:
+    typedef const Field* Key;
+    typedef intptr_t Value;
+    typedef FieldIdPair Pair;
+
+    FieldIdPair(Key key, Value value) : key_(key), value_(value) { }
+
+    static Key KeyOf(Pair kv) {
+      return kv.key_;
+    }
+
+    static Value ValueOf(Pair kv) {
+      return kv.value_;
+    }
+
+    static intptr_t Hashcode(Key key) {
+      return String::Handle(key->name()).Hash();
+    }
+
+    static inline bool IsKeyEqual(Pair kv, Key key) {
+      return KeyOf(kv)->raw() == key->raw();
+    }
+
+   private:
+    Key key_;
+    Value value_;
+  };
+
+  // Table mapping static field to their id used during optimization pass.
+  DirectChainedHashMap<FieldIdPair> field_ids_;
+  intptr_t max_field_id_;
+};
 
 
 static Definition* GetStoredValue(Instruction* instr) {
@@ -3126,6 +3335,15 @@
     return store_vm_field->value()->definition();
   }
 
+  StoreStaticFieldInstr* store_static_field = instr->AsStoreStaticField();
+  if (store_static_field != NULL) {
+    return store_static_field->value()->definition();
+  }
+
+  if (instr->IsStoreContext() || instr->IsChainContext()) {
+    return instr->InputAt(0)->definition();
+  }
+
   UNREACHABLE();  // Should only be called for supported store instructions.
   return NULL;
 }
@@ -3136,7 +3354,7 @@
 class LoadKeyValueTrait {
  public:
   typedef Definition* Value;
-  typedef Definition* Key;
+  typedef Instruction* Key;
   typedef Definition* Pair;
 
   static Key KeyOf(Pair kv) {
@@ -3171,6 +3389,16 @@
       StoreVMFieldInstr* store_field = key->AsStoreVMField();
       object = store_field->dest()->definition()->ssa_temp_index();
       location = store_field->offset_in_bytes();
+    } else if (key->IsLoadStaticField()) {
+      LoadStaticFieldInstr* load_static_field = key->AsLoadStaticField();
+      object = String::Handle(load_static_field->field().name()).Hash();
+    } else if (key->IsStoreStaticField()) {
+      StoreStaticFieldInstr* store_static_field = key->AsStoreStaticField();
+      object = String::Handle(store_static_field->field().name()).Hash();
+    } else {
+      ASSERT(key->IsStoreContext() ||
+             key->IsCurrentContext() ||
+             key->IsChainContext());
     }
 
     return object * 31 + location;
@@ -3189,6 +3417,20 @@
       return false;
     }
 
+    if (kv->IsLoadStaticField()) {
+      if (key->IsStoreStaticField()) {
+        LoadStaticFieldInstr* load_static_field = kv->AsLoadStaticField();
+        StoreStaticFieldInstr* store_static_field = key->AsStoreStaticField();
+        return load_static_field->field().raw() ==
+            store_static_field->field().raw();
+      }
+      return false;
+    }
+
+    if (kv->IsCurrentContext()) {
+      return key->IsStoreContext() || key->IsChainContext();
+    }
+
     ASSERT(kv->IsLoadField());
     LoadFieldInstr* load_field = kv->AsLoadField();
     if (key->IsStoreVMField()) {
@@ -3206,10 +3448,9 @@
 };
 
 
-static intptr_t NumberLoadExpressions(
+static AliasedSet* NumberLoadExpressions(
     FlowGraph* graph,
-    DirectChainedHashMap<LoadKeyValueTrait>* map,
-    GrowableArray<BitVector*>* kill_by_offs) {
+    DirectChainedHashMap<LoadKeyValueTrait>* map) {
   intptr_t expr_id = 0;
 
   // Loads representing different expression ids will be collected and
@@ -3238,35 +3479,24 @@
     }
   }
 
-  // Build per offset kill sets. Any store interferes only with loads from
-  // the same offset.
+  // Build aliasing sets mapping aliases to loads.
+  AliasedSet* aliased_set = new AliasedSet(expr_id);
   for (intptr_t i = 0; i < loads.length(); i++) {
     Definition* defn = loads[i];
-
-    const intptr_t offset_in_words = ComputeLoadOffsetInWords(defn);
-    while (kill_by_offs->length() <= offset_in_words) {
-      kill_by_offs->Add(NULL);
-    }
-    if ((*kill_by_offs)[offset_in_words] == NULL) {
-      (*kill_by_offs)[offset_in_words] = new BitVector(expr_id);
-    }
-    (*kill_by_offs)[offset_in_words]->Add(defn->expr_id());
+    aliased_set->Add(aliased_set->ComputeAliasForLoad(defn), defn->expr_id());
   }
-
-  return expr_id;
+  return aliased_set;
 }
 
 
 class LoadOptimizer : public ValueObject {
  public:
   LoadOptimizer(FlowGraph* graph,
-                intptr_t max_expr_id,
-                DirectChainedHashMap<LoadKeyValueTrait>* map,
-                const GrowableArray<BitVector*>& kill_by_offset)
+                AliasedSet* aliased_set,
+                DirectChainedHashMap<LoadKeyValueTrait>* map)
       : graph_(graph),
         map_(map),
-        max_expr_id_(max_expr_id),
-        kill_by_offset_(kill_by_offset),
+        aliased_set_(aliased_set),
         in_(graph_->preorder().length()),
         out_(graph_->preorder().length()),
         gen_(graph_->preorder().length()),
@@ -3275,24 +3505,26 @@
         out_values_(graph_->preorder().length()),
         phis_(5),
         worklist_(5),
-        in_worklist_(NULL) {
+        in_worklist_(NULL),
+        forwarded_(false) {
     const intptr_t num_blocks = graph_->preorder().length();
     for (intptr_t i = 0; i < num_blocks; i++) {
-      out_.Add(new BitVector(max_expr_id_));
-      gen_.Add(new BitVector(max_expr_id_));
-      kill_.Add(new BitVector(max_expr_id_));
-      in_.Add(new BitVector(max_expr_id_));
+      out_.Add(new BitVector(aliased_set_->max_expr_id()));
+      gen_.Add(new BitVector(aliased_set_->max_expr_id()));
+      kill_.Add(new BitVector(aliased_set_->max_expr_id()));
+      in_.Add(new BitVector(aliased_set_->max_expr_id()));
 
       exposed_values_.Add(NULL);
       out_values_.Add(NULL);
     }
   }
 
-  void Optimize() {
+  bool Optimize() {
     ComputeInitialSets();
     ComputeOutValues();
     ForwardLoads();
     EmitPhis();
+    return forwarded_;
   }
 
  private:
@@ -3320,16 +3552,16 @@
            instr_it.Advance()) {
         Instruction* instr = instr_it.Current();
 
-        intptr_t offset_in_words = 0;
-        if (IsInterferingStore(instr, &offset_in_words)) {
+        const Alias alias = aliased_set_->ComputeAliasForStore(instr);
+        if (!alias.IsNone()) {
           // Interfering stores kill only loads from the same offset.
-          if ((offset_in_words < kill_by_offset_.length()) &&
-              (kill_by_offset_[offset_in_words] != NULL)) {
-            kill->AddAll(kill_by_offset_[offset_in_words]);
+          if (aliased_set_->Contains(alias)) {
+            BitVector* killed = aliased_set_->Get(alias);
+            kill->AddAll(killed);
             // There is no need to clear out_values when clearing GEN set
             // because only those values that are in the GEN set
             // will ever be used.
-            gen->RemoveAll(kill_by_offset_[offset_in_words]);
+            gen->RemoveAll(killed);
 
             // Only forward stores to normal arrays and float64 arrays
             // to loads because other array stores (intXX/uintXX/float32)
@@ -3338,7 +3570,7 @@
             if (array_store == NULL ||
                 array_store->class_id() == kArrayCid ||
                 array_store->class_id() == kTypedDataFloat64ArrayCid) {
-              Definition* load = map_->Lookup(instr->AsDefinition());
+              Definition* load = map_->Lookup(instr);
               if (load != NULL) {
                 // Store has a corresponding numbered load. Try forwarding
                 // stored value to it.
@@ -3348,7 +3580,7 @@
               }
             }
           }
-          ASSERT(instr->IsDefinition() &&
+          ASSERT(!instr->IsDefinition() ||
                  !IsLoadEliminationCandidate(instr->AsDefinition()));
           continue;
         }
@@ -3383,6 +3615,7 @@
 
           defn->ReplaceUsesWith(replacement);
           instr_it.RemoveCurrentFromGraph();
+          forwarded_ = true;
           continue;
         } else if (!kill->Contains(expr_id)) {
           // This is an exposed load: it is the first representative of a
@@ -3391,7 +3624,8 @@
           if (exposed_values == NULL) {
             static const intptr_t kMaxExposedValuesInitialSize = 5;
             exposed_values = new ZoneGrowableArray<Definition*>(
-                Utils::Minimum(kMaxExposedValuesInitialSize, max_expr_id_));
+                Utils::Minimum(kMaxExposedValuesInitialSize,
+                               aliased_set_->max_expr_id()));
           }
 
           exposed_values->Add(defn);
@@ -3417,7 +3651,7 @@
   // These phis are not inserted at the graph immediately because some of them
   // might become redundant after load forwarding is done.
   void ComputeOutValues() {
-    BitVector* temp = new BitVector(max_expr_id_);
+    BitVector* temp = new BitVector(aliased_set_->max_expr_id());
 
     bool changed = true;
     while (changed) {
@@ -3591,6 +3825,7 @@
           load->ReplaceUsesWith(replacement);
           load->RemoveFromGraph();
           load->SetReplacement(replacement);
+          forwarded_ = true;
         }
       }
     }
@@ -3668,8 +3903,8 @@
 
   ZoneGrowableArray<Definition*>* CreateBlockOutValues() {
     ZoneGrowableArray<Definition*>* out =
-        new ZoneGrowableArray<Definition*>(max_expr_id_);
-    for (intptr_t i = 0; i < max_expr_id_; i++) {
+        new ZoneGrowableArray<Definition*>(aliased_set_->max_expr_id());
+    for (intptr_t i = 0; i < aliased_set_->max_expr_id(); i++) {
       out->Add(NULL);
     }
     return out;
@@ -3677,11 +3912,10 @@
 
   FlowGraph* graph_;
   DirectChainedHashMap<LoadKeyValueTrait>* map_;
-  const intptr_t max_expr_id_;
 
   // Mapping between field offsets in words and expression ids of loads from
   // that offset.
-  const GrowableArray<BitVector*>& kill_by_offset_;
+  AliasedSet* aliased_set_;
 
   // Per block sets of expression ids for loads that are: incoming (available
   // on the entry), outgoing (available on the exit), generated and killed.
@@ -3706,6 +3940,9 @@
   GrowableArray<PhiInstr*> worklist_;
   BitVector* in_worklist_;
 
+  // True if any load was eliminated.
+  bool forwarded_;
+
   DISALLOW_COPY_AND_ASSIGN(LoadOptimizer);
 };
 
@@ -3715,11 +3952,16 @@
   if (FLAG_load_cse) {
     GrowableArray<BitVector*> kill_by_offs(10);
     DirectChainedHashMap<LoadKeyValueTrait> map;
-    const intptr_t max_expr_id =
-        NumberLoadExpressions(graph, &map, &kill_by_offs);
-    if (max_expr_id > 0) {
-      LoadOptimizer load_optimizer(graph, max_expr_id, &map, kill_by_offs);
-      load_optimizer.Optimize();
+    AliasedSet* aliased_set = NumberLoadExpressions(graph, &map);
+    if (!aliased_set->IsEmpty()) {
+      // If any loads were forwarded return true from Optimize to run load
+      // forwarding again. This will allow to forward chains of loads.
+      // This is especially important for context variables as they are built
+      // as loads from loaded context.
+      // TODO(vegorov): renumber newly discovered congruences during the
+      // forwarding to forward chains without running whole pass twice.
+      LoadOptimizer load_optimizer(graph, aliased_set, &map);
+      changed = load_optimizer.Optimize() || changed;
     }
   }
 
@@ -4310,10 +4552,7 @@
       SetValue(instr, object);
       return;
     }
-    if (instr->type_arguments().IsUninstantiatedIdentity() &&
-        !object.IsNull() &&
-        object.IsTypeArguments() &&
-        (TypeArguments::Cast(object).Length() == len)) {
+    if (instr->type_arguments().IsUninstantiatedIdentity()) {
       SetValue(instr, object);
       return;
     }
@@ -4502,6 +4741,27 @@
 }
 
 
+void ConstantPropagator::VisitFloat32x4Constructor(
+    Float32x4ConstructorInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
+void ConstantPropagator::VisitFloat32x4Shuffle(Float32x4ShuffleInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
+void ConstantPropagator::VisitFloat32x4Zero(Float32x4ZeroInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
+void ConstantPropagator::VisitFloat32x4Splat(Float32x4SplatInstr* instr) {
+  SetValue(instr, non_constant_);
+}
+
+
 void ConstantPropagator::VisitMathSqrt(MathSqrtInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsNonConstant(value)) {
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index 80c8e7f..4bc64c3 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -132,6 +132,9 @@
   bool InstanceCallNeedsClassCheck(InstanceCallInstr* call) const;
   bool MethodExtractorNeedsClassCheck(InstanceCallInstr* call) const;
 
+  bool InlineFloat32x4Getter(InstanceCallInstr* call,
+                             MethodRecognizer::Kind getter);
+
   void InlineImplicitInstanceGetter(InstanceCallInstr* call);
   void InlineArrayLengthGetter(InstanceCallInstr* call,
                                intptr_t length_offset,
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index ec1a880..f3f77f8 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -734,11 +734,9 @@
     return false;
   }
 
-  if (value_type->IsMoreSpecificThan(dst_type())) {
-    return UpdateType(*value_type);
-  }
-
-  return false;
+  return UpdateType(value_type->IsMoreSpecificThan(dst_type())
+      ? *value_type
+      : CompileType::FromAbstractType(dst_type()));
 }
 
 
@@ -967,6 +965,32 @@
 }
 
 
+CompileType Float32x4ShuffleInstr::ComputeType() const {
+  if ((op_kind() == MethodRecognizer::kFloat32x4ShuffleX) ||
+      (op_kind() == MethodRecognizer::kFloat32x4ShuffleY) ||
+      (op_kind() == MethodRecognizer::kFloat32x4ShuffleZ) ||
+      (op_kind() == MethodRecognizer::kFloat32x4ShuffleW)) {
+    return CompileType::FromCid(kDoubleCid);
+  }
+  return CompileType::FromCid(kFloat32x4Cid);
+}
+
+
+CompileType Float32x4ConstructorInstr::ComputeType() const {
+  return CompileType::FromCid(kFloat32x4Cid);
+}
+
+
+CompileType Float32x4ZeroInstr::ComputeType() const {
+  return CompileType::FromCid(kFloat32x4Cid);
+}
+
+
+CompileType Float32x4SplatInstr::ComputeType() const {
+  return CompileType::FromCid(kFloat32x4Cid);
+}
+
+
 CompileType MathSqrtInstr::ComputeType() const {
   return CompileType::FromCid(kDoubleCid);
 }
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index 35d6c62..e15c532 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -187,10 +187,6 @@
     }
     marking_stack_->Push(raw_obj);
 
-    // Update the number of used bytes on this page for fast accounting.
-    HeapPage* page = PageSpace::PageFor(raw_obj);
-    page->AddUsed(raw_obj->Size());
-
     // TODO(iposva): Should we mark the classes early?
     MarkObject(raw_class, NULL);
   }
diff --git a/runtime/vm/gc_sweeper.cc b/runtime/vm/gc_sweeper.cc
index d87ea64..439cdd7 100644
--- a/runtime/vm/gc_sweeper.cc
+++ b/runtime/vm/gc_sweeper.cc
@@ -7,7 +7,6 @@
 #include "vm/freelist.h"
 #include "vm/globals.h"
 #include "vm/heap.h"
-#include "vm/heap_trace.h"
 #include "vm/pages.h"
 
 namespace dart {
@@ -15,47 +14,29 @@
 intptr_t GCSweeper::SweepPage(HeapPage* page, FreeList* freelist) {
   // Keep track of the discovered live object sizes to be able to finish
   // sweeping early. Reset the per page in_use count for the next marking phase.
-  intptr_t in_use_swept = 0;
-  intptr_t in_use = page->used();
-  page->set_used(0);
-
-  // Whole page is empty. Do not enter anything into the freelist.
-  if (in_use == 0) {
-    return 0;
-  }
+  intptr_t in_use = 0;
 
   bool is_executable = (page->type() == HeapPage::kExecutable);
-  uword current = page->object_start();
+  uword start = page->object_start();
   uword end = page->object_end();
+  uword current = start;
 
   while (current < end) {
     intptr_t obj_size;
-    if (in_use_swept == in_use && !HeapTrace::is_enabled()) {
-      // No more marked objects will be found on this page.
-      obj_size = end - current;
-      freelist->Free(current, obj_size);
-      break;
-    }
     RawObject* raw_obj = RawObject::FromAddr(current);
     if (raw_obj->IsMarked()) {
       // Found marked object. Clear the mark bit and update swept bytes.
       raw_obj->ClearMarkBit();
       obj_size = raw_obj->Size();
-      in_use_swept += obj_size;
+      in_use += obj_size;
     } else {
       uword free_end = current + raw_obj->Size();
-      if (HeapTrace::is_enabled()) {
-        heap_->trace()->TraceSweep(current);
-      }
       while (free_end < end) {
         RawObject* next_obj = RawObject::FromAddr(free_end);
         if (next_obj->IsMarked()) {
           // Reached the end of the free block.
           break;
         }
-        if (HeapTrace::is_enabled()) {
-          heap_->trace()->TraceSweep(free_end);
-        }
         // Expand the free block by the size of this object.
         free_end += next_obj->Size();
       }
@@ -63,21 +44,22 @@
       if (is_executable) {
         memset(reinterpret_cast<void*>(current), 0xcc, obj_size);
       }
-      freelist->Free(current, obj_size);
+      if ((current != start) || (free_end != end)) {
+        // Only add to the free list if not covering the whole page.
+        freelist->Free(current, obj_size);
+      }
     }
     current += obj_size;
   }
+  ASSERT(current == end);
 
-  return in_use_swept;
+  return in_use;
 }
 
 
 intptr_t GCSweeper::SweepLargePage(HeapPage* page) {
   RawObject* raw_obj = RawObject::FromAddr(page->object_start());
   if (!raw_obj->IsMarked()) {
-    if (HeapTrace::is_enabled()) {
-      heap_->trace()->TraceSweep(page->object_start());
-    }
     // The large object was not marked. Used size is zero, which also tells the
     // calling code that the large object page can be recycled.
     return 0;
diff --git a/runtime/vm/handles_impl.h b/runtime/vm/handles_impl.h
index a856638..95d7515 100644
--- a/runtime/vm/handles_impl.h
+++ b/runtime/vm/handles_impl.h
@@ -6,7 +6,6 @@
 #define VM_HANDLES_IMPL_H_
 
 #include "vm/heap.h"
-#include "vm/heap_trace.h"
 #include "vm/visitor.h"
 
 namespace dart {
@@ -116,10 +115,6 @@
   Handles* handles = isolate->current_zone()->handles();
   ASSERT(handles != NULL);
   uword address = handles->AllocateHandleInZone();
-  if (HeapTrace::is_enabled()) {
-    uword zone_addr = reinterpret_cast<uword>(isolate->current_zone());
-    isolate->heap()->trace()->TraceAllocateZoneHandle(address, zone_addr);
-  }
   return address;
 }
 
@@ -153,13 +148,6 @@
   zone_blocks_ = NULL;
 
   // Delete all the scoped handle blocks.
-  // Do not trace if there is no  current isolate. This can happen during
-  // isolate shutdown.
-  if (HeapTrace::is_enabled() && Isolate::Current() != NULL) {
-    Isolate::Current()->heap()->trace()->TraceDeleteScopedHandles();
-  }
-
-
   scoped_blocks_ = first_scoped_block_.next_block();
   DeleteHandleBlocks(scoped_blocks_);
   first_scoped_block_.ReInit();
diff --git a/runtime/vm/hash_map.h b/runtime/vm/hash_map.h
index 22efc32..fefd788 100644
--- a/runtime/vm/hash_map.h
+++ b/runtime/vm/hash_map.h
@@ -57,9 +57,12 @@
 typename KeyValueTrait::Value
     DirectChainedHashMap<KeyValueTrait>::
         Lookup(typename KeyValueTrait::Key key) const {
+  const typename KeyValueTrait::Value kNoValue =
+      static_cast<typename KeyValueTrait::Value>(0);
+
   uword hash = static_cast<uword>(KeyValueTrait::Hashcode(key));
   uword pos = Bound(hash);
-  if (KeyValueTrait::ValueOf(array_[pos].kv) != NULL) {
+  if (KeyValueTrait::ValueOf(array_[pos].kv) != kNoValue) {
     if (KeyValueTrait::IsKeyEqual(array_[pos].kv, key)) {
       return KeyValueTrait::ValueOf(array_[pos].kv);
     }
@@ -72,7 +75,7 @@
       next = lists_[next].next;
     }
   }
-  return NULL;
+  return kNoValue;
 }
 
 
@@ -95,6 +98,9 @@
 
 template <typename KeyValueTrait>
 void DirectChainedHashMap<KeyValueTrait>::Resize(intptr_t new_size) {
+  const typename KeyValueTrait::Value kNoValue =
+      static_cast<typename KeyValueTrait::Value>(0);
+
   ASSERT(new_size > count_);
   // Hashing the values into the new array has no more collisions than in the
   // old hash map, so we can use the existing lists_ array, if we are careful.
@@ -119,7 +125,7 @@
   if (old_array != NULL) {
     // Iterate over all the elements in lists, rehashing them.
     for (intptr_t i = 0; i < old_size; ++i) {
-      if (KeyValueTrait::ValueOf(old_array[i].kv) != NULL) {
+      if (KeyValueTrait::ValueOf(old_array[i].kv) != kNoValue) {
         intptr_t current = old_array[i].next;
         while (current != kNil) {
           Insert(lists_[current].kv);
@@ -166,14 +172,17 @@
 template <typename KeyValueTrait>
 void DirectChainedHashMap<KeyValueTrait>::
     Insert(typename KeyValueTrait::Pair kv) {
-  ASSERT(KeyValueTrait::ValueOf(kv) != NULL);
+  const typename KeyValueTrait::Value kNoValue =
+      static_cast<typename KeyValueTrait::Value>(0);
+
+  ASSERT(KeyValueTrait::ValueOf(kv) != kNoValue);
   // Resizing when half of the hashtable is filled up.
   if (count_ >= array_size_ >> 1) Resize(array_size_ << 1);
   ASSERT(count_ < array_size_);
   count_++;
   uword pos = Bound(
       static_cast<uword>(KeyValueTrait::Hashcode(KeyValueTrait::KeyOf(kv))));
-  if (KeyValueTrait::ValueOf(array_[pos].kv) == NULL) {
+  if (KeyValueTrait::ValueOf(array_[pos].kv) == kNoValue) {
     array_[pos].kv = kv;
     array_[pos].next = kNil;
   } else {
@@ -186,7 +195,7 @@
     lists_[new_element_pos].kv = kv;
     lists_[new_element_pos].next = array_[pos].next;
     ASSERT(array_[pos].next == kNil ||
-           KeyValueTrait::ValueOf(lists_[array_[pos].next].kv) != NULL);
+           KeyValueTrait::ValueOf(lists_[array_[pos].next].kv) != kNoValue);
     array_[pos].next = new_element_pos;
   }
 }
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 0809917..d36c847 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -8,7 +8,6 @@
 #include "platform/utils.h"
 #include "vm/flags.h"
 #include "vm/heap_profiler.h"
-#include "vm/heap_trace.h"
 #include "vm/isolate.h"
 #include "vm/object.h"
 #include "vm/object_set.h"
@@ -41,7 +40,6 @@
                              kNewObjectAlignmentOffset);
   old_space_ = new PageSpace(this, (FLAG_old_gen_heap_size * MB));
   stats_.num_ = 0;
-  heap_trace_ = new HeapTrace;
 }
 
 
@@ -61,9 +59,6 @@
       return AllocateOld(size, HeapPage::kData);
     }
   }
-  if (HeapTrace::is_enabled()) {
-    heap_trace_->TraceAllocation(addr, size);
-  }
   return addr;
 }
 
@@ -80,9 +75,6 @@
       return 0;
     }
   }
-  if (HeapTrace::is_enabled()) {
-    heap_trace_->TraceAllocation(addr, size);
-  }
   return addr;
 }
 
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index ab0f5db..b85d262 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -15,7 +15,6 @@
 namespace dart {
 
 // Forward declarations.
-class HeapTrace;
 class Isolate;
 class ObjectPointerVisitor;
 class ObjectSet;
@@ -59,7 +58,7 @@
     switch (space) {
       case kNew:
         // Do not attempt to allocate very large objects in new space.
-        if (!PageSpace::IsPageAllocatableSize(size)) {
+        if (!IsAllocatableInNewSpace(size)) {
           return AllocateOld(size, HeapPage::kData);
         }
         return AllocateNew(size);
@@ -151,10 +150,6 @@
   // Verify that all pointers in the heap point to the heap.
   bool Verify() const;
 
-  // Accessor function to get the HeapTrace used for tracing.  There
-  // should only ever be one of these per isolate
-  HeapTrace* trace() const { return heap_trace_; }
-
   // Print heap sizes.
   void PrintSizes() const;
 
@@ -197,6 +192,10 @@
 
   bool gc_in_progress() const { return gc_in_progress_; }
 
+  static bool IsAllocatableInNewSpace(intptr_t size) {
+    return size <= kNewAllocatableSize;
+  }
+
  private:
   class GCStats : public ValueObject {
    public:
@@ -229,6 +228,8 @@
     DISALLOW_COPY_AND_ASSIGN(GCStats);
   };
 
+  static const intptr_t kNewAllocatableSize = 256 * KB;
+
   Heap();
 
   uword AllocateNew(intptr_t size);
@@ -246,9 +247,6 @@
   // GC stats collection.
   GCStats stats_;
 
-  // The active heap trace.
-  HeapTrace* heap_trace_;
-
   // This heap is in read-only mode: No allocation is allowed.
   bool read_only_;
 
diff --git a/runtime/vm/heap_test.cc b/runtime/vm/heap_test.cc
index 0a487e5..54d0cd7 100644
--- a/runtime/vm/heap_test.cc
+++ b/runtime/vm/heap_test.cc
@@ -9,8 +9,6 @@
 
 namespace dart {
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
 TEST_CASE(OldGC) {
   const char* kScriptChars =
   "main() {\n"
@@ -48,6 +46,4 @@
   Dart_ExitScope();
   heap->CollectGarbage(Heap::kOld);
 }
-
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
 }
diff --git a/runtime/vm/heap_trace.cc b/runtime/vm/heap_trace.cc
deleted file mode 100644
index 56282c2..0000000
--- a/runtime/vm/heap_trace.cc
+++ /dev/null
@@ -1,488 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#include "vm/heap_trace.h"
-
-#include "include/dart_api.h"
-#include "vm/dart_api_state.h"
-#include "vm/debugger.h"
-#include "vm/isolate.h"
-#include "vm/object.h"
-#include "vm/object_set.h"
-#include "vm/object_store.h"
-#include "vm/os.h"
-#include "vm/stack_frame.h"
-#include "vm/unicode.h"
-
-namespace dart {
-
-DEFINE_FLAG(bool, heap_trace, false, "Enable heap tracing.");
-
-Dart_FileOpenCallback HeapTrace::open_callback_ = NULL;
-Dart_FileWriteCallback HeapTrace::write_callback_ = NULL;
-Dart_FileCloseCallback HeapTrace::close_callback_ = NULL;
-bool HeapTrace::is_enabled_ = false;
-
-class HeapTraceVisitor : public ObjectPointerVisitor {
- public:
-  HeapTraceVisitor(Isolate* isolate,
-                   HeapTrace* heap_trace,
-                   ObjectSet* object_set)
-      : ObjectPointerVisitor(isolate),
-        heap_trace_(heap_trace),
-        vm_isolate_(Dart::vm_isolate()),
-        object_set_(object_set) {
-  }
-
-  void VisitPointers(RawObject** first, RawObject** last) {
-    for (RawObject** current = first; current <= last; current++) {
-      RawObject* raw_obj = *current;
-
-      // We only care about objects in the heap
-      // Also, since this visitor will frequently be encountering redudant
-      // roots, we use an object_set to skip the duplicates.
-      if (raw_obj->IsHeapObject() &&
-          raw_obj != reinterpret_cast<RawObject*>(0x1) &&
-          raw_obj != reinterpret_cast<RawObject*>(0xabababab) &&
-          !object_set_->Contains(raw_obj) &&
-          !vm_isolate_->heap()->Contains(RawObject::ToAddr(raw_obj))) {
-        object_set_->Add(raw_obj);
-        uword addr = RawObject::ToAddr(raw_obj);
-        heap_trace_->TraceSingleRoot(addr);
-      }
-    }
-  }
-
- private:
-  HeapTrace* heap_trace_;
-  Isolate* vm_isolate_;
-  // TODO(cshapiro): replace with a sparse data structure.
-  ObjectSet* object_set_;
-  DISALLOW_COPY_AND_ASSIGN(HeapTraceVisitor);
-};
-
-
-class HeapTraceScopedHandleVisitor : public ObjectPointerVisitor {
- public:
-  HeapTraceScopedHandleVisitor(Isolate* isolate, HeapTrace* heap_trace)
-       : ObjectPointerVisitor(isolate), heap_trace_(heap_trace) {
-  }
-
-  void VisitPointers(RawObject**  first, RawObject** last) {
-    for (RawObject** current = first; current <= last; current++) {
-      RawObject* raw_obj = *current;
-      Heap* heap = isolate()->heap();
-
-      // We only care about objects in the heap
-      if (raw_obj->IsHeapObject() &&
-          raw_obj != reinterpret_cast<RawObject*>(0x1) &&
-          raw_obj != reinterpret_cast<RawObject*>(0xabababab) &&
-          heap->Contains(RawObject::ToAddr(raw_obj))) {
-        uword addr = RawObject::ToAddr(raw_obj);
-        heap_trace_->TraceScopedHandle(addr);
-     }
-    }
-  }
-
- private:
-  HeapTrace* heap_trace_;
-  DISALLOW_COPY_AND_ASSIGN(HeapTraceScopedHandleVisitor);
-};
-
-
-class HeapTraceObjectStoreVisitor : public ObjectPointerVisitor {
- public:
-  HeapTraceObjectStoreVisitor(Isolate* isolate, HeapTrace* heap_trace)
-        : ObjectPointerVisitor(isolate), heap_trace_(heap_trace) {
-  }
-
-  void VisitPointers(RawObject** first, RawObject** last) {
-    for (RawObject** current = first; current <= last; current++) {
-      RawObject* raw_obj = *current;
-
-      // We only care about obects in the heap.
-      if (raw_obj->IsHeapObject() &&
-          raw_obj != reinterpret_cast<RawObject*>(0x1) &&
-          raw_obj != reinterpret_cast<RawObject*>(0xabababab)) {
-        uword addr = RawObject::ToAddr(raw_obj);
-        heap_trace_->TraceObjectStorePointer(addr);
-      }
-    }
-  }
-
- private:
-  HeapTrace* heap_trace_;
-  DISALLOW_COPY_AND_ASSIGN(HeapTraceObjectStoreVisitor);
-};
-
-
-class HeapTraceInitialHeapVisitor : public ObjectVisitor {
- public:
-  HeapTraceInitialHeapVisitor(Isolate* isolate, HeapTrace* heap_trace)
-    : ObjectVisitor(isolate), heap_trace_(heap_trace) {}
-
-  void VisitObject(RawObject* raw_obj) {
-    heap_trace_->TraceSnapshotAlloc(raw_obj, raw_obj->Size());
-  }
-
- private:
-  HeapTrace* heap_trace_;
-  DISALLOW_COPY_AND_ASSIGN(HeapTraceInitialHeapVisitor);
-};
-
-
-HeapTrace::HeapTrace() : isolate_initialized_(false), output_stream_(NULL) {
-}
-
-
-HeapTrace::~HeapTrace() {
-  if (isolate_initialized_) {
-    (*close_callback_)(output_stream_);
-  }
-}
-
-
-void HeapTrace::InitOnce(Dart_FileOpenCallback open_callback,
-                         Dart_FileWriteCallback write_callback,
-                         Dart_FileCloseCallback close_callback) {
-  ASSERT(open_callback != NULL);
-  ASSERT(write_callback != NULL);
-  ASSERT(close_callback != NULL);
-  HeapTrace::open_callback_ = open_callback;
-  HeapTrace::write_callback_ = write_callback;
-  HeapTrace::close_callback_ = close_callback;
-  HeapTrace::is_enabled_ = true;
-}
-
-
-ObjectSet* HeapTrace::CreateEmptyObjectSet() const {
-  Isolate* isolate = Isolate::Current();
-  uword start, end;
-  isolate->heap()->StartEndAddress(&start, &end);
-
-  Isolate* vm_isolate = Dart::vm_isolate();
-  uword vm_start, vm_end;
-  vm_isolate->heap()->StartEndAddress(&vm_start, &vm_end);
-
-  ObjectSet* allocated_set = new ObjectSet(Utils::Minimum(start, vm_start),
-                                           Utils::Maximum(end, vm_end));
-
-  return allocated_set;
-}
-
-
-void HeapTrace::ResizeObjectSet() {
-  Isolate* isolate = Isolate::Current();
-  uword start, end;
-  isolate->heap()->StartEndAddress(&start, &end);
-  Isolate* vm_isolate = Dart::vm_isolate();
-  uword vm_start, vm_end;
-  vm_isolate->heap()->StartEndAddress(&vm_start, &vm_end);
-  object_set_.Resize(Utils::Minimum(start, vm_start),
-                     Utils::Maximum(end, vm_end));
-}
-
-
-void HeapTrace::Init(Isolate* isolate) {
-  // Do not trace the VM isolate
-  if (isolate == Dart::vm_isolate()) {
-    return;
-  }
-  ASSERT(isolate_initialized_ == false);
-  const char* format = "%s.htrace";
-  intptr_t len = OS::SNPrint(NULL, 0, format, isolate->name());
-  char* filename = new char[len + 1];
-  OS::SNPrint(filename, len + 1, format, isolate->name());
-  output_stream_ = (*open_callback_)(filename);
-  ASSERT(output_stream_ != NULL);
-  delete[] filename;
-  isolate_initialized_ = true;
-
-  HeapTraceObjectStoreVisitor object_store_visitor(isolate, this);
-  isolate->object_store()->VisitObjectPointers(&object_store_visitor);
-
-  // Visit any objects that may have been allocated during startup,
-  // before we started tracing.
-  HeapTraceInitialHeapVisitor heap_visitor(isolate, this);
-  isolate->heap()->IterateObjects(&heap_visitor);
-  TraceRoots(isolate);
-}
-
-
-// Allocation Record - 'A' (0x41)
-//
-// Format:
-// 'A'
-//  uword - address of allocated object
-//  uword - size of allocated object
-void HeapTrace::TraceAllocation(uword addr, intptr_t size) {
-  if (isolate_initialized_) {
-    {
-      AllocationRecord rec(this);
-      rec.Write(addr);
-      rec.Write(size);
-    }
-    TraceRoots(Isolate::Current());
-  }
-}
-
-
-// Snapshot Allocation Record - 'B' (0x41)
-//
-// Format:
-// 'B'
-//  uword - address of allocated object
-//  uword - size of allocated object
-void HeapTrace::TraceSnapshotAlloc(RawObject* obj, intptr_t size) {
-  if (isolate_initialized_) {
-    SnapshotAllocationRecord rec(this);
-    rec.Write(RawObject::ToAddr(obj));
-    rec.Write(static_cast<uword>(size));
-  }
-}
-
-
-// Allocate Zone Handle Record - 'Z' (0x5a)
-//
-// Format:
-//  'Z'
-//  uword - handle address (where the handle is pointing)
-//  uword - zone address (address of the zone the handle is in)
-void HeapTrace::TraceAllocateZoneHandle(uword handle, uword zone_addr) {
-  if (isolate_initialized_) {
-    AllocZoneHandleRecord rec(this);
-    rec.Write(handle);
-    rec.Write(zone_addr);
-  }
-}
-
-
-// Delete Zone Record - 'z' (0x7a)
-//
-// Format:
-//  'z'
-//  uword - zone address (all the handles in that zone are now gone)
-void HeapTrace::TraceDeleteZone(Zone* zone) {
-  if (isolate_initialized_) {
-    DeleteZoneRecord rec(this);
-    rec.Write(reinterpret_cast<uword>(zone));
-  }
-}
-
-
-// Delete Scoped Hanldes Record - 's' (0x73)
-//
-// Format:
-//  's'
-void HeapTrace::TraceDeleteScopedHandles() {
-  if (isolate_initialized_) {
-    DeleteScopedHandlesRecord rec(this);
-  }
-}
-
-
-//  Copy Record - 'C' (0x43)
-//
-//  Format:
-//   'C'
-//   uword - old address
-//   uword - new address
-void HeapTrace::TraceCopy(uword from_addr, uword to_addr) {
-    if (isolate_initialized_) {
-      CopyRecord rec(this);
-      rec.Write(from_addr);
-      rec.Write(to_addr);
-  }
-}
-
-
-// Object Store Recorda - 'O'(0x4f)
-//
-// Format:
-//  'O'
-//  uword - address
-void HeapTrace::TraceObjectStorePointer(uword addr) {
-  if (isolate_initialized_) {
-    ObjectStoreRecord rec(this);
-    rec.Write(addr);
-  }
-}
-
-
-// Promotion Records - 'P' (0x50)
-//
-// Format:
-//  'P'
-//  uword - old address
-//  uword - new address
-void HeapTrace::TracePromotion(uword old_addr, uword promoted_addr) {
-  if (isolate_initialized_) {
-    PromotionRecord rec(this);
-    rec.Write(old_addr);
-    rec.Write(promoted_addr);
-  }
-}
-
-
-// Death Range Record - 'L' (0x4c)
-//
-// Format:
-//  'L'
-//  uword - inclusive start address of the space being left
-//  uword - exclusive end address of the space being left
-void HeapTrace::TraceDeathRange(uword inclusive_start, uword exclusive_end) {
-  if (isolate_initialized_) {
-    DeathRangeRecord rec(this);
-    rec.Write(inclusive_start);
-    rec.Write(exclusive_end);
-  }
-}
-
-
-// Register Class Record - 'K' (0x4b)
-//
-// Format:
-//  'K'
-//  uword - address ( the address of the class)
-void HeapTrace::TraceRegisterClass(const Class& cls) {
-  if (isolate_initialized_) {
-    RegisterClassRecord rec(this);
-    rec.Write(RawObject::ToAddr(cls.raw()));
-  }
-}
-
-
-// Scoped Handle Record - 'H' (0x48)
-//
-// Format:
-//  'H'
-//  uword - adress of the scoped handle (where it is pointing)
-void HeapTrace::TraceScopedHandle(uword handle) {
-  if (isolate_initialized_) {
-    AllocScopedHandleRecord rec(this);
-    rec.Write(handle);
-  }
-}
-
-
-// Root Record - 'R' (0x52)
-//
-// Format:
-// 'R'
-// uword - address
-void HeapTrace::TraceSingleRoot(uword root_addr) {
-  if (isolate_initialized_) {
-    RootRecord rec(this);
-    rec.Write(root_addr);
-  }
-}
-
-
-// Sweep Record - 'S'
-//
-// Format:
-// 'S'
-// uword - address
-void HeapTrace::TraceSweep(uword sweept_addr) {
-  if (isolate_initialized_) {
-    SweepRecord rec(this);
-    rec.Write(sweept_addr);
-  }
-}
-
-
-// Does not output any records directly,
-// but does call TraceSingleRoot
-void HeapTrace::TraceRoots(Isolate* isolate) {
-  if (isolate_initialized_) {
-    ResizeObjectSet();
-    HeapTraceVisitor visitor(isolate, this, &object_set_);
-    HeapTraceScopedHandleVisitor handle_visitor(isolate, this);
-
-    bool visit_prologue_weak_handles = true;
-    bool validate_frames = false;
-
-    // Visit objects in per isolate stubs.
-    StubCode::VisitObjectPointers(&visitor);
-
-    // stack
-    StackFrameIterator frames_iterator(validate_frames);
-    StackFrame* frame = frames_iterator.NextFrame();
-    while (frame != NULL) {
-      frame->VisitObjectPointers(&visitor);
-      frame = frames_iterator.NextFrame();
-    }
-
-    if (isolate->api_state() != NULL) {
-      isolate->api_state()->VisitObjectPointers(&visitor,
-                                                visit_prologue_weak_handles);
-    }
-
-    // Visit the top context which is stored in the isolate.
-    RawContext* top_context = isolate->top_context();
-    visitor.VisitPointer(reinterpret_cast<RawObject**>(&top_context));
-
-    // Visit the currently active IC data array.
-    RawArray* ic_data_array = isolate->ic_data_array();
-    visitor.VisitPointer(reinterpret_cast<RawObject**>(&ic_data_array));
-
-    // Visit objects in the debugger.
-    isolate->debugger()->VisitObjectPointers(&visitor);
-
-    isolate->current_zone()->handles()->
-        VisitUnvisitedScopedHandles(&handle_visitor);
-
-    object_set_.FastClear();
-  }
-}
-
-
-// Store Record - 'U' (0x55)
-//
-// Format:
-//  'U'
-//  uword - originating object address (where a pointer is being stored)
-//  uword - byte offset into origin where the pointer is being stored
-//  uword - value of the pointer being stored
-void HeapTrace::TraceStoreIntoObject(uword object,
-                                     uword field_addr,
-                                     uword value) {
-  if (isolate_initialized_) {
-    // We don't care about pointers into the VM_Islate heap, so skip them.
-    // There should not be any pointers /out/ of the VM isolate; so we
-    // do not check object.
-    if (Isolate::Current()->heap()->Contains(value)) {
-      StoreRecord rec(this);
-      uword slot_offset =  field_addr - object;
-
-      rec.Write(object);
-      rec.Write(slot_offset);
-      rec.Write(value);
-    }
-  }
-}
-
-
-// Mark Sweep Start Record - '{' (0x7b)
-//
-// Format:
-//  '{'
-void HeapTrace::TraceMarkSweepStart() {
-  if (isolate_initialized_) {
-    MarkSweepStartRecord rec(this);
-  }
-}
-
-
-// Mark Sweep Finish Record - '}' (0x7d)
-//
-// Format:
-//  '}'
-void HeapTrace::TraceMarkSweepFinish() {
-  if (isolate_initialized_) {
-    MarkSweepFinishRecord rec(this);
-  }
-}
-
-}  // namespace dart
diff --git a/runtime/vm/heap_trace.h b/runtime/vm/heap_trace.h
deleted file mode 100644
index 983f7df..0000000
--- a/runtime/vm/heap_trace.h
+++ /dev/null
@@ -1,213 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#ifndef VM_HEAP_TRACE_H_
-#define VM_HEAP_TRACE_H_
-
-#include "include/dart_api.h"
-#include "vm/globals.h"
-#include "vm/object_set.h"
-
-namespace dart {
-
-// Forward declarations.
-class HeapTraceVisitor;
-class Isolate;
-class RawClass;
-class RawObject;
-class RawString;
-class BaseZone;
-
-class HeapTrace {
- public:
-  enum RecordSize {
-    kRootSize = 5,
-    kAllocSize = 9,
-    kSnapshotAllocSize = 9,
-    kCopySize = 9,
-    kStoreSize = 13,
-    kSweepSize = 5,
-    kDeathRangeSize = 9,
-    kPromotionSize = 9,
-    kAllocZoneHandleSize = 9,
-    kDeleteZoneSize = 5,
-    kRegisterClassSize = 5,
-    kAllocScopedHandleSize = 5,
-    kDeleteScopedHandlesSize = 1,
-    kMarkSweepStartSize = 1,
-    kMarkSweepFinishSize = 1,
-    kObjectStoreSize = 5
-  };
-
-  enum RecordType {
-    kRootType = 'R',
-    kAllocType = 'A',
-    kSnapshotAllocType = 'B',
-    kCopyType = 'C',
-    kStoreType = 'U',
-    kSweepType = 'S',
-    kDeathRangeType = 'L',
-    kPromotionType = 'P',
-    kAllocZoneHandleType = 'Z',
-    kDeleteZoneType = 'z',
-    kRegisterClassType = 'K',
-    kAllocScopedHandleType = 'H',
-    kDeleteScopedHandlesType = 'h',
-    kMarkSweepStartType = '{',
-    kMarkSweepFinishType = '}',
-    kObjectStoreType = 'O'
-  };
-
-  template <RecordType T, RecordSize N>
-  class Record {
-   public:
-    explicit Record(HeapTrace* trace): cursor_(0), trace_(trace) {
-      ASSERT(N >= 1);
-      buffer_[0] = T;
-      ++cursor_;
-    }
-    ~Record() {
-      (*trace_->write_callback_)(Buffer(), Length(), trace_->output_stream_);
-    }
-
-    void Write(uword word) {
-      ASSERT(cursor_ + sizeof(word) <= N);
-      memmove(&buffer_[cursor_], &word, sizeof(word));
-      cursor_ += sizeof(word);
-    }
-
-    intptr_t Length() const { return cursor_; }
-
-    const uint8_t* Buffer() const {
-      ASSERT(cursor_ == N);
-      return buffer_;
-    }
-
-   private:
-    uint8_t buffer_[N];
-    intptr_t cursor_;
-    HeapTrace* trace_;
-    DISALLOW_COPY_AND_ASSIGN(Record);
-  };
-
-  typedef Record<kRootType, kRootSize> RootRecord;
-  typedef Record<kAllocType, kAllocSize> AllocationRecord;
-  typedef Record<kSnapshotAllocType, kSnapshotAllocSize>
-  SnapshotAllocationRecord;
-  typedef Record<kCopyType, kCopySize> CopyRecord;
-  typedef Record<kStoreType, kStoreSize> StoreRecord;
-  typedef Record<kSweepType, kSweepSize> SweepRecord;
-  typedef Record<kDeathRangeType, kDeathRangeSize> DeathRangeRecord;
-  typedef Record<kPromotionType, kPromotionSize> PromotionRecord;
-  typedef Record<kAllocZoneHandleType, kAllocZoneHandleSize>
-  AllocZoneHandleRecord;
-  typedef Record<kDeleteZoneType, kDeleteZoneSize>
-  DeleteZoneRecord;
-  typedef Record<kRegisterClassType, kRegisterClassSize> RegisterClassRecord;
-  typedef Record<kAllocScopedHandleType, kAllocScopedHandleSize>
-  AllocScopedHandleRecord;
-  typedef Record<kDeleteScopedHandlesType, kDeleteScopedHandlesSize>
-  DeleteScopedHandlesRecord;
-  typedef Record<kMarkSweepStartType, kMarkSweepStartSize> MarkSweepStartRecord;
-  typedef Record<kMarkSweepFinishType, kMarkSweepFinishSize>
-  MarkSweepFinishRecord;
-  typedef Record<kObjectStoreType, kObjectStoreSize> ObjectStoreRecord;
-
-  HeapTrace();
-  ~HeapTrace();
-
-  // Called by the isolate just before EnableGrowthControl.  Indicates
-  // the Isolate is initialized and enables tracing.
-  void Init(Isolate* isolate);
-
-  // Called when an object is allocated in the heap.
-  void TraceAllocation(uword addr, intptr_t size);
-
-  // Invoked after the snapshot is loaded at Isolate startup time.
-  void TraceSnapshotAlloc(RawObject* obj, intptr_t size);
-
-  // Rename to something like TraceAllocateZoneHandle (or whatever)
-  void TraceAllocateZoneHandle(uword handle, uword zone_addr);
-
-  // Invoked when a Zone block is deleted.
-  void TraceDeleteZone(Zone* zone);
-
-  // Invoked whenever the scoped handles are delelted.
-  void TraceDeleteScopedHandles();
-
-  // Invoked when objects are coped from the from space to the to space
-  // by the scavenger.
-  void TraceCopy(uword from_addr, uword to_addr);
-
-  // Invoked on each pointer in the object store.
-  void TraceObjectStorePointer(uword addr);
-
-  // Invoked when an object is promoted from the new space to the old space.
-  void TracePromotion(uword old_addr, uword promoted_addr);
-
-  // Invoked after a scavenge with the addressed range of from-space
-  void TraceDeathRange(uword inclusive_start, uword exclusive_end);
-
-  // Invoked whenever a class is registered in the class table.
-  void TraceRegisterClass(const Class& cls);
-
-  // Invoked when an address is swept.
-  void TraceSweep(uword sweept_addr);
-
-  // Invoked when storing value into origin, and value is an object.
-  void TraceStoreIntoObject(uword origin_object_addr,
-                            uword slot_addr,
-                            uword value);
-
-  // Invoked when starting a mark-sweep collection on old space
-  void TraceMarkSweepStart();
-
-  // Invoked after finishing a mark sweep collection on old space.
-  void TraceMarkSweepFinish();
-
-  // Initialize tracing globablly across the VM. Invidual isolates
-  // will still have to initialized themselves when they are started.
-  static void InitOnce(Dart_FileOpenCallback open_callback,
-                       Dart_FileWriteCallback write_callback,
-                       Dart_FileCloseCallback close_callback);
-
-  // Returns true if tracign is enabled for the VM.
-  static bool is_enabled() { return is_enabled_; }
-
- private:
-  ObjectSet* CreateEmptyObjectSet() const;
-  void ResizeObjectSet();
-
-  void TraceScopedHandle(uword handle);
-
-  // A helper for PutRoots, called by HeapTraceVisitor.
-  void TraceSingleRoot(uword root);
-
-  // Invoked while tracing an allocation.
-  void TraceRoots(Isolate* isolate);
-
-  // Is the isolate we are tracing initialized?
-  bool isolate_initialized_;
-
-  void* output_stream_;
-
-  ObjectSet object_set_;
-
-  static Dart_FileOpenCallback open_callback_;
-  static Dart_FileWriteCallback write_callback_;
-  static Dart_FileCloseCallback close_callback_;
-
-  static bool is_enabled_;
-
-  friend class HeapTraceVisitor;
-  friend class HeapTraceScopedHandleVisitor;
-  friend class HeapTraceObjectStoreVisitor;
-  friend class HeapTraceDebugObjectVisitor;
-
-  DISALLOW_COPY_AND_ASSIGN(HeapTrace);
-};
-
-}  // namespace dart
-
-#endif  // VM_HEAP_TRACE_H_
diff --git a/runtime/vm/heap_trace_test.cc b/runtime/vm/heap_trace_test.cc
deleted file mode 100644
index eb0ca6b..0000000
--- a/runtime/vm/heap_trace_test.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include "vm/dart_api_impl.h"
-#include "vm/growable_array.h"
-#include "vm/heap.h"
-#include "vm/heap_trace.h"
-#include "vm/unit_test.h"
-
-namespace dart {
-
-// only ia32 can run heap trace tests.
-#if defined(TARGET_ARCH_IA32)
-static std::stringstream* global_stream;
-
-static void* OpenTraceFile(const char* name) {
-  ASSERT(global_stream == NULL);
-  global_stream = new std::stringstream;
-  return reinterpret_cast<void*>(global_stream);
-}
-
-
-static void WriteToTraceFile(const void* data, intptr_t length, void* stream) {
-  ASSERT(stream == global_stream);
-  std::stringstream* sstream = reinterpret_cast<std::stringstream*>(stream);
-  sstream->write(reinterpret_cast<const char*>(data), length);
-}
-
-
-static void CloseTraceFile(void *stream) {
-  ASSERT(stream == global_stream);
-  global_stream = NULL;
-  delete reinterpret_cast<std::stringstream*>(stream);
-}
-
-
-bool DoesAllocationRecordExist(uword addr, const std::string& trace_string) {
-  const char* raw_trace = trace_string.c_str();
-  for (size_t i = 0; i < trace_string.length(); ++i) {
-    if ((raw_trace[i] == 'A') && (i + 4 < trace_string.length())) {
-      const uword candidate_address =
-          *(reinterpret_cast<const uword*>(raw_trace + i + 1));
-      if (candidate_address == addr) {
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-
-bool DoesSweepRecordExist(uword addr, const std::string& trace_string) {
-  const char* raw_trace = trace_string.c_str();
-  for (size_t i = 0; i < trace_string.length(); ++i) {
-    if ((raw_trace[i] == 'S') && (i + 4 < trace_string.length())) {
-      const uword candidate_address =
-          *(reinterpret_cast<const uword*>(raw_trace + i + 1));
-      if (candidate_address == addr) {
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-
-TEST_CASE(GCTraceAllocate) {
-  HeapTrace::InitOnce(OpenTraceFile,
-                      WriteToTraceFile,
-                      CloseTraceFile);
-
-  Isolate* isolate = Isolate::Current();
-  isolate->heap()->trace()->Init(isolate);
-
-  const int kArrayLen = 5;
-  RawArray* raw_arr = Array::New(kArrayLen);
-  uword addr = RawObject::ToAddr(raw_arr);
-
-  ASSERT(DoesAllocationRecordExist(addr, global_stream->str()));
-}
-
-
-TEST_CASE(GCTraceSweep) {
-  HeapTrace::InitOnce(OpenTraceFile,
-                      WriteToTraceFile,
-                      CloseTraceFile);
-
-  Isolate* isolate = Isolate::Current();
-  isolate->heap()->trace()->Init(isolate);
-
-  const int kArrayLen = 5;
-  RawArray* raw_arr = Array::New(kArrayLen, Heap::kOld);
-  uword addr = RawObject::ToAddr(raw_arr);
-
-  Isolate::Current()->heap()->CollectGarbage(Heap::kOld);
-  DoesSweepRecordExist(addr, global_stream->str());
-}
-#endif
-
-}  // namespace dart
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index ce75a13..c0dffcc 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -603,6 +603,37 @@
 }
 
 
+void Float32x4ShuffleInstr::PrintOperandsTo(BufferFormatter* f) const {
+  // TODO(johnmccutchan): Add proper string enumeration of shuffle.
+  f->Print("SHUFFLE ");
+  value()->PrintTo(f);
+}
+
+
+void Float32x4ZeroInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("ZERO ");
+}
+
+
+void Float32x4SplatInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("SPLAT ");
+  value()->PrintTo(f);
+}
+
+
+void Float32x4ConstructorInstr::PrintOperandsTo(BufferFormatter* f) const {
+  f->Print("Float32x4(");
+  value0()->PrintTo(f);
+  f->Print(", ");
+  value1()->PrintTo(f);
+  f->Print(", ");
+  value2()->PrintTo(f);
+  f->Print(", ");
+  value3()->PrintTo(f);
+  f->Print(")");
+}
+
+
 void BinaryMintOpInstr::PrintOperandsTo(BufferFormatter* f) const {
   f->Print("%s, ", Token::Str(op_kind()));
   left()->PrintTo(f);
diff --git a/runtime/vm/instructions_mips.cc b/runtime/vm/instructions_mips.cc
index 69e99c2..41648b1 100644
--- a/runtime/vm/instructions_mips.cc
+++ b/runtime/vm/instructions_mips.cc
@@ -73,7 +73,7 @@
   instr = Instr::At(reinterpret_cast<uword>(&i));
   ASSERT(instr->OpcodeField() == LUI);
   ASSERT(instr->RtField() == *reg);
-  imm |= instr->UImmField();
+  imm |= (instr->UImmField() << 16);
   *value = imm;
   return end;
 }
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 55de520..ea389c7 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1166,6 +1166,7 @@
     case kTypedDataUint64ArrayCid:
     case kTypedDataFloat32ArrayCid:
     case kTypedDataFloat64ArrayCid:
+    case kTypedDataFloat32x4ArrayCid:
       return true;
     default:
       return false;
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 05b0a21..c8110bb 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -37,25 +37,25 @@
 #define RECOGNIZED_LIST(V)                                                     \
   V(_ObjectArray, get:length, ObjectArrayLength, 405297088)                    \
   V(_ImmutableArray, get:length, ImmutableArrayLength, 433698233)              \
-  V(_TypedList, get:length, TypedDataLength, 231908172)                        \
-  V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 380843687)                     \
-  V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 380843687)                   \
-  V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 380843687)                   \
-  V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 380843687)                 \
-  V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 380843687)                   \
-  V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 380843687)                 \
-  V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 979971573)               \
-  V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 979971573)               \
-  V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 690339584)           \
-  V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 287047804)                     \
-  V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 287047804)                   \
-  V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 287047804)                   \
-  V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 287047804)                 \
-  V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 287047804)                   \
-  V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 287047804)                 \
-  V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 1032541114)              \
-  V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 1032541114)              \
-  V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 1016704782)          \
+  V(_TypedList, get:length, TypedDataLength, 1004567191)                       \
+  V(_TypedList, _getInt8, ByteArrayBaseGetInt8, 728842615)                     \
+  V(_TypedList, _getUint8, ByteArrayBaseGetUint8, 728842615)                   \
+  V(_TypedList, _getInt16, ByteArrayBaseGetInt16, 728842615)                   \
+  V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 728842615)                 \
+  V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 728842615)                   \
+  V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 728842615)                 \
+  V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 1067360925)              \
+  V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 1067360925)              \
+  V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 279982060)           \
+  V(_TypedList, _setInt8, ByteArrayBaseSetInt8, 427754869)                     \
+  V(_TypedList, _setUint8, ByteArrayBaseSetUint8, 427754869)                   \
+  V(_TypedList, _setInt16, ByteArrayBaseSetInt16, 427754869)                   \
+  V(_TypedList, _setUint16, ByteArrayBaseSetUint16, 427754869)                 \
+  V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 427754869)                   \
+  V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 427754869)                 \
+  V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 637235443)               \
+  V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 637235443)               \
+  V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 780994886)           \
   V(_GrowableObjectArray, get:length, GrowableArrayLength, 725548050)          \
   V(_GrowableObjectArray, get:_capacity, GrowableArrayCapacity, 725548050)     \
   V(_StringBase, get:length, StringBaseLength, 320803993)                      \
@@ -71,6 +71,17 @@
   V(_Double, pow, DoublePow, 631903778)                                        \
   V(_Double, _modulo, DoubleMod, 437099337)                                    \
   V(::, sqrt, MathSqrt, 1662640002)                                            \
+  V(Float32x4, Float32x4., Float32x4Constructor, 1327837070)                   \
+  V(Float32x4, Float32x4.zero, Float32x4Zero, 927169529)                       \
+  V(Float32x4, Float32x4.splat, Float32x4Splat, 1778587275)                    \
+  V(_Float32x4, get:xxxx, Float32x4ShuffleXXXX, 42621627)                      \
+  V(_Float32x4, get:yyyy, Float32x4ShuffleYYYY, 42621627)                      \
+  V(_Float32x4, get:zzzz, Float32x4ShuffleZZZZ, 42621627)                      \
+  V(_Float32x4, get:wwww, Float32x4ShuffleWWWW, 42621627)                      \
+  V(_Float32x4, get:x, Float32x4ShuffleX, 211144022)                           \
+  V(_Float32x4, get:y, Float32x4ShuffleY, 211144022)                           \
+  V(_Float32x4, get:z, Float32x4ShuffleZ, 211144022)                           \
+  V(_Float32x4, get:w, Float32x4ShuffleW, 211144022)                           \
 
 // Class that recognizes the name and owner of a function and returns the
 // corresponding enum. See RECOGNIZED_LIST above for list of recognizable
@@ -505,6 +516,11 @@
   M(GuardField)                                                                \
   M(IfThenElse)                                                                \
   M(BinaryFloat32x4Op)                                                         \
+  M(Float32x4Shuffle)                                                          \
+  M(Float32x4Constructor)                                                      \
+  M(Float32x4Zero)                                                             \
+  M(Float32x4Splat)                                                            \
+
 
 #define FORWARD_DECLARATION(type) class type##Instr;
 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
@@ -755,6 +771,10 @@
   friend class UnboxFloat32x4Instr;
   friend class BinaryDoubleOpInstr;
   friend class BinaryFloat32x4OpInstr;
+  friend class Float32x4ZeroInstr;
+  friend class Float32x4SplatInstr;
+  friend class Float32x4ShuffleInstr;
+  friend class Float32x4ConstructorInstr;
   friend class BinaryMintOpInstr;
   friend class BinarySmiOpInstr;
   friend class UnarySmiOpInstr;
@@ -1073,7 +1093,7 @@
 class ForwardInstructionIterator : public ValueObject {
  public:
   explicit ForwardInstructionIterator(BlockEntryInstr* block_entry)
-      : block_entry_(block_entry), current_(block_entry) {
+      : current_(block_entry) {
     Advance();
   }
 
@@ -1090,7 +1110,6 @@
   Instruction* Current() const { return current_; }
 
  private:
-  BlockEntryInstr* block_entry_;
   Instruction* current_;
 };
 
@@ -2319,6 +2338,8 @@
 
   virtual bool HasSideEffect() const { return false; }
 
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
  private:
   DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr);
 };
@@ -4139,6 +4160,194 @@
 };
 
 
+class Float32x4ShuffleInstr : public TemplateDefinition<1> {
+ public:
+  Float32x4ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value,
+                        InstanceCallInstr* instance_call)
+      : op_kind_(op_kind) {
+    SetInputAt(0, value);
+    deopt_id_ = instance_call->deopt_id();
+  }
+
+  Value* value() const { return inputs_[0]; }
+
+  MethodRecognizer::Kind op_kind() const { return op_kind_; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual bool HasSideEffect() const { return false; }
+
+  virtual bool AffectedBySideEffect() const { return false; }
+
+  virtual bool AttributesEqual(Instruction* other) const {
+    return op_kind() == other->AsFloat32x4Shuffle()->op_kind();
+  }
+
+  virtual Representation representation() const {
+    if ((op_kind_ == MethodRecognizer::kFloat32x4ShuffleX) ||
+        (op_kind_ == MethodRecognizer::kFloat32x4ShuffleY) ||
+        (op_kind_ == MethodRecognizer::kFloat32x4ShuffleZ) ||
+        (op_kind_ == MethodRecognizer::kFloat32x4ShuffleW)) {
+      return kUnboxedDouble;
+    }
+    return kUnboxedFloat32x4;
+  }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    ASSERT(idx == 0);
+    return kUnboxedFloat32x4;
+  }
+
+  virtual intptr_t DeoptimizationTarget() const {
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
+    return deopt_id_;
+  }
+
+  DECLARE_INSTRUCTION(Float32x4Shuffle)
+  virtual CompileType ComputeType() const;
+
+ private:
+  const MethodRecognizer::Kind op_kind_;
+
+  DISALLOW_COPY_AND_ASSIGN(Float32x4ShuffleInstr);
+};
+
+
+class Float32x4ConstructorInstr : public TemplateDefinition<4> {
+ public:
+  Float32x4ConstructorInstr(Value* value0, Value* value1, Value* value2,
+                            Value* value3, StaticCallInstr* static_call) {
+    SetInputAt(0, value0);
+    SetInputAt(1, value1);
+    SetInputAt(2, value2);
+    SetInputAt(3, value3);
+    deopt_id_ = static_call->deopt_id();
+  }
+
+  Value* value0() const { return inputs_[0]; }
+  Value* value1() const { return inputs_[1]; }
+  Value* value2() const { return inputs_[2]; }
+  Value* value3() const { return inputs_[3]; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual bool HasSideEffect() const { return false; }
+
+  virtual bool AffectedBySideEffect() const { return false; }
+
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+  virtual Representation representation() const {
+    return kUnboxedFloat32x4;
+  }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    ASSERT(idx >= 0 && idx < 4);
+    return kUnboxedDouble;
+  }
+
+  virtual intptr_t DeoptimizationTarget() const {
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
+    return deopt_id_;
+  }
+
+  DECLARE_INSTRUCTION(Float32x4Constructor)
+  virtual CompileType ComputeType() const;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Float32x4ConstructorInstr);
+};
+
+
+class Float32x4SplatInstr : public TemplateDefinition<1> {
+ public:
+  Float32x4SplatInstr(Value* value, StaticCallInstr* static_call) {
+    SetInputAt(0, value);
+    deopt_id_ = static_call->deopt_id();
+  }
+
+  Value* value() const { return inputs_[0]; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual bool HasSideEffect() const { return false; }
+
+  virtual bool AffectedBySideEffect() const { return false; }
+
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+  virtual Representation representation() const {
+    return kUnboxedFloat32x4;
+  }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    ASSERT(idx == 0);
+    return kUnboxedDouble;
+  }
+
+  virtual intptr_t DeoptimizationTarget() const {
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
+    return deopt_id_;
+  }
+
+  DECLARE_INSTRUCTION(Float32x4Splat)
+  virtual CompileType ComputeType() const;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Float32x4SplatInstr);
+};
+
+
+class Float32x4ZeroInstr : public TemplateDefinition<0> {
+ public:
+  explicit Float32x4ZeroInstr(StaticCallInstr* static_call) {
+    deopt_id_ = static_call->deopt_id();
+  }
+
+  Value* value() const { return inputs_[0]; }
+
+  virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+  virtual bool CanDeoptimize() const { return false; }
+
+  virtual bool HasSideEffect() const { return false; }
+
+  virtual bool AffectedBySideEffect() const { return false; }
+
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
+  virtual Representation representation() const {
+    return kUnboxedFloat32x4;
+  }
+
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const {
+    UNIMPLEMENTED();
+    return kUnboxedFloat32x4;
+  }
+
+  virtual intptr_t DeoptimizationTarget() const {
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
+    return deopt_id_;
+  }
+
+  DECLARE_INSTRUCTION(Float32x4Zero)
+  virtual CompileType ComputeType() const;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(Float32x4ZeroInstr);
+};
+
+
 class BinaryMintOpInstr : public TemplateDefinition<2> {
  public:
   BinaryMintOpInstr(Token::Kind op_kind,
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index 64e8e39..43043a5 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -95,10 +95,9 @@
   __ LeaveDartFrame();
   __ Ret();
 
-  // Generate 2 NOP instructions so that the debugger can patch the return
-  // pattern (1 instruction) with a call to the debug stub (3 instructions).
-  __ nop();
-  __ nop();
+  // No need to generate NOP instructions so that the debugger can patch the
+  // return pattern (3 instructions) with a call to the debug stub (also 3
+  // instructions).
   compiler->AddCurrentDescriptor(PcDescriptors::kReturn,
                                  Isolate::kNoDeoptId,
                                  token_pos());
@@ -208,8 +207,8 @@
   LocationSummary* summary =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(R0));  // Value.
-  summary->set_in(1, Location::RegisterLocation(R1));  // Instantiator.
-  summary->set_in(2, Location::RegisterLocation(R2));  // Type arguments.
+  summary->set_in(1, Location::RegisterLocation(R2));  // Instantiator.
+  summary->set_in(2, Location::RegisterLocation(R1));  // Type arguments.
   summary->set_out(Location::RegisterLocation(R0));
   return summary;
 }
@@ -344,7 +343,7 @@
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R1));
   locs->set_in(1, Location::RegisterLocation(R0));
-  locs->set_temp(0, Location::RegisterLocation(R6));
+  locs->set_temp(0, Location::RegisterLocation(R5));
   locs->set_out(Location::RegisterLocation(R0));
   return locs;
 }
@@ -352,7 +351,7 @@
 
 // R1: left.
 // R0: right.
-// Uses R6 to load ic_call_data.
+// Uses R5 to load ic_call_data.
 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler,
                                        intptr_t deopt_id,
                                        intptr_t token_pos,
@@ -405,13 +404,9 @@
   Label equality_done;
   if (compiler->is_optimizing()) {
     // No need to update IC data.
-    Label is_true;
     __ cmp(R0, ShifterOperand(R1));
-    __ b(&is_true, EQ);
-    __ LoadObject(R0, (kind == Token::kEQ) ? Bool::False() : Bool::True());
-    __ b(&equality_done);
-    __ Bind(&is_true);
-    __ LoadObject(R0, (kind == Token::kEQ) ? Bool::True() : Bool::False());
+    __ LoadObject(R0, (kind == Token::kEQ) ? Bool::False() : Bool::True(), NE);
+    __ LoadObject(R0, (kind == Token::kEQ) ? Bool::True() : Bool::False(), EQ);
     if (kind == Token::kNE) {
       // Skip not-equal result conversion.
       __ b(&equality_done);
@@ -420,7 +415,7 @@
     // Call stub, load IC data in register. The stub will update ICData if
     // necessary.
     Register ic_data_reg = locs->temp(0).reg();
-    ASSERT(ic_data_reg == R6);  // Stub depends on it.
+    ASSERT(ic_data_reg == R5);  // Stub depends on it.
     __ LoadObject(ic_data_reg, equality_ic_data);
     // Pass left in R1 and right in R0.
     compiler->GenerateCall(token_pos,
@@ -430,15 +425,10 @@
   }
   __ Bind(&check_ne);
   if (kind == Token::kNE) {
-    Label true_label, done;
     // Negate the condition: true label returns false and vice versa.
     __ CompareObject(R0, Bool::True());
-    __ b(&true_label, EQ);
-    __ LoadObject(R0, Bool::True());
-    __ b(&done);
-    __ Bind(&true_label);
-    __ LoadObject(R0, Bool::False());
-    __ Bind(&done);
+    __ LoadObject(R0, Bool::True(), NE);
+    __ LoadObject(R0, Bool::False(), EQ);
   }
   __ Bind(&equality_done);
 }
@@ -488,6 +478,25 @@
 }
 
 
+static Condition NegateCondition(Condition condition) {
+  switch (condition) {
+    case EQ: return NE;
+    case NE: return EQ;
+    case LT: return GE;
+    case LE: return GT;
+    case GT: return LE;
+    case GE: return LT;
+    case CC: return CS;
+    case LS: return HI;
+    case HI: return LS;
+    case CS: return CC;
+    default:
+      UNIMPLEMENTED();
+      return EQ;
+  }
+}
+
+
 static void EmitSmiComparisonOp(FlowGraphCompiler* compiler,
                                 const LocationSummary& locs,
                                 Token::Kind kind,
@@ -511,13 +520,8 @@
     branch->EmitBranchOnCondition(compiler, true_condition);
   } else {
     Register result = locs.out().reg();
-    Label done, is_true;
-    __ b(&is_true, true_condition);
-    __ LoadObject(result, Bool::False());
-    __ b(&done);
-    __ Bind(&is_true);
-    __ LoadObject(result, Bool::True());
-    __ Bind(&done);
+    __ LoadObject(result, Bool::True(), true_condition);
+    __ LoadObject(result, Bool::False(), NegateCondition(true_condition));
   }
 }
 
@@ -837,25 +841,192 @@
 
 
 CompileType LoadIndexedInstr::ComputeType() const {
-  UNIMPLEMENTED();
-  return CompileType::Dynamic();
+  switch (class_id_) {
+    case kArrayCid:
+    case kImmutableArrayCid:
+      return CompileType::Dynamic();
+
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+      return CompileType::FromCid(kDoubleCid);
+    case kTypedDataFloat32x4ArrayCid:
+      return CompileType::FromCid(kFloat32x4Cid);
+
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataUint16ArrayCid:
+    case kOneByteStringCid:
+    case kTwoByteStringCid:
+      return CompileType::FromCid(kSmiCid);
+
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataUint32ArrayCid:
+      // Result can be Smi or Mint when boxed.
+      // Instruction can deoptimize if we optimistically assumed that the result
+      // fits into Smi.
+      return CanDeoptimize() ? CompileType::FromCid(kSmiCid)
+                             : CompileType::Int();
+
+    default:
+      UNIMPLEMENTED();
+      return CompileType::Dynamic();
+  }
 }
 
 
 Representation LoadIndexedInstr::representation() const {
-  UNIMPLEMENTED();
-  return kTagged;
+  switch (class_id_) {
+    case kArrayCid:
+    case kImmutableArrayCid:
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataUint16ArrayCid:
+    case kOneByteStringCid:
+    case kTwoByteStringCid:
+      return kTagged;
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataUint32ArrayCid:
+      // Instruction can deoptimize if we optimistically assumed that the result
+      // fits into Smi.
+      return CanDeoptimize() ? kTagged : kUnboxedMint;
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+      return kUnboxedDouble;
+    case kTypedDataFloat32x4ArrayCid:
+      return kUnboxedFloat32x4;
+    default:
+      UNIMPLEMENTED();
+      return kTagged;
+  }
 }
 
 
 LocationSummary* LoadIndexedInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RequiresRegister());
+  // The smi index is either untagged (element size == 1), or it is left smi
+  // tagged (for all element sizes > 1).
+  // TODO(regis): Revisit and see if the index can be immediate.
+  locs->set_in(1, Location::WritableRegister());
+  if (representation() == kUnboxedDouble) {
+    locs->set_out(Location::RequiresFpuRegister());
+  } else {
+    locs->set_out(Location::RequiresRegister());
+  }
+  return locs;
 }
 
 
 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register array = locs()->in(0).reg();
+  Location index = locs()->in(1);
+
+  Address element_address(kNoRegister, 0);
+  if (IsExternal()) {
+    UNIMPLEMENTED();
+  } else {
+    ASSERT(this->array()->definition()->representation() == kTagged);
+    ASSERT(index.IsRegister());  // TODO(regis): Revisit.
+    // Note that index is expected smi-tagged, (i.e, times 2) for all arrays
+    // with index scale factor > 1. E.g., for Uint8Array and OneByteString the
+    // index is expected to be untagged before accessing.
+    ASSERT(kSmiTagShift == 1);
+    switch (index_scale()) {
+      case 1: {
+        __ SmiUntag(index.reg());
+        break;
+      }
+      case 2: {
+        break;
+      }
+      case 4: {
+        __ mov(index.reg(), ShifterOperand(index.reg(), LSL, 1));
+        break;
+      }
+      case 8: {
+        __ mov(index.reg(), ShifterOperand(index.reg(), LSL, 2));
+        break;
+      }
+      case 16: {
+        __ mov(index.reg(), ShifterOperand(index.reg(), LSL, 3));
+        break;
+      }
+      default:
+        UNREACHABLE();
+    }
+    __ AddImmediate(index.reg(),
+        FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag);
+    element_address = Address(array, index.reg(), LSL, 0);
+  }
+
+  if ((representation() == kUnboxedDouble) ||
+      (representation() == kUnboxedMint) ||
+      (representation() == kUnboxedFloat32x4)) {
+    UNIMPLEMENTED();
+  }
+
+  Register result = locs()->out().reg();
+  if ((index_scale() == 1) && index.IsRegister()) {
+    __ SmiUntag(index.reg());
+  }
+  switch (class_id()) {
+    case kTypedDataInt8ArrayCid:
+      ASSERT(index_scale() == 1);
+      __ ldrsb(result, element_address);
+      __ SmiTag(result);
+      break;
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kOneByteStringCid:
+      ASSERT(index_scale() == 1);
+      __ ldrb(result, element_address);
+      __ SmiTag(result);
+      break;
+    case kTypedDataInt16ArrayCid:
+      __ ldrsh(result, element_address);
+      __ SmiTag(result);
+      break;
+    case kTypedDataUint16ArrayCid:
+    case kTwoByteStringCid:
+      __ ldrh(result, element_address);
+      __ SmiTag(result);
+      break;
+    case kTypedDataInt32ArrayCid: {
+        Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptInt32Load);
+        __ ldr(result, element_address);
+        // Verify that the signed value in 'result' can fit inside a Smi.
+        __ CompareImmediate(result, 0xC0000000);
+        __ b(deopt, MI);
+        __ SmiTag(result);
+      }
+      break;
+    case kTypedDataUint32ArrayCid: {
+        Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptUint32Load);
+        __ ldr(result, element_address);
+        // Verify that the unsigned value in 'result' can fit inside a Smi.
+        __ tst(result, ShifterOperand(0xC0000000));
+        __ b(deopt, NE);
+        __ SmiTag(result);
+      }
+      break;
+    default:
+      ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid));
+      __ ldr(result, element_address);
+      break;
+  }
 }
 
 
@@ -1039,28 +1210,25 @@
     FieldAddress field_nullability_operand(
         field_reg, Field::is_nullable_offset());
 
+    if (value_cid_reg == kNoRegister) {
+      ASSERT(!compiler->is_optimizing());
+      value_cid_reg = R3;
+      ASSERT((value_cid_reg != value_reg) && (field_reg != value_cid_reg));
+    }
+
     if (value_cid == kDynamicCid) {
-      if (value_cid_reg == kNoRegister) {
-        ASSERT(!compiler->is_optimizing());
-        value_cid_reg = R3;
-        ASSERT((value_cid_reg != value_reg) && (field_reg != value_cid_reg));
-      }
-
       LoadValueCid(compiler, value_cid_reg, value_reg);
-
       __ ldr(IP, field_cid_operand);
       __ cmp(value_cid_reg, ShifterOperand(IP));
       __ b(&ok, EQ);
       __ ldr(IP, field_nullability_operand);
       __ cmp(value_cid_reg, ShifterOperand(IP));
     } else if (value_cid == kNullCid) {
-      // TODO(regis): IP may conflict. Revisit.
-      __ ldr(IP, field_nullability_operand);
-      __ CompareImmediate(IP, value_cid);
+      __ ldr(value_cid_reg, field_nullability_operand);
+      __ CompareImmediate(value_cid_reg, value_cid);
     } else {
-      // TODO(regis): IP may conflict. Revisit.
-      __ ldr(IP, field_cid_operand);
-      __ CompareImmediate(IP, value_cid);
+      __ ldr(value_cid_reg, field_cid_operand);
+      __ CompareImmediate(value_cid_reg, value_cid);
     }
     __ b(&ok, EQ);
 
@@ -1274,11 +1442,10 @@
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 1;
+  const intptr_t kNumTemps = 0;
   LocationSummary* locs =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(R0));
-  locs->set_temp(0, Location::RegisterLocation(R1));
   locs->set_out(Location::RegisterLocation(R0));
   return locs;
 }
@@ -1287,48 +1454,34 @@
 void InstantiateTypeArgumentsInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
   Register instantiator_reg = locs()->in(0).reg();
-  Register temp = locs()->temp(0).reg();
   Register result_reg = locs()->out().reg();
 
   // 'instantiator_reg' is the instantiator AbstractTypeArguments object
   // (or null).
-  // If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments.
-  Label type_arguments_instantiated;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
-    __ cmp(instantiator_reg, ShifterOperand(IP));
-    __ b(&type_arguments_instantiated, EQ);
+  if (!type_arguments().IsUninstantiatedIdentity()) {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments.
+    Label type_arguments_instantiated;
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+      __ cmp(instantiator_reg, ShifterOperand(IP));
+      __ b(&type_arguments_instantiated, EQ);
+    }
+    // Instantiate non-null type arguments.
+    // A runtime call to instantiate the type arguments is required.
+    __ PushObject(Object::ZoneHandle());  // Make room for the result.
+    __ PushObject(type_arguments());
+    __ Push(instantiator_reg);  // Push instantiator type arguments.
+    compiler->GenerateCallRuntime(token_pos(),
+                                  deopt_id(),
+                                  kInstantiateTypeArgumentsRuntimeEntry,
+                                  locs());
+    __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
+    __ Pop(result_reg);  // Pop instantiated type arguments.
+    __ Bind(&type_arguments_instantiated);
   }
-  // Instantiate non-null type arguments.
-  if (type_arguments().IsUninstantiatedIdentity()) {
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check the instantiator ('instantiator_reg') for null here,
-    // because a null instantiator will have the wrong class (Null instead of
-    // TypeArguments).
-    Label type_arguments_uninstantiated;
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp);
-    __ b(&type_arguments_uninstantiated, NE);
-    __ ldr(temp,
-           FieldAddress(instantiator_reg, TypeArguments::length_offset()));
-    __ CompareImmediate(temp, Smi::RawValue(len));
-    __ b(&type_arguments_instantiated, EQ);
-    __ Bind(&type_arguments_uninstantiated);
-  }
-  // A runtime call to instantiate the type arguments is required.
-  __ PushObject(Object::ZoneHandle());  // Make room for the result.
-  __ PushObject(type_arguments());
-  __ Push(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateCallRuntime(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeArgumentsRuntimeEntry,
-                                locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
-  __ Pop(result_reg);  // Pop instantiated type arguments.
-  __ Bind(&type_arguments_instantiated);
   ASSERT(instantiator_reg == result_reg);
   // 'result_reg': Instantiated type arguments.
 }
@@ -1337,12 +1490,11 @@
 LocationSummary*
 ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 1;
+  const intptr_t kNumTemps = 0;
   LocationSummary* locs =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_out(Location::SameAsFirstInput());
-  locs->set_temp(0, Location::RequiresRegister());
   return locs;
 }
 
@@ -1352,40 +1504,28 @@
   Register instantiator_reg = locs()->in(0).reg();
   Register result_reg = locs()->out().reg();
   ASSERT(instantiator_reg == result_reg);
-  Register temp_reg = locs()->temp(0).reg();
 
   // instantiator_reg is the instantiator type argument vector, i.e. an
   // AbstractTypeArguments object (or null).
-  // If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments.
-  Label type_arguments_instantiated;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    __ CompareImmediate(instantiator_reg,
-                        reinterpret_cast<intptr_t>(Object::null()));
-    __ b(&type_arguments_instantiated, EQ);
+  if (!type_arguments().IsUninstantiatedIdentity()) {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments.
+    Label type_arguments_instantiated;
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      __ CompareImmediate(instantiator_reg,
+                          reinterpret_cast<intptr_t>(Object::null()));
+      __ b(&type_arguments_instantiated, EQ);
+    }
+    // Instantiate non-null type arguments.
+    // In the non-factory case, we rely on the allocation stub to
+    // instantiate the type arguments.
+    __ LoadObject(result_reg, type_arguments());
+    // result_reg: uninstantiated type arguments.
+    __ Bind(&type_arguments_instantiated);
   }
-  // Instantiate non-null type arguments.
-  if (type_arguments().IsUninstantiatedIdentity()) {
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check instantiator_reg for null here, because a null
-    // instantiator will have the wrong class (Null instead of TypeArguments).
-    Label type_arguments_uninstantiated;
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg);
-    __ b(&type_arguments_uninstantiated, NE);
-    __ ldr(temp_reg,
-           FieldAddress(instantiator_reg, TypeArguments::length_offset()));
-    __ CompareImmediate(temp_reg, Smi::RawValue(type_arguments().Length()));
-    __ b(&type_arguments_instantiated, EQ);
-    __ Bind(&type_arguments_uninstantiated);
-  }
-  // In the non-factory case, we rely on the allocation stub to
-  // instantiate the type arguments.
-  __ LoadObject(result_reg, type_arguments());
-  // result_reg: uninstantiated type arguments.
-  __ Bind(&type_arguments_instantiated);
+  ASSERT(instantiator_reg == result_reg);
   // result_reg: uninstantiated or instantiated type arguments.
 }
 
@@ -1393,12 +1533,11 @@
 LocationSummary*
 ExtractConstructorInstantiatorInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 1;
+  const intptr_t kNumTemps = 0;
   LocationSummary* locs =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_out(Location::SameAsFirstInput());
-  locs->set_temp(0, Location::RequiresRegister());
   return locs;
 }
 
@@ -1407,51 +1546,31 @@
     FlowGraphCompiler* compiler) {
   Register instantiator_reg = locs()->in(0).reg();
   ASSERT(locs()->out().reg() == instantiator_reg);
-  Register temp_reg = locs()->temp(0).reg();
 
   // instantiator_reg is the instantiator AbstractTypeArguments object
-  // (or null).  If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments and do not pass the instantiator.
-  Label done;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    Label instantiator_not_null;
-    __ CompareImmediate(instantiator_reg,
-                        reinterpret_cast<intptr_t>(Object::null()));
-    __ b(&instantiator_not_null, NE);
-    // Null was used in VisitExtractConstructorTypeArguments as the
-    // instantiated type arguments, no proper instantiator needed.
-    __ LoadImmediate(instantiator_reg,
-                     Smi::RawValue(StubCode::kNoInstantiator));
-    __ b(&done);
-    __ Bind(&instantiator_not_null);
-  }
-  // Instantiate non-null type arguments.
+  // (or null).
   if (type_arguments().IsUninstantiatedIdentity()) {
-    // TODO(regis): The following emitted code is duplicated in
-    // VisitExtractConstructorTypeArguments above. The reason is that the code
-    // is split between two computations, so that each one produces a
-    // single value, rather than producing a pair of values.
-    // If this becomes an issue, we should expose these tests at the IL level.
-
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check the instantiator ('instantiator_reg') for null here,
-    // because a null instantiator will have the wrong class (Null instead of
-    // TypeArguments).
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg);
-    __ b(&done, NE);
-    __ ldr(temp_reg,
-           FieldAddress(instantiator_reg, TypeArguments::length_offset()));
-    __ CompareImmediate(temp_reg, Smi::RawValue(type_arguments().Length()));
-    __ b(&done, NE);
     // The instantiator was used in VisitExtractConstructorTypeArguments as the
     // instantiated type arguments, no proper instantiator needed.
     __ LoadImmediate(instantiator_reg,
                      Smi::RawValue(StubCode::kNoInstantiator));
+  } else {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments and do not pass the instantiator.
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      Label instantiator_not_null;
+      __ CompareImmediate(instantiator_reg,
+                          reinterpret_cast<intptr_t>(Object::null()));
+      __ b(&instantiator_not_null, NE);
+      // Null was used in VisitExtractConstructorTypeArguments as the
+      // instantiated type arguments, no proper instantiator needed.
+      __ LoadImmediate(instantiator_reg,
+                       Smi::RawValue(StubCode::kNoInstantiator));
+      __ Bind(&instantiator_not_null);
+    }
   }
-  __ Bind(&done);
   // instantiator_reg: instantiator or kNoInstantiator.
 }
 
@@ -1625,14 +1744,24 @@
       case Token::kMUL: {
         // Keep left value tagged and untag right value.
         const intptr_t value = Smi::Cast(constant).Value();
-        if (value == 2) {
-          __ mov(result, ShifterOperand(left, LSL, 1));
+        if (deopt == NULL) {
+          if (value == 2) {
+            __ mov(result, ShifterOperand(left, LSL, 1));
+          } else {
+            __ LoadImmediate(IP, value);
+            __ mul(result, left, IP);
+          }
         } else {
-          __ LoadImmediate(IP, value);
-          __ mul(result, left, IP);
-        }
-        if (deopt != NULL) {
-          UNIMPLEMENTED();
+          if (value == 2) {
+            __ mov(IP, ShifterOperand(left, ASR, 31));  // IP = sign of left.
+            __ mov(result, ShifterOperand(left, LSL, 1));
+          } else {
+            __ LoadImmediate(IP, value);
+            __ smull(result, IP, left, IP);
+          }
+          // IP: result bits 32..63.
+          __ cmp(IP, ShifterOperand(result, ASR, 31));
+          __ b(deopt, NE);
         }
         break;
       }
@@ -1840,6 +1969,50 @@
 }
 
 
+LocationSummary* Float32x4ShuffleInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4ZeroInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4SplatInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   UNIMPLEMENTED();
   return NULL;
@@ -1971,13 +2144,56 @@
 
 
 LocationSummary* CheckClassInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  if (!null_check()) {
+    summary->AddTemp(Location::RequiresRegister());
+  }
+  return summary;
 }
 
 
 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  if (null_check()) {
+    Label* deopt = compiler->AddDeoptStub(deopt_id(),
+                                          kDeoptCheckClass);
+    __ CompareImmediate(locs()->in(0).reg(),
+                        reinterpret_cast<intptr_t>(Object::null()));
+    __ b(deopt, EQ);
+    return;
+  }
+
+  ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) ||
+         (unary_checks().NumberOfChecks() > 1));
+  Register value = locs()->in(0).reg();
+  Register temp = locs()->temp(0).reg();
+  Label* deopt = compiler->AddDeoptStub(deopt_id(),
+                                        kDeoptCheckClass);
+  Label is_ok;
+  intptr_t cix = 0;
+  if (unary_checks().GetReceiverClassIdAt(cix) == kSmiCid) {
+    __ tst(value, ShifterOperand(kSmiTagMask));
+    __ b(&is_ok, EQ);
+    cix++;  // Skip first check.
+  } else {
+    __ tst(value, ShifterOperand(kSmiTagMask));
+    __ b(deopt, EQ);
+  }
+  __ LoadClassId(temp, value);
+  const intptr_t num_checks = unary_checks().NumberOfChecks();
+  for (intptr_t i = cix; i < num_checks; i++) {
+    ASSERT(unary_checks().GetReceiverClassIdAt(i) != kSmiCid);
+    __ CompareImmediate(temp, unary_checks().GetReceiverClassIdAt(i));
+    if (i == (num_checks - 1)) {
+      __ b(deopt, NE);
+    } else {
+      __ b(&is_ok, EQ);
+    }
+  }
+  __ Bind(&is_ok);
 }
 
 
@@ -2001,13 +2217,44 @@
 
 
 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RegisterOrSmiConstant(length()));
+  locs->set_in(1, Location::RegisterOrSmiConstant(index()));
+  return locs;
 }
 
 
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Label* deopt = compiler->AddDeoptStub(deopt_id(),
+                                        kDeoptCheckArrayBound);
+  if (locs()->in(0).IsConstant() && locs()->in(1).IsConstant()) {
+    // Unconditionally deoptimize for constant bounds checks because they
+    // only occur only when index is out-of-bounds.
+    __ b(deopt);
+    return;
+  }
+
+  if (locs()->in(1).IsConstant()) {
+    Register length = locs()->in(0).reg();
+    const Object& constant = locs()->in(1).constant();
+    ASSERT(constant.IsSmi());
+    __ CompareImmediate(length, reinterpret_cast<int32_t>(constant.raw()));
+    __ b(deopt, LS);
+  } else if (locs()->in(0).IsConstant()) {
+    ASSERT(locs()->in(0).constant().IsSmi());
+    const Smi& smi_const = Smi::Cast(locs()->in(0).constant());
+    Register index = locs()->in(1).reg();
+    __ CompareImmediate(index, reinterpret_cast<int32_t>(smi_const.raw()));
+    __ b(deopt, CS);
+  } else {
+    Register length = locs()->in(0).reg();
+    Register index = locs()->in(1).reg();
+    __ cmp(index, ShifterOperand(length));
+    __ b(deopt, CS);
+  }
 }
 
 
@@ -2120,26 +2367,6 @@
 }
 
 
-static Condition NegateCondition(Condition condition) {
-  switch (condition) {
-    case EQ: return NE;
-    case NE: return EQ;
-    case LT: return GE;
-    case LE: return GT;
-    case GT: return LE;
-    case GE: return LT;
-    case CC: return CS;
-    case LS: return HI;
-    case HI: return LS;
-    case CS: return CC;
-    default:
-      OS::Print("Error %d\n", condition);
-      UNIMPLEMENTED();
-      return EQ;
-  }
-}
-
-
 void ControlInstruction::EmitBranchOnValue(FlowGraphCompiler* compiler,
                                            bool value) {
   if (value && !compiler->CanFallThroughTo(true_successor())) {
@@ -2221,14 +2448,9 @@
   }
 
   Register result = locs()->out().reg();
-  Label load_true, done;
   Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE;
-  __ b(&load_true, true_condition);
-  __ LoadObject(result, Bool::False());
-  __ b(&done);
-  __ Bind(&load_true);
-  __ LoadObject(result, Bool::True());
-  __ Bind(&done);
+  __ LoadObject(result, Bool::True(), true_condition);
+  __ LoadObject(result, Bool::False(), NegateCondition(true_condition));
 }
 
 
@@ -2275,34 +2497,54 @@
   Register value = locs()->in(0).reg();
   Register result = locs()->out().reg();
 
-  Label done;
   __ LoadObject(result, Bool::True());
   __ cmp(result, ShifterOperand(value));
-  __ b(&done, NE);
-  __ LoadObject(result, Bool::False());
-  __ Bind(&done);
+  __ LoadObject(result, Bool::False(), EQ);
 }
 
 
 LocationSummary* ChainContextInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(1,
+                               Location::NoLocation(),
+                               LocationSummary::kNoCall);
 }
 
 
 void ChainContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register context_value = locs()->in(0).reg();
+
+  // Chain the new context in context_value to its parent in CTX.
+  __ StoreIntoObject(context_value,
+                     FieldAddress(context_value, Context::parent_offset()),
+                     CTX);
+  // Set new context as current context.
+  __ mov(CTX, ShifterOperand(context_value));
 }
 
 
 LocationSummary* StoreVMFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
+                                              : Location::RequiresRegister());
+  locs->set_in(1, Location::RequiresRegister());
+  return locs;
 }
 
 
 void StoreVMFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register value_reg = locs()->in(0).reg();
+  Register dest_reg = locs()->in(1).reg();
+
+  if (value()->NeedsStoreBuffer()) {
+    __ StoreIntoObject(dest_reg, FieldAddress(dest_reg, offset_in_bytes()),
+                       value_reg);
+  } else {
+    __ StoreIntoObjectNoBarrier(
+        dest_reg, FieldAddress(dest_reg, offset_in_bytes()), value_reg);
+  }
 }
 
 
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index ad46c62..00cd501 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -1859,11 +1859,10 @@
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 1;
+  const intptr_t kNumTemps = 0;
   LocationSummary* locs =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
   locs->set_in(0, Location::RegisterLocation(EAX));
-  locs->set_temp(0, Location::RegisterLocation(ECX));
   locs->set_out(Location::RegisterLocation(EAX));
   return locs;
 }
@@ -1872,48 +1871,35 @@
 void InstantiateTypeArgumentsInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
   Register instantiator_reg = locs()->in(0).reg();
-  Register temp = locs()->temp(0).reg();
   Register result_reg = locs()->out().reg();
 
   // 'instantiator_reg' is the instantiator AbstractTypeArguments object
   // (or null).
-  // If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments.
-  Label type_arguments_instantiated;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    const Immediate& raw_null =
-        Immediate(reinterpret_cast<intptr_t>(Object::null()));
-    __ cmpl(instantiator_reg, raw_null);
-    __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
+  if (!type_arguments().IsUninstantiatedIdentity()) {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments.
+    Label type_arguments_instantiated;
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      const Immediate& raw_null =
+          Immediate(reinterpret_cast<intptr_t>(Object::null()));
+      __ cmpl(instantiator_reg, raw_null);
+      __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
+    }
+    // Instantiate non-null type arguments.
+    // A runtime call to instantiate the type arguments is required.
+    __ PushObject(Object::ZoneHandle());  // Make room for the result.
+    __ PushObject(type_arguments());
+    __ pushl(instantiator_reg);  // Push instantiator type arguments.
+    compiler->GenerateCallRuntime(token_pos(),
+                                  deopt_id(),
+                                  kInstantiateTypeArgumentsRuntimeEntry,
+                                  locs());
+    __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
+    __ popl(result_reg);  // Pop instantiated type arguments.
+    __ Bind(&type_arguments_instantiated);
   }
-  // Instantiate non-null type arguments.
-  if (type_arguments().IsUninstantiatedIdentity()) {
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check the instantiator ('instantiator_reg') for null here,
-    // because a null instantiator will have the wrong class (Null instead of
-    // TypeArguments).
-    Label type_arguments_uninstantiated;
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp);
-    __ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
-    __ cmpl(FieldAddress(instantiator_reg, TypeArguments::length_offset()),
-            Immediate(Smi::RawValue(len)));
-    __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
-    __ Bind(&type_arguments_uninstantiated);
-  }
-  // A runtime call to instantiate the type arguments is required.
-  __ PushObject(Object::ZoneHandle());  // Make room for the result.
-  __ PushObject(type_arguments());
-  __ pushl(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateCallRuntime(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeArgumentsRuntimeEntry,
-                                locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
-  __ popl(result_reg);  // Pop instantiated type arguments.
-  __ Bind(&type_arguments_instantiated);
   ASSERT(instantiator_reg == result_reg);
   // 'result_reg': Instantiated type arguments.
 }
@@ -1922,12 +1908,11 @@
 LocationSummary*
 ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 1;
+  const intptr_t kNumTemps = 0;
   LocationSummary* locs =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_out(Location::SameAsFirstInput());
-  locs->set_temp(0, Location::RequiresRegister());
   return locs;
 }
 
@@ -1937,42 +1922,29 @@
   Register instantiator_reg = locs()->in(0).reg();
   Register result_reg = locs()->out().reg();
   ASSERT(instantiator_reg == result_reg);
-  Register temp_reg = locs()->temp(0).reg();
 
   // instantiator_reg is the instantiator type argument vector, i.e. an
   // AbstractTypeArguments object (or null).
-  // If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments.
-  Label type_arguments_instantiated;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    const Immediate& raw_null =
-        Immediate(reinterpret_cast<intptr_t>(Object::null()));
-    __ cmpl(instantiator_reg, raw_null);
-    __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
+  if (!type_arguments().IsUninstantiatedIdentity()) {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments.
+    Label type_arguments_instantiated;
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      const Immediate& raw_null =
+          Immediate(reinterpret_cast<intptr_t>(Object::null()));
+      __ cmpl(instantiator_reg, raw_null);
+      __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
+    }
+    // Instantiate non-null type arguments.
+    // In the non-factory case, we rely on the allocation stub to
+    // instantiate the type arguments.
+    __ LoadObject(result_reg, type_arguments());
+    // result_reg: uninstantiated type arguments.
+    __ Bind(&type_arguments_instantiated);
   }
-  // Instantiate non-null type arguments.
-  if (type_arguments().IsUninstantiatedIdentity()) {
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check instantiator_reg for null here, because a null
-    // instantiator will have the wrong class (Null instead of TypeArguments).
-    Label type_arguments_uninstantiated;
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg);
-    __ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
-    const Immediate& arguments_length =
-        Immediate(Smi::RawValue(type_arguments().Length()));
-    __ cmpl(FieldAddress(instantiator_reg, TypeArguments::length_offset()),
-        arguments_length);
-    __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
-    __ Bind(&type_arguments_uninstantiated);
-  }
-  // In the non-factory case, we rely on the allocation stub to
-  // instantiate the type arguments.
-  __ LoadObject(result_reg, type_arguments());
-  // result_reg: uninstantiated type arguments.
-  __ Bind(&type_arguments_instantiated);
+  ASSERT(instantiator_reg == result_reg);
   // result_reg: uninstantiated or instantiated type arguments.
 }
 
@@ -1980,12 +1952,11 @@
 LocationSummary*
 ExtractConstructorInstantiatorInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
-  const intptr_t kNumTemps = 1;
+  const intptr_t kNumTemps = 0;
   LocationSummary* locs =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
   locs->set_in(0, Location::RequiresRegister());
   locs->set_out(Location::SameAsFirstInput());
-  locs->set_temp(0, Location::RequiresRegister());
   return locs;
 }
 
@@ -1994,52 +1965,32 @@
     FlowGraphCompiler* compiler) {
   Register instantiator_reg = locs()->in(0).reg();
   ASSERT(locs()->out().reg() == instantiator_reg);
-  Register temp_reg = locs()->temp(0).reg();
 
   // instantiator_reg is the instantiator AbstractTypeArguments object
-  // (or null).  If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments and do not pass the instantiator.
-  Label done;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    const Immediate& raw_null =
-        Immediate(reinterpret_cast<intptr_t>(Object::null()));
-    Label instantiator_not_null;
-    __ cmpl(instantiator_reg, raw_null);
-    __ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump);
-    // Null was used in VisitExtractConstructorTypeArguments as the
-    // instantiated type arguments, no proper instantiator needed.
-    __ movl(instantiator_reg,
-            Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
-    __ jmp(&done);
-    __ Bind(&instantiator_not_null);
-  }
-  // Instantiate non-null type arguments.
+  // (or null).
   if (type_arguments().IsUninstantiatedIdentity()) {
-    // TODO(regis): The following emitted code is duplicated in
-    // VisitExtractConstructorTypeArguments above. The reason is that the code
-    // is split between two computations, so that each one produces a
-    // single value, rather than producing a pair of values.
-    // If this becomes an issue, we should expose these tests at the IL level.
-
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check the instantiator for null here, because a null
-    // instantiator will have the wrong class (Null instead of TypeArguments).
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg);
-    __ j(NOT_EQUAL, &done, Assembler::kNearJump);
-    const Immediate& arguments_length =
-        Immediate(Smi::RawValue(type_arguments().Length()));
-    __ cmpl(FieldAddress(instantiator_reg, TypeArguments::length_offset()),
-        arguments_length);
-    __ j(NOT_EQUAL, &done, Assembler::kNearJump);
     // The instantiator was used in VisitExtractConstructorTypeArguments as the
     // instantiated type arguments, no proper instantiator needed.
     __ movl(instantiator_reg,
             Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
+  } else {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments and do not pass the instantiator.
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      const Immediate& raw_null =
+          Immediate(reinterpret_cast<intptr_t>(Object::null()));
+      Label instantiator_not_null;
+      __ cmpl(instantiator_reg, raw_null);
+      __ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump);
+      // Null was used in VisitExtractConstructorTypeArguments as the
+      // instantiated type arguments, no proper instantiator needed.
+      __ movl(instantiator_reg,
+              Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
+      __ Bind(&instantiator_not_null);
+    }
   }
-  __ Bind(&done);
   // instantiator_reg: instantiator or kNoInstantiator.
 }
 
@@ -2843,6 +2794,132 @@
   }
 }
 
+
+LocationSummary* Float32x4ShuffleInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister value = locs()->in(0).fpu_reg();
+
+  ASSERT(locs()->out().fpu_reg() == value);
+
+  switch (op_kind()) {
+    case MethodRecognizer::kFloat32x4ShuffleXXXX:
+      __ shufps(value, value, Immediate(0x00));
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleYYYY:
+      __ shufps(value, value, Immediate(0x55));
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleZZZZ:
+      __ shufps(value, value, Immediate(0xAA));
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleWWWW:
+      __ shufps(value, value, Immediate(0xFF));
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleX:
+      __ shufps(value, value, Immediate(0x00));
+      __ cvtss2sd(value, value);
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleY:
+      __ shufps(value, value, Immediate(0x55));
+      __ cvtss2sd(value, value);
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleZ:
+      __ shufps(value, value, Immediate(0xAA));
+      __ cvtss2sd(value, value);
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleW:
+      __ shufps(value, value, Immediate(0xFF));
+      __ cvtss2sd(value, value);
+      break;
+
+    default: UNREACHABLE();
+  }
+}
+
+
+LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 4;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_in(1, Location::RequiresFpuRegister());
+  summary->set_in(2, Location::RequiresFpuRegister());
+  summary->set_in(3, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister v0 = locs()->in(0).fpu_reg();
+  XmmRegister v1 = locs()->in(1).fpu_reg();
+  XmmRegister v2 = locs()->in(2).fpu_reg();
+  XmmRegister v3 = locs()->in(3).fpu_reg();
+  ASSERT(v0 == locs()->out().fpu_reg());
+  __ subl(ESP, Immediate(16));
+  __ cvtsd2ss(v0, v0);
+  __ movss(Address(ESP, -16), v0);
+  __ movsd(v0, v1);
+  __ cvtsd2ss(v0, v0);
+  __ movss(Address(ESP, -12), v0);
+  __ movsd(v0, v2);
+  __ cvtsd2ss(v0, v0);
+  __ movss(Address(ESP, -8), v0);
+  __ movsd(v0, v3);
+  __ cvtsd2ss(v0, v0);
+  __ movss(Address(ESP, -4), v0);
+  __ movups(v0, Address(ESP, -16));
+  __ addl(ESP, Immediate(16));
+}
+
+
+LocationSummary* Float32x4ZeroInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 0;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_out(Location::RequiresFpuRegister());
+  return summary;
+}
+
+
+void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister value = locs()->out().fpu_reg();
+  __ xorps(value, value);
+}
+
+
+LocationSummary* Float32x4SplatInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister value = locs()->out().fpu_reg();
+  ASSERT(locs()->in(0).fpu_reg() == locs()->out().fpu_reg());
+  // Convert to Float32.
+  __ cvtsd2ss(value, value);
+  // Splat across all lanes.
+  __ shufps(value, value, Immediate(0x00));
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
@@ -3599,7 +3676,6 @@
     case ABOVE:         return BELOW_EQUAL;
     case ABOVE_EQUAL:   return BELOW;
     default:
-      OS::Print("Error %d\n", condition);
       UNIMPLEMENTED();
       return EQUAL;
   }
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 03b08cf..fa66db3 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -46,6 +46,7 @@
 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
   // where PushArgument is handled by BindInstr::EmitNativeCode.
+  __ TraceSimMsg("PushArgumentInstr");
   if (compiler->is_optimizing()) {
     Location value = locs()->in(0);
     if (value.IsRegister()) {
@@ -75,6 +76,7 @@
 // The entry needs to be patchable, no inlined objects are allowed in the area
 // that will be overwritten by the patch instructions: a branch macro sequence.
 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("ReturnInstr");
   Register result = locs()->in(0).reg();
   ASSERT(result == V0);
 #if defined(DEBUG)
@@ -85,6 +87,7 @@
   if (!compiler->HasFinally()) {
     Label stack_ok;
     __ Comment("Stack Check");
+    __ TraceSimMsg("Stack Check");
     const intptr_t fp_sp_dist =
         (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
     ASSERT(fp_sp_dist <= 0);
@@ -96,13 +99,11 @@
     __ Bind(&stack_ok);
   }
 #endif
+  // This sequence is patched by a debugger breakpoint. There is no need for
+  // extra NOP instructions here because the sequence patched in for a
+  // breakpoint is shorter than the sequence here.
   __ LeaveDartFrame();
   __ Ret();
-
-  // Generate 2 NOP instructions so that the debugger can patch the return
-  // pattern (1 instruction) with a call to the debug stub (3 instructions).
-  __ nop();
-  __ nop();
   compiler->AddCurrentDescriptor(PcDescriptors::kReturn,
                                  Isolate::kNoDeoptId,
                                  token_pos());
@@ -134,8 +135,31 @@
 
 
 LocationSummary* ClosureCallInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 0;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* result =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  result->set_out(Location::RegisterLocation(V0));
+  result->set_temp(0, Location::RegisterLocation(S4));  // Arg. descriptor.
+  return result;
+}
+
+
+void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  // The arguments to the stub include the closure, as does the arguments
+  // descriptor.
+  Register temp_reg = locs()->temp(0).reg();
+  int argument_count = ArgumentCount();
+  const Array& arguments_descriptor =
+      Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
+                                                 argument_names()));
+  __ LoadObject(temp_reg, arguments_descriptor);
+  compiler->GenerateDartCall(deopt_id(),
+                             token_pos(),
+                             &StubCode::CallClosureFunctionLabel(),
+                             PcDescriptors::kOther,
+                             locs());
+  __ Drop(argument_count);
 }
 
 
@@ -147,6 +171,7 @@
 
 
 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("LoadLocalInstr");
   Register result = locs()->out().reg();
   __ lw(result, Address(FP, local().index() * kWordSize));
 }
@@ -160,6 +185,7 @@
 
 
 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("StoreLocalInstr");
   Register value = locs()->in(0).reg();
   Register result = locs()->out().reg();
   ASSERT(result == value);  // Assert that register assignment is correct.
@@ -177,6 +203,7 @@
 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // The register allocator drops constant definitions that have no uses.
   if (!locs()->out().IsInvalid()) {
+    __ TraceSimMsg("ConstantInstr");
     Register result = locs()->out().reg();
     __ LoadObject(result, value());
   }
@@ -189,8 +216,8 @@
   LocationSummary* summary =
       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
   summary->set_in(0, Location::RegisterLocation(A0));  // Value.
-  summary->set_in(1, Location::RegisterLocation(A1));  // Instantiator.
-  summary->set_in(2, Location::RegisterLocation(A2));  // Type arguments.
+  summary->set_in(1, Location::RegisterLocation(A2));  // Instantiator.
+  summary->set_in(2, Location::RegisterLocation(A1));  // Type arguments.
   summary->set_out(Location::RegisterLocation(A0));
   return summary;
 }
@@ -234,6 +261,7 @@
   Register obj = locs()->in(0).reg();
   Register result = locs()->out().reg();
 
+  __ TraceSimMsg("AssertBooleanInstr");
   EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler);
   ASSERT(obj == result);
 }
@@ -324,6 +352,7 @@
                                        Token::Kind kind,
                                        LocationSummary* locs,
                                        const ICData& original_ic_data) {
+  __ TraceSimMsg("EmitEqualityAsInstanceCall");
   if (!compiler->is_optimizing()) {
     compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
                                    deopt_id,
@@ -411,6 +440,7 @@
                          Register value_cid_reg,
                          Register value_reg,
                          Label* value_is_smi = NULL) {
+  __ TraceSimMsg("LoadValueCid");
   Label done;
   if (value_is_smi == NULL) {
     __ LoadImmediate(value_cid_reg, kSmiCid);
@@ -470,6 +500,7 @@
                                 const LocationSummary& locs,
                                 Token::Kind kind,
                                 BranchInstr* branch) {
+  __ TraceSimMsg("EmitSmiComparisonOp");
   Location left = locs.in(0);
   Location right = locs.in(1);
   ASSERT(!left.IsConstant() || !right.IsConstant());
@@ -577,6 +608,7 @@
 
 void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
                                           BranchInstr* branch) {
+  __ TraceSimMsg("EqualityCompareInstr");
   ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
   if (receiver_class_id() == kSmiCid) {
     // Deoptimizes if both arguments not Smi.
@@ -666,6 +698,7 @@
 
 
 void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("RelationalOpInstr");
   if (operands_class_id() == kSmiCid) {
     EmitSmiComparisonOp(compiler, *locs(), kind(), NULL);
     return;
@@ -684,8 +717,9 @@
   // explicitly pushing arguments to the call here.
   Register left = locs()->in(0).reg();
   Register right = locs()->in(1).reg();
-  __ Push(left);
-  __ Push(right);
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(left, Address(SP, 1 * kWordSize));
+  __ sw(right, Address(SP, 0 * kWordSize));
   if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
     Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptRelationalOp);
     // Load class into A2.
@@ -737,6 +771,7 @@
 
 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
                                        BranchInstr* branch) {
+  __ TraceSimMsg("RelationalOpInstr");
   if (operands_class_id() == kSmiCid) {
     EmitSmiComparisonOp(compiler, *locs(), kind(), branch);
     return;
@@ -769,6 +804,7 @@
 
 
 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("NativeCallInstr");
   ASSERT(locs()->temp(0).reg() == A1);
   ASSERT(locs()->temp(1).reg() == A2);
   ASSERT(locs()->temp(2).reg() == T5);
@@ -853,57 +889,350 @@
 
 
 LocationSummary* StoreIndexedInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 3;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RequiresRegister());
+  // The smi index is either untagged (element size == 1), or it is left smi
+  // tagged (for all element sizes > 1).
+  // TODO(regis): Revisit and see if the index can be immediate.
+  locs->set_in(1, Location::WritableRegister());
+  switch (class_id()) {
+    case kArrayCid:
+      locs->set_in(2, ShouldEmitStoreBarrier()
+                        ? Location::WritableRegister()
+                        : Location::RegisterOrConstant(value()));
+      break;
+    case kExternalTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataUint16ArrayCid:
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataUint32ArrayCid:
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+    case kTypedDataFloat32x4ArrayCid:
+      UNIMPLEMENTED();
+      break;
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+  return locs;
 }
 
 
 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  __ TraceSimMsg("StoreIndexedInstr");
+  Register array = locs()->in(0).reg();
+  Location index = locs()->in(1);
+
+  Address element_address(kNoRegister, 0);
+  if (IsExternal()) {
+    UNIMPLEMENTED();
+  } else {
+    ASSERT(this->array()->definition()->representation() == kTagged);
+    ASSERT(index.IsRegister());  // TODO(regis): Revisit.
+    // Note that index is expected smi-tagged, (i.e, times 2) for all arrays
+    // with index scale factor > 1. E.g., for Uint8Array and OneByteString the
+    // index is expected to be untagged before accessing.
+    ASSERT(kSmiTagShift == 1);
+    switch (index_scale()) {
+      case 1: {
+        __ SmiUntag(index.reg());
+        break;
+      }
+      case 2: {
+        break;
+      }
+      case 4: {
+        __ sll(index.reg(), index.reg(), 1);
+        break;
+      }
+      case 8: {
+        __ sll(index.reg(), index.reg(), 2);
+        break;
+      }
+      case 16: {
+        __ sll(index.reg(), index.reg(), 3);
+        break;
+      }
+      default:
+        UNREACHABLE();
+    }
+    __ AddImmediate(index.reg(),
+        FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag);
+    __ addu(TMP1, array, index.reg());
+    element_address = Address(TMP1);
+  }
+
+  switch (class_id()) {
+    case kArrayCid:
+      if (ShouldEmitStoreBarrier()) {
+        Register value = locs()->in(2).reg();
+        __ StoreIntoObject(array, element_address, value);
+      } else if (locs()->in(2).IsConstant()) {
+        const Object& constant = locs()->in(2).constant();
+        __ StoreIntoObjectNoBarrier(array, element_address, constant);
+      } else {
+        Register value = locs()->in(2).reg();
+        __ StoreIntoObjectNoBarrier(array, element_address, value);
+      }
+      break;
+    case kTypedDataInt8ArrayCid:
+    case kTypedDataUint8ArrayCid:
+    case kExternalTypedDataUint8ArrayCid:
+    case kTypedDataUint8ClampedArrayCid:
+    case kExternalTypedDataUint8ClampedArrayCid:
+    case kTypedDataInt16ArrayCid:
+    case kTypedDataUint16ArrayCid:
+    case kTypedDataInt32ArrayCid:
+    case kTypedDataUint32ArrayCid:
+    case kTypedDataFloat32ArrayCid:
+    case kTypedDataFloat64ArrayCid:
+    case kTypedDataFloat32x4ArrayCid:
+      UNIMPLEMENTED();
+      break;
+    default:
+      UNREACHABLE();
+  }
 }
 
 
 LocationSummary* GuardFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  if ((value()->Type()->ToCid() == kDynamicCid) &&
+      (field().guarded_cid() != kSmiCid)) {
+    summary->AddTemp(Location::RequiresRegister());
+  }
+  if (field().guarded_cid() == kIllegalCid) {
+    summary->AddTemp(Location::RequiresRegister());
+  }
+  return summary;
 }
 
 
 void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  __ TraceSimMsg("GuardFieldInstr");
+  const intptr_t field_cid = field().guarded_cid();
+  const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid;
+
+  if (field_cid == kDynamicCid) {
+    ASSERT(!compiler->is_optimizing());
+    return;  // Nothing to emit.
+  }
+
+  const intptr_t value_cid = value()->Type()->ToCid();
+
+  Register value_reg = locs()->in(0).reg();
+
+  Register value_cid_reg = ((value_cid == kDynamicCid) &&
+      (field_cid != kSmiCid)) ? locs()->temp(0).reg() : kNoRegister;
+
+  Register field_reg = (field_cid == kIllegalCid) ?
+      locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
+
+  Label ok, fail_label;
+
+  Label* deopt = compiler->is_optimizing() ?
+      compiler->AddDeoptStub(deopt_id(), kDeoptGuardField) : NULL;
+
+  Label* fail = (deopt != NULL) ? deopt : &fail_label;
+
+  const bool ok_is_fall_through = (deopt != NULL);
+
+  if (!compiler->is_optimizing() || (field_cid == kIllegalCid)) {
+    if (!compiler->is_optimizing()) {
+      // Currently we can't have different location summaries for optimized
+      // and non-optimized code. So instead we manually pick up a register
+      // that is known to be free because we know how non-optimizing compiler
+      // allocates registers.
+      field_reg = A0;
+      ASSERT((field_reg != value_reg) && (field_reg != value_cid_reg));
+    }
+
+    __ LoadObject(field_reg, Field::ZoneHandle(field().raw()));
+
+    FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset());
+    FieldAddress field_nullability_operand(
+        field_reg, Field::is_nullable_offset());
+
+    if (value_cid == kDynamicCid) {
+      if (value_cid_reg == kNoRegister) {
+        ASSERT(!compiler->is_optimizing());
+        value_cid_reg = A1;
+        ASSERT((value_cid_reg != value_reg) && (field_reg != value_cid_reg));
+      }
+
+      LoadValueCid(compiler, value_cid_reg, value_reg);
+
+      __ lw(TMP1, field_cid_operand);
+      __ beq(value_cid_reg, TMP1, &ok);
+      __ lw(TMP1, field_nullability_operand);
+      __ subu(CMPRES, value_cid_reg, TMP1);
+    } else if (value_cid == kNullCid) {
+      // TODO(regis): TMP1 may conflict. Revisit.
+      __ lw(TMP1, field_nullability_operand);
+      __ LoadImmediate(TMP2, value_cid);
+      __ subu(CMPRES, TMP1, TMP2);
+    } else {
+      // TODO(regis): TMP1 may conflict. Revisit.
+      __ lw(TMP1, field_cid_operand);
+      __ LoadImmediate(TMP2, value_cid);
+      __ subu(CMPRES, TMP1, TMP2);
+    }
+    __ beq(CMPRES, ZR, &ok);
+
+    __ lw(TMP1, field_cid_operand);
+    __ BranchNotEqual(TMP1, kIllegalCid, fail);
+
+    if (value_cid == kDynamicCid) {
+      __ sw(value_cid_reg, field_cid_operand);
+      __ sw(value_cid_reg, field_nullability_operand);
+    } else {
+      __ LoadImmediate(TMP1, value_cid);
+      __ sw(TMP1, field_cid_operand);
+      __ sw(TMP1, field_nullability_operand);
+    }
+
+    if (!ok_is_fall_through) {
+      __ b(&ok);
+    }
+  } else {
+    if (value_cid == kDynamicCid) {
+      // Field's guarded class id is fixed by value's class id is not known.
+      __ andi(CMPRES, value_reg, Immediate(kSmiTagMask));
+
+      if (field_cid != kSmiCid) {
+        __ beq(CMPRES, ZR, fail);
+        __ LoadClassId(value_cid_reg, value_reg);
+        __ LoadImmediate(TMP1, field_cid);
+        __ subu(CMPRES, value_cid_reg, TMP1);
+      }
+
+      if (field().is_nullable() && (field_cid != kNullCid)) {
+        __ beq(CMPRES, ZR, &ok);
+        __ LoadImmediate(TMP1, reinterpret_cast<intptr_t>(Object::null()));
+        __ subu(CMPRES, value_reg, TMP1);
+      }
+
+      if (ok_is_fall_through) {
+        __ bne(CMPRES, ZR, fail);
+      } else {
+        __ beq(CMPRES, ZR, &ok);
+      }
+    } else {
+      // Both value's and field's class id is known.
+      if ((value_cid != field_cid) && (value_cid != nullability)) {
+        if (ok_is_fall_through) {
+          __ b(fail);
+        }
+      } else {
+        // Nothing to emit.
+        ASSERT(!compiler->is_optimizing());
+        return;
+      }
+    }
+  }
+
+  if (deopt == NULL) {
+    ASSERT(!compiler->is_optimizing());
+    __ Bind(fail);
+
+    __ lw(TMP1, FieldAddress(field_reg, Field::guarded_cid_offset()));
+    __ BranchEqual(TMP1, kDynamicCid, &ok);
+
+    __ addiu(SP, SP, Immediate(-2 * kWordSize));
+    __ sw(field_reg, Address(SP, 1 * kWordSize));
+    __ sw(value_reg, Address(SP, 0 * kWordSize));
+    __ CallRuntime(kUpdateFieldCidRuntimeEntry);
+    __ Drop(2);  // Drop the field and the value.
+  }
+
+  __ Bind(&ok);
 }
 
 
 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  const intptr_t num_temps =  0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresRegister());
+  summary->set_in(1, ShouldEmitStoreBarrier()
+                       ? Location::WritableRegister()
+                       : Location::RegisterOrConstant(value()));
+  return summary;
 }
 
 
 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instance_reg = locs()->in(0).reg();
+  if (ShouldEmitStoreBarrier()) {
+    Register value_reg = locs()->in(1).reg();
+    __ StoreIntoObject(instance_reg,
+                       FieldAddress(instance_reg, field().Offset()),
+                       value_reg,
+                       CanValueBeSmi());
+  } else {
+    if (locs()->in(1).IsConstant()) {
+      __ StoreIntoObjectNoBarrier(
+          instance_reg,
+          FieldAddress(instance_reg, field().Offset()),
+          locs()->in(1).constant());
+    } else {
+      Register value_reg = locs()->in(1).reg();
+      __ StoreIntoObjectNoBarrier(instance_reg,
+          FieldAddress(instance_reg, field().Offset()), value_reg);
+    }
+  }
 }
 
 
 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(0,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  __ TraceSimMsg("LoadStaticFieldInstr");
+  Register result = locs()->out().reg();
+  __ LoadObject(result, field());
+  __ lw(result, Address(result, Field::value_offset() - kHeapObjectTag));
 }
 
 
 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall);
+  locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
+                                              : Location::RequiresRegister());
+  locs->set_temp(0, Location::RequiresRegister());
+  return locs;
 }
 
 
 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  __ TraceSimMsg("StoreStaticFieldInstr");
+  Register value = locs()->in(0).reg();
+  Register temp = locs()->temp(0).reg();
+
+  __ LoadObject(temp, field());
+  if (this->value()->NeedsStoreBuffer()) {
+    __ StoreIntoObject(temp,
+        FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi());
+  } else {
+    __ StoreIntoObjectNoBarrier(
+        temp, FieldAddress(temp, Field::value_offset()), value);
+  }
 }
 
 
@@ -919,13 +1248,26 @@
 
 
 LocationSummary* CreateArrayInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  locs->set_in(0, Location::RegisterLocation(A0));
+  locs->set_out(Location::RegisterLocation(V0));
+  return locs;
 }
 
 
 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  __ TraceSimMsg("CreateArrayInstr");
+  // Allocate the array.  A1 = length, A0 = element type.
+  ASSERT(locs()->in(0).reg() == A0);
+  __ LoadImmediate(A1, Smi::RawValue(num_elements()));
+  compiler->GenerateCall(token_pos(),
+                         &StubCode::AllocateArrayLabel(),
+                         PcDescriptors::kOther,
+                         locs());
+  ASSERT(locs()->out().reg() == V0);
 }
 
 
@@ -943,62 +1285,186 @@
 
 
 LocationSummary* LoadFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(1,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instance_reg = locs()->in(0).reg();
+  Register result_reg = locs()->out().reg();
+
+  __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag));
 }
 
 
 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  locs->set_in(0, Location::RegisterLocation(T0));
+  locs->set_out(Location::RegisterLocation(T0));
+  return locs;
 }
 
 
 void InstantiateTypeArgumentsInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  __ TraceSimMsg("InstantiateTypeArgumentsInstr");
+  Register instantiator_reg = locs()->in(0).reg();
+  Register result_reg = locs()->out().reg();
+
+  // 'instantiator_reg' is the instantiator AbstractTypeArguments object
+  // (or null).
+  if (!type_arguments().IsUninstantiatedIdentity()) {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments.
+    Label type_arguments_instantiated;
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      __ BranchEqual(instantiator_reg,
+                     reinterpret_cast<intptr_t>(Object::null()),
+                     &type_arguments_instantiated);
+    }
+    // Instantiate non-null type arguments.
+    // A runtime call to instantiate the type arguments is required.
+    __ addiu(SP, SP, Immediate(-3 * kWordSize));
+    __ LoadObject(TMP1, Object::ZoneHandle());
+    __ LoadObject(TMP2, type_arguments());
+    __ sw(TMP1, Address(SP, 2 * kWordSize));  // Make room for the result.
+    __ sw(TMP2, Address(SP, 1 * kWordSize));
+    // Push instantiator type arguments.
+    __ sw(instantiator_reg, Address(SP, 0 * kWordSize));
+
+    compiler->GenerateCallRuntime(token_pos(),
+                                  deopt_id(),
+                                  kInstantiateTypeArgumentsRuntimeEntry,
+                                  locs());
+    // Pop instantiated type arguments.
+    __ lw(result_reg, Address(SP, 2 * kWordSize));
+    // Drop instantiator and uninstantiated type arguments.
+    __ addiu(SP, SP, Immediate(3 * kWordSize));
+    __ Bind(&type_arguments_instantiated);
+  }
+  ASSERT(instantiator_reg == result_reg);
+  // 'result_reg': Instantiated type arguments.
 }
 
 
 LocationSummary*
 ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RequiresRegister());
+  locs->set_out(Location::SameAsFirstInput());
+  return locs;
 }
 
 
 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instantiator_reg = locs()->in(0).reg();
+  Register result_reg = locs()->out().reg();
+  ASSERT(instantiator_reg == result_reg);
+
+  // instantiator_reg is the instantiator type argument vector, i.e. an
+  // AbstractTypeArguments object (or null).
+  if (!type_arguments().IsUninstantiatedIdentity()) {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments.
+    Label type_arguments_instantiated;
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      __ BranchEqual(instantiator_reg,
+                     reinterpret_cast<intptr_t>(Object::null()),
+                     &type_arguments_instantiated);
+    }
+    // Instantiate non-null type arguments.
+    // In the non-factory case, we rely on the allocation stub to
+    // instantiate the type arguments.
+    __ LoadObject(result_reg, type_arguments());
+    // result_reg: uninstantiated type arguments.
+    __ Bind(&type_arguments_instantiated);
+  }
+  ASSERT(instantiator_reg == result_reg);
+  // result_reg: uninstantiated or instantiated type arguments.
 }
 
 
 LocationSummary*
 ExtractConstructorInstantiatorInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, Location::RequiresRegister());
+  locs->set_out(Location::SameAsFirstInput());
+  return locs;
 }
 
 
 void ExtractConstructorInstantiatorInstr::EmitNativeCode(
     FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register instantiator_reg = locs()->in(0).reg();
+  ASSERT(locs()->out().reg() == instantiator_reg);
+
+  // instantiator_reg is the instantiator AbstractTypeArguments object
+  // (or null).
+  if (type_arguments().IsUninstantiatedIdentity()) {
+    // The instantiator was used in VisitExtractConstructorTypeArguments as the
+    // instantiated type arguments, no proper instantiator needed.
+    __ LoadImmediate(instantiator_reg,
+                     Smi::RawValue(StubCode::kNoInstantiator));
+  } else {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments and do not pass the instantiator.
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      Label instantiator_not_null;
+      __ BranchNotEqual(instantiator_reg,
+          reinterpret_cast<intptr_t>(Object::null()), &instantiator_not_null);
+      // Null was used in VisitExtractConstructorTypeArguments as the
+      // instantiated type arguments, no proper instantiator needed.
+      __ LoadImmediate(instantiator_reg,
+                       Smi::RawValue(StubCode::kNoInstantiator));
+      __ Bind(&instantiator_not_null);
+    }
+  }
+  // instantiator_reg: instantiator or kNoInstantiator.
 }
 
 
 LocationSummary* AllocateContextInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 0;
+  const intptr_t kNumTemps = 1;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  locs->set_temp(0, Location::RegisterLocation(T1));
+  locs->set_out(Location::RegisterLocation(V0));
+  return locs;
 }
 
 
 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register temp = T1;
+  ASSERT(locs()->temp(0).reg() == temp);
+  ASSERT(locs()->out().reg() == V0);
+
+  __ TraceSimMsg("AllocateContextInstr");
+  __ LoadImmediate(temp, num_context_variables());
+  const ExternalLabel label("alloc_context",
+                            StubCode::AllocateContextEntryPoint());
+  compiler->GenerateCall(token_pos(),
+                         &label,
+                         PcDescriptors::kOther,
+                         locs());
 }
 
 
@@ -1014,13 +1480,44 @@
 
 
 LocationSummary* CatchEntryInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(0,
+                               Location::NoLocation(),
+                               LocationSummary::kNoCall);
 }
 
 
+// Restore stack and initialize the two exception variables:
+// exception and stack trace variables.
 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  // Restore SP from FP as we are coming from a throw and the code for
+  // popping arguments has not been run.
+  const intptr_t fp_sp_dist =
+      (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+  ASSERT(fp_sp_dist <= 0);
+  __ AddImmediate(SP, FP, fp_sp_dist);
+
+  ASSERT(!exception_var().is_captured());
+  ASSERT(!stacktrace_var().is_captured());
+
+  __ sw(kExceptionObjectReg,
+        Address(FP, exception_var().index() * kWordSize));
+  __ sw(kStackTraceObjectReg,
+        Address(FP, stacktrace_var().index() * kWordSize));
+
+  Label next;
+  __ mov(TMP1, RA);  // Save return adress.
+  // Restore the pool pointer.
+  __ bal(&next);  // Branch and link to next instruction to get PC in RA.
+  __ delay_slot()->mov(TMP2, RA);  // Save PC of the following mov.
+
+  // Calculate offset of pool pointer from the PC.
+  const intptr_t object_pool_pc_dist =
+     Instructions::HeaderSize() - Instructions::object_pool_offset() +
+     compiler->assembler()->CodeSize();
+
+  __ Bind(&next);
+  __ mov(RA, TMP1);  // Restore return address.
+  __ lw(PP, Address(TMP2, -object_pool_pc_dist));
 }
 
 
@@ -1041,6 +1538,7 @@
       : instruction_(instruction) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
+    __ TraceSimMsg("CheckStackOverflowSlowPath");
     __ Comment("CheckStackOverflowSlowPath");
     __ Bind(entry_label());
     compiler->SaveLiveRegisters(instruction_->locs());
@@ -1063,6 +1561,7 @@
 
 
 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("CheckStackOverflowInstr");
   CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this);
   compiler->AddSlowPathCode(slow_path);
 
@@ -1095,6 +1594,7 @@
 
 
 void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("BinarySmiOpInstr");
   if (op_kind() == Token::kSHL) {
     UNIMPLEMENTED();
     return;
@@ -1134,15 +1634,26 @@
       case Token::kMUL: {
         // Keep left value tagged and untag right value.
         const intptr_t value = Smi::Cast(constant).Value();
-        if (value == 2) {
-          __ sll(result, left, 1);
+        if (deopt == NULL) {
+          if (value == 2) {
+            __ sll(result, left, 1);
+          } else {
+            __ LoadImmediate(TMP1, value);
+            __ mult(left, TMP1);
+            __ mflo(result);
+          }
         } else {
-          __ LoadImmediate(TMP1, value);
-          __ mult(left, TMP1);
-          __ mflo(result);
-        }
-        if (deopt != NULL) {
-          UNIMPLEMENTED();
+          if (value == 2) {
+            __ sra(TMP1, left, 31);  // TMP1 = sign of left.
+            __ sll(result, left, 1);
+          } else {
+            __ LoadImmediate(TMP1, value);
+            __ mult(left, TMP1);
+            __ mflo(result);
+            __ mfhi(TMP1);
+          }
+          __ sra(TMP2, result, 31);
+          __ bne(TMP1, TMP2, deopt);
         }
         break;
       }
@@ -1346,6 +1857,50 @@
 }
 
 
+LocationSummary* Float32x4ShuffleInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4ZeroInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
+LocationSummary* Float32x4SplatInstr::MakeLocationSummary() const {
+  UNIMPLEMENTED();
+  return NULL;
+}
+
+
+void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  UNIMPLEMENTED();
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   UNIMPLEMENTED();
   return NULL;
@@ -1429,6 +1984,7 @@
 
 
 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("PolymorphicInstanceCallInstr");
   Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
                                         kDeoptPolymorphicInstanceCallTestFail);
   if (ic_data().NumberOfChecks() == 0) {
@@ -1448,7 +2004,7 @@
     return;
   }
 
-  // Load receiver into R0.
+  // Load receiver into T0.
   __ lw(T0, Address(SP, (instance_call()->ArgumentCount() - 1) * kWordSize));
 
   LoadValueCid(compiler, T2, T0,
@@ -1472,6 +2028,7 @@
 
 
 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("BranchInstr");
   comparison()->EmitBranchCode(compiler, this);
 }
 
@@ -1498,6 +2055,7 @@
 
 
 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("CheckSmiInstr");
   Register value = locs()->in(0).reg();
   Label* deopt = compiler->AddDeoptStub(deopt_id(),
                                         kDeoptCheckSmi);
@@ -1573,25 +2131,31 @@
 
 
 LocationSummary* ThrowInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return new LocationSummary(0, 0, LocationSummary::kCall);
 }
 
 
 
 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  compiler->GenerateCallRuntime(token_pos(),
+                                deopt_id(),
+                                kThrowRuntimeEntry,
+                                locs());
+  __ break_(0);
 }
 
 
 LocationSummary* ReThrowInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return new LocationSummary(0, 0, LocationSummary::kCall);
 }
 
 
 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  compiler->GenerateCallRuntime(token_pos(),
+                                deopt_id(),
+                                kReThrowRuntimeEntry,
+                                locs());
+  __ break_(0);
 }
 
 
@@ -1601,6 +2165,7 @@
 
 
 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("GotoInstr");
   // Add deoptimization descriptor for deoptimizing instructions
   // that may be inserted before this instruction.
   if (!compiler->is_optimizing()) {
@@ -1639,6 +2204,7 @@
 
 void ControlInstruction::EmitBranchOnValue(FlowGraphCompiler* compiler,
                                            bool value) {
+  __ TraceSimMsg("ControlInstruction::EmitBranchOnValue");
   if (value && !compiler->CanFallThroughTo(true_successor())) {
     __ b(compiler->GetJumpLabel(true_successor()));
   } else if (!value && !compiler->CanFallThroughTo(false_successor())) {
@@ -1650,6 +2216,7 @@
 // The comparison result is in CMPRES.
 void ControlInstruction::EmitBranchOnCondition(FlowGraphCompiler* compiler,
                                                Condition true_condition) {
+  __ TraceSimMsg("ControlInstruction::EmitBranchOnCondition");
   if (compiler->CanFallThroughTo(false_successor())) {
     // If the next block is the false successor we will fall through to it.
     Label* label = compiler->GetJumpLabel(true_successor());
@@ -1689,13 +2256,14 @@
 
 
 LocationSummary* CurrentContextInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(0,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  __ mov(locs()->out().reg(), CTX);
 }
 
 
@@ -1713,6 +2281,7 @@
 
 // Special code for numbers (compare values instead of references.)
 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("StrictCompareInstr");
   ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
   Location left = locs()->in(0);
   Location right = locs()->in(1);
@@ -1756,6 +2325,7 @@
 
 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
                                         BranchInstr* branch) {
+  __ TraceSimMsg("StrictCompareInstr::EmitBranchCode");
   ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
   Location left = locs()->in(0);
   Location right = locs()->in(1);
@@ -1786,41 +2356,66 @@
 }
 
 
-void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
-}
-
-
 LocationSummary* BooleanNegateInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(1,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register value = locs()->in(0).reg();
+  Register result = locs()->out().reg();
+
+  __ LoadObject(result, Bool::True());
+  __ LoadObject(TMP1, Bool::False());
+  __ subu(CMPRES, value, result);
+  __ movz(result, TMP1, CMPRES);  // If value is True, move False into result.
 }
 
 
 LocationSummary* ChainContextInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(1,
+                               Location::NoLocation(),
+                               LocationSummary::kNoCall);
 }
 
 
 void ChainContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register context_value = locs()->in(0).reg();
+
+  // Chain the new context in context_value to its parent in CTX.
+  __ StoreIntoObject(context_value,
+                     FieldAddress(context_value, Context::parent_offset()),
+                     CTX);
+  // Set new context as current context.
+  __ mov(CTX, context_value);
 }
 
 
 LocationSummary* StoreVMFieldInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
+                                              : Location::RequiresRegister());
+  locs->set_in(1, Location::RequiresRegister());
+  return locs;
 }
 
 
 void StoreVMFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register value_reg = locs()->in(0).reg();
+  Register dest_reg = locs()->in(1).reg();
+
+  if (value()->NeedsStoreBuffer()) {
+    __ StoreIntoObject(dest_reg, FieldAddress(dest_reg, offset_in_bytes()),
+                       value_reg);
+  } else {
+    __ StoreIntoObjectNoBarrier(
+        dest_reg, FieldAddress(dest_reg, offset_in_bytes()), value_reg);
+  }
 }
 
 
@@ -1830,6 +2425,7 @@
 
 
 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  __ TraceSimMsg("AllocateObjectInstr");
   const Class& cls = Class::ZoneHandle(constructor().Owner());
   const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls));
   const ExternalLabel label(cls.ToCString(), stub.EntryPoint());
@@ -1842,13 +2438,21 @@
 
 
 LocationSummary* CreateClosureInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return MakeCallSummary();
 }
 
 
 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  const Function& closure_function = function();
+  ASSERT(!closure_function.IsImplicitStaticClosureFunction());
+  const Code& stub = Code::Handle(
+      StubCode::GetAllocationStubForClosure(closure_function));
+  const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
+  compiler->GenerateCall(token_pos(),
+                         &label,
+                         PcDescriptors::kOther,
+                         locs());
+  __ Drop(2);  // Discard type arguments and receiver.
 }
 
 }  // namespace dart
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 2e45481..f859440 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -128,7 +128,6 @@
     case ABOVE:         return BELOW_EQUAL;
     case ABOVE_EQUAL:   return BELOW;
     default:
-      OS::Print("Error %d\n", condition);
       UNIMPLEMENTED();
       return EQUAL;
   }
@@ -1846,43 +1845,31 @@
 
   // 'instantiator_reg' is the instantiator AbstractTypeArguments object
   // (or null).
-  // If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments.
-  Label type_arguments_instantiated;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    const Immediate& raw_null =
-        Immediate(reinterpret_cast<intptr_t>(Object::null()));
-    __ cmpq(instantiator_reg, raw_null);
-    __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
+  if (!type_arguments().IsUninstantiatedIdentity()) {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments.
+    Label type_arguments_instantiated;
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      const Immediate& raw_null =
+          Immediate(reinterpret_cast<intptr_t>(Object::null()));
+      __ cmpq(instantiator_reg, raw_null);
+      __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
+    }
+    // Instantiate non-null type arguments.
+    // A runtime call to instantiate the type arguments is required.
+    __ PushObject(Object::ZoneHandle());  // Make room for the result.
+    __ PushObject(type_arguments());
+    __ pushq(instantiator_reg);  // Push instantiator type arguments.
+    compiler->GenerateCallRuntime(token_pos(),
+                                  deopt_id(),
+                                  kInstantiateTypeArgumentsRuntimeEntry,
+                                  locs());
+    __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
+    __ popq(result_reg);  // Pop instantiated type arguments.
+    __ Bind(&type_arguments_instantiated);
   }
-  // Instantiate non-null type arguments.
-  if (type_arguments().IsUninstantiatedIdentity()) {
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check the instantiator ('instantiator_reg') for null here,
-    // because a null instantiator will have the wrong class (Null instead of
-    // TypeArguments).
-    Label type_arguments_uninstantiated;
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid);
-    __ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
-    __ cmpq(FieldAddress(instantiator_reg, TypeArguments::length_offset()),
-            Immediate(Smi::RawValue(len)));
-    __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
-    __ Bind(&type_arguments_uninstantiated);
-  }
-  // A runtime call to instantiate the type arguments is required.
-  __ PushObject(Object::ZoneHandle());  // Make room for the result.
-  __ PushObject(type_arguments());
-  __ pushq(instantiator_reg);  // Push instantiator type arguments.
-  compiler->GenerateCallRuntime(token_pos(),
-                                deopt_id(),
-                                kInstantiateTypeArgumentsRuntimeEntry,
-                                locs());
-  __ Drop(2);  // Drop instantiator and uninstantiated type arguments.
-  __ popq(result_reg);  // Pop instantiated type arguments.
-  __ Bind(&type_arguments_instantiated);
   ASSERT(instantiator_reg == result_reg);
   // 'result_reg': Instantiated type arguments.
 }
@@ -1908,38 +1895,26 @@
 
   // instantiator_reg is the instantiator type argument vector, i.e. an
   // AbstractTypeArguments object (or null).
-  // If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments.
-  Label type_arguments_instantiated;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    const Immediate& raw_null =
-        Immediate(reinterpret_cast<intptr_t>(Object::null()));
-    __ cmpq(instantiator_reg, raw_null);
-    __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
+  if (!type_arguments().IsUninstantiatedIdentity()) {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments.
+    Label type_arguments_instantiated;
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      const Immediate& raw_null =
+          Immediate(reinterpret_cast<intptr_t>(Object::null()));
+      __ cmpq(instantiator_reg, raw_null);
+      __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
+    }
+    // Instantiate non-null type arguments.
+    // In the non-factory case, we rely on the allocation stub to
+    // instantiate the type arguments.
+    __ LoadObject(result_reg, type_arguments());
+    // result_reg: uninstantiated type arguments.
+    __ Bind(&type_arguments_instantiated);
   }
-  // Instantiate non-null type arguments.
-  if (type_arguments().IsUninstantiatedIdentity()) {
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check instantiator_reg for null here, because a null
-    // instantiator will have the wrong class (Null instead of TypeArguments).
-    Label type_arguments_uninstantiated;
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid);
-    __ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
-    const Immediate& arguments_length =
-        Immediate(Smi::RawValue(type_arguments().Length()));
-    __ cmpq(FieldAddress(instantiator_reg, TypeArguments::length_offset()),
-        arguments_length);
-    __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump);
-    __ Bind(&type_arguments_uninstantiated);
-  }
-  // In the non-factory case, we rely on the allocation stub to
-  // instantiate the type arguments.
-  __ LoadObject(result_reg, type_arguments());
-  // result_reg: uninstantiated type arguments.
-  __ Bind(&type_arguments_instantiated);
+  ASSERT(instantiator_reg == result_reg);
   // result_reg: uninstantiated or instantiated type arguments.
 }
 
@@ -1962,50 +1937,30 @@
   ASSERT(locs()->out().reg() == instantiator_reg);
 
   // instantiator_reg is the instantiator AbstractTypeArguments object
-  // (or null).  If the instantiator is null and if the type argument vector
-  // instantiated from null becomes a vector of dynamic, then use null as
-  // the type arguments and do not pass the instantiator.
-  Label done;
-  const intptr_t len = type_arguments().Length();
-  if (type_arguments().IsRawInstantiatedRaw(len)) {
-    const Immediate& raw_null =
-        Immediate(reinterpret_cast<intptr_t>(Object::null()));
-    Label instantiator_not_null;
-    __ cmpq(instantiator_reg, raw_null);
-    __ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump);
-    // Null was used in VisitExtractConstructorTypeArguments as the
-    // instantiated type arguments, no proper instantiator needed.
-    __ movq(instantiator_reg,
-            Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
-    __ jmp(&done);
-    __ Bind(&instantiator_not_null);
-  }
-  // Instantiate non-null type arguments.
+  // (or null).
   if (type_arguments().IsUninstantiatedIdentity()) {
-    // TODO(regis): The following emitted code is duplicated in
-    // VisitExtractConstructorTypeArguments above. The reason is that the code
-    // is split between two computations, so that each one produces a
-    // single value, rather than producing a pair of values.
-    // If this becomes an issue, we should expose these tests at the IL level.
-
-    // Check if the instantiator type argument vector is a TypeArguments of a
-    // matching length and, if so, use it as the instantiated type_arguments.
-    // No need to check the instantiator ('instantiator_reg') for null here,
-    // because a null instantiator will have the wrong class (Null instead of
-    // TypeArguments).
-    __ CompareClassId(instantiator_reg, kTypeArgumentsCid);
-    __ j(NOT_EQUAL, &done, Assembler::kNearJump);
-    const Immediate& arguments_length =
-        Immediate(Smi::RawValue(type_arguments().Length()));
-    __ cmpq(FieldAddress(instantiator_reg, TypeArguments::length_offset()),
-        arguments_length);
-    __ j(NOT_EQUAL, &done, Assembler::kNearJump);
     // The instantiator was used in VisitExtractConstructorTypeArguments as the
     // instantiated type arguments, no proper instantiator needed.
     __ movq(instantiator_reg,
             Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
+  } else {
+    // If the instantiator is null and if the type argument vector
+    // instantiated from null becomes a vector of dynamic, then use null as
+    // the type arguments and do not pass the instantiator.
+    const intptr_t len = type_arguments().Length();
+    if (type_arguments().IsRawInstantiatedRaw(len)) {
+      const Immediate& raw_null =
+          Immediate(reinterpret_cast<intptr_t>(Object::null()));
+      Label instantiator_not_null;
+      __ cmpq(instantiator_reg, raw_null);
+      __ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump);
+      // Null was used in VisitExtractConstructorTypeArguments as the
+      // instantiated type arguments, no proper instantiator needed.
+      __ movq(instantiator_reg,
+              Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
+      __ Bind(&instantiator_not_null);
+    }
   }
-  __ Bind(&done);
   // instantiator_reg: instantiator or kNoInstantiator.
 }
 
@@ -2861,6 +2816,130 @@
 }
 
 
+LocationSummary* Float32x4ShuffleInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void Float32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister value = locs()->in(0).fpu_reg();
+
+  ASSERT(locs()->out().fpu_reg() == value);
+
+  switch (op_kind()) {
+    case MethodRecognizer::kFloat32x4ShuffleXXXX:
+      __ shufps(value, value, Immediate(0x00));
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleYYYY:
+      __ shufps(value, value, Immediate(0x55));
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleZZZZ:
+      __ shufps(value, value, Immediate(0xAA));
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleWWWW:
+      __ shufps(value, value, Immediate(0xFF));
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleX:
+      __ shufps(value, value, Immediate(0x00));
+      __ cvtss2sd(value, value);
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleY:
+      __ shufps(value, value, Immediate(0x55));
+      __ cvtss2sd(value, value);
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleZ:
+      __ shufps(value, value, Immediate(0xAA));
+      __ cvtss2sd(value, value);
+      break;
+    case MethodRecognizer::kFloat32x4ShuffleW:
+      __ shufps(value, value, Immediate(0xFF));
+      __ cvtss2sd(value, value);
+      break;
+    default: UNREACHABLE();
+  }
+}
+
+
+LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 4;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_in(1, Location::RequiresFpuRegister());
+  summary->set_in(2, Location::RequiresFpuRegister());
+  summary->set_in(3, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister v0 = locs()->in(0).fpu_reg();
+  XmmRegister v1 = locs()->in(1).fpu_reg();
+  XmmRegister v2 = locs()->in(2).fpu_reg();
+  XmmRegister v3 = locs()->in(3).fpu_reg();
+  ASSERT(v0 == locs()->out().fpu_reg());
+  __ subq(RSP, Immediate(16));
+  __ cvtsd2ss(v0, v0);
+  __ movss(Address(RSP, -16), v0);
+  __ movsd(v0, v1);
+  __ cvtsd2ss(v0, v0);
+  __ movss(Address(RSP, -12), v0);
+  __ movsd(v0, v2);
+  __ cvtsd2ss(v0, v0);
+  __ movss(Address(RSP, -8), v0);
+  __ movsd(v0, v3);
+  __ cvtsd2ss(v0, v0);
+  __ movss(Address(RSP, -4), v0);
+  __ movups(v0, Address(RSP, -16));
+  __ addq(RSP, Immediate(16));
+}
+
+
+LocationSummary* Float32x4ZeroInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 0;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_out(Location::RequiresFpuRegister());
+  return summary;
+}
+
+
+void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister value = locs()->out().fpu_reg();
+  __ xorps(value, value);
+}
+
+
+LocationSummary* Float32x4SplatInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 1;
+  const intptr_t kNumTemps = 0;
+  LocationSummary* summary =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+  summary->set_in(0, Location::RequiresFpuRegister());
+  summary->set_out(Location::SameAsFirstInput());
+  return summary;
+}
+
+
+void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+  XmmRegister value = locs()->out().fpu_reg();
+  ASSERT(locs()->in(0).fpu_reg() == locs()->out().fpu_reg());
+  // Convert to Float32.
+  __ cvtsd2ss(value, value);
+  // Splat across all lanes.
+  __ shufps(value, value, Immediate(0x00));
+}
+
+
 LocationSummary* MathSqrtInstr::MakeLocationSummary() const {
   const intptr_t kNumInputs = 1;
   const intptr_t kNumTemps = 0;
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc
index f7303a9..068c817 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -123,9 +123,9 @@
   lib = Library::MathLibrary();
   MATH_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
 
-  // Set up all dart:typeddata lib functions that can be intrisified.
+  // Set up all dart:typed_data lib functions that can be intrisified.
   lib = Library::TypedDataLibrary();
-  TYPEDDATA_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
+  TYPED_DATA_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
 
 #undef SETUP_FUNCTION
 }
@@ -150,7 +150,7 @@
   if (lib.raw() == Library::CoreLibrary()) {
     CORE_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
   } else if (lib.raw() == Library::TypedDataLibrary()) {
-    TYPEDDATA_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
+    TYPED_DATA_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
   } else if (lib.raw() == Library::MathLibrary()) {
     MATH_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
   }
diff --git a/runtime/vm/intrinsifier.h b/runtime/vm/intrinsifier.h
index 1b851aa..b60dd83 100644
--- a/runtime/vm/intrinsifier.h
+++ b/runtime/vm/intrinsifier.h
@@ -91,32 +91,32 @@
   V(::, cos, Math_cos, 1749547468)                                             \
 
 
-#define TYPEDDATA_LIB_INTRINSIC_LIST(V)                                        \
-  V(_TypedList, get:length, TypedData_getLength, 231908172)                    \
-  V(_Int8Array, _new, TypedData_Int8Array_new, 844274443)                      \
-  V(_Uint8Array, _new, TypedData_Uint8Array_new, 997951645)                    \
-  V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 1025045044)     \
-  V(_Int16Array, _new, TypedData_Int16Array_new, 1064563368)                   \
-  V(_Uint16Array, _new, TypedData_Uint16Array_new, 110927177)                  \
-  V(_Int32Array, _new, TypedData_Int32Array_new, 770802406)                    \
-  V(_Uint32Array, _new, TypedData_Uint32Array_new, 856841876)                  \
-  V(_Int64Array, _new, TypedData_Int64Array_new, 941769528)                    \
-  V(_Uint64Array, _new, TypedData_Uint64Array_new, 977566635)                  \
-  V(_Float32Array, _new, TypedData_Float32Array_new, 1053133615)               \
-  V(_Float64Array, _new, TypedData_Float64Array_new, 936673303)                \
-  V(_Float32x4Array, _new, TypedData_Float32x4Array_new, 212088644)            \
-  V(_Int8Array, ., TypedData_Int8Array_factory, 156009974)                     \
-  V(_Uint8Array, ., TypedData_Uint8Array_factory, 1465460956)                  \
-  V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 970170700)     \
-  V(_Int16Array, ., TypedData_Int16Array_factory, 1520309224)                  \
-  V(_Uint16Array, ., TypedData_Uint16Array_factory, 195493071)                 \
-  V(_Int32Array, ., TypedData_Int32Array_factory, 27437702)                    \
-  V(_Uint32Array, ., TypedData_Uint32Array_factory, 1702451035)                \
-  V(_Int64Array, ., TypedData_Int64Array_factory, 225360944)                   \
-  V(_Uint64Array, ., TypedData_Uint64Array_factory, 1730375031)                \
-  V(_Float32Array, ., TypedData_Float32Array_factory, 563498394)               \
-  V(_Float64Array, ., TypedData_Float64Array_factory, 492220296)               \
-  V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1845796718)          \
+#define TYPED_DATA_LIB_INTRINSIC_LIST(V)                                       \
+  V(_TypedList, get:length, TypedData_getLength, 1004567191)                   \
+  V(_Int8Array, _new, TypedData_Int8Array_new, 48970297)                       \
+  V(_Uint8Array, _new, TypedData_Uint8Array_new, 389788863)                    \
+  V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 59021935)       \
+  V(_Int16Array, _new, TypedData_Int16Array_new, 465688649)                    \
+  V(_Uint16Array, _new, TypedData_Uint16Array_new, 169304657)                  \
+  V(_Int32Array, _new, TypedData_Int32Array_new, 947562951)                    \
+  V(_Uint32Array, _new, TypedData_Uint32Array_new, 85066537)                   \
+  V(_Int64Array, _new, TypedData_Int64Array_new, 775415132)                    \
+  V(_Uint64Array, _new, TypedData_Uint64Array_new, 536384146)                  \
+  V(_Float32Array, _new, TypedData_Float32Array_new, 723829075)                \
+  V(_Float64Array, _new, TypedData_Float64Array_new, 111654177)                \
+  V(_Float32x4Array, _new, TypedData_Float32x4Array_new, 984763738)            \
+  V(_Int8Array, ., TypedData_Int8Array_factory, 974805301)                     \
+  V(_Uint8Array, ., TypedData_Uint8Array_factory, 839639001)                   \
+  V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 1947193032)    \
+  V(_Int16Array, ., TypedData_Int16Array_factory, 1492289327)                  \
+  V(_Uint16Array, ., TypedData_Uint16Array_factory, 358109132)                 \
+  V(_Int32Array, ., TypedData_Int32Array_factory, 1238390459)                  \
+  V(_Uint32Array, ., TypedData_Uint32Array_factory, 1091191177)                \
+  V(_Int64Array, ., TypedData_Int64Array_factory, 569474614)                   \
+  V(_Uint64Array, ., TypedData_Uint64Array_factory, 1778132384)                \
+  V(_Float32Array, ., TypedData_Float32Array_factory, 630024167)               \
+  V(_Float64Array, ., TypedData_Float64Array_factory, 740945295)               \
+  V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1881134784)          \
 
 // TODO(srdjan): Implement _FixedSizeArrayIterator, get:current and
 //   _FixedSizeArrayIterator, moveNext.
@@ -140,7 +140,7 @@
 
   CORE_LIB_INTRINSIC_LIST(DECLARE_FUNCTION)
   MATH_LIB_INTRINSIC_LIST(DECLARE_FUNCTION)
-  TYPEDDATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION)
+  TYPED_DATA_LIB_INTRINSIC_LIST(DECLARE_FUNCTION)
 
 #undef DECLARE_FUNCTION
 };
diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc
index 6b006a9..ad286f7 100644
--- a/runtime/vm/intrinsifier_arm.cc
+++ b/runtime/vm/intrinsifier_arm.cc
@@ -85,15 +85,15 @@
 }
 
 
-#define TYPEDDATA_ALLOCATOR(clazz)                                             \
+#define TYPED_DATA_ALLOCATOR(clazz)                                            \
 bool Intrinsifier::TypedData_##clazz##_new(Assembler* assembler) {             \
   return false;                                                                \
 }                                                                              \
 bool Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {         \
   return false;                                                                \
 }
-CLASS_LIST_TYPED_DATA(TYPEDDATA_ALLOCATOR)
-#undef TYPEDDATA_ALLOCATOR
+CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
+#undef TYPED_DATA_ALLOCATOR
 
 
 bool Intrinsifier::Integer_addFromInteger(Assembler* assembler) {
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index 2afcd70..25632ee 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -574,7 +574,7 @@
 };
 
 
-#define TYPEDDATA_ALLOCATOR(clazz)                                             \
+#define TYPED_DATA_ALLOCATOR(clazz)                                            \
 bool Intrinsifier::TypedData_##clazz##_new(Assembler* assembler) {             \
   intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);       \
   intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);           \
@@ -589,8 +589,8 @@
   TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale);   \
   return false;                                                                \
 }
-CLASS_LIST_TYPED_DATA(TYPEDDATA_ALLOCATOR)
-#undef TYPEDDATA_ALLOCATOR
+CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
+#undef TYPED_DATA_ALLOCATOR
 
 
 // Tests if two top most arguments are smis, jumps to label not_smi if not.
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index 75e10dd..f09c712 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -85,15 +85,15 @@
 }
 
 
-#define TYPEDDATA_ALLOCATOR(clazz)                                             \
+#define TYPED_DATA_ALLOCATOR(clazz)                                            \
 bool Intrinsifier::TypedData_##clazz##_new(Assembler* assembler) {             \
   return false;                                                                \
 }                                                                              \
 bool Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) {         \
   return false;                                                                \
 }
-CLASS_LIST_TYPED_DATA(TYPEDDATA_ALLOCATOR)
-#undef TYPEDDATA_ALLOCATOR
+CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
+#undef TYPED_DATA_ALLOCATOR
 
 
 bool Intrinsifier::Integer_addFromInteger(Assembler* assembler) {
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index 59f1794..cbb5e49 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -534,7 +534,7 @@
 };
 
 
-#define TYPEDDATA_ALLOCATOR(clazz)                                             \
+#define TYPED_DATA_ALLOCATOR(clazz)                                            \
 bool Intrinsifier::TypedData_##clazz##_new(Assembler* assembler) {             \
   intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid);       \
   intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid);           \
@@ -549,8 +549,8 @@
   TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale);   \
   return false;                                                                \
 }
-CLASS_LIST_TYPED_DATA(TYPEDDATA_ALLOCATOR)
-#undef TYPEDDATA_ALLOCATOR
+CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR)
+#undef TYPED_DATA_ALLOCATOR
 
 
 // Tests if two top most arguments are smis, jumps to label not_smi if not.
diff --git a/runtime/vm/isolate_test.cc b/runtime/vm/isolate_test.cc
index 9812840..d970968 100644
--- a/runtime/vm/isolate_test.cc
+++ b/runtime/vm/isolate_test.cc
@@ -17,8 +17,7 @@
   delete isolate;
 }
 
-// Only ia32 and x64 can run dart execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+
 // Test to ensure that an exception is thrown if no isolate creation
 // callback has been set by the embedder when an isolate is spawned.
 TEST_CASE(IsolateSpawn) {
@@ -40,6 +39,5 @@
   Dart_Handle exception_result = Dart_ErrorGetException(result);
   EXPECT_VALID(exception_result);
 }
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
 
 }  // namespace dart
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index b579c2a..b43547d 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -7,6 +7,7 @@
 #include "include/dart_api.h"
 #include "platform/assert.h"
 #include "vm/assembler.h"
+#include "vm/cpu.h"
 #include "vm/bigint_operations.h"
 #include "vm/bootstrap.h"
 #include "vm/class_finalizer.h"
@@ -71,6 +72,7 @@
 Instance* Object::transition_sentinel_ = NULL;
 Bool* Object::bool_true_ = NULL;
 Bool* Object::bool_false_ = NULL;
+LanguageError* Object::snapshot_writer_error_ = NULL;
 
 RawObject* Object::null_ = reinterpret_cast<RawObject*>(RAW_NULL);
 RawClass* Object::class_class_ = reinterpret_cast<RawClass*>(RAW_NULL);
@@ -320,6 +322,7 @@
   transition_sentinel_ = Instance::ReadOnlyHandle(isolate);
   bool_true_ = Bool::ReadOnlyHandle(isolate);
   bool_false_ = Bool::ReadOnlyHandle(isolate);
+  snapshot_writer_error_ = LanguageError::ReadOnlyHandle(isolate);
 
   // Allocate and initialize the null instance.
   // 'null_' must be the first object allocated as it is used in allocation to
@@ -510,6 +513,10 @@
   isolate->object_store()->set_bool_class(cls);
   *bool_true_ = Bool::New(true);
   *bool_false_ = Bool::New(false);
+
+  *snapshot_writer_error_ =
+      LanguageError::New(String::Handle(String::New("SnapshotWriter Error")));
+
   ASSERT(!empty_array_->IsSmi());
   ASSERT(empty_array_->IsArray());
   ASSERT(!sentinel_->IsSmi());
@@ -520,6 +527,8 @@
   ASSERT(bool_true_->IsBool());
   ASSERT(!bool_false_->IsSmi());
   ASSERT(bool_false_->IsBool());
+  ASSERT(!snapshot_writer_error_->IsSmi());
+  ASSERT(snapshot_writer_error_->IsLanguageError());
 }
 
 
@@ -888,20 +897,20 @@
   Library::InitNativeWrappersLibrary(isolate);
   ASSERT(isolate->object_store()->native_wrappers_library() != Library::null());
 
-  // Pre-register the typeddata library so the native class implementations
+  // Pre-register the typed_data library so the native class implementations
   // can be hooked up before compiling it.
-  LOAD_LIBRARY(TypedData, typeddata);
+  LOAD_LIBRARY(TypedData, typed_data);
   ASSERT(!lib.IsNull());
   ASSERT(lib.raw() == Library::TypedDataLibrary());
-  const intptr_t typeddata_class_array_length =
+  const intptr_t typed_data_class_array_length =
       RawObject::NumberOfTypedDataClasses();
-  Array& typeddata_classes =
-      Array::Handle(Array::New(typeddata_class_array_length));
+  Array& typed_data_classes =
+      Array::Handle(Array::New(typed_data_class_array_length));
   int index = 0;
 #define REGISTER_TYPED_DATA_CLASS(clazz)                                       \
   cls = Class::NewTypedDataClass(kTypedData##clazz##Cid);                      \
   index = kTypedData##clazz##Cid - kTypedDataInt8ArrayCid;                     \
-  typeddata_classes.SetAt(index, cls);                                         \
+  typed_data_classes.SetAt(index, cls);                                        \
   RegisterPrivateClass(cls, Symbols::_##clazz(), lib);                         \
 
   CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS);
@@ -909,21 +918,21 @@
 #define REGISTER_TYPED_DATA_VIEW_CLASS(clazz)                                  \
   cls = Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid);              \
   index = kTypedData##clazz##ViewCid - kTypedDataInt8ArrayCid;                 \
-  typeddata_classes.SetAt(index, cls);                                         \
+  typed_data_classes.SetAt(index, cls);                                        \
   RegisterPrivateClass(cls, Symbols::_##clazz##View(), lib);                   \
   pending_classes.Add(cls, Heap::kOld);                                        \
 
   CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS);
   cls = Class::NewTypedDataViewClass(kByteDataViewCid);
   index = kByteDataViewCid - kTypedDataInt8ArrayCid;
-  typeddata_classes.SetAt(index, cls);
+  typed_data_classes.SetAt(index, cls);
   RegisterPrivateClass(cls, Symbols::_ByteDataView(), lib);
   pending_classes.Add(cls, Heap::kOld);
 #undef REGISTER_TYPED_DATA_VIEW_CLASS
 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz)                                   \
   cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid);      \
   index = kExternalTypedData##clazz##Cid - kTypedDataInt8ArrayCid;             \
-  typeddata_classes.SetAt(index, cls);                                         \
+  typed_data_classes.SetAt(index, cls);                                        \
   RegisterPrivateClass(cls, Symbols::_External##clazz(), lib);                 \
 
   CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS);
@@ -949,7 +958,7 @@
   type = Type::NewNonParameterizedType(cls);
   object_store->set_uint32x4_type(type);
 
-  object_store->set_typeddata_classes(typeddata_classes);
+  object_store->set_typed_data_classes(typed_data_classes);
 
   // Set the super type of class Stacktrace to Object type so that the
   // 'toString' method is implemented.
@@ -1042,7 +1051,7 @@
   INIT_LIBRARY(Json, json, true);
   INIT_LIBRARY(Math, math, true);
   INIT_LIBRARY(Mirrors, mirrors, true);
-  INIT_LIBRARY(TypedData, typeddata, true);
+  INIT_LIBRARY(TypedData, typed_data, true);
   INIT_LIBRARY(Utf, utf, false);
   INIT_LIBRARY(Uri, uri, false);
 
@@ -6616,7 +6625,7 @@
 
 
 RawLibrary* Library::TypedDataLibrary() {
-  return Isolate::Current()->object_store()->typeddata_library();
+  return Isolate::Current()->object_store()->typed_data_library();
 }
 
 
@@ -6906,7 +6915,7 @@
   MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
 
   lib = Library::TypedDataLibrary();
-  TYPEDDATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
+  TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
 
 #undef CHECK_FINGERPRINTS
   if (has_errors) {
@@ -7761,6 +7770,7 @@
   MemoryRegion region(reinterpret_cast<void*>(instrs.EntryPoint()),
                       instrs.size());
   assembler->FinalizeInstructions(region);
+  CPU::FlushICache(instrs.EntryPoint(), instrs.size());
 
   CodeObservers::NotifyAll(name,
                            instrs.EntryPoint(),
@@ -8246,7 +8256,8 @@
 
 
 void ICData::AddReceiverCheck(intptr_t receiver_class_id,
-                              const Function& target) const {
+                              const Function& target,
+                              intptr_t count) const {
 #if defined(DEBUG)
   GrowableArray<intptr_t> class_ids(1);
   class_ids.Add(receiver_class_id);
@@ -8273,7 +8284,7 @@
   }
   data.SetAt(data_pos, Smi::Handle(Smi::New(receiver_class_id)));
   data.SetAt(data_pos + 1, target);
-  data.SetAt(data_pos + 2, Smi::Handle(Smi::New(1)));
+  data.SetAt(data_pos + 2, Smi::Handle(Smi::New(count)));
 }
 
 
@@ -8336,6 +8347,24 @@
 }
 
 
+void ICData::IncrementCountAt(intptr_t index, intptr_t value) const {
+  ASSERT(0 <= value);
+  ASSERT(value <= Smi::kMaxValue);
+  SetCountAt(index, Utils::Minimum(GetCountAt(index) + value, Smi::kMaxValue));
+}
+
+
+void ICData::SetCountAt(intptr_t index, intptr_t value) const {
+  ASSERT(0 <= value);
+  ASSERT(value <= Smi::kMaxValue);
+
+  const Array& data = Array::Handle(ic_data());
+  const intptr_t data_pos = index * TestEntryLength() +
+      CountIndexFor(num_args_tested());
+  data.SetAt(data_pos, Smi::Handle(Smi::New(value)));
+}
+
+
 intptr_t ICData::GetCountAt(intptr_t index) const {
   const Array& data = Array::Handle(ic_data());
   const intptr_t data_pos = index * TestEntryLength() +
@@ -8383,6 +8412,7 @@
   const intptr_t len = NumberOfChecks();
   for (intptr_t i = 0; i < len; i++) {
     const intptr_t class_id = GetClassIdAt(i, arg_nr);
+    const intptr_t count = GetCountAt(i);
     intptr_t duplicate_class_id = -1;
     const intptr_t result_len = result.NumberOfChecks();
     for (intptr_t k = 0; k < result_len; k++) {
@@ -8395,10 +8425,12 @@
       // This check is valid only when checking the receiver.
       ASSERT((arg_nr != 0) ||
              (result.GetTargetAt(duplicate_class_id) == GetTargetAt(i)));
+      result.IncrementCountAt(duplicate_class_id, count);
     } else {
       // This will make sure that Smi is first if it exists.
       result.AddReceiverCheck(class_id,
-                              Function::Handle(GetTargetAt(i)));
+                              Function::Handle(GetTargetAt(i)),
+                              count);
     }
   }
   return result.raw();
@@ -8805,9 +8837,14 @@
 
 const char* UnhandledException::ToErrorCString() const {
   Isolate* isolate = Isolate::Current();
+  if (exception() == isolate->object_store()->out_of_memory()) {
+    return "Unhandled exception:\nOut of memory";
+  }
+  if (exception() == isolate->object_store()->stack_overflow()) {
+    return "Unhandled exception:\nStack overflow";
+  }
   HANDLESCOPE(isolate);
   Object& strtmp = Object::Handle();
-
   const Instance& exc = Instance::Handle(exception());
   strtmp = DartLibraryCalls::ToString(exc);
   const char* exc_str =
@@ -8986,16 +9023,16 @@
       type_arguments = type_arguments.Canonicalize();
       SetTypeArguments(type_arguments);
     }
-    // Verify that the number of type arguments in the instance matches the
-    // number of type arguments expected by the instance class.
+    // The number of type arguments in the instance must be greater or equal to
+    // the number of type arguments expected by the instance class.
     // A discrepancy is allowed for closures, which borrow the type argument
     // vector of their instantiator, which may be of a subclass of the class
     // defining the closure. Truncating the vector to the correct length on
     // instantiation is unnecessary. The vector may therefore be longer.
+    // Also, an optimization reuses the type argument vector of the instantiator
+    // of generic instances when its layout is compatible.
     ASSERT(type_arguments.IsNull() ||
-           (type_arguments.Length() == num_type_arguments) ||
-           (cls.IsSignatureClass() &&
-            (type_arguments.Length() > num_type_arguments)));
+           (type_arguments.Length() >= num_type_arguments));
   }
   Class& other_class = Class::Handle();
   AbstractTypeArguments& other_type_arguments = AbstractTypeArguments::Handle();
@@ -12687,28 +12724,6 @@
 };
 
 
-void TypedData::Copy(const TypedData& dst,
-                     intptr_t dst_offset_in_bytes,
-                     const TypedData& src,
-                     intptr_t src_offset_in_bytes,
-                     intptr_t length_in_bytes) {
-  ASSERT(Utils::RangeCheck(src_offset_in_bytes,
-                           length_in_bytes,
-                           src.LengthInBytes()));
-  ASSERT(Utils::RangeCheck(dst_offset_in_bytes,
-                           length_in_bytes,
-                           dst.LengthInBytes()));
-  {
-    NoGCScope no_gc;
-    if (length_in_bytes > 0) {
-      memmove(dst.DataAddr(dst_offset_in_bytes),
-              src.DataAddr(src_offset_in_bytes),
-              length_in_bytes);
-    }
-  }
-}
-
-
 RawTypedData* TypedData::New(intptr_t class_id,
                              intptr_t len,
                              Heap::Space space) {
@@ -12746,28 +12761,6 @@
 }
 
 
-void ExternalTypedData::Copy(const ExternalTypedData& dst,
-                             intptr_t dst_offset_in_bytes,
-                             const ExternalTypedData& src,
-                             intptr_t src_offset_in_bytes,
-                             intptr_t length_in_bytes) {
-  ASSERT(Utils::RangeCheck(src_offset_in_bytes,
-                           length_in_bytes,
-                           src.LengthInBytes()));
-  ASSERT(Utils::RangeCheck(dst_offset_in_bytes,
-                           length_in_bytes,
-                           dst.LengthInBytes()));
-  {
-    NoGCScope no_gc;
-    if (length_in_bytes > 0) {
-      memmove(dst.DataAddr(dst_offset_in_bytes),
-              src.DataAddr(src_offset_in_bytes),
-              length_in_bytes);
-    }
-  }
-}
-
-
 RawExternalTypedData* ExternalTypedData::New(intptr_t class_id,
                                              uint8_t* data,
                                              intptr_t len,
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 9dfdad2..222b358 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -127,6 +127,11 @@
     }                                                                          \
   }                                                                            \
   /* Disallow allocation, copy constructors and override super assignment. */  \
+ public:  /* NOLINT */                                                         \
+  void operator delete(void* pointer) {                                        \
+    UNREACHABLE();                                                             \
+  }                                                                            \
+ private:  /* NOLINT */                                                        \
   void* operator new(size_t size);                                             \
   object(const object& value);                                                 \
   void operator=(Raw##super* value);                                           \
@@ -324,6 +329,10 @@
     ASSERT(bool_false_ != NULL);
     return *bool_false_;
   }
+  static const LanguageError& snapshot_writer_error() {
+    ASSERT(snapshot_writer_error_ != NULL);
+    return *snapshot_writer_error_;
+  }
 
   static RawClass* class_class() { return class_class_; }
   static RawClass* null_class() { return null_class_; }
@@ -515,6 +524,7 @@
   static Instance* transition_sentinel_;
   static Bool* bool_true_;
   static Bool* bool_false_;
+  static LanguageError* snapshot_writer_error_;
 
   friend void ClassTable::Register(const Class& cls);
   friend void RawObject::Validate(Isolate* isolate) const;
@@ -525,9 +535,7 @@
   friend class ExternalOneByteString;
   friend class ExternalTwoByteString;
 
-  // Disallow allocation.
-  void* operator new(size_t size);
-  // Disallow copy constructor.
+  DISALLOW_ALLOCATION();
   DISALLOW_COPY_AND_ASSIGN(Object);
 };
 
@@ -3083,7 +3091,8 @@
   // Adds sorted so that Smi is the first class-id. Use only for
   // num_args_tested == 1.
   void AddReceiverCheck(intptr_t receiver_class_id,
-                        const Function& target) const;
+                        const Function& target,
+                        intptr_t count = 1) const;
 
   // Retrieving checks.
 
@@ -3099,6 +3108,8 @@
   RawFunction* GetTargetAt(intptr_t index) const;
   RawFunction* GetTargetForReceiverClassId(intptr_t class_id) const;
 
+  void IncrementCountAt(intptr_t index, intptr_t value) const;
+  void SetCountAt(intptr_t index, intptr_t value) const;
   intptr_t GetCountAt(intptr_t index) const;
   intptr_t AggregateCount() const;
 
@@ -4770,7 +4781,10 @@
     return raw_ptr()->type_arguments_;
   }
   virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
-    ASSERT(value.IsNull() || ((value.Length() == 1) && value.IsInstantiated()));
+    // An Array is raw or takes one type argument. However, its type argument
+    // vector may be longer than 1 due to a type optimization reusing the type
+    // argument vector of the instantiator.
+    ASSERT(value.IsNull() || ((value.Length() >= 1) && value.IsInstantiated()));
     StorePointer(&raw_ptr()->type_arguments_, value.raw());
   }
 
@@ -4898,7 +4912,10 @@
     return raw_ptr()->type_arguments_;
   }
   virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
-    ASSERT(value.IsNull() || ((value.Length() == 1) && value.IsInstantiated()));
+    // A GrowableObjectArray is raw or takes one type argument. However, its
+    // type argument vector may be longer than 1 due to a type optimization
+    // reusing the type argument vector of the instantiator.
+    ASSERT(value.IsNull() || ((value.Length() >= 1) && value.IsInstantiated()));
     const Array& contents = Array::Handle(data());
     contents.SetTypeArguments(value);
     StorePointer(&raw_ptr()->type_arguments_, value.raw());
@@ -5040,6 +5057,12 @@
     return ElementSizeInBytes(cid);
   }
 
+
+  TypeDataElementType ElementType() const {
+    intptr_t cid = raw()->GetClassId();
+    return ElementType(cid);
+  }
+
   intptr_t LengthInBytes() const {
     intptr_t cid = raw()->GetClassId();
     return (ElementSizeInBytes(cid) * Length());
@@ -5089,7 +5112,13 @@
 
   static intptr_t ElementSizeInBytes(intptr_t class_id) {
     ASSERT(RawObject::IsTypedDataClassId(class_id));
-    return element_size[class_id - kTypedDataInt8ArrayCid];
+    return element_size[ElementType(class_id)];
+  }
+
+  static TypeDataElementType ElementType(intptr_t class_id) {
+    ASSERT(RawObject::IsTypedDataClassId(class_id));
+    return static_cast<TypeDataElementType>(
+        class_id - kTypedDataInt8ArrayCid);
   }
 
   static intptr_t MaxElements(intptr_t class_id) {
@@ -5101,11 +5130,26 @@
                            intptr_t len,
                            Heap::Space space = Heap::kNew);
 
-  static void Copy(const TypedData& dst,
-                   intptr_t dst_offset_in_bytes,
-                   const TypedData& src,
-                   intptr_t src_offset_in_bytes,
-                   intptr_t length_in_bytes);
+  template <typename DstType, typename SrcType>
+  static void Copy(const DstType& dst, intptr_t dst_offset_in_bytes,
+                   const SrcType& src, intptr_t src_offset_in_bytes,
+                   intptr_t length_in_bytes) {
+    ASSERT(dst.ElementType() == src.ElementType());
+    ASSERT(Utils::RangeCheck(src_offset_in_bytes,
+                             length_in_bytes,
+                             src.LengthInBytes()));
+    ASSERT(Utils::RangeCheck(dst_offset_in_bytes,
+                             length_in_bytes,
+                             dst.LengthInBytes()));
+    {
+      NoGCScope no_gc;
+      if (length_in_bytes > 0) {
+        memmove(dst.DataAddr(dst_offset_in_bytes),
+                src.DataAddr(src_offset_in_bytes),
+                length_in_bytes);
+      }
+    }
+  }
 
   static bool IsTypedData(const Instance& obj) {
     ASSERT(!obj.IsNull());
@@ -5140,6 +5184,11 @@
     return ElementSizeInBytes(cid);
   }
 
+  TypeDataElementType ElementType() const {
+    intptr_t cid = raw()->GetClassId();
+    return ElementType(cid);
+  }
+
   intptr_t LengthInBytes() const {
     intptr_t cid = raw()->GetClassId();
     return (ElementSizeInBytes(cid) * Length());
@@ -5190,7 +5239,13 @@
 
   static intptr_t ElementSizeInBytes(intptr_t class_id) {
     ASSERT(RawObject::IsExternalTypedDataClassId(class_id));
-    return TypedData::element_size[class_id - kExternalTypedDataInt8ArrayCid];
+    return TypedData::element_size[ElementType(class_id)];
+  }
+
+  static TypeDataElementType ElementType(intptr_t class_id) {
+    ASSERT(RawObject::IsExternalTypedDataClassId(class_id));
+    return static_cast<TypeDataElementType>(
+        class_id - kExternalTypedDataInt8ArrayCid);
   }
 
   static intptr_t MaxElements(intptr_t class_id) {
@@ -5203,12 +5258,6 @@
                                    intptr_t len,
                                    Heap::Space space = Heap::kNew);
 
-  static void Copy(const ExternalTypedData& dst,
-                   intptr_t dst_offset_in_bytes,
-                   const ExternalTypedData& src,
-                   intptr_t src_offset_in_bytes,
-                   intptr_t length_in_bytes);
-
   static bool IsExternalTypedData(const Instance& obj) {
     ASSERT(!obj.IsNull());
     intptr_t cid = obj.raw()->GetClassId();
diff --git a/runtime/vm/object_mips_test.cc b/runtime/vm/object_mips_test.cc
index ef10b2d..750f65c 100644
--- a/runtime/vm/object_mips_test.cc
+++ b/runtime/vm/object_mips_test.cc
@@ -18,21 +18,37 @@
 // Generate a simple dart code sequence.
 // This is used to test Code and Instruction object creation.
 void GenerateIncrement(Assembler* assembler) {
-  __ Unimplemented("GenerateIncrement");
+  __ Push(ZR);
+  __ lw(TMP1, Address(SP, 0));
+  __ addiu(TMP1, TMP1, Immediate(1));
+  __ sw(TMP1, Address(SP, 0));
+  __ lw(TMP1, Address(SP, 0));
+  __ addiu(TMP1, TMP1, Immediate(1));
+  __ Pop(V0);
+  __ mov(V0, TMP1);
+  __ Ret();
 }
 
 
 // Generate a dart code sequence that embeds a string object in it.
 // This is used to test Embedded String objects in the instructions.
 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) {
-  __ Unimplemented("GenerateEmbedStringInCode");
+  __ EnterDartFrame(0);  // To setup pp.
+  const String& string_object =
+      String::ZoneHandle(String::New(str, Heap::kOld));
+  __ LoadObject(V0, string_object);
+  __ LeaveDartFrame();
+  __ Ret();
 }
 
 
 // Generate a dart code sequence that embeds a smi object in it.
 // This is used to test Embedded Smi objects in the instructions.
 void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) {
-  __ Unimplemented("GenerateEmbedSmiInCode");
+  // No need to setup pp, since Smis are not stored in the object pool.
+  const Smi& smi_object = Smi::ZoneHandle(Smi::New(value));
+  __ LoadObject(V0, smi_object);
+  __ Ret();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc
index 648f236..5c3aebf 100644
--- a/runtime/vm/object_store.cc
+++ b/runtime/vm/object_store.cc
@@ -41,7 +41,7 @@
     growable_object_array_class_(Class::null()),
     float32x4_class_(Class::null()),
     uint32x4_class_(Class::null()),
-    typeddata_classes_(Array::null()),
+    typed_data_classes_(Array::null()),
     stacktrace_class_(Class::null()),
     jsregexp_class_(Class::null()),
     weak_property_class_(Class::null()),
@@ -58,7 +58,7 @@
     mirrors_library_(Library::null()),
     native_wrappers_library_(Library::null()),
     root_library_(Library::null()),
-    typeddata_library_(Library::null()),
+    typed_data_library_(Library::null()),
     uri_library_(Library::null()),
     utf_library_(Library::null()),
     libraries_(GrowableObjectArray::null()),
@@ -104,8 +104,7 @@
   ASSERT(this->stack_overflow() == Instance::null());
   ASSERT(this->out_of_memory() == Instance::null());
   ASSERT(this->preallocated_stack_trace() == Stacktrace::null());
-  // TODO(regis): Reenable this code for arm and mips when possible.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
+
   Object& result = Object::Handle();
 
   result = Exceptions::Create(Exceptions::kStackOverflow,
@@ -131,7 +130,7 @@
       Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
   result = Stacktrace::New(func_array, code_array, pc_offset_array);
   set_preallocated_stack_trace(Stacktrace::Cast(result));
-#endif
+
   return true;
 }
 
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index 5ceabd5..8eb1d16 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -194,11 +194,11 @@
   RawType* uint32x4_type() const { return uint32x4_type_; }
   void set_uint32x4_type(const Type& value) { uint32x4_type_ = value.raw(); }
 
-  RawArray* typeddata_classes() const {
-    return typeddata_classes_;
+  RawArray* typed_data_classes() const {
+    return typed_data_classes_;
   }
-  void set_typeddata_classes(const Array& value) {
-    typeddata_classes_ = value.raw();
+  void set_typed_data_classes(const Array& value) {
+    typed_data_classes_ = value.raw();
   }
 
   RawClass* stacktrace_class() const {
@@ -319,11 +319,11 @@
     root_library_ = value.raw();
   }
 
-  RawLibrary* typeddata_library() const {
-    return typeddata_library_;
+  RawLibrary* typed_data_library() const {
+    return typed_data_library_;
   }
-  void set_typeddata_library(const Library& value) {
-    typeddata_library_ = value.raw();
+  void set_typed_data_library(const Library& value) {
+    typed_data_library_ = value.raw();
   }
 
   RawLibrary* uri_library() const {
@@ -464,7 +464,7 @@
   RawClass* growable_object_array_class_;
   RawClass* float32x4_class_;
   RawClass* uint32x4_class_;
-  RawArray* typeddata_classes_;
+  RawArray* typed_data_classes_;
   RawClass* stacktrace_class_;
   RawClass* jsregexp_class_;
   RawClass* weak_property_class_;
@@ -483,7 +483,7 @@
   RawLibrary* mirrors_library_;
   RawLibrary* native_wrappers_library_;
   RawLibrary* root_library_;
-  RawLibrary* typeddata_library_;
+  RawLibrary* typed_data_library_;
   RawLibrary* uri_library_;
   RawLibrary* utf_library_;
   RawGrowableObjectArray* libraries_;
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 7ad93d2..854dd5e 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -2237,11 +2237,6 @@
 }
 
 
-// Only ia32, x64, and arm can run execution tests.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 static Function* CreateFunction(const char* name) {
   const String& class_name = String::Handle(Symbols::New("ownerClass"));
   const Script& script = Script::Handle();
@@ -2254,6 +2249,7 @@
   return &function;
 }
 
+
 // Test for Code and Instruction object creation.
 TEST_CASE(Code) {
   extern void GenerateIncrement(Assembler* assembler);
@@ -2345,7 +2341,6 @@
 #endif
   EXPECT((retval >> kSmiTagShift) == kSmiTestValue);
 }
-#endif
 
 
 TEST_CASE(ExceptionHandlers) {
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 1f06422..d8522bb 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -8,7 +8,6 @@
 #include "vm/compiler_stats.h"
 #include "vm/gc_marker.h"
 #include "vm/gc_sweeper.h"
-#include "vm/heap_trace.h"
 #include "vm/object.h"
 #include "vm/virtual_memory.h"
 
@@ -33,15 +32,13 @@
   HeapPage* result = reinterpret_cast<HeapPage*>(memory->address());
   result->memory_ = memory;
   result->next_ = NULL;
-  result->used_ = 0;
   result->executable_ = is_executable;
   return result;
 }
 
 
 HeapPage* HeapPage::Allocate(intptr_t size, PageType type) {
-  VirtualMemory* memory =
-      VirtualMemory::ReserveAligned(size, PageSpace::kPageAlignment);
+  VirtualMemory* memory = VirtualMemory::Reserve(size);
   return Initialize(memory, type);
 }
 
@@ -408,10 +405,6 @@
   Isolate* isolate = Isolate::Current();
   NoHandleScope no_handles(isolate);
 
-  if (HeapTrace::is_enabled()) {
-    isolate->heap()->trace()->TraceMarkSweepStart();
-  }
-
   if (FLAG_print_free_list_before_gc) {
     OS::Print("Data Freelist (before GC):\n");
     freelist_[HeapPage::kData].Print();
@@ -503,10 +496,6 @@
     OS::PrintErr(" done.\n");
   }
 
-  if (HeapTrace::is_enabled()) {
-    isolate->heap()->trace()->TraceMarkSweepFinish();
-  }
-
   // Done, reset the marker.
   ASSERT(sweeping_);
   sweeping_ = false;
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index f89b083..4a61de0 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -41,12 +41,6 @@
     return object_end_;
   }
 
-  void set_used(uword used) { used_ = used; }
-  uword used() const { return used_; }
-  void AddUsed(uword size) {
-    used_ += size;
-  }
-
   PageType type() const {
     return executable_ ? kExecutable : kData;
   }
@@ -77,7 +71,6 @@
 
   VirtualMemory* memory_;
   HeapPage* next_;
-  uword used_;
   uword object_end_;
   bool executable_;
 
@@ -190,9 +183,6 @@
   bool IsValidAddress(uword addr) const {
     return Contains(addr);
   }
-  static bool IsPageAllocatableSize(intptr_t size) {
-    return size <= kAllocatablePageSize;
-  }
 
   void VisitObjects(ObjectVisitor* visitor) const;
   void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
@@ -203,11 +193,6 @@
   // Collect the garbage in the page space using mark-sweep.
   void MarkSweep(bool invoke_api_callbacks);
 
-  static HeapPage* PageFor(RawObject* raw_obj) {
-    return reinterpret_cast<HeapPage*>(
-        RawObject::ToAddr(raw_obj) & ~(kPageSize -1));
-  }
-
   void StartEndAddress(uword* start, uword* end) const;
 
   void SetGrowthControlState(bool state) {
@@ -245,7 +230,7 @@
     kAllowedGrowth = 3
   };
 
-  static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage);
+  static const intptr_t kAllocatablePageSize = 64 * KB;
 
   HeapPage* AllocatePage(HeapPage::PageType type);
   void FreePage(HeapPage* page, HeapPage* previous_page);
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 6f6c4da..d409f54 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4177,14 +4177,17 @@
              field_name->ToCString());
   }
 
+  intptr_t accessor_end_pos = accessor_pos;
   if (is_external) {
     ExpectSemicolon();
   } else if (CurrentToken() == Token::kLBRACE) {
     SkipBlock();
+    accessor_end_pos = TokenPos() - 1;
   } else if (CurrentToken() == Token::kARROW) {
     ConsumeToken();
     SkipExpr();
     ExpectSemicolon();
+    accessor_end_pos = TokenPos() - 1;
   } else if (IsLiteral("native")) {
     ParseNativeDeclaration();
   } else {
@@ -4201,6 +4204,7 @@
                     current_class(),
                     accessor_pos));
   func.set_result_type(result_type);
+  func.set_end_token_pos(accessor_end_pos);
   AddFormalParamsToFunction(&params, func);
   top_level->functions.Add(func);
   if (!is_patch) {
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 59fb1ec..cfb81b0 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -172,6 +172,12 @@
   kSmiTagShift = 1,
 };
 
+enum TypeDataElementType {
+#define V(name) k##name##Element,
+CLASS_LIST_TYPED_DATA(V)
+#undef V
+};
+
 #define SNAPSHOT_WRITER_SUPPORT()                                              \
   void WriteTo(                                                                \
       SnapshotWriter* writer, intptr_t object_id, Snapshot::Kind kind);        \
@@ -415,10 +421,6 @@
   friend class Heap;
   friend class HeapProfiler;
   friend class HeapProfilerRootVisitor;
-  friend class HeapTrace;
-  friend class HeapTraceDebugObjectVisitor;
-  friend class HeapTraceHandleVisitor;
-  friend class HeapTraceVisitor;
   friend class MarkingVisitor;
   friend class Object;
   friend class RawExternalTypedData;
@@ -477,7 +479,6 @@
   intptr_t token_pos_;
   uint8_t state_bits_;  // state, is_const, is_implemented.
 
-  friend class HeapTrace;
   friend class Instance;
   friend class Object;
   friend class RawInstance;
@@ -1240,8 +1241,6 @@
   RawSmi* length_;
   RawSmi* hash_;
   RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); }
-
-  friend class HeapTrace;
 };
 
 
@@ -1252,7 +1251,6 @@
   uint8_t data_[0];
 
   friend class ApiMessageReader;
-  friend class HeapTrace;
   friend class SnapshotReader;
 };
 
@@ -1263,7 +1261,6 @@
   // Variable length data follows here.
   uint16_t data_[0];
 
-  friend class HeapTrace;
   friend class SnapshotReader;
 };
 
@@ -1343,7 +1340,6 @@
 class RawImmutableArray : public RawArray {
   RAW_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray);
 
-  friend class HeapTrace;
   friend class SnapshotReader;
 };
 
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 0c1a5a2..642ec7e 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -178,9 +178,6 @@
         // Not a survivor of a previous scavenge. Just copy the object into the
         // to space.
         new_addr = scavenger_->TryAllocate(size);
-        if (HeapTrace::is_enabled()) {
-          heap_->trace()->TraceCopy(raw_addr, new_addr);
-        }
       } else {
         // TODO(iposva): Experiment with less aggressive promotion. For example
         // a coin toss determines if an object is promoted or whether it should
@@ -194,9 +191,6 @@
           // be traversed later.
           scavenger_->PushToPromotedStack(new_addr);
           bytes_promoted_ += size;
-          if (HeapTrace::is_enabled()) {
-            heap_->trace()->TracePromotion(raw_addr, new_addr);
-          }
         } else if (!scavenger_->had_promotion_failure_) {
           // Signal a promotion failure and set the growth policy for
           // this, and all subsequent promotion allocations, to force
@@ -207,24 +201,15 @@
           if (new_addr != 0) {
             scavenger_->PushToPromotedStack(new_addr);
             bytes_promoted_ += size;
-            if (HeapTrace::is_enabled()) {
-              heap_->trace()->TracePromotion(raw_addr, new_addr);
-            }
           } else {
             // Promotion did not succeed. Copy into the to space
             // instead.
             new_addr = scavenger_->TryAllocate(size);
-            if (HeapTrace::is_enabled()) {
-              heap_->trace()->TraceCopy(raw_addr, new_addr);
-            }
           }
         } else {
           ASSERT(growth_policy_ == PageSpace::kForceGrowth);
           // Promotion did not succeed. Copy into the to space instead.
           new_addr = scavenger_->TryAllocate(size);
-          if (HeapTrace::is_enabled()) {
-            heap_->trace()->TraceCopy(raw_addr, new_addr);
-          }
         }
       }
       // During a scavenge we always succeed to at least copy all of the
@@ -391,6 +376,15 @@
 
 void Scavenger::IterateStoreBuffers(Isolate* isolate,
                                     ScavengerVisitor* visitor) {
+  // Drain store buffer block into store buffer to deduplicate it. It might be
+  // full of large objects repeated multiple times.
+  // Use DrainBlock directly instead of ProcessBlock because we are in the
+  // middle of a scavenge cycle and thus do not care if we are temporary
+  // running over the max number of deduplication sets.
+  StoreBufferBlock* block = isolate->store_buffer_block();
+  heap_->RecordData(kStoreBufferBlockEntries, block->Count());
+  isolate->store_buffer()->DrainBlock(block);
+
   // Iterating through the store buffers.
   // Grab the deduplication sets out of the store buffer.
   StoreBuffer::DedupSet* pending = isolate->store_buffer()->DedupSets();
@@ -417,16 +411,6 @@
     pending = next;
   }
   heap_->RecordData(kStoreBufferEntries, entries);
-  StoreBufferBlock* block = isolate->store_buffer_block();
-  entries = block->Count();
-  for (intptr_t i = 0; i < entries; i++) {
-    RawObject* raw_object = reinterpret_cast<RawObject*>(block->At(i));
-    ASSERT(raw_object->IsHeapObject());
-    visitor->VisitingOldObject(raw_object);
-    raw_object->VisitPointers(visitor);
-  }
-  block->Reset();
-  heap_->RecordData(kStoreBufferBlockEntries, entries);
   // Done iterating through old objects remembered in the store buffers.
   visitor->VisitingOldObject(NULL);
 }
@@ -642,9 +626,6 @@
     OS::PrintErr(" done.\n");
   }
 
-  uword prev_first_obj_start = FirstObjectStart();
-  uword prev_top_addr = *(TopAddress());
-
   // Setup the visitor and run a scavenge.
   ScavengerVisitor visitor(isolate, this);
   Prologue(isolate, invoke_api_callbacks);
@@ -668,10 +649,6 @@
     OS::PrintErr(" done.\n");
   }
 
-  if (HeapTrace::is_enabled()) {
-    heap_->trace()->TraceDeathRange(prev_first_obj_start, prev_top_addr);
-  }
-
   // Done scavenging. Reset the marker.
   ASSERT(scavenging_);
   scavenging_ = false;
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index 6cd45fc..c5d9724 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -196,7 +196,7 @@
     }
     return true;
   }
-  if ((desc[0] == '*')) {
+  if (desc[0] == '*') {
     uint32_t addr;
     if (GetValue(desc + 1, &addr)) {
       if (Simulator::IsIllegalAddress(addr)) {
@@ -220,7 +220,7 @@
     *value = sim_->get_sregister(sreg);
     return true;
   }
-  if ((desc[0] == '*')) {
+  if (desc[0] == '*') {
     uint32_t addr;
     if (GetValue(desc + 1, &addr)) {
       if (Simulator::IsIllegalAddress(addr)) {
@@ -240,7 +240,7 @@
     *value = sim_->get_dregister(dreg);
     return true;
   }
-  if ((desc[0] == '*')) {
+  if (desc[0] == '*') {
     uint32_t addr;
     if (GetValue(desc + 1, &addr)) {
       if (Simulator::IsIllegalAddress(addr)) {
@@ -505,8 +505,7 @@
   char line_buf[256];
   int offset = 0;
   bool keep_going = true;
-  fprintf(stdout, "%s", prompt);
-  fflush(stdout);
+  OS::Print("%s", prompt);
   while (keep_going) {
     if (fgets(line_buf, sizeof(line_buf), stdin) == NULL) {
       // fgets got an error. Just give up.
@@ -1556,6 +1555,27 @@
             }
             break;
           }
+          case 6: {
+            // Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
+            // Format(instr, "smull'cond's 'rd, 'rn, 'rm, 'rs");
+            int64_t left_op  = static_cast<int32_t>(rm_val);
+            int64_t right_op = static_cast<int32_t>(rs_val);
+            int64_t result = left_op * right_op;
+            int32_t hi_res = Utils::High32Bits(result);
+            int32_t lo_res = Utils::Low32Bits(result);
+            set_register(rd, lo_res);
+            set_register(rn, hi_res);
+            if (instr->HasS()) {
+              if (lo_res != 0) {
+                // Collapse bits 0..31 into bit 32 so that 32-bit Z check works.
+                hi_res |= 1;
+              }
+              ASSERT((result == 0) == (hi_res == 0));  // Z bit
+              ASSERT(((result & (1LL << 63)) != 0) == (hi_res < 0));  // N bit
+              SetNZFlags(hi_res);
+            }
+            break;
+          }
           default: {
             UnimplementedInstruction(instr);
             break;
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index 3031ddc..6d4710c2 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -184,7 +184,7 @@
     *value = sim_->get_register(reg);
     return true;
   }
-  if ((desc[0] == '*')) {
+  if (desc[0] == '*') {
     uint32_t addr;
     if (GetValue(desc + 1, &addr)) {
       if (Simulator::IsIllegalAddress(addr)) {
@@ -212,7 +212,7 @@
     *value = sim_->get_fregister(freg);
     return true;
   }
-  if ((desc[0] == '*')) {
+  if (desc[0] == '*') {
     uint32_t addr;
     if (GetValue(desc + 1, &addr)) {
       if (Simulator::IsIllegalAddress(addr)) {
@@ -468,8 +468,7 @@
   char line_buf[256];
   int offset = 0;
   bool keep_going = true;
-  fprintf(stdout, "%s", prompt);
-  fflush(stdout);
+  OS::Print("%s", prompt);
   while (keep_going) {
     if (fgets(line_buf, sizeof(line_buf), stdin) == NULL) {
       // fgets got an error. Just give up.
@@ -751,9 +750,9 @@
 void Simulator::UnalignedAccess(const char* msg, uword addr, Instr* instr) {
   // The debugger will not be able to single step past this instruction, but
   // it will be possible to disassemble the code and inspect registers.
-  char buffer[64];
+  char buffer[128];
   snprintf(buffer, sizeof(buffer),
-           "unaligned %s at 0x%"Px", pc=%p\n", msg, addr, instr);
+           "pc=%p, unaligned %s at 0x%"Px"\n",  instr, msg, addr);
   SimulatorDebugger dbg(this);
   dbg.Stop(instr, buffer);
   // The debugger will return control in non-interactive mode.
@@ -905,6 +904,15 @@
     dbg.Stop(instr, message);
     // Adjust for extra pc increment.
     set_pc(get_pc() - Instr::kInstrSize);
+  } else if (instr->BreakCodeField() == Instr::kMsgMessageCode) {
+    const char* message = *reinterpret_cast<const char**>(
+        reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
+    if (FLAG_trace_sim) {
+      OS::Print("Message: %s\n", message);
+    } else {
+      OS::PrintErr("Bad break code: 0x%x\n", instr->InstructionBits());
+      UnimplementedInstruction(instr);
+    }
   } else if (instr->BreakCodeField() == Instr::kRedirectCode) {
     SimulatorSetjmpBuffer buffer(this);
 
@@ -986,6 +994,8 @@
     } else {
       // Coming via long jump from a throw. Continue to exception handler.
       set_top_exit_frame_info(0);
+      // Adjust for extra pc increment.
+      set_pc(get_pc() - Instr::kInstrSize);
     }
   } else {
     SimulatorDebugger dbg(this);
@@ -1830,7 +1840,7 @@
   set_register(R22, r22_val);
   set_register(R23, r23_val);
 
-  // Restore the SP register and return R1:R0.
+  // Restore the SP register and return V1:V0.
   set_register(SP, sp_before_call);
   return Utils::LowHighTo64Bits(get_register(V0), get_register(V1));
 }
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 0342930..5a2323a 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -860,8 +860,7 @@
       class_table_(Isolate::Current()->class_table()),
       forward_list_(),
       exception_type_(Exceptions::kNone),
-      exception_msg_(NULL),
-      error_(LanguageError::Handle()) {
+      exception_msg_(NULL) {
 }
 
 
@@ -1036,9 +1035,6 @@
   LongJump* base = isolate->long_jump_base();
   LongJump jump;
   isolate->set_long_jump_base(&jump);
-  // TODO(6726): Allocate these constant strings once in the VM isolate.
-  *ErrorHandle() = LanguageError::New(
-      String::Handle(String::New("Error while writing full snapshot")));
   if (setjmp(*jump.Set()) == 0) {
     NoGCScope no_gc;
 
@@ -1334,9 +1330,10 @@
 void SnapshotWriter::SetWriteException(Exceptions::ExceptionType type,
                                        const char* msg) {
   set_exception_type(type);
-  // TODO(6726): Allocate these constant strings once in the VM isolate.
   set_exception_msg(msg);
-  Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
+  // The more specific error is set up in SnapshotWriter::ThrowException().
+  Isolate::Current()->long_jump_base()->
+      Jump(1, Object::snapshot_writer_error());
 }
 
 
@@ -1400,10 +1397,14 @@
                                     const char* msg) {
   Isolate::Current()->object_store()->clear_sticky_error();
   UnmarkAll();
-  const String& msg_obj = String::Handle(String::New(msg));
-  const Array& args = Array::Handle(Array::New(1));
-  args.SetAt(0, msg_obj);
-  Exceptions::ThrowByType(type, args);
+  if (msg != NULL) {
+    const String& msg_obj = String::Handle(String::New(msg));
+    const Array& args = Array::Handle(Array::New(1));
+    args.SetAt(0, msg_obj);
+    Exceptions::ThrowByType(type, args);
+  } else {
+    Exceptions::ThrowByType(type, Object::empty_array());
+  }
   UNREACHABLE();
 }
 
@@ -1419,8 +1420,6 @@
   LongJump* base = isolate->long_jump_base();
   LongJump jump;
   isolate->set_long_jump_base(&jump);
-  *ErrorHandle() = LanguageError::New(
-      String::Handle(String::New("Error while writing script snapshot")));
   if (setjmp(*jump.Set()) == 0) {
     // Write out the library object.
     NoGCScope no_gc;
@@ -1458,8 +1457,6 @@
   LongJump* base = isolate->long_jump_base();
   LongJump jump;
   isolate->set_long_jump_base(&jump);
-  *ErrorHandle() = LanguageError::New(
-      String::Handle(String::New("Error while writing message")));
   if (setjmp(*jump.Set()) == 0) {
     NoGCScope no_gc;
     WriteObject(obj.raw());
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index 9b649bd..d21fe69 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -466,7 +466,6 @@
   void set_exception_msg(const char* msg) {
     exception_msg_ = msg;
   }
-  LanguageError* ErrorHandle() { return &error_; }
   void ThrowException(Exceptions::ExceptionType type, const char* msg);
 
  protected:
@@ -521,7 +520,6 @@
   GrowableArray<ForwardObjectNode*> forward_list_;
   Exceptions::ExceptionType exception_type_;  // Exception type.
   const char* exception_msg_;  // Message associated with exception.
-  LanguageError& error_;  // Error handle.
 
   friend class RawArray;
   friend class RawClass;
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index d219122..2bdca58 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -905,8 +905,6 @@
 }
 
 
-// Only ia32 and x64 can run execution tests.
-#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
 UNIT_TEST_CASE(FullSnapshot) {
   const char* kScriptChars =
       "class Fields  {\n"
@@ -1775,7 +1773,7 @@
 UNIT_TEST_CASE(DartGeneratedListMessagesWithBackref) {
   const int kArrayLength = 10;
   static const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "final int kArrayLength = 10;\n"
       "getStringList() {\n"
       "  var s = 'Hello, world!';\n"
@@ -1974,7 +1972,7 @@
 UNIT_TEST_CASE(DartGeneratedArrayLiteralMessagesWithBackref) {
   const int kArrayLength = 10;
   static const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "final int kArrayLength = 10;\n"
       "getStringList() {\n"
       "  var s = 'Hello, world!';\n"
@@ -2185,7 +2183,7 @@
 
 UNIT_TEST_CASE(DartGeneratedListMessagesWithTypedData) {
   static const char* kScriptChars =
-      "import 'dart:typeddata';\n"
+      "import 'dart:typed_data';\n"
       "getTypedDataList() {\n"
       "  var list = new List(10);\n"
       "  var index = 0;\n"
@@ -2494,6 +2492,4 @@
   Dart_ExitScope();
 }
 
-#endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
-
 }  // namespace dart
diff --git a/runtime/vm/stack_frame_mips.cc b/runtime/vm/stack_frame_mips.cc
index 032197d6..d713b1c 100644
--- a/runtime/vm/stack_frame_mips.cc
+++ b/runtime/vm/stack_frame_mips.cc
@@ -11,6 +11,7 @@
 
 // The constant kExitLinkOffsetInEntryFrame must be kept in sync with the
 // code in the InvokeDartCode stub.
+static const int kSavedContextOffsetInEntryFrame = -11 * kWordSize;
 static const int kExitLinkOffsetInEntryFrame = -10 * kWordSize;
 static const int kPcAddressOffsetFromSp = -2 * kWordSize;
 static const int kEntrypointMarkerOffsetFromFp = 2 * kWordSize;
@@ -38,14 +39,12 @@
 
 
 intptr_t EntryFrame::ExitLinkOffset() const {
-  UNIMPLEMENTED();
-  return 0;
+  return kExitLinkOffsetInEntryFrame;
 }
 
 
 intptr_t EntryFrame::SavedContextOffset() const {
-  UNIMPLEMENTED();
-  return 0;
+  return kSavedContextOffsetInEntryFrame;
 }
 
 
diff --git a/runtime/vm/stack_frame_test.cc b/runtime/vm/stack_frame_test.cc
index 37a0801..8ab3c07 100644
--- a/runtime/vm/stack_frame_test.cc
+++ b/runtime/vm/stack_frame_test.cc
@@ -16,11 +16,6 @@
 
 namespace dart {
 
-// Only ia32, x64, and arm can run stack frame iteration tests.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 // Unit test for empty stack frame iteration.
 TEST_CASE(EmptyStackFrameIteration) {
   StackFrameIterator iterator(StackFrameIterator::kValidateFrames);
@@ -290,6 +285,4 @@
   EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL));
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 }  // namespace dart
diff --git a/runtime/vm/store_buffer.cc b/runtime/vm/store_buffer.cc
index ebfd64a..d07728a 100644
--- a/runtime/vm/store_buffer.cc
+++ b/runtime/vm/store_buffer.cc
@@ -21,12 +21,7 @@
 
 
 void StoreBufferBlock::ProcessBuffer(Isolate* isolate) {
-  StoreBuffer* buffer = isolate->store_buffer();
-  int32_t end = top_;
-  for (int32_t i = 0; i < end; i++) {
-    buffer->AddPointer(pointers_[i]);
-  }
-  top_ = 0;  // Reset back to the beginning.
+  isolate->store_buffer()->ProcessBlock(this);
 }
 
 
@@ -61,19 +56,51 @@
 }
 
 
-void StoreBuffer::AddPointer(uword address) {
+bool StoreBuffer::AddPointerInternal(uword address) {
   ASSERT(dedup_sets_ != NULL);
   ASSERT(Isolate::Current()->heap()->OldContains(address));
   ASSERT((address & kSmiTagMask) != kSmiTag);
   if (!dedup_sets_->set()->Add(address)) {
-    // Add a new DedupSet. Schedule an interrupt if we have run over the max
-    // number of DedupSets.
+    // Add a new DedupSet.
     dedup_sets_ = new DedupSet(dedup_sets_);
     count_++;
-    // TODO(iposva): Fix magic number.
-    if (count_ > 100) {
-      Isolate::Current()->ScheduleInterrupts(Isolate::kStoreBufferInterrupt);
-    }
+    return true;
+  }
+  return false;
+}
+
+
+void StoreBuffer::AddPointer(uword address) {
+  if (AddPointerInternal(address)) {
+    // Had to create a new DedupSet.
+    CheckThreshold();
+  }
+}
+
+
+bool StoreBuffer::DrainBlock(StoreBufferBlock* block) {
+  const intptr_t old_count = count_;
+  intptr_t entries = block->Count();
+  for (intptr_t i = 0; i < entries; i++) {
+    AddPointerInternal(block->At(i));
+  }
+  block->Reset();
+  return (count_ > old_count);
+}
+
+
+void StoreBuffer::CheckThreshold() {
+  // Schedule an interrupt if we have run over the max number of DedupSets.
+  // TODO(iposva): Fix magic number.
+  if (count_ > 100) {
+    Isolate::Current()->ScheduleInterrupts(Isolate::kStoreBufferInterrupt);
+  }
+}
+
+
+void StoreBuffer::ProcessBlock(StoreBufferBlock* block) {
+  if (DrainBlock(block)) {
+    CheckThreshold();
   }
 }
 
diff --git a/runtime/vm/store_buffer.h b/runtime/vm/store_buffer.h
index bc52958..5657f79 100644
--- a/runtime/vm/store_buffer.h
+++ b/runtime/vm/store_buffer.h
@@ -95,6 +95,12 @@
 
   void AddPointer(uword address);
 
+  // Drain StoreBufferBlock into deduplication sets.
+  // Returns true if new sets were created.
+  bool DrainBlock(StoreBufferBlock* block);
+
+  // Drain StoreBufferBlock into deduplication sets.
+  // Schedule an interrupt if we run over the max number of deduplication sets.
   void ProcessBlock(StoreBufferBlock* block);
 
   DedupSet* DedupSets() {
@@ -105,6 +111,14 @@
   }
 
  private:
+  // Add pointer to deduplication sets. Returns true if the current set is full
+  // and a new set was created.
+  bool AddPointerInternal(uword address);
+
+  // Check if we run over the max number of deduplication sets.
+  // If we did schedule an interrupt.
+  void CheckThreshold();
+
   DedupSet* dedup_sets_;
   intptr_t count_;
 
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 0e9fbfe..1174f54 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -10,6 +10,7 @@
 #include "vm/compiler.h"
 #include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
+#include "vm/heap.h"
 #include "vm/instructions.h"
 #include "vm/object_store.h"
 #include "vm/stack_frame.h"
@@ -198,6 +199,8 @@
 // Input parameters:
 //   R4: arguments descriptor array.
 void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
   __ EnterStubFrame();
   // Setup space on stack for return value and preserve arguments descriptor.
   __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
@@ -205,17 +208,34 @@
   __ CallRuntime(kPatchStaticCallRuntimeEntry);
   // Get Code object result and restore arguments descriptor array.
   __ PopList((1 << R0) | (1 << R4));
-  // Remove the stub frame as we are about to jump to the dart function.
+  // Remove the stub frame.
   __ LeaveStubFrame();
-
+  // Jump to the dart function.
   __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
   __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
   __ bx(R0);
 }
 
 
+// Called from a static call only when an invalid code has been entered
+// (invalid because its function was optimized or deoptimized).
+// R4: arguments descriptor array.
 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
-  __ Unimplemented("FixCallersTarget stub");
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  // Setup space on stack for return value and preserve arguments descriptor.
+  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ PushList((1 << R0) | (1 << R4));
+  __ CallRuntime(kFixCallersTargetRuntimeEntry);
+  // Get Code object result and restore arguments descriptor array.
+  __ PopList((1 << R0) | (1 << R4));
+  // Remove the stub frame.
+  __ LeaveStubFrame();
+  // Jump to the dart function.
+  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
+  __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ bx(R0);
 }
 
 
@@ -291,13 +311,100 @@
 }
 
 
+DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
+                           intptr_t deopt_reason,
+                           uword saved_registers_address);
+
+DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
+
+
+// Used by eager and lazy deoptimization. Preserve result in R0 if necessary.
+// This stub translates optimized frame into unoptimized frame. The optimized
+// frame can contain values in registers and on stack, the unoptimized
+// frame contains all values on stack.
+// Deoptimization occurs in following steps:
+// - Push all registers that can contain values.
+// - Call C routine to copy the stack and saved registers into temporary buffer.
+// - Adjust caller's frame to correct unoptimized frame size.
+// - Fill the unoptimized frame.
+// - Materialize objects that require allocation (e.g. Double instances).
+// GC can occur only after frame is fully rewritten.
+// Stack after EnterFrame(...) below:
+//   +------------------+
+//   | Saved FP         | <- TOS
+//   +------------------+
+//   | return-address   |  (deoptimization point)
+//   +------------------+
+//   | optimized frame  |
+//   |  ...             |
+//
+// Parts of the code cannot GC, part of the code can GC.
+static void GenerateDeoptimizationSequence(Assembler* assembler,
+                                           bool preserve_result) {
+  __ EnterFrame((1 << FP) | (1 << LR), 0);
+  // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
+  // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
+  const intptr_t saved_r0_offset_from_fp = -(kNumberOfCpuRegisters - R0);
+  // Result in R0 is preserved as part of pushing all registers below.
+
+  // Push registers in their enumeration order: lowest register number at
+  // lowest address.
+  __ PushList(kAllCpuRegistersList);
+  ASSERT(kFpuRegisterSize == 2 * kWordSize);
+  __ vstmd(DB_W, SP, D0, static_cast<DRegister>(kNumberOfDRegisters - 1));
+
+  __ mov(R0, ShifterOperand(SP));  // Pass address of saved registers block.
+  __ ReserveAlignedFrameSpace(0);
+  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry);
+  // Result (R0) is stack-size (FP - SP) in bytes, incl. the return address.
+
+  if (preserve_result) {
+    // Restore result into R1 temporarily.
+    __ ldr(R1, Address(FP, saved_r0_offset_from_fp * kWordSize));
+  }
+
+  __ LeaveFrame((1 << FP) | (1 << LR));
+  __ sub(SP, FP, ShifterOperand(R0));
+
+  __ EnterFrame((1 << FP) | (1 << LR), 0);
+  __ mov(R0, ShifterOperand(SP));  // Get last FP address.
+  if (preserve_result) {
+    __ Push(R1);  // Preserve result.
+  }
+  __ ReserveAlignedFrameSpace(0);
+  __ CallRuntime(kDeoptimizeFillFrameRuntimeEntry);  // Pass last FP in R0.
+  // Result (R0) is our FP.
+  if (preserve_result) {
+    // Restore result into R1.
+    __ ldr(R1, Address(FP, -1 * kWordSize));
+  }
+  // Code above cannot cause GC.
+  __ LeaveFrame((1 << FP) | (1 << LR));
+  __ mov(FP, ShifterOperand(R0));
+
+  // Frame is fully rewritten at this point and it is safe to perform a GC.
+  // Materialize any objects that were deferred by FillFrame because they
+  // require allocation.
+  __ EnterStubFrame();
+  if (preserve_result) {
+    __ Push(R1);  // Preserve result, it will be GC-d here.
+  }
+  __ CallRuntime(kDeoptimizeMaterializeDoublesRuntimeEntry);
+  if (preserve_result) {
+    __ Pop(R0);  // Restore result.
+  }
+  __ LeaveStubFrame();
+  __ Ret();
+}
+
+
 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) {
   __ Unimplemented("DeoptimizeLazy stub");
 }
 
 
 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
-  __ Unimplemented("Deoptimize stub");
+  GenerateDeoptimizationSequence(assembler, false);  // Don't preserve R0.
 }
 
 
@@ -585,7 +692,7 @@
   // kExitLinkOffsetInEntryFrame must be kept in sync with the code below.
   __ PushList((1 << R4) | (1 << R5));
 
-  // The stack pointer is restore after the call to this location.
+  // The stack pointer is restored after the call to this location.
   const intptr_t kSavedContextOffsetInEntryFrame = -10 * kWordSize;
 
   // Load arguments descriptor array into R4, which is passed to Dart code.
@@ -827,7 +934,7 @@
   ASSERT(instance_size > 0);
   const intptr_t type_args_size = InstantiatedTypeArguments::InstanceSize();
   if (FLAG_inline_alloc &&
-      PageSpace::IsPageAllocatableSize(instance_size + type_args_size)) {
+      Heap::IsAllocatableInNewSpace(instance_size + type_args_size)) {
     Label slow_case;
     Heap* heap = Isolate::Current()->heap();
     __ LoadImmediate(R5, heap->TopAddress());
@@ -997,7 +1104,7 @@
   const intptr_t closure_size = Closure::InstanceSize();
   const intptr_t context_size = Context::InstanceSize(1);  // Captured receiver.
   if (FLAG_inline_alloc &&
-      PageSpace::IsPageAllocatableSize(closure_size + context_size)) {
+      Heap::IsAllocatableInNewSpace(closure_size + context_size)) {
     Label slow_case;
     Heap* heap = Isolate::Current()->heap();
     __ LoadImmediate(R5, heap->TopAddress());
@@ -1132,8 +1239,35 @@
 }
 
 
+//  R6: function object.
+//  R5: inline cache data object.
+//  R4: arguments descriptor array.
 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
-  __ Unimplemented("OptimizedUsageCounterIncrement stub");
+  Register ic_reg = R5;
+  Register func_reg = R6;
+  if (FLAG_trace_optimized_ic_calls) {
+    __ EnterStubFrame();
+    __ PushList((1 << R4) | (1 << R5) | (1 << R6));  // Preserve.
+    __ Push(ic_reg);  // Argument.
+    __ Push(func_reg);  // Argument.
+    __ CallRuntime(kTraceICCallRuntimeEntry);
+    __ Drop(2);  // Discard argument;
+    __ PushList((1 << R4) | (1 << R5) | (1 << R6));  // Restore.
+    __ LeaveStubFrame();
+  }
+  __ ldr(R7, FieldAddress(func_reg, Function::usage_counter_offset()));
+  Label is_hot;
+  if (FlowGraphCompiler::CanOptimize()) {
+    ASSERT(FLAG_optimization_counter_threshold > 1);
+    __ CompareImmediate(R7, FLAG_optimization_counter_threshold);
+    __ b(&is_hot, GE);
+    // As long as VM has no OSR do not optimize in the middle of the function
+    // but only at exit so that we have collected all type feedback before
+    // optimizing.
+  }
+  __ add(R7, R7, ShifterOperand(1));
+  __ str(R7, FieldAddress(func_reg, Function::usage_counter_offset()));
+  __ Bind(&is_hot);
 }
 
 
@@ -1385,18 +1519,66 @@
 }
 
 
+//  LR: return address (Dart code).
+//  R4: arguments descriptor array.
 void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) {
-  __ Unimplemented("BreakpointStatic stub");
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  // Preserve arguments descriptor and make room for result.
+  __ PushList((1 << R0) | (1 << R4));
+  __ CallRuntime(kBreakpointStaticHandlerRuntimeEntry);
+  // Pop code object result and restore arguments descriptor.
+  __ PopList((1 << R0) | (1 << R4));
+  __ LeaveStubFrame();
+
+  // Now call the static function. The breakpoint handler function
+  // ensures that the call target is compiled.
+  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
+  __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ bx(R0);
 }
 
 
+//  R0: return value.
 void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) {
-  __ Unimplemented("BreakpointReturn stub");
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  __ Push(R0);
+  __ CallRuntime(kBreakpointReturnHandlerRuntimeEntry);
+  __ Pop(R0);
+  __ LeaveStubFrame();
+
+  // Instead of returning to the patched Dart function, emulate the
+  // smashed return code pattern and return to the function's caller.
+  __ LeaveDartFrame();
+  __ Ret();
 }
 
 
+//  LR: return address (Dart code).
+//  R5: inline cache data array.
+//  R4: arguments descriptor array.
 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) {
-  __ Unimplemented("BreakpointDynamic stub");
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  __ PushList((1 << R4) | (1 << R5));
+  __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry);
+  __ PopList((1 << R4) | (1 << R5));
+  __ LeaveStubFrame();
+
+  // Find out which dispatch stub to call.
+  __ ldr(IP, FieldAddress(R5, ICData::num_args_tested_offset()));
+  __ cmp(IP, ShifterOperand(1));
+  __ Branch(&StubCode::OneArgCheckInlineCacheLabel(), EQ);
+  __ cmp(IP, ShifterOperand(2));
+  __ Branch(&StubCode::TwoArgsCheckInlineCacheLabel(), EQ);
+  __ cmp(IP, ShifterOperand(3));
+  __ Branch(&StubCode::ThreeArgsCheckInlineCacheLabel(), EQ);
+  __ Stop("Unsupported number of arguments tested.");
 }
 
 
@@ -1533,8 +1715,89 @@
 }
 
 
+// Implements equality operator when one of the arguments is null
+// (identity check) and updates ICData if necessary.
+// LR: return address.
+// R1: left argument.
+// R0: right argument.
+// R5: ICData.
+// R0: result.
+// TODO(srdjan): Move to VM stubs once Boolean objects become VM objects.
 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
-  __ Unimplemented("EqualityWithNullArg Stub");
+  __ EnterStubFrame();
+  static const intptr_t kNumArgsTested = 2;
+#if defined(DEBUG)
+  { Label ok;
+    __ ldr(IP, FieldAddress(R5, ICData::num_args_tested_offset()));
+    __ cmp(IP, ShifterOperand(kNumArgsTested));
+    __ b(&ok, EQ);
+    __ Stop("Incorrect ICData for equality");
+    __ Bind(&ok);
+  }
+#endif  // DEBUG
+  // Check IC data, update if needed.
+  // R5: IC data object (preserved).
+  __ ldr(R6, FieldAddress(R5, ICData::ic_data_offset()));
+  // R6: ic_data_array with check entries: classes and target functions.
+  __ AddImmediate(R6, Array::data_offset() - kHeapObjectTag);
+  // R6: points directly to the first ic data array element.
+
+  Label get_class_id_as_smi, no_match, loop, found;
+  __ Bind(&loop);
+  // Check left.
+  __ mov(R2, ShifterOperand(R1));
+  __ bl(&get_class_id_as_smi);
+  __ ldr(R3, Address(R6, 0 * kWordSize));
+  __ cmp(R2, ShifterOperand(R3));  // Class id match?
+  __ b(&no_match, NE);
+  // Check right.
+  __ mov(R2, ShifterOperand(R0));
+  __ bl(&get_class_id_as_smi);
+  __ ldr(R3, Address(R6, 1 * kWordSize));
+  __ cmp(R2, ShifterOperand(R3));  // Class id match?
+  __ b(&found, EQ);
+  __ Bind(&no_match);
+  // Next check group.
+  __ AddImmediate(R6, kWordSize * ICData::TestEntryLengthFor(kNumArgsTested));
+  __ CompareImmediate(R3, Smi::RawValue(kIllegalCid));  // Done?
+  __ b(&loop, NE);
+  Label update_ic_data;
+  __ b(&update_ic_data);
+
+  __ Bind(&found);
+  const intptr_t count_offset =
+      ICData::CountIndexFor(kNumArgsTested) * kWordSize;
+  __ ldr(IP, Address(R6, count_offset));
+  __ adds(IP, IP, ShifterOperand(Smi::RawValue(1)));
+  __ LoadImmediate(IP, Smi::RawValue(Smi::kMaxValue), VS);  // If overflow.
+  __ str(IP, Address(R6, count_offset));
+
+  Label compute_result;
+  __ Bind(&compute_result);
+  __ cmp(R0, ShifterOperand(R1));
+  __ LoadObject(R0, Bool::False(), NE);
+  __ LoadObject(R0, Bool::True(), EQ);
+  __ LeaveStubFrame();
+  __ Ret();
+
+  __ Bind(&get_class_id_as_smi);
+  // Test if Smi -> load Smi class for comparison.
+  __ tst(R2, ShifterOperand(kSmiTagMask));
+  __ mov(R2, ShifterOperand(Smi::RawValue(kSmiCid)), EQ);
+  __ bx(LR, EQ);
+  __ LoadClassId(R2, R2);
+  __ SmiTag(R2);
+  __ bx(LR);
+
+  __ Bind(&update_ic_data);
+  // R5: ICData
+  __ PushList((1 << R0) | (1 << R1));
+  __ PushObject(Symbols::EqualOperator());  // Target's name.
+  __ Push(R5);  // ICData
+  __ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry);  // Clobbers R4, R5.
+  __ Drop(2);
+  __ PopList((1 << R0) | (1 << R1));
+  __ b(&compute_result);
 }
 
 
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 6da47f7..dd4a3d7 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -10,8 +10,8 @@
 #include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
 #include "vm/instructions.h"
+#include "vm/heap.h"
 #include "vm/object_store.h"
-#include "vm/pages.h"
 #include "vm/resolver.h"
 #include "vm/scavenger.h"
 #include "vm/stub_code.h"
@@ -322,7 +322,7 @@
 // - Fill the unoptimized frame.
 // - Materialize objects that require allocation (e.g. Double instances).
 // GC can occur only after frame is fully rewritten.
-// Stack:
+// Stack after EnterFrame(0) below:
 //   +------------------+
 //   | Saved FP         | <- TOS
 //   +------------------+
@@ -353,9 +353,8 @@
     offset += kFpuRegisterSize;
   }
 
-  __ movl(ECX, ESP);  // Saved saved registers block.
+  __ movl(ECX, ESP);  // Preserve saved registers block.
   __ ReserveAlignedFrameSpace(1 * kWordSize);
-  __ SmiUntag(EAX);
   __ movl(Address(ESP, 0), ECX);  // Start of register block.
   __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry);
   // Result (EAX) is stack-size (FP - SP) in bytes, incl. the return address.
@@ -1030,7 +1029,7 @@
   ASSERT(instance_size > 0);
   const intptr_t type_args_size = InstantiatedTypeArguments::InstanceSize();
   if (FLAG_inline_alloc &&
-      PageSpace::IsPageAllocatableSize(instance_size + type_args_size)) {
+      Heap::IsAllocatableInNewSpace(instance_size + type_args_size)) {
     Label slow_case;
     Heap* heap = Isolate::Current()->heap();
     __ movl(EAX, Address::Absolute(heap->TopAddress()));
@@ -1203,7 +1202,7 @@
   const intptr_t closure_size = Closure::InstanceSize();
   const intptr_t context_size = Context::InstanceSize(1);  // Captured receiver.
   if (FLAG_inline_alloc &&
-      PageSpace::IsPageAllocatableSize(closure_size + context_size)) {
+      Heap::IsAllocatableInNewSpace(closure_size + context_size)) {
     Label slow_case;
     Heap* heap = Isolate::Current()->heap();
     __ movl(EAX, Address::Absolute(heap->TopAddress()));
@@ -1919,7 +1918,7 @@
   }
 #endif  // DEBUG
   // Check IC data, update if needed.
-  // EBX: IC data object (preserved).
+  // ECX: IC data object (preserved).
   __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset()));
   // EBX: ic_data_array with check entries: classes and target functions.
   __ leal(EBX, FieldAddress(EBX, Array::data_offset()));
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index 077690c..b3599c4 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -7,9 +7,12 @@
 
 #include "vm/assembler.h"
 #include "vm/code_generator.h"
+#include "vm/compiler.h"
 #include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
+#include "vm/heap.h"
 #include "vm/instructions.h"
+#include "vm/object_store.h"
 #include "vm/stack_frame.h"
 #include "vm/stub_code.h"
 
@@ -37,6 +40,7 @@
   const intptr_t argv_offset = NativeArguments::argv_offset();
   const intptr_t retval_offset = NativeArguments::retval_offset();
 
+  __ TraceSimMsg("CallToRuntimeStub");
   __ addiu(SP, SP, Immediate(-2 * kWordSize));
   __ sw(RA, Address(SP, 1 * kWordSize));
   __ sw(FP, Address(SP, 0 * kWordSize));
@@ -81,6 +85,7 @@
 
   // Call runtime or redirection via simulator.
   __ jalr(S5);
+  __ TraceSimMsg("CallToRuntimeStub return");
 
   // Reset exit frame information in Isolate structure.
   __ sw(ZR, Address(CTX, Isolate::top_exit_frame_info_offset()));
@@ -120,6 +125,7 @@
   const intptr_t argv_offset = NativeArguments::argv_offset();
   const intptr_t retval_offset = NativeArguments::retval_offset();
 
+  __ TraceSimMsg("CallNativeCFunctionStub");
   __ addiu(SP, SP, Immediate(-2 * kWordSize));
   __ sw(RA, Address(SP, 1 * kWordSize));
   __ sw(FP, Address(SP, 0 * kWordSize));
@@ -173,11 +179,12 @@
 
   // Call native function or redirection via simulator.
   __ jalr(T5);
+  __ TraceSimMsg("CallNativeCFunctionStub return");
 
   // Reset exit frame information in Isolate structure.
   __ sw(ZR, Address(CTX, Isolate::top_exit_frame_info_offset()));
 
-  // Load Context pointer from Isolate structure into R2.
+  // Load Context pointer from Isolate structure into A2.
   __ lw(A2, Address(CTX, Isolate::top_context_offset()));
 
   // Reset Context pointer in Isolate structure.
@@ -198,6 +205,7 @@
 // Input parameters:
 //   S4: arguments descriptor array.
 void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
+  __ TraceSimMsg("CallStaticFunctionStub");
   __ EnterStubFrame();
   // Setup space on stack for return value and preserve arguments descriptor.
   __ LoadImmediate(T0, reinterpret_cast<intptr_t>(Object::null()));
@@ -207,6 +215,7 @@
   __ sw(T0, Address(SP, 0 * kWordSize));
 
   __ CallRuntime(kPatchStaticCallRuntimeEntry);
+  __ TraceSimMsg("CallStaticFunctionStub return");
 
   // Get Code object result and restore arguments descriptor array.
   __ lw(T0, Address(SP, 0 * kWordSize));
@@ -222,13 +231,113 @@
 }
 
 
+// Called from a static call only when an invalid code has been entered
+// (invalid because its function was optimized or deoptimized).
+// S4: arguments descriptor array.
 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
-  __ Unimplemented("FixCallersTarget stub");
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  // Setup space on stack for return value and preserve arguments descriptor.
+  __ LoadImmediate(T0, reinterpret_cast<intptr_t>(Object::null()));
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(S4, Address(SP, 1 * kWordSize));
+  __ sw(T0, Address(SP, 0 * kWordSize));
+  __ CallRuntime(kFixCallersTargetRuntimeEntry);
+  // Get Code object result and restore arguments descriptor array.
+  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ lw(S4, Address(SP, 1 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  // Remove the stub frame.
+  __ LeaveStubFrame();
+  // Jump to the dart function.
+  __ lw(T0, FieldAddress(T0, Code::instructions_offset()));
+  __ AddImmediate(T0, T0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ jr(T0);
 }
 
 
+// Input parameters:
+//   A1: Smi-tagged argument count, may be zero.
+//   FP[kLastParamSlotIndex]: Last argument.
+static void PushArgumentsArray(Assembler* assembler) {
+  __ TraceSimMsg("PushArgumentsArray");
+  // Allocate array to store arguments of caller.
+  __ LoadImmediate(A0, reinterpret_cast<intptr_t>(Object::null()));
+  // A0: Null element type for raw Array.
+  // A1: Smi-tagged argument count, may be zero.
+  __ BranchLink(&StubCode::AllocateArrayLabel());
+  __ TraceSimMsg("PushArgumentsArray return");
+  // V0: newly allocated array.
+  // A1: Smi-tagged argument count, may be zero (was preserved by the stub).
+  __ Push(V0);  // Array is in V0 and on top of stack.
+  __ sll(T1, A1, 1);
+  __ addu(T1, FP, T1);
+  __ AddImmediate(T1, (kLastParamSlotIndex - 1) * kWordSize);
+  __ AddImmediate(T2, V0, Array::data_offset() - kHeapObjectTag);
+  // T1: address of first argument on stack.
+  // T2: address of first argument in array.
+  Label loop, loop_condition;
+  __ b(&loop_condition);
+  __ Bind(&loop);
+  __ lw(TMP, Address(T1));
+  __ sw(TMP, Address(T2));
+  __ AddImmediate(T1, -kWordSize);
+  __ AddImmediate(T2, kWordSize);
+  __ Bind(&loop_condition);
+  __ AddImmediate(A1, -Smi::RawValue(1));  // A1 is Smi.
+  __ BranchGreaterEqual(A1, ZR, &loop);
+}
+
+
+// Input parameters:
+//   S5: ic-data.
+//   S4: arguments descriptor array.
+// Note: The receiver object is the first argument to the function being
+//       called, the stub accesses the receiver from this location directly
+//       when trying to resolve the call.
 void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) {
-  __ Unimplemented("InstanceFunctionLookup stub");
+  __ TraceSimMsg("InstanceFunctionLookupStub");
+  __ EnterStubFrame();
+
+  // Load the receiver.
+  __ lw(A1, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
+  __ sll(TMP1, A1, 1);  // A1 is Smi.
+  __ addu(TMP1, FP, TMP1);
+  __ lw(T1, Address(TMP1, (kLastParamSlotIndex - 1) * kWordSize));
+
+  // Push space for the return value.
+  // Push the receiver.
+  // Push TMP1 data object.
+  // Push arguments descriptor array.
+  __ LoadImmediate(TMP1, reinterpret_cast<intptr_t>(Object::null()));
+  __ addiu(SP, SP, Immediate(-4 * kWordSize));
+  __ sw(TMP1, Address(SP, 3 * kWordSize));
+  __ sw(T1, Address(SP, 2 * kWordSize));
+  __ sw(S5, Address(SP, 1 * kWordSize));
+  __ sw(S4, Address(SP, 0 * kWordSize));
+
+  // A1: Smi-tagged arguments array length.
+  PushArgumentsArray(assembler);
+  __ TraceSimMsg("InstanceFunctionLookupStub return");
+
+  // Stack:
+  // TOS + 0: argument array.
+  // TOS + 1: arguments descriptor array.
+  // TOS + 2: IC data object.
+  // TOS + 3: Receiver.
+  // TOS + 4: place for result from the call.
+  // TOS + 5: saved FP of previous frame.
+  // TOS + 6: dart code return address
+  // TOS + 7: pc marker (0 for stub).
+  // TOS + 8: last argument of caller.
+  // ....
+  __ CallRuntime(kInstanceFunctionLookupRuntimeEntry);
+  // Remove arguments.
+  __ lw(V0, Address(SP, 4 * kWordSize));
+  __ addiu(SP, SP, Immediate(5 * kWordSize));  // Get result into V0.
+  __ LeaveStubFrame();
+  __ Ret();
 }
 
 
@@ -247,13 +356,261 @@
 }
 
 
+// Called for inline allocation of arrays.
+// Input parameters:
+//   RA: return address.
+//   A1: Array length as Smi.
+//   A0: array element type (either NULL or an instantiated type).
+// NOTE: A1 cannot be clobbered here as the caller relies on it being saved.
+// The newly allocated object is returned in V0.
 void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
-  __ Unimplemented("AllocateArray stub");
+  __ TraceSimMsg("AllocateArrayStub");
+  Label slow_case;
+  if (FLAG_inline_alloc) {
+    // Compute the size to be allocated, it is based on the array length
+    // and is computed as:
+    // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)).
+    // Assert that length is a Smi.
+    __ andi(CMPRES, A1, Immediate(kSmiTagMask));
+    if (FLAG_use_slow_path) {
+      __ b(&slow_case);
+    } else {
+      __ bne(CMPRES, ZR, &slow_case);
+    }
+    __ lw(T0, FieldAddress(CTX, Context::isolate_offset()));
+    __ lw(T0, Address(T0, Isolate::heap_offset()));
+    __ lw(T0, Address(T0, Heap::new_space_offset()));
+
+    // Calculate and align allocation size.
+    // Load new object start and calculate next object start.
+    // A0: array element type.
+    // A1: Array length as Smi.
+    // T0: Points to new space object.
+    __ lw(V0, Address(T0, Scavenger::top_offset()));
+    intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
+    __ LoadImmediate(T3, fixed_size);
+    __ sll(TMP1, A1, 1);  // A1 is Smi.
+    __ addu(T3, T3, TMP1);
+    ASSERT(kSmiTagShift == 1);
+    __ LoadImmediate(TMP1, ~(kObjectAlignment - 1));
+    __ and_(T3, T3, TMP1);
+    __ addu(T2, T3, V0);
+
+    // Check if the allocation fits into the remaining space.
+    // V0: potential new object start.
+    // A0: array element type.
+    // A1: array length as Smi.
+    // T0: points to new space object.
+    // T2: potential next object start.
+    // T3: array size.
+    __ lw(TMP1, Address(T0, Scavenger::end_offset()));
+    __ BranchGreaterEqual(T2, TMP1, &slow_case);
+
+    // Successfully allocated the object(s), now update top to point to
+    // next object start and initialize the object.
+    // V0: potential new object start.
+    // T2: potential next object start.
+    // T0: Points to new space object.
+    __ sw(T2, Address(T0, Scavenger::top_offset()));
+    __ addiu(V0, V0, Immediate(kHeapObjectTag));
+
+    // V0: new object start as a tagged pointer.
+    // A0: array element type.
+    // A1: Array length as Smi.
+    // T2: new object end address.
+
+    // Store the type argument field.
+    __ StoreIntoObjectNoBarrier(
+        V0,
+        FieldAddress(V0, Array::type_arguments_offset()),
+        A0);
+
+    // Set the length field.
+    __ StoreIntoObjectNoBarrier(
+        V0,
+        FieldAddress(V0, Array::length_offset()),
+        A1);
+
+    // Calculate the size tag.
+    // V0: new object start as a tagged pointer.
+    // A1: Array length as Smi.
+    // T2: new object end address.
+    // T3: array size.
+    const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2;
+    // If no size tag overflow, shift T3 left, else set T3 to zero.
+    __ LoadImmediate(TMP2, RawObject::SizeTag::kMaxSizeTag);
+    __ sltu(CMPRES, TMP2, T3);  // CMPRES = TMP2 < T3 ? 1 : 0
+    __ sll(TMP1, T3, shift);  // TMP1 = T3 << shift;
+    __ movz(T3, TMP1, CMPRES);  // T3 = TMP2 >= T3 ? 0 : T3
+    __ movn(T3, ZR, CMPRES);  // T3 = TMP2 < T3 ? TMP1 : T3
+
+    // Get the class index and insert it into the tags.
+    __ LoadImmediate(TMP1, RawObject::ClassIdTag::encode(kArrayCid));
+    __ or_(T3, T3, TMP1);
+    __ sw(T3, FieldAddress(V0, Array::tags_offset()));
+
+    // Initialize all array elements to raw_null.
+    // V0: new object start as a tagged pointer.
+    // T2: new object end address.
+    // A1: Array length as Smi.
+    __ AddImmediate(T3, V0, Array::data_offset() - kHeapObjectTag);
+    // R1: iterator which initially points to the start of the variable
+    // data area to be initialized.
+    __ LoadImmediate(TMP1, reinterpret_cast<intptr_t>(Object::null()));
+    Label loop, test;
+    __ b(&test);
+    __ Bind(&loop);
+    // TODO(cshapiro): StoreIntoObjectNoBarrier
+    __ sw(TMP1, Address(T3, 0));
+    __ AddImmediate(T3, kWordSize);
+    __ Bind(&test);
+    __ bne(T3, T2, &loop);
+
+    // Done allocating and initializing the array.
+    // V0: new object.
+    // A1: Array length as Smi (preserved for the caller.)
+    __ Ret();
+  }
+
+  // Unable to allocate the array using the fast inline code, just call
+  // into the runtime.
+  __ Bind(&slow_case);
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  __ LoadImmediate(TMP1, reinterpret_cast<intptr_t>(Object::null()));
+  // Setup space on stack for return value.
+  // Push array length as Smi and element type.
+  __ addiu(SP, SP, Immediate(-3 * kWordSize));
+  __ sw(TMP1, Address(SP, 2 * kWordSize));
+  __ sw(A1, Address(SP, 1 * kWordSize));
+  __ sw(T3, Address(SP, 0 * kWordSize));
+  __ CallRuntime(kAllocateArrayRuntimeEntry);
+  __ TraceSimMsg("AllocateArrayStub return");
+  // Pop arguments; result is popped in IP.
+  __ lw(TMP1, Address(SP, 2 * kWordSize));
+  __ lw(A1, Address(SP, 1 * kWordSize));
+  __ lw(T3, Address(SP, 0 * kWordSize));
+  __ addiu(SP, SP, Immediate(3 * kWordSize));
+  __ mov(V0, TMP1);
+  __ LeaveStubFrame();
+  __ Ret();
 }
 
 
+// Input parameters:
+//   RA: return address.
+//   SP: address of last argument.
+//   S4: Arguments descriptor array.
+// Return: V0.
+// Note: The closure object is the first argument to the function being
+//       called, the stub accesses the closure from this location directly
+//       when trying to resolve the call.
 void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
-  __ Unimplemented("CallClosureFunction stub");
+  // Load num_args.
+  __ TraceSimMsg("GenerateCallClosureFunctionStub");
+  __ lw(T0, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
+  __ LoadImmediate(TMP1, Smi::RawValue(1));
+  __ subu(T0, T0, TMP1);
+
+  // Load closure object in T1.
+  __ sll(T1, T0, 1);  // T0 (num_args - 1) is a Smi.
+  __ addu(T1, SP, T1);
+  __ lw(T1, Address(T1));
+
+  // Verify that T1 is a closure by checking its class.
+  Label not_closure;
+
+  __ LoadImmediate(T7, reinterpret_cast<intptr_t>(Object::null()));
+  // See if it is not a closure, but null object.
+  __ beq(T1, T7, &not_closure);
+
+  __ andi(CMPRES, T1, Immediate(kSmiTagMask));
+  __ beq(CMPRES, ZR, &not_closure);  // Not a closure, but a smi.
+
+  // Verify that the class of the object is a closure class by checking that
+  // class.signature_function() is not null.
+  __ LoadClass(T0, T1);
+  __ lw(T0, FieldAddress(T0, Class::signature_function_offset()));
+
+  // See if actual class is not a closure class.
+  __ beq(T0, T7, &not_closure);
+
+  // T0 is just the signature function. Load the actual closure function.
+  __ lw(T2, FieldAddress(T1, Closure::function_offset()));
+
+  // Load closure context in CTX; note that CTX has already been preserved.
+  __ lw(CTX, FieldAddress(T1, Closure::context_offset()));
+
+  Label function_compiled;
+  // Load closure function code in T0.
+  __ lw(T0, FieldAddress(T2, Function::code_offset()));
+  __ bne(T0, T7, &function_compiled);
+
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+
+  // Preserve arguments descriptor array and read-only function object argument.
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(S4, Address(SP, 1 * kWordSize));
+  __ sw(T2, Address(SP, 0 * kWordSize));
+  __ CallRuntime(kCompileFunctionRuntimeEntry);
+  __ TraceSimMsg("GenerateCallClosureFunctionStub return");
+  // Restore arguments descriptor array and read-only function object argument.
+  __ lw(T2, Address(SP, 0 * kWordSize));
+  __ lw(S4, Address(SP, 1 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  // Restore T0.
+  __ lw(T0, FieldAddress(T2, Function::code_offset()));
+
+  // Remove the stub frame as we are about to jump to the closure function.
+  __ LeaveStubFrame();
+
+  __ Bind(&function_compiled);
+  // T0: Code.
+  // S4: Arguments descriptor array.
+  __ lw(T0, FieldAddress(T0, Code::instructions_offset()));
+  __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ jr(T0);
+
+  __ Bind(&not_closure);
+  // Call runtime to attempt to resolve and invoke a call method on a
+  // non-closure object, passing the non-closure object and its arguments array,
+  // returning here.
+  // If no call method exists, throw a NoSuchMethodError.
+  // T1: non-closure object.
+  // S4: arguments descriptor array.
+
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+
+  // Setup space on stack for result from error reporting.
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  __ sw(T7, Address(SP, 1 * kWordSize));  // Arguments descriptor and raw null.
+  __ sw(S4, Address(SP, 0 * kWordSize));
+
+  // Load smi-tagged arguments array length, including the non-closure.
+  __ lw(A1, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
+  PushArgumentsArray(assembler);
+
+  // Stack:
+  // TOS + 0: Argument array.
+  // TOS + 1: Arguments descriptor array.
+  // TOS + 2: Place for result from the call.
+  // TOS + 3: Saved FP of previous frame.
+  // TOS + 4: Dart code return address.
+  // TOS + 5: PC marker (0 for stub).
+  // TOS + 6: Last argument of caller.
+  // ....
+  __ CallRuntime(kInvokeNonClosureRuntimeEntry);
+  __ lw(V0, Address(SP, 2 * kWordSize));  // Get result into V0.
+  __ addiu(SP, SP, Immediate(3 * kWordSize));  // Remove arguments.
+
+  // Remove the stub frame as we are about to return.
+  __ LeaveStubFrame();
+  __ Ret();
 }
 
 
@@ -266,6 +623,7 @@
 //   A3 : new context containing the current isolate pointer.
 void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
   // Save frame pointer coming in.
+  __ TraceSimMsg("InvokeDartCodeStub");
   __ EnterStubFrame();
 
   // Save new context and C++ ABI callee-saved registers.
@@ -308,8 +666,8 @@
   __ sw(T0, Address(SP, 1 * kWordSize));
   __ sw(T1, Address(SP, 0 * kWordSize));
 
-  // after the call, The stack pointer is restored to this location.
-  // Pushed A3, S0-7, S4, S5 = 11.
+  // After the call, The stack pointer is restored to this location.
+  // Pushed A3, S0-7, T0, T1 = 11.
   const intptr_t kSavedContextOffsetInEntryFrame = -11 * kWordSize;
 
   // Load arguments descriptor array into S4, which is passed to Dart code.
@@ -339,6 +697,7 @@
 
   // Call the Dart code entrypoint.
   __ jalr(A0);  // S4 is the arguments descriptor array.
+  __ TraceSimMsg("InvokeDartCodeStub return");
 
   // Read the saved new Context pointer.
   __ lw(CTX, Address(FP, kNewContextOffset));
@@ -364,7 +723,7 @@
     Register r = static_cast<Register>(i);
     __ lw(r, Address(SP, (i - S0 + 3) * kWordSize));
   }
-  __ lw(A3, Address(SP));
+  __ lw(A3, Address(SP, 2 * kWordSize));
   __ addiu(SP, SP, Immediate((3 + kAbiPreservedCpuRegCount) * kWordSize));
 
   // Restore the frame pointer and return.
@@ -373,8 +732,129 @@
 }
 
 
+// Called for inline allocation of contexts.
+// Input:
+//   T1: number of context variables.
+// Output:
+//   V0: new allocated RawContext object.
 void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
-  __ Unimplemented("AllocateContext stub");
+  if (FLAG_inline_alloc) {
+    const Class& context_class = Class::ZoneHandle(Object::context_class());
+    Label slow_case;
+    Heap* heap = Isolate::Current()->heap();
+    // First compute the rounded instance size.
+    // T1: number of context variables.
+    intptr_t fixed_size = sizeof(RawContext) + kObjectAlignment - 1;
+    __ LoadImmediate(T2, fixed_size);
+    __ sll(T0, T1, 2);
+    __ addu(T2, T2, T0);
+    ASSERT(kSmiTagShift == 1);
+    __ LoadImmediate(T0, ~((kObjectAlignment) - 1));
+    __ and_(T2, T2, T0);
+
+    // Now allocate the object.
+    // T1: number of context variables.
+    // T2: object size.
+    __ LoadImmediate(T5, heap->TopAddress());
+    __ lw(V0, Address(T5, 0));
+    __ addu(T3, T2, V0);
+
+    // Check if the allocation fits into the remaining space.
+    // V0: potential new object.
+    // T1: number of context variables.
+    // T2: object size.
+    // T3: potential next object start.
+    __ LoadImmediate(TMP1, heap->EndAddress());
+    __ lw(TMP1, Address(TMP1, 0));
+    if (FLAG_use_slow_path) {
+      __ b(&slow_case);
+    } else {
+      __ BranchGreaterEqual(T3, TMP1, &slow_case);
+    }
+
+    // Successfully allocated the object, now update top to point to
+    // next object start and initialize the object.
+    // V0: new object.
+    // T1: number of context variables.
+    // T2: object size.
+    // T3: next object start.
+    __ sw(T3, Address(T5, 0));
+    __ addiu(V0, V0, Immediate(kHeapObjectTag));
+
+    // Calculate the size tag.
+    // V0: new object.
+    // T1: number of context variables.
+    // T2: object size.
+    const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2;
+    __ LoadImmediate(TMP1, RawObject::SizeTag::kMaxSizeTag);
+    __ sltu(CMPRES, TMP1, T2);  // CMPRES = T2 > TMP1 ? 1 : 0.
+    __ movn(T2, ZR, CMPRES);  // T2 = CMPRES != 0 ? 0 : T2.
+    __ sll(TMP1, T2, shift);  // TMP2 = T2 << shift.
+    __ movz(T2, TMP1, CMPRES);  // T2 = CMPRES == 0 ? TMP1 : T2.
+
+    // Get the class index and insert it into the tags.
+    // T2: size and bit tags.
+    __ LoadImmediate(TMP1, RawObject::ClassIdTag::encode(context_class.id()));
+    __ or_(T2, T2, TMP1);
+    __ sw(T2, FieldAddress(V0, Context::tags_offset()));
+
+    // Setup up number of context variables field.
+    // V0: new object.
+    // T1: number of context variables as integer value (not object).
+    __ sw(T1, FieldAddress(V0, Context::num_variables_offset()));
+
+    // Setup isolate field.
+    // Load Isolate pointer from Context structure into R2.
+    // V0: new object.
+    // T1: number of context variables.
+    __ lw(T2, FieldAddress(CTX, Context::isolate_offset()));
+    // T2: isolate, not an object.
+    __ sw(T2, FieldAddress(V0, Context::isolate_offset()));
+
+    // Setup the parent field.
+    // V0: new object.
+    // T1: number of context variables.
+    __ LoadImmediate(T2, reinterpret_cast<intptr_t>(Object::null()));
+    __ sw(T2, FieldAddress(V0, Context::parent_offset()));
+
+    // Initialize the context variables.
+    // V0: new object.
+    // T1: number of context variables.
+    // T2: raw null.
+    Label loop, loop_test;
+    __ AddImmediate(T3, V0, Context::variable_offset(0) - kHeapObjectTag);
+    __ b(&loop_test);
+    __ delay_slot()->sll(T1, T1, 2);
+    __ Bind(&loop);
+    __ addu(TMP1, T3, T1);
+    __ sw(T2, Address(TMP1));
+    __ Bind(&loop_test);
+    __ addiu(T1, T1, Immediate(-kWordSize));
+    __ bne(T1, ZR, &loop);  // Loop if R1 not zero.
+
+    // Done allocating and initializing the context.
+    // V0: new object.
+    __ Ret();
+
+    __ Bind(&slow_case);
+  }
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  // Setup space on stack for return value.
+  __ LoadImmediate(T2, reinterpret_cast<intptr_t>(Object::null()));
+  __ SmiTag(T1);
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(T2, Address(SP, 1 * kWordSize));
+  __ sw(T1, Address(SP, 0 * kWordSize));
+  __ CallRuntime(kAllocateContextRuntimeEntry);  // Allocate context.
+  __ lw(V0, Address(SP, 1 * kWordSize));  // Get the new context.
+  __ addiu(SP, SP, Immediate(2 * kWordSize));  // Pop argument and return.
+
+  // V0: new object
+  // Restore the frame pointer.
+  __ LeaveStubFrame();
+  __ Ret();
 }
 
 
@@ -386,6 +866,7 @@
 //   T0: Address (i.e. object) being stored into.
 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
   // Save values being destroyed.
+  __ TraceSimMsg("UpdateStoreBufferStub");
   __ addiu(SP, SP, Immediate(-3 * kWordSize));
   __ sw(T3, Address(SP, 2 * kWordSize));
   __ sw(T2, Address(SP, 1 * kWordSize));
@@ -400,7 +881,7 @@
   // T1: Isolate.
   intptr_t store_buffer_offset = Isolate::store_buffer_block_offset();
   __ lw(T2, Address(T1, store_buffer_offset + StoreBufferBlock::top_offset()));
-  __ sll(T3, T2, 1);
+  __ sll(T3, T2, 2);
   __ addu(T3, T1, T3);
   __ sw(T0,
         Address(T3, store_buffer_offset + StoreBufferBlock::pointers_offset()));
@@ -427,6 +908,7 @@
   __ EnterCallRuntimeFrame(0 * kWordSize);
   __ lw(T0, FieldAddress(CTX, Context::isolate_offset()));
   __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry);
+  __ TraceSimMsg("UpdateStoreBufferStub return");
   // Restore callee-saved registers, tear down frame.
   __ LeaveCallRuntimeFrame();
   __ Ret();
@@ -440,6 +922,7 @@
 //   SP + 0 : type arguments of instantiator (only if class is parameterized).
 void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
                                               const Class& cls) {
+  __ TraceSimMsg("AllocationStubForClass");
   // The generated code is different if the class is parameterized.
   const bool is_cls_parameterized =
       cls.type_arguments_field_offset() != Class::kNoTypeArguments;
@@ -451,7 +934,7 @@
   ASSERT(instance_size > 0);
   const intptr_t type_args_size = InstantiatedTypeArguments::InstanceSize();
   if (FLAG_inline_alloc &&
-      PageSpace::IsPageAllocatableSize(instance_size + type_args_size)) {
+      Heap::IsAllocatableInNewSpace(instance_size + type_args_size)) {
     Label slow_case;
     Heap* heap = Isolate::Current()->heap();
     __ LoadImmediate(T5, heap->TopAddress());
@@ -475,10 +958,12 @@
     // Check if the allocation fits into the remaining space.
     // T2: potential new object start.
     // T3: potential next object start.
+    __ LoadImmediate(TMP1, heap->EndAddress());
+    __ lw(TMP1, Address(TMP1));
     if (FLAG_use_slow_path) {
       __ b(&slow_case);
     } else {
-      __ BranchGreaterEqual(T3, heap->EndAddress(), &slow_case);
+      __ BranchGreaterEqual(T3, TMP1, &slow_case);
     }
 
     // Successfully allocated the object(s), now update top to point to
@@ -566,7 +1051,7 @@
       __ sw(T1, Address(T2, cls.type_arguments_field_offset()));
     }
     // Done allocating and initializing the instance.
-    // R2: new object still missing its heap tag.
+    // T2: new object still missing its heap tag.
     __ Ret();
     __ delay_slot()->addiu(V0, T2, Immediate(kHeapObjectTag));
 
@@ -580,23 +1065,27 @@
   // calling into the runtime.
   __ EnterStubFrame(true);  // Uses pool pointer to pass cls to runtime.
   __ LoadImmediate(T2, reinterpret_cast<intptr_t>(Object::null()));
-  __ Push(T2);  // Setup space on stack for return value.
-  __ PushObject(cls);  // Push class of object to be allocated.
+  __ LoadObject(TMP1, cls);
+
+  __ addiu(SP, SP, Immediate(-4 * kWordSize));
+  __ sw(T2, Address(SP, 3 * kWordSize));  // Space on stack for return value.
+  __ sw(TMP1, Address(SP, 2 * kWordSize));  // Class of object to be allocated.
+
   if (is_cls_parameterized) {
     // Push type arguments of object to be allocated and of instantiator.
-    __ addiu(SP, SP, Immediate(-2 * kWordSize));
     __ sw(T1, Address(SP, 1 * kWordSize));
     __ sw(T0, Address(SP, 0 * kWordSize));
   } else {
     // Push null type arguments and kNoInstantiator.
     __ LoadImmediate(T1, Smi::RawValue(StubCode::kNoInstantiator));
-    __ addiu(SP, SP, Immediate(-2 * kWordSize));
     __ sw(T2, Address(SP, 1 * kWordSize));
     __ sw(T1, Address(SP, 0 * kWordSize));
   }
   __ CallRuntime(kAllocateObjectRuntimeEntry);  // Allocate object.
-  __ Drop(3);  // Pop arguments.
-  __ Pop(V0);  // Pop result (newly allocated object).
+  __ TraceSimMsg("AllocationStubForClass return");
+  // Pop result (newly allocated object).
+  __ lw(V0, Address(SP, 3 * kWordSize));
+  __ addiu(SP, SP, Immediate(4 * kWordSize));  // Pop arguments.
   // V0: new object
   // Restore the frame pointer.
   __ LeaveStubFrame(true);
@@ -604,9 +1093,166 @@
 }
 
 
+// Called for inline allocation of closures.
+// Input parameters:
+//   RA: return address.
+//   SP + 4 : receiver (null if not an implicit instance closure).
+//   SP + 0 : type arguments object (null if class is no parameterized).
 void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
                                                 const Function& func) {
-  __ Unimplemented("AllocateClosure stub");
+  ASSERT(func.IsClosureFunction());
+  const bool is_implicit_static_closure =
+      func.IsImplicitStaticClosureFunction();
+  const bool is_implicit_instance_closure =
+      func.IsImplicitInstanceClosureFunction();
+  const Class& cls = Class::ZoneHandle(func.signature_class());
+  const bool has_type_arguments = cls.HasTypeArguments();
+
+  __ TraceSimMsg("AllocationStubForClosure");
+  __ EnterStubFrame(true);  // Uses pool pointer to refer to function.
+  const intptr_t kTypeArgumentsFPOffset = 4 * kWordSize;
+  const intptr_t kReceiverFPOffset = 5 * kWordSize;
+  const intptr_t closure_size = Closure::InstanceSize();
+  const intptr_t context_size = Context::InstanceSize(1);  // Captured receiver.
+  if (FLAG_inline_alloc &&
+      Heap::IsAllocatableInNewSpace(closure_size + context_size)) {
+    Label slow_case;
+    Heap* heap = Isolate::Current()->heap();
+    __ LoadImmediate(T5, heap->TopAddress());
+    __ lw(T2, Address(T5));
+    __ AddImmediate(T3, T2, closure_size);
+    if (is_implicit_instance_closure) {
+      __ mov(T4, T3);  // T4: new context address.
+      __ AddImmediate(T3, context_size);
+    }
+    // Check if the allocation fits into the remaining space.
+    // T2: potential new closure object.
+    // T3: address of top of heap.
+    // T4: potential new context object (only if is_implicit_closure).
+    __ LoadImmediate(TMP1, heap->EndAddress());
+    __ lw(TMP1, Address(TMP1));
+    if (FLAG_use_slow_path) {
+      __ b(&slow_case);
+    } else {
+      __ BranchGreaterEqual(T3, TMP1, &slow_case);
+    }
+
+    // Successfully allocated the object, now update top to point to
+    // next object start and initialize the object.
+    __ sw(T3, Address(T5));
+
+    // T2: new closure object.
+    // T4: new context object (only if is_implicit_closure).
+    // Set the tags.
+    uword tags = 0;
+    tags = RawObject::SizeTag::update(closure_size, tags);
+    tags = RawObject::ClassIdTag::update(cls.id(), tags);
+    __ LoadImmediate(T0, tags);
+    __ sw(T0, Address(T2, Instance::tags_offset()));
+
+    // Initialize the function field in the object.
+    // T2: new closure object.
+    // T4: new context object (only if is_implicit_closure).
+    __ LoadObject(T0, func);  // Load function of closure to be allocated.
+    __ sw(T0, Address(T2, Closure::function_offset()));
+
+    // Setup the context for this closure.
+    if (is_implicit_static_closure) {
+      ObjectStore* object_store = Isolate::Current()->object_store();
+      ASSERT(object_store != NULL);
+      const Context& empty_context =
+          Context::ZoneHandle(object_store->empty_context());
+      __ LoadObject(T0, empty_context);
+      __ sw(T0, Address(T0, Closure::context_offset()));
+    } else if (is_implicit_instance_closure) {
+      // Initialize the new context capturing the receiver.
+      const Class& context_class = Class::ZoneHandle(Object::context_class());
+      // Set the tags.
+      uword tags = 0;
+      tags = RawObject::SizeTag::update(context_size, tags);
+      tags = RawObject::ClassIdTag::update(context_class.id(), tags);
+      __ LoadImmediate(T0, tags);
+      __ sw(T0, Address(T4, Context::tags_offset()));
+
+      // Set number of variables field to 1 (for captured receiver).
+      __ LoadImmediate(T0, 1);
+      __ sw(T0, Address(T4, Context::num_variables_offset()));
+
+      // Set isolate field to isolate of current context.
+      __ lw(T0, FieldAddress(CTX, Context::isolate_offset()));
+      __ sw(T0, Address(T4, Context::isolate_offset()));
+
+      // Set the parent to null.
+      __ LoadImmediate(T0, reinterpret_cast<intptr_t>(Object::null()));
+      __ sw(T0, Address(T4, Context::parent_offset()));
+
+      // Initialize the context variable to the receiver.
+      __ lw(T0, Address(FP, kReceiverFPOffset));
+      __ sw(T0, Address(T4, Context::variable_offset(0)));
+
+      // Set the newly allocated context in the newly allocated closure.
+      __ AddImmediate(T1, T4, kHeapObjectTag);
+      __ sw(T1, Address(T2, Closure::context_offset()));
+    } else {
+      __ sw(CTX, Address(T2, Closure::context_offset()));
+    }
+
+    // Set the type arguments field in the newly allocated closure.
+    __ lw(T0, Address(FP, kTypeArgumentsFPOffset));
+    __ sw(T0, Address(T2, Closure::type_arguments_offset()));
+
+    // Done allocating and initializing the instance.
+    // V0: new object.
+    __ addiu(V0, T2, Immediate(kHeapObjectTag));
+    __ LeaveStubFrame(true);
+    __ Ret();
+
+    __ Bind(&slow_case);
+  }
+
+  // If it's an implicit static closure we need 2 stack slots. Otherwise,
+  // If it's an implicit instance closure we need 4 stack slots, o/w only 3.
+  int num_slots = 2;
+  if (!is_implicit_static_closure) {
+    num_slots = is_implicit_instance_closure ? 4 : 3;
+  }
+  __ addiu(SP, SP, Immediate(-num_slots * kWordSize));
+  __ LoadImmediate(V0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP1, func);
+  // Setup space on stack for return value.
+  __ sw(V0, Address(SP, (num_slots - 1) * kWordSize));
+  __ sw(TMP1, Address(SP, (num_slots - 2) * kWordSize));
+  if (is_implicit_static_closure) {
+    __ CallRuntime(kAllocateImplicitStaticClosureRuntimeEntry);
+    __ TraceSimMsg("AllocationStubForClosure return");
+  } else {
+    if (is_implicit_instance_closure) {
+      __ lw(T1, Address(FP, kReceiverFPOffset));
+      __ sw(T1, Address(SP, (num_slots - 3) * kWordSize));  // Receiver.
+      __ sw(V0, Address(SP, (num_slots - 4) * kWordSize));  // Push null.
+    }
+    if (has_type_arguments) {
+      __ lw(V0, Address(FP, kTypeArgumentsFPOffset));
+      // Push type arguments of closure.
+      __ sw(V0, Address(SP, (num_slots - 3) * kWordSize));
+    }
+
+    if (is_implicit_instance_closure) {
+      __ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry);
+      __ TraceSimMsg("AllocationStubForClosure return");
+    } else {
+      ASSERT(func.IsNonImplicitClosureFunction());
+      __ CallRuntime(kAllocateClosureRuntimeEntry);
+      __ TraceSimMsg("AllocationStubForClosure return");
+    }
+  }
+  __ lw(V0, Address(SP, (num_slots - 1) * kWordSize));  // Pop function object.
+  __ addiu(SP, SP, Immediate(num_slots * kWordSize));
+
+  // V0: new object
+  // Restore the frame pointer.
+  __ LeaveStubFrame(true);
+  __ Ret();
 }
 
 
@@ -623,6 +1269,7 @@
 // Loads function into 'temp_reg'.
 void StubCode::GenerateUsageCounterIncrement(Assembler* assembler,
                                              Register temp_reg) {
+  __ TraceSimMsg("UsageCounterIncrement");
   Register ic_reg = S5;
   Register func_reg = temp_reg;
   ASSERT(temp_reg == T0);
@@ -657,6 +1304,7 @@
 // - Match not found -> jump to IC miss.
 void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler,
                                                  intptr_t num_args) {
+  __ TraceSimMsg("NArgsCheckInlineCacheStub");
   ASSERT(num_args > 0);
 #if defined(DEBUG)
   { Label ok;
@@ -669,7 +1317,7 @@
   }
 #endif  // DEBUG
 
-  // Preserve return address, since LR is needed for subroutine call.
+  // Preserve return address, since RA is needed for subroutine call.
   __ mov(T2, RA);
   // Loop that checks if there is an IC data match.
   Label loop, update, test, found, get_class_id_as_smi;
@@ -682,7 +1330,8 @@
   // Get the receiver's class ID (first read number of arguments from
   // arguments descriptor array and then access the receiver from the stack).
   __ lw(T1, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
-  __ AddImmediate(T1, -Smi::RawValue(1));
+  __ LoadImmediate(TMP1, Smi::RawValue(1));
+  __ subu(T1, T1, TMP1);
   __ sll(T3, T1, 1);  // T1 (argument_count - 1) is smi.
   __ addu(T3, T3, SP);
   __ bal(&get_class_id_as_smi);
@@ -721,7 +1370,7 @@
   // Reload receiver class ID.  It has not been destroyed when num_args == 1.
   if (num_args > 1) {
     __ sll(T3, T1, 1);
-    __ addu(T3, SP, T3);
+    __ addu(T3, T3, SP);
     __ bal(&get_class_id_as_smi);
     __ delay_slot()->lw(T3, Address(T3));
   }
@@ -740,8 +1389,8 @@
   // Compute address of arguments (first read number of arguments from
   // arguments descriptor array and then compute address on the stack).
   // T1: argument_count - 1 (smi).
-  __ sll(T1, T1, 1);
-  __ addu(T1, SP, T1);  // T1 is Smi.
+  __ sll(T1, T1, 1);  // T1 is Smi.
+  __ addu(T1, SP, T1);
   // T1: address of receiver.
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
@@ -749,19 +1398,19 @@
   __ LoadImmediate(T3, reinterpret_cast<intptr_t>(Object::null()));
   // Preserve IC data object and arguments descriptor array and
   // setup space on stack for result (target code object).
-  __ addiu(SP, SP, Immediate(-3 * kWordSize));
-  __ sw(S5, Address(SP, 2 * kWordSize));
-  __ sw(S4, Address(SP, 1 * kWordSize));
-  __ sw(T3, Address(SP, 0 * kWordSize));
+  int num_slots = num_args + 5;
+  __ addiu(SP, SP, Immediate(-num_slots * kWordSize));
+  __ sw(S5, Address(SP, (num_slots - 1) * kWordSize));
+  __ sw(S4, Address(SP, (num_slots - 2) * kWordSize));
+  __ sw(T3, Address(SP, (num_slots - 3) * kWordSize));
   // Push call arguments.
   for (intptr_t i = 0; i < num_args; i++) {
-    __ lw(TMP, Address(T1, -i * kWordSize));
-    __ Push(TMP);
+    __ lw(TMP1, Address(T1, -i * kWordSize));
+    __ sw(TMP1, Address(SP, (num_slots - i - 4) * kWordSize));
   }
   // Pass IC data object and arguments descriptor array.
-  __ addiu(SP, SP, Immediate(-2 * kWordSize));
-  __ sw(S5, Address(SP, 1 * kWordSize));
-  __ sw(S4, Address(SP, 0 * kWordSize));
+  __ sw(S5, Address(SP, (num_slots - num_args - 4) * kWordSize));
+  __ sw(S4, Address(SP, (num_slots - num_args - 5) * kWordSize));
 
   if (num_args == 1) {
     __ CallRuntime(kInlineCacheMissHandlerOneArgRuntimeEntry);
@@ -772,15 +1421,15 @@
   } else {
     UNIMPLEMENTED();
   }
-  // Remove the call arguments pushed earlier, including the IC data object
-  // and the arguments descriptor array.
-  __ Drop(num_args + 2);
+  __ TraceSimMsg("NArgsCheckInlineCacheStub return");
   // Pop returned code object into T3 (null if not found).
   // Restore arguments descriptor array and IC data array.
-  __ lw(T3, Address(SP, 0 * kWordSize));
-  __ lw(S4, Address(SP, 1 * kWordSize));
-  __ lw(S5, Address(SP, 2 * kWordSize));
-  __ addiu(SP, SP, Immediate(3 * kWordSize));
+  __ lw(T3, Address(SP, (num_slots - 3) * kWordSize));
+  __ lw(S4, Address(SP, (num_slots - 2) * kWordSize));
+  __ lw(S5, Address(SP, (num_slots - 1) * kWordSize));
+  // Remove the call arguments pushed earlier, including the IC data object
+  // and the arguments descriptor array.
+  __ addiu(SP, SP, Immediate(num_slots * kWordSize));
   __ LeaveStubFrame();
   Label call_target_function;
   __ BranchNotEqual(T3, reinterpret_cast<intptr_t>(Object::null()),
@@ -808,7 +1457,7 @@
   __ sw(T1, Address(T0, count_offset));
 
   __ Bind(&call_target_function);
-  // T0: Target function.
+  // T3: Target function.
   __ lw(T3, FieldAddress(T3, Function::code_offset()));
   __ lw(T3, FieldAddress(T3, Code::instructions_offset()));
   __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag);
@@ -890,18 +1539,83 @@
 }
 
 
+//  RA: return address (Dart code).
+//  S4: Arguments descriptor array.
 void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) {
-  __ Unimplemented("BreakpointStatic stub");
+  __ TraceSimMsg("BreakpointStaticStub");
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  __ LoadImmediate(T0, reinterpret_cast<intptr_t>(Object::null()));
+  // Preserve arguments descriptor and make room for result.
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(S4, Address(SP, 1 * kWordSize));
+  __ sw(T0, Address(SP, 0 * kWordSize));
+  __ CallRuntime(kBreakpointStaticHandlerRuntimeEntry);
+  // Pop code object result and restore arguments descriptor.
+  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ lw(S4, Address(SP, 1 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  __ LeaveStubFrame();
+
+  // Now call the static function. The breakpoint handler function
+  // ensures that the call target is compiled.
+  __ lw(T0, FieldAddress(T0, Code::instructions_offset()));
+  __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ jr(T0);
 }
 
 
+//  V0: return value.
 void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) {
-  __ Unimplemented("BreakpointReturn stub");
+  __ TraceSimMsg("BreakpoingReturnStub");
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  __ Push(V0);
+  __ CallRuntime(kBreakpointReturnHandlerRuntimeEntry);
+  __ Pop(V0);
+  __ LeaveStubFrame();
+
+  // Instead of returning to the patched Dart function, emulate the
+  // smashed return code pattern and return to the function's caller.
+  __ LeaveDartFrame();
+  __ Ret();
 }
 
 
+//  RA: return address (Dart code).
+//  S5: Inline cache data array.
+//  S4: Arguments descriptor array.
 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) {
-  __ Unimplemented("BreakpointDynamic stub");
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame();
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(S5, Address(SP, 1 * kWordSize));
+  __ sw(S4, Address(SP, 0 * kWordSize));
+  __ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry);
+  __ lw(S4, Address(SP, 0 * kWordSize));
+  __ lw(S5, Address(SP, 1 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  __ LeaveStubFrame();
+
+  // Find out which dispatch stub to call.
+  __ lw(TMP1, FieldAddress(S5, ICData::num_args_tested_offset()));
+
+  Label one_arg, two_args, three_args;
+  __ BranchEqual(TMP1, 1, &one_arg);
+  __ BranchEqual(TMP1, 2, &two_args);
+  __ BranchEqual(TMP1, 3, &three_args);
+  __ Stop("Unsupported number of arguments tested.");
+
+  __ Bind(&one_arg);
+  __ Branch(&StubCode::OneArgCheckInlineCacheLabel());
+  __ Bind(&two_args);
+  __ Branch(&StubCode::TwoArgsCheckInlineCacheLabel());
+  __ Bind(&three_args);
+  __ Branch(&StubCode::ThreeArgsCheckInlineCacheLabel());
+  __ break_(0);
 }
 
 
@@ -912,6 +1626,7 @@
 // A2: cache array.
 // Result in V0: null -> not found, otherwise result (true or false).
 static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) {
+  __ TraceSimMsg("SubtypeNTestCacheStub");
   ASSERT((1 <= n) && (n <= 3));
   if (n > 1) {
     // Get instance type arguments.
@@ -946,18 +1661,18 @@
   __ BranchEqual(T3, reinterpret_cast<intptr_t>(Object::null()), &not_found);
 
   if (n == 1) {
-    __ BranchEqual(T3, T0, &found);
+    __ beq(T3, T0, &found);
   } else {
-    __ BranchNotEqual(T3, T0, &next_iteration);
+    __ bne(T3, T0, &next_iteration);
     __ lw(T3,
           Address(T2, kWordSize * SubtypeTestCache::kInstanceTypeArguments));
     if (n == 2) {
-      __ BranchEqual(T3, T1, &found);
+      __ beq(T3, T1, &found);
     } else {
-      __ BranchNotEqual(T3, T1, &next_iteration);
+      __ bne(T3, T1, &next_iteration);
       __ lw(T3, Address(T2, kWordSize *
                         SubtypeTestCache::kInstantiatorTypeArguments));
-      __ BranchEqual(T3, A1, &found);
+      __ beq(T3, A1, &found);
     }
   }
   __ Bind(&next_iteration);
@@ -987,7 +1702,7 @@
 
 
 // Used to check class and type arguments. Arguments passed in registers:
-// LR: return address.
+// RA: return address.
 // A0: instance (must be preserved).
 // A1: instantiator type arguments or NULL.
 // A2: cache array.
@@ -1016,14 +1731,117 @@
 
 
 // Jump to the exception or error handler.
-// No Result.
+// RA: return address.
+// A0: program_counter.
+// A1: stack_pointer.
+// A2: frame_pointer.
+// A3: error object.
+// SP: address of stacktrace object.
+// Does not return.
 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
-  __ Unimplemented("JumpToExceptionHandler Stub");
+  ASSERT(kExceptionObjectReg == V0);
+  ASSERT(kStackTraceObjectReg == V1);
+  __ mov(V0, A3);  // Exception object.
+  __ lw(V1, Address(SP, 0));  // StackTrace object.
+  __ mov(FP, A2);  // Frame_pointer.
+  __ mov(SP, A1);  // Stack pointer.
+  __ jr(A0);  // Jump to the exception handler code.
 }
 
 
+// Implements equality operator when one of the arguments is null
+// (identity check) and updates ICData if necessary.
+// RA: return address.
+// A1: left argument.
+// A0: right argument.
+// T0: ICData.
+// V0: result.
+// TODO(srdjan): Move to VM stubs once Boolean objects become VM objects.
 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
-  __ Unimplemented("EqualityWithNullArg Stub");
+  __ EnterStubFrame();
+  static const intptr_t kNumArgsTested = 2;
+#if defined(DEBUG)
+  { Label ok;
+    __ lw(TMP1, FieldAddress(T0, ICData::num_args_tested_offset()));
+    __ BranchEqual(TMP1, kNumArgsTested, &ok);
+    __ Stop("Incorrect ICData for equality");
+    __ Bind(&ok);
+  }
+#endif  // DEBUG
+  // Check IC data, update if needed.
+  // T0: IC data object (preserved).
+  __ lw(T6, FieldAddress(T0, ICData::ic_data_offset()));
+  // T6: ic_data_array with check entries: classes and target functions.
+  __ AddImmediate(T6, Array::data_offset() - kHeapObjectTag);
+  // T6: points directly to the first ic data array element.
+
+  Label get_class_id_as_smi, no_match, loop, found;
+  __ Bind(&loop);
+  // Check left.
+  __ bal(&get_class_id_as_smi);
+  __ delay_slot()->mov(T2, A1);
+  __ lw(T3, Address(T6, 0 * kWordSize));
+  __ bne(T2, T3, &no_match);  // Class id match?
+
+  // Check right.
+  __ bal(&get_class_id_as_smi);
+  __ delay_slot()->mov(T2, A0);
+  __ lw(T3, Address(T6, 1 * kWordSize));
+  __ beq(T2, T3, &found);  // Class id match?
+  __ Bind(&no_match);
+  // Next check group.
+  __ AddImmediate(T6, kWordSize * ICData::TestEntryLengthFor(kNumArgsTested));
+  __ BranchNotEqual(T3, Smi::RawValue(kIllegalCid), &loop);  // Done?
+
+  Label update_ic_data;
+  __ b(&update_ic_data);
+
+  __ Bind(&found);
+  const intptr_t count_offset =
+      ICData::CountIndexFor(kNumArgsTested) * kWordSize;
+  Label no_overflow;
+  __ lw(T1, Address(T6, count_offset));
+  __ AddImmediateDetectOverflow(T1, T1, Smi::RawValue(1), CMPRES);
+  __ bgez(CMPRES, &no_overflow);
+  __ LoadImmediate(TMP1, Smi::RawValue(Smi::kMaxValue));
+  __ sw(TMP1, Address(T6, count_offset));  // If overflow.
+  __ Bind(&no_overflow);
+
+  Label compute_result;
+  __ Bind(&compute_result);
+  __ LoadObject(TMP1, Bool::True());
+  __ LoadObject(TMP2, Bool::False());
+  __ subu(CMPRES, A0, A1);
+  __ movz(V0, TMP1, CMPRES);
+  __ movn(V0, TMP2, CMPRES);
+  __ LeaveStubFrame();
+  __ Ret();
+
+  __ Bind(&get_class_id_as_smi);
+  // Test if Smi -> load Smi class for comparison.
+  Label not_smi;
+  __ andi(CMPRES, T2, Immediate(kSmiTagMask));
+  __ bne(CMPRES, ZR, &not_smi);
+  __ jr(RA);
+  __ delay_slot()->addiu(T2, ZR, Immediate(Smi::RawValue(kSmiCid)));
+  __ Bind(&not_smi);
+  __ LoadClassId(T2, T2);
+  __ jr(RA);
+  __ delay_slot()->SmiTag(T2);
+
+  __ Bind(&update_ic_data);
+  // T0: ICData
+  __ addiu(SP, SP, Immediate(-4 * kWordSize));
+  __ sw(A1, Address(SP, 3 * kWordSize));
+  __ sw(A0, Address(SP, 2 * kWordSize));
+  __ LoadObject(TMP1, Symbols::EqualOperator());  // Target's name.
+  __ sw(TMP1, Address(SP, 1 * kWordSize));
+  __ sw(T0, Address(SP, 0 * kWordSize));  // ICData.
+  __ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry);
+  __ lw(A0, Address(SP, 2 * kWordSize));
+  __ lw(A1, Address(SP, 3 * kWordSize));
+  __ b(&compute_result);
+  __ delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize));
 }
 
 
@@ -1031,15 +1849,20 @@
 // T0: function to be reoptimized.
 // S4: argument descriptor (preserved).
 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
+  __ TraceSimMsg("OptimizeFunctionStub");
   __ EnterStubFrame();
-  __ Push(S4);
+  __ addiu(SP, SP, Immediate(-3 * kWordSize));
+  __ sw(S4, Address(SP, 2 * kWordSize));
+  // Setup space on stack for return value.
   __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
-  __ Push(TMP);  // Setup space on stack for return value.
-  __ Push(T0);
+  __ sw(TMP1, Address(SP, 1 * kWordSize));
+  __ sw(T0, Address(SP, 0 * kWordSize));
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
-  __ Pop(T0);  // Discard argument.
-  __ Pop(T0);  // Get Code object
-  __ Pop(S4);  // Restore argument descriptor.
+  __ TraceSimMsg("OptimizeFunctionStub return");
+  __ lw(T0, Address(SP, 1 * kWordSize));  // Get Code object
+  __ lw(S4, Address(SP, 2 * kWordSize));  // Restore argument descriptor.
+  __ addiu(SP, SP, Immediate(3 * kWordSize));  // Discard argument.
+
   __ lw(T0, FieldAddress(T0, Code::instructions_offset()));
   __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag);
   __ LeaveStubFrame();
@@ -1056,24 +1879,25 @@
 
 // Does identical check (object references are equal or not equal) with special
 // checks for boxed numbers.
-// LR: return address.
+// RA: return address.
 // SP + 4: left operand.
 // SP + 0: right operand.
 // Return: CMPRES is zero if equal, non-zero otherwise.
 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint
 // cannot contain a value that fits in Mint or Smi.
 void StubCode::GenerateIdenticalWithNumberCheckStub(Assembler* assembler) {
+  __ TraceSimMsg("IdenticalWithNumberCheckStub");
   const Register ret = CMPRES;
   const Register temp1 = TMP1;
   const Register temp2 = TMP2;
   const Register left = T1;
   const Register right = T0;
-  // Preserve left, right and temp.
+  // Preserve left, right.
   __ addiu(SP, SP, Immediate(-2 * kWordSize));
   __ sw(T1, Address(SP, 1 * kWordSize));
   __ sw(T0, Address(SP, 0 * kWordSize));
-  // TOS + 4: left argument.
-  // TOS + 3: right argument.
+  // TOS + 3: left argument.
+  // TOS + 2: right argument.
   // TOS + 1: saved left
   // TOS + 0: saved right
   __ lw(left, Address(SP, 3 * kWordSize));
@@ -1130,10 +1954,10 @@
 
   __ EnterStubFrame(0);
   __ ReserveAlignedFrameSpace(2 * kWordSize);
-  __ addiu(SP, SP, Immediate(-2 * kWordSize));
   __ sw(T1, Address(SP, 1 * kWordSize));
   __ sw(T0, Address(SP, 0 * kWordSize));
   __ CallRuntime(kBigintCompareRuntimeEntry);
+  __ TraceSimMsg("IdenticalWithNumberCheckStub return");
   // Result in V0, 0 means equal.
   __ LeaveStubFrame();
   __ b(&done);
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 0f688e5..6125c83 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -9,9 +9,9 @@
 #include "vm/compiler.h"
 #include "vm/dart_entry.h"
 #include "vm/flow_graph_compiler.h"
+#include "vm/heap.h"
 #include "vm/instructions.h"
 #include "vm/object_store.h"
-#include "vm/pages.h"
 #include "vm/resolver.h"
 #include "vm/scavenger.h"
 #include "vm/stub_code.h"
@@ -316,9 +316,9 @@
 // - Fill the unoptimized frame.
 // - Materialize objects that require allocation (e.g. Double instances).
 // GC can occur only after frame is fully rewritten.
-// Stack:
+// Stack after EnterFrame(0) below:
 //   +------------------+
-//   | Saved FP         |
+//   | Saved FP         | <- TOS
 //   +------------------+
 //   | return-address   |  (deoptimization point)
 //   +------------------+
@@ -347,11 +347,8 @@
     offset += kFpuRegisterSize;
   }
 
-  __ movq(RCX, RSP);  // Saved saved registers block.
+  __ movq(RDI, RSP);  // Pass address of saved registers block.
   __ ReserveAlignedFrameSpace(0);
-  __ SmiUntag(RAX);
-  __ movq(RDI, RCX);  // Set up argument 1 saved_registers_address.
-
   __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry);
   // Result (RAX) is stack-size (FP - SP) in bytes, incl. the return address.
 
@@ -1013,7 +1010,7 @@
   ASSERT(instance_size > 0);
   const intptr_t type_args_size = InstantiatedTypeArguments::InstanceSize();
   if (FLAG_inline_alloc &&
-      PageSpace::IsPageAllocatableSize(instance_size + type_args_size)) {
+      Heap::IsAllocatableInNewSpace(instance_size + type_args_size)) {
     Label slow_case;
     Heap* heap = Isolate::Current()->heap();
     __ movq(RAX, Immediate(heap->TopAddress()));
@@ -1187,7 +1184,7 @@
   const intptr_t closure_size = Closure::InstanceSize();
   const intptr_t context_size = Context::InstanceSize(1);  // Captured receiver.
   if (FLAG_inline_alloc &&
-      PageSpace::IsPageAllocatableSize(closure_size + context_size)) {
+      Heap::IsAllocatableInNewSpace(closure_size + context_size)) {
     Label slow_case;
     Heap* heap = Isolate::Current()->heap();
     __ movq(RAX, Immediate(heap->TopAddress()));
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index 5cf2f00..779aa1c 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -147,6 +147,7 @@
   V(Uint64List, "Uint64List")                                                  \
   V(Uint64ListFactory, "Uint64List.")                                          \
   V(Float32x4List, "Float32x4List")                                            \
+  V(Float32x4ListFactory, "Float32x4List.")                                    \
   V(Float32List, "Float32List")                                                \
   V(Float32ListFactory, "Float32List.")                                        \
   V(Float64List, "Float64List")                                                \
@@ -237,7 +238,7 @@
   V(DartMath, "dart:math")                                                     \
   V(DartIsolate, "dart:isolate")                                               \
   V(DartMirrors, "dart:mirrors")                                               \
-  V(DartTypedData, "dart:typeddata")                                           \
+  V(DartTypedData, "dart:typed_data")                                          \
   V(DartNativeWrappers, "dart:nativewrappers")                                 \
   V(DartAsync, "dart:async")                                                   \
   V(DartUri, "dart:uri")                                                       \
diff --git a/runtime/vm/unit_test.cc b/runtime/vm/unit_test.cc
index 831a72b..09f3df6 100644
--- a/runtime/vm/unit_test.cc
+++ b/runtime/vm/unit_test.cc
@@ -18,6 +18,8 @@
 #include "vm/symbols.h"
 #include "vm/virtual_memory.h"
 
+using dart::bin::Builtin;
+using dart::bin::DartUtils;
 
 namespace dart {
 
diff --git a/runtime/vm/vm.gypi b/runtime/vm/vm.gypi
index eaf38652..d55ace1 100644
--- a/runtime/vm/vm.gypi
+++ b/runtime/vm/vm.gypi
@@ -4,29 +4,30 @@
 
 {
   'variables': {
+    'gen_source_dir': '<(LIB_DIR)',
     'builtin_in_cc_file': '../bin/builtin_in.cc',
-    'async_cc_file': '<(SHARED_INTERMEDIATE_DIR)/async_gen.cc',
-    'async_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/async_patch_gen.cc',
-    'corelib_cc_file': '<(SHARED_INTERMEDIATE_DIR)/corelib_gen.cc',
-    'corelib_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/corelib_patch_gen.cc',
-    'collection_cc_file': '<(SHARED_INTERMEDIATE_DIR)/collection_gen.cc',
-    'collection_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/collection_patch_gen.cc',
-    'collection_dev_cc_file': '<(SHARED_INTERMEDIATE_DIR)/collection_dev_gen.cc',
-    'collection_dev_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/collection_dev_patch_gen.cc',
-    'crypto_cc_file': '<(SHARED_INTERMEDIATE_DIR)/crypto_gen.cc',
-    'math_cc_file': '<(SHARED_INTERMEDIATE_DIR)/math_gen.cc',
-    'math_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/math_patch_gen.cc',
-    'mirrors_cc_file': '<(SHARED_INTERMEDIATE_DIR)/mirrors_gen.cc',
-    'mirrors_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/mirrors_patch_gen.cc',
-    'isolate_cc_file': '<(SHARED_INTERMEDIATE_DIR)/isolate_gen.cc',
-    'isolate_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/isolate_patch_gen.cc',
-    'json_cc_file': '<(SHARED_INTERMEDIATE_DIR)/json_gen.cc',
-    'json_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/json_patch_gen.cc',
-    'typeddata_cc_file': '<(SHARED_INTERMEDIATE_DIR)/typeddata_gen.cc',
-    'typeddata_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/typeddata_patch_gen.cc',
-    'uri_cc_file': '<(SHARED_INTERMEDIATE_DIR)/uri_gen.cc',
-    'utf_cc_file': '<(SHARED_INTERMEDIATE_DIR)/utf_gen.cc',
-    'snapshot_test_dat_file': '<(SHARED_INTERMEDIATE_DIR)/snapshot_test.dat',
+    'async_cc_file': '<(gen_source_dir)/async_gen.cc',
+    'async_patch_cc_file': '<(gen_source_dir)/async_patch_gen.cc',
+    'corelib_cc_file': '<(gen_source_dir)/corelib_gen.cc',
+    'corelib_patch_cc_file': '<(gen_source_dir)/corelib_patch_gen.cc',
+    'collection_cc_file': '<(gen_source_dir)/collection_gen.cc',
+    'collection_patch_cc_file': '<(gen_source_dir)/collection_patch_gen.cc',
+    'collection_dev_cc_file': '<(gen_source_dir)/collection_dev_gen.cc',
+    'collection_dev_patch_cc_file': '<(gen_source_dir)/collection_dev_patch_gen.cc',
+    'crypto_cc_file': '<(gen_source_dir)/crypto_gen.cc',
+    'math_cc_file': '<(gen_source_dir)/math_gen.cc',
+    'math_patch_cc_file': '<(gen_source_dir)/math_patch_gen.cc',
+    'mirrors_cc_file': '<(gen_source_dir)/mirrors_gen.cc',
+    'mirrors_patch_cc_file': '<(gen_source_dir)/mirrors_patch_gen.cc',
+    'isolate_cc_file': '<(gen_source_dir)/isolate_gen.cc',
+    'isolate_patch_cc_file': '<(gen_source_dir)/isolate_patch_gen.cc',
+    'json_cc_file': '<(gen_source_dir)/json_gen.cc',
+    'json_patch_cc_file': '<(gen_source_dir)/json_patch_gen.cc',
+    'typed_data_cc_file': '<(gen_source_dir)/typed_data_gen.cc',
+    'typed_data_patch_cc_file': '<(gen_source_dir)/typed_data_patch_gen.cc',
+    'uri_cc_file': '<(gen_source_dir)/uri_gen.cc',
+    'utf_cc_file': '<(gen_source_dir)/utf_gen.cc',
+    'snapshot_test_dat_file': '<(gen_source_dir)/snapshot_test.dat',
     'snapshot_test_in_dat_file': 'snapshot_test_in.dat',
     'snapshot_test_dart_file': 'snapshot_test.dart',
   },
@@ -34,6 +35,7 @@
     {
       'target_name': 'libdart_vm',
       'type': 'static_library',
+      'toolsets':['host', 'target'],
       'includes': [
         'vm_sources.gypi',
         '../platform/platform_headers.gypi',
@@ -91,6 +93,7 @@
     {
       'target_name': 'libdart_lib_withcore',
       'type': 'static_library',
+      'toolsets':['host', 'target'],
       'dependencies': [
         'generate_async_cc_file',
         'generate_async_patch_cc_file',
@@ -109,8 +112,8 @@
         'generate_json_patch_cc_file',
         'generate_mirrors_cc_file',
         'generate_mirrors_patch_cc_file',
-        'generate_typeddata_cc_file',
-        'generate_typeddata_patch_cc_file',
+        'generate_typed_data_cc_file',
+        'generate_typed_data_patch_cc_file',
         'generate_uri_cc_file',
         'generate_utf_cc_file',
       ],
@@ -121,7 +124,7 @@
         '../lib/isolate_sources.gypi',
         '../lib/math_sources.gypi',
         '../lib/mirrors_sources.gypi',
-        '../lib/typeddata_sources.gypi',
+        '../lib/typed_data_sources.gypi',
       ],
       'sources': [
         'bootstrap.cc',
@@ -143,8 +146,8 @@
         '<(json_patch_cc_file)',
         '<(mirrors_cc_file)',
         '<(mirrors_patch_cc_file)',
-        '<(typeddata_cc_file)',
-        '<(typeddata_patch_cc_file)',
+        '<(typed_data_cc_file)',
+        '<(typed_data_patch_cc_file)',
         '<(uri_cc_file)',
         '<(utf_cc_file)',
       ],
@@ -155,6 +158,7 @@
     {
       'target_name': 'libdart_lib',
       'type': 'static_library',
+      'toolsets':['host', 'target'],
       'includes': [
         '../lib/async_sources.gypi',
         '../lib/collection_sources.gypi',
@@ -162,7 +166,7 @@
         '../lib/isolate_sources.gypi',
         '../lib/math_sources.gypi',
         '../lib/mirrors_sources.gypi',
-        '../lib/typeddata_sources.gypi',
+        '../lib/typed_data_sources.gypi',
       ],
       'sources': [
         'bootstrap_nocorelib.cc',
@@ -174,8 +178,9 @@
     {
       'target_name': 'generate_async_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'async_dart': '<(SHARED_INTERMEDIATE_DIR)/async_gen.dart',
+        'async_dart': '<(gen_source_dir)/async_gen.dart',
       },
       'includes': [
         '../../sdk/lib/async/async_sources.gypi',
@@ -230,8 +235,9 @@
     {
       'target_name': 'generate_corelib_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'core_dart': '<(SHARED_INTERMEDIATE_DIR)/core_gen.dart',
+        'core_dart': '<(gen_source_dir)/core_gen.dart',
       },'includes': [
         # Load the shared core library sources.
         '../../sdk/lib/core/corelib_sources.gypi',
@@ -286,6 +292,7 @@
     {
       'target_name': 'generate_corelib_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the runtime implementation sources.
         '../lib/lib_sources.gypi',
@@ -324,8 +331,9 @@
     {
       'target_name': 'generate_collection_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'collection_dart': '<(SHARED_INTERMEDIATE_DIR)/collection_gen.dart',
+        'collection_dart': '<(gen_source_dir)/collection_gen.dart',
       },
       'includes': [
         # Load the shared collection library sources.
@@ -381,6 +389,7 @@
     {
       'target_name': 'generate_collection_dev_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the runtime implementation sources.
         '../lib/collection_dev_sources.gypi',
@@ -419,8 +428,9 @@
     {
       'target_name': 'generate_collection_dev_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'collection_dev_dart': '<(SHARED_INTERMEDIATE_DIR)/collection_dev_gen.dart',
+        'collection_dev_dart': '<(gen_source_dir)/collection_dev_gen.dart',
       },
       'includes': [
         # Load the shared collection_dev library sources.
@@ -476,8 +486,9 @@
     {
       'target_name': 'generate_crypto_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'crypto_dart': '<(SHARED_INTERMEDIATE_DIR)/crypto_gen.dart',
+        'crypto_dart': '<(gen_source_dir)/crypto_gen.dart',
       },
       'includes': [
         # Load the shared crypto sources.
@@ -526,8 +537,9 @@
     {
       'target_name': 'generate_math_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'math_dart': '<(SHARED_INTERMEDIATE_DIR)/math_gen.dart',
+        'math_dart': '<(gen_source_dir)/math_gen.dart',
       },
       'includes': [
         # Load the shared math library sources.
@@ -583,6 +595,7 @@
     {
       'target_name': 'generate_math_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the shared math library sources.
         '../lib/math_sources.gypi',
@@ -621,8 +634,9 @@
     {
       'target_name': 'generate_mirrors_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'mirrors_dart': '<(SHARED_INTERMEDIATE_DIR)/mirrors_gen.dart',
+        'mirrors_dart': '<(gen_source_dir)/mirrors_gen.dart',
       },
       'includes': [
         # Load the shared core library sources.
@@ -678,6 +692,7 @@
     {
       'target_name': 'generate_mirrors_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the patch sources.
         '../lib/mirrors_sources.gypi',
@@ -716,8 +731,9 @@
     {
       'target_name': 'generate_isolate_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'isolate_dart': '<(SHARED_INTERMEDIATE_DIR)/isolate_gen.dart',
+        'isolate_dart': '<(gen_source_dir)/isolate_gen.dart',
       },
       'includes': [
         # Load the runtime implementation sources.
@@ -773,6 +789,7 @@
     {
       'target_name': 'generate_async_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the runtime implementation sources.
         '../lib/async_sources.gypi',
@@ -811,6 +828,7 @@
     {
       'target_name': 'generate_collection_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the runtime implementation sources.
         '../lib/collection_sources.gypi',
@@ -849,6 +867,7 @@
     {
       'target_name': 'generate_isolate_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the runtime implementation sources.
         '../lib/isolate_sources.gypi',
@@ -887,8 +906,9 @@
     {
       'target_name': 'generate_json_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'json_dart': '<(SHARED_INTERMEDIATE_DIR)/json_gen.dart',
+        'json_dart': '<(gen_source_dir)/json_gen.dart',
       },
       'includes': [
         # Load the shared json sources.
@@ -937,6 +957,7 @@
     {
       'target_name': 'generate_json_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the shared json library sources.
         '../lib/json_sources.gypi',
@@ -973,14 +994,15 @@
       ]
     },
     {
-      'target_name': 'generate_typeddata_cc_file',
+      'target_name': 'generate_typed_data_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'typeddata_dart': '<(SHARED_INTERMEDIATE_DIR)/typeddata_gen.dart',
+        'typed_data_dart': '<(gen_source_dir)/typed_data_gen.dart',
       },
       'includes': [
         # Load the shared library sources.
-        '../../sdk/lib/typeddata/typeddata_sources.gypi',
+        '../../sdk/lib/typed_data/typed_data_sources.gypi',
       ],
       'sources/': [
         # Exclude all .[cc|h] files.
@@ -991,50 +1013,51 @@
       ],
       'actions': [
         {
-          'action_name': 'generate_typeddata_dart',
+          'action_name': 'generate_typed_data_dart',
           'inputs': [
             '../tools/concat_library.py',
             '<@(_sources)',
           ],
           'outputs': [
-            '<(typeddata_dart)',
+            '<(typed_data_dart)',
           ],
           'action': [
             'python',
             '<@(_inputs)',
-            '--output', '<(typeddata_dart)',
+            '--output', '<(typed_data_dart)',
           ],
-          'message': 'Generating ''<(typeddata_dart)'' file.',
+          'message': 'Generating ''<(typed_data_dart)'' file.',
         },
         {
-          'action_name': 'generate_typeddata_cc',
+          'action_name': 'generate_typed_data_cc',
           'inputs': [
             '../tools/create_string_literal.py',
             '<(builtin_in_cc_file)',
-            '<(typeddata_dart)',
+            '<(typed_data_dart)',
           ],
           'outputs': [
-            '<(typeddata_cc_file)',
+            '<(typed_data_cc_file)',
           ],
           'action': [
             'python',
             'tools/create_string_literal.py',
-            '--output', '<(typeddata_cc_file)',
+            '--output', '<(typed_data_cc_file)',
             '--input_cc', '<(builtin_in_cc_file)',
             '--include', 'vm/bootstrap.h',
-            '--var_name', 'dart::Bootstrap::typeddata_source_',
-            '<(typeddata_dart)',
+            '--var_name', 'dart::Bootstrap::typed_data_source_',
+            '<(typed_data_dart)',
           ],
-          'message': 'Generating ''<(typeddata_cc_file)'' file.'
+          'message': 'Generating ''<(typed_data_cc_file)'' file.'
         },
       ]
     },
     {
-      'target_name': 'generate_typeddata_patch_cc_file',
+      'target_name': 'generate_typed_data_patch_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'includes': [
         # Load the runtime implementation sources.
-        '../lib/typeddata_sources.gypi',
+        '../lib/typed_data_sources.gypi',
       ],
       'sources/': [
         # Exclude all .[cc|h] files.
@@ -1045,33 +1068,34 @@
       ],
       'actions': [
         {
-          'action_name': 'generate_typeddata_patch_cc',
+          'action_name': 'generate_typed_data_patch_cc',
           'inputs': [
             '../tools/create_string_literal.py',
             '<(builtin_in_cc_file)',
             '<@(_sources)',
           ],
           'outputs': [
-            '<(typeddata_patch_cc_file)',
+            '<(typed_data_patch_cc_file)',
           ],
           'action': [
             'python',
             'tools/create_string_literal.py',
-            '--output', '<(typeddata_patch_cc_file)',
+            '--output', '<(typed_data_patch_cc_file)',
             '--input_cc', '<(builtin_in_cc_file)',
             '--include', 'vm/bootstrap.h',
-            '--var_name', 'dart::Bootstrap::typeddata_patch_',
+            '--var_name', 'dart::Bootstrap::typed_data_patch_',
             '<@(_sources)',
           ],
-          'message': 'Generating ''<(typeddata_patch_cc_file)'' file.'
+          'message': 'Generating ''<(typed_data_patch_cc_file)'' file.'
         },
       ]
     },
     {
       'target_name': 'generate_uri_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'uri_dart': '<(SHARED_INTERMEDIATE_DIR)/uri_gen.dart',
+        'uri_dart': '<(gen_source_dir)/uri_gen.dart',
       },
       'includes': [
         # Load the shared uri sources.
@@ -1120,8 +1144,9 @@
     {
       'target_name': 'generate_utf_cc_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'variables': {
-        'utf_dart': '<(SHARED_INTERMEDIATE_DIR)/utf_gen.dart',
+        'utf_dart': '<(gen_source_dir)/utf_gen.dart',
       },
       'includes': [
         # Load the shared utf sources.
@@ -1170,6 +1195,7 @@
     {
       'target_name': 'generate_snapshot_test_dat_file',
       'type': 'none',
+      'toolsets':['host', 'target'],
       'actions': [
         {
           'action_name': 'generate_snapshot_test_dat',
diff --git a/runtime/vm/vm_sources.gypi b/runtime/vm/vm_sources.gypi
index 9df78d4..9009b9e 100644
--- a/runtime/vm/vm_sources.gypi
+++ b/runtime/vm/vm_sources.gypi
@@ -175,9 +175,6 @@
     'heap_profiler.h',
     'heap_profiler_test.cc',
     'heap_test.cc',
-    'heap_trace.cc',
-    'heap_trace.h',
-    'heap_trace_test.cc',
     'il_printer.cc',
     'il_printer.h',
     'instructions.h',
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index 76fda21..a37a443 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -8,7 +8,6 @@
 #include "platform/utils.h"
 #include "vm/flags.h"
 #include "vm/heap.h"
-#include "vm/heap_trace.h"
 #include "vm/isolate.h"
 #include "vm/os.h"
 
@@ -98,10 +97,6 @@
   }
 #endif
   DeleteAll();
-  if (HeapTrace::is_enabled()) {
-    Isolate* isolate = Isolate::Current();
-    isolate->heap()->trace()->TraceDeleteZone(this);
-  }
 }
 
 
diff --git a/sdk/bin/pub b/sdk/bin/pub
index 726b58b..76085ab 100755
--- a/sdk/bin/pub
+++ b/sdk/bin/pub
@@ -6,8 +6,6 @@
 # dart-sdk/bin has been symlinked to. On MacOS, readlink doesn't work
 # with this case.
 BIN_DIR="$(cd "${0%/*}" ; pwd -P)"
-export DART_SDK="$(cd "${BIN_DIR%/*}" ; pwd -P)"
+DART_SDK="$(cd "${BIN_DIR%/*}" ; pwd -P)"
 
-# TODO(dgrove): This doesn't work yet. It will once dartbug.com/6619 is
-# fixed.
-exec "$BIN_DIR"/dart "$DART_SDK"/lib/_internal/pub/pub.dart $@
+exec "$BIN_DIR"/dart "$DART_SDK"/bin/snapshots/pub.dart.snapshot $@
diff --git a/sdk/bin/pub.bat b/sdk/bin/pub.bat
index dba1caf..99846ec 100644
--- a/sdk/bin/pub.bat
+++ b/sdk/bin/pub.bat
@@ -1,17 +1,16 @@
 @echo off
-REM Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
+:: 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.
 
-REM Run pub.dart on the Dart VM. This script assumes the Dart SDK's directory
-REM structure.
+:: Run pub.dart on the Dart VM. This script assumes the Dart SDK's directory
+:: structure.
 
 set SCRIPTPATH=%~dp0
 
-REM Does the string have a trailing slash? If so, remove it.
+:: Does the string have a trailing slash? If so, remove it.
 if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%
 
-REM Set DART_SDK so pub can find SDK packages.
-set DART_SDK=%SCRIPTPATH%\..\
-
-"%SCRIPTPATH%\dart" "%SCRIPTPATH%\..\util\pub\pub.dart" %*
+:: The trailing forward slash in --package-root is required because of issue
+:: 9499.
+"%SCRIPTPATH%\dart.exe" "%SCRIPTPATH%\..\bin\snapshots\pub.dart.snapshot" %*
diff --git a/sdk/lib/_collection_dev/list.dart b/sdk/lib/_collection_dev/list.dart
index 93e49ae..c14cb50 100644
--- a/sdk/lib/_collection_dev/list.dart
+++ b/sdk/lib/_collection_dev/list.dart
@@ -35,7 +35,7 @@
         "Cannot add to a fixed-length list");
   }
 
-  void remove(E element) {
+  bool remove(E element) {
     throw new UnsupportedError(
         "Cannot remove from a fixed-length list");
   }
@@ -112,7 +112,7 @@
 
   void add(E value) {
     throw new UnsupportedError(
-        "Cannot add to an unmodifiable list");
+      "Cannot add to an unmodifiable list");
   }
 
   E insert(int index, E value) {
@@ -130,7 +130,7 @@
         "Cannot add to an unmodifiable list");
   }
 
-  void remove(E element) {
+  bool remove(E element) {
     throw new UnsupportedError(
         "Cannot remove from an unmodifiable list");
   }
diff --git a/sdk/lib/_collection_dev/symbol.dart b/sdk/lib/_collection_dev/symbol.dart
index 7fd79d3..87517ba 100644
--- a/sdk/lib/_collection_dev/symbol.dart
+++ b/sdk/lib/_collection_dev/symbol.dart
@@ -58,6 +58,8 @@
     return 0x1fffffff & (arbitraryPrime * _name.hashCode);
   }
 
+  toString() => 'Symbol("$_name")';
+
   /// Platform-private accessor which cannot be called from user libraries.
   static String getName(Symbol symbol) => symbol._name;
 
diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
index 9c134be..cb39371 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -442,7 +442,8 @@
 
   Constant makeTypeConstant(Element element) {
     DartType elementType = element.computeType(compiler).asRaw();
-    DartType constantType = compiler.typeClass.computeType(compiler);
+    DartType constantType =
+        compiler.backend.typeImplementation.computeType(compiler);
     Constant constant = new TypeConstant(elementType, constantType);
     // If we use a type literal in a constant, the compile time
     // constant emitter will generate a call to the createRuntimeType
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart
index 1c409a2..35c4dc6 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -177,6 +177,8 @@
   ClassElement get boolImplementation => compiler.boolClass;
   ClassElement get nullImplementation => compiler.nullClass;
 
+  ClassElement defaultSuperclass(ClassElement element) => compiler.objectClass;
+
   bool isDefaultNoSuchMethodImplementation(Element element) {
     assert(element.name == Compiler.NO_SUCH_METHOD);
     ClassElement classElement = element.getEnclosingClass();
@@ -735,7 +737,7 @@
     // TODO(ngeoffray): Enable annotations on these classes.
     ClassElement cls =
         isolateHelperLibrary.find(const SourceString('_WorkerStub'));
-    cls.setNative('"*Worker"');
+    cls.setNative('"Worker"');
 
     assertMethod = jsHelperLibrary.find(const SourceString('assertHelper'));
     identicalFunction = coreLibrary.find(const SourceString('identical'));
@@ -1021,7 +1023,7 @@
 
   void resolveTypedef(TypedefElement element) {
     withCurrentElement(element,
-                       () => resolver.resolveTypedef(element));
+                       () => resolver.resolve(element));
   }
 
   FunctionType computeFunctionType(Element element,
diff --git a/sdk/lib/_internal/compiler/implementation/dart2js.dart b/sdk/lib/_internal/compiler/implementation/dart2js.dart
index 4031beb..61660e5 100644
--- a/sdk/lib/_internal/compiler/implementation/dart2js.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart2js.dart
@@ -80,10 +80,9 @@
 
 void compile(List<String> argv) {
   bool isWindows = (Platform.operatingSystem == 'windows');
-  Uri cwd = getCurrentDirectory();
-  Uri libraryRoot = cwd;
-  Uri out = cwd.resolve('out.js');
-  Uri sourceMapOut = cwd.resolve('out.js.map');
+  Uri libraryRoot = currentDirectory;
+  Uri out = currentDirectory.resolve('out.js');
+  Uri sourceMapOut = currentDirectory.resolve('out.js.map');
   Uri packageRoot = null;
   List<String> options = new List<String>();
   bool explicitOut = false;
@@ -102,16 +101,16 @@
   }
 
   setLibraryRoot(String argument) {
-    libraryRoot = cwd.resolve(extractPath(argument));
+    libraryRoot = currentDirectory.resolve(extractPath(argument));
   }
 
   setPackageRoot(String argument) {
-    packageRoot = cwd.resolve(extractPath(argument));
+    packageRoot = currentDirectory.resolve(extractPath(argument));
   }
 
   setOutput(String argument) {
     explicitOut = true;
-    out = cwd.resolve(nativeToUriPath(extractParameter(argument)));
+    out = currentDirectory.resolve(nativeToUriPath(extractParameter(argument)));
     sourceMapOut = Uri.parse('$out.map');
   }
 
@@ -119,8 +118,8 @@
     if (argument == '--output-type=dart') {
       outputLanguage = OUTPUT_LANGUAGE_DART;
       if (!explicitOut) {
-        out = cwd.resolve('out.dart');
-        sourceMapOut = cwd.resolve('out.dart.map');
+        out = currentDirectory.resolve('out.dart');
+        sourceMapOut = currentDirectory.resolve('out.dart.map');
       }
     }
     passThrough(argument);
@@ -254,7 +253,7 @@
     diagnosticHandler.diagnosticHandler(uri, begin, end, message, kind);
   }
 
-  Uri uri = cwd.resolve(arguments[0]);
+  Uri uri = currentDirectory.resolve(arguments[0]);
   if (packageRoot == null) {
     packageRoot = uri.resolve('./packages/');
   }
@@ -273,10 +272,10 @@
     diagnosticHandler.info(
          'compiled ${inputProvider.dartCharactersRead} characters Dart '
          '-> $charactersWritten characters $outputLanguage '
-         'in ${relativize(cwd, out, isWindows)}');
+         'in ${relativize(currentDirectory, out, isWindows)}');
     if (!explicitOut) {
       String input = uriPathToNative(arguments[0]);
-      String output = relativize(cwd, out, isWindows);
+      String output = relativize(currentDirectory, out, isWindows);
       print('Dart file $input compiled to $outputLanguage: $output');
     }
   }
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/utils.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/utils.dart
index c30a2cf..3dbc248 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/utils.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/utils.dart
@@ -163,6 +163,9 @@
   visitParenthesizedExpression(ParenthesizedExpression node) =>
       new ParenthesizedExpression(visit(node.expression), node.beginToken);
 
+  visitRethrow(Rethrow node) => new Rethrow(
+      node.throwToken, node.endToken);
+
   visitReturn(Return node) => new Return(
       node.beginToken, node.endToken, visit(node.expression));
 
diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart
index 9639b3d..8a2cab2 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -999,6 +999,19 @@
     if (s is !FunctionType) return false;
     FunctionType tf = t;
     FunctionType sf = s;
+    if (!identical(sf.returnType, voidType) &&
+        !isAssignable(tf.returnType, sf.returnType)) {
+      return false;
+    }
+
+    // TODO(johnniwinther): Rewrite the function subtyping to be more readable
+    // but still as efficient.
+
+    // For the comments we use the following abbreviations:
+    //  x.p     : parameterTypes on [:x:],
+    //  x.o     : optionalParameterTypes on [:x:], and
+    //  len(xs) : length of list [:xs:].
+
     Link<DartType> tps = tf.parameterTypes;
     Link<DartType> sps = sf.parameterTypes;
     while (!tps.isEmpty && !sps.isEmpty) {
@@ -1006,15 +1019,18 @@
       tps = tps.tail;
       sps = sps.tail;
     }
-    if (!tps.isEmpty || !sps.isEmpty) return false;
-    if (!identical(sf.returnType, voidType) &&
-        !isAssignable(tf.returnType, sf.returnType)) {
+    if (!tps.isEmpty) {
+      // We must have [: len(t.p) <= len(s.p) :].
       return false;
     }
     if (!sf.namedParameters.isEmpty) {
+      if (!sps.isEmpty) {
+        // We must have [: len(t.p) == len(s.p) :].
+        return false;
+      }
       // Since named parameters are globally ordered we can determine the
-      // subset relation with a linear search for [:sf.NamedParameters:]
-      // within [:tf.NamedParameters:].
+      // subset relation with a linear search for [:sf.namedParameters:]
+      // within [:tf.namedParameters:].
       Link<SourceString> tNames = tf.namedParameters;
       Link<DartType> tTypes = tf.namedParameterTypes;
       Link<SourceString> sNames = sf.namedParameters;
@@ -1033,22 +1049,36 @@
         // We didn't find all names.
         return false;
       }
-    }
-    if (!sf.optionalParameterTypes.isEmpty) {
-      Link<DartType> tOptionalParameterType = tf.optionalParameterTypes;
-      Link<DartType> sOptionalParameterType = sf.optionalParameterTypes;
-      while (!tOptionalParameterType.isEmpty &&
-             !sOptionalParameterType.isEmpty) {
-        if (!isAssignable(tOptionalParameterType.head,
-                          sOptionalParameterType.head)) {
+    } else {
+      // Check the remaining [: s.p :] against [: t.o :].
+      tps = tf.optionalParameterTypes;
+      while (!tps.isEmpty && !sps.isEmpty) {
+        if (!isAssignable(tps.head, sps.head)) return false;
+        tps = tps.tail;
+        sps = sps.tail;
+      }
+      if (!sps.isEmpty) {
+        // We must have [: len(t.p) + len(t.o) >= len(s.p) :].
+        return false;
+      }
+      if (!sf.optionalParameterTypes.isEmpty) {
+        // Check the remaining [: s.o :] against the remaining [: t.o :].
+        sps = sf.optionalParameterTypes;
+        while (!tps.isEmpty && !sps.isEmpty) {
+          if (!isAssignable(tps.head, sps.head)) return false;
+          tps = tps.tail;
+          sps = sps.tail;
+        }
+        if (!sps.isEmpty) {
+          // We didn't find enough parameters:
+          // We must have [: len(t.p) + len(t.o) <= len(s.p) + len(s.o) :].
           return false;
         }
-        sOptionalParameterType = sOptionalParameterType.tail;
-        tOptionalParameterType = tOptionalParameterType.tail;
-      }
-      if (!sOptionalParameterType.isEmpty) {
-        // We didn't find enough optional parameters.
-        return false;
+      } else {
+        if (!sps.isEmpty) {
+          // We must have [: len(t.p) + len(t.o) >= len(s.p) :].
+          return false;
+        }
       }
     }
     return true;
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index 94d8a1c..c036596 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -623,12 +623,9 @@
   Link<DartType> get typeVariables;
 
   bool get isResolved;
-  bool get isBeingResolved;
 
   // TODO(kasperl): Try to get rid of these setters.
   void set alias(DartType value);
-  void set isResolved(bool value);
-  void set isBeingResolved(bool value);
   void set functionSignature(FunctionSignature value);
 }
 
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 71d6a39..909c4c6 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -791,8 +791,10 @@
    */
   DartType alias;
 
-  bool isResolved = false;
-  bool isBeingResolved = false;
+  bool get isResolved => mapping != null;
+
+  // TODO(johnniwinther): Store the mapping in the resolution enqueuer instead.
+  TreeElements mapping;
 
   TypedefElementX(SourceString name, Element enclosing)
       : super(name, ElementKind.TYPEDEF, enclosing);
@@ -1226,7 +1228,8 @@
     if (super.isAbstract(compiler)) return true;
     if (modifiers.isExternal()) return false;
     if (isFunction() || isAccessor()) {
-      return !parseNode(compiler).hasBody();
+      return compiler.withCurrentElement(this,
+          () => !parseNode(compiler).hasBody());
     }
     return false;
   }
diff --git a/sdk/lib/_internal/compiler/implementation/filenames.dart b/sdk/lib/_internal/compiler/implementation/filenames.dart
index 198a28f..46bc421 100644
--- a/sdk/lib/_internal/compiler/implementation/filenames.dart
+++ b/sdk/lib/_internal/compiler/implementation/filenames.dart
@@ -21,9 +21,8 @@
   return new Path(path).toNativePath();
 }
 
-Uri getCurrentDirectory() {
-  final String dir = nativeToUriPath(new File('.').fullPathSync());
-  return new Uri.fromComponents(scheme: 'file', path: appendSlash(dir));
-}
+final Uri currentDirectory = new Uri.fromComponents(
+    scheme: 'file',
+    path: appendSlash(nativeToUriPath(new File('.').fullPathSync())));
 
 String appendSlash(String path) => path.endsWith('/') ? path : '$path/';
diff --git a/sdk/lib/_internal/compiler/implementation/js/builder.dart b/sdk/lib/_internal/compiler/implementation/js/builder.dart
index 7e71928..1a22692 100644
--- a/sdk/lib/_internal/compiler/implementation/js/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/js/builder.dart
@@ -42,7 +42,11 @@
     if (statement is Block) {
       return statement;
     } else if (statement is List) {
-      return new Block(statement.map(toStatement).toList());
+      List<Statement> statements = statement
+          .map(toStatement)
+          .where((s) => s is !EmptyStatement)
+          .toList();
+      return new Block(statements);
     } else {
       return new Block(<Statement>[toStatement(statement)]);
     }
@@ -81,7 +85,7 @@
 
   Statement toStatement(statement) {
     if (statement is List) {
-      return new Block(statement.map(toStatement).toList());
+      return block(statement);
     } else if (statement is Node) {
       return statement.toStatement();
     } else {
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index de43ed6..7feb253 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -652,12 +652,13 @@
   ClassElement jsBoolClass;
 
   ClassElement jsIndexableClass;
+  ClassElement jsMutableIndexableClass;
+
   ClassElement jsMutableArrayClass;
   ClassElement jsFixedArrayClass;
   ClassElement jsExtendableArrayClass;
 
-  Element jsArrayLength;
-  Element jsStringLength;
+  Element jsIndexableLength;
   Element jsArrayRemoveLast;
   Element jsArrayAdd;
   Element jsStringSplit;
@@ -899,6 +900,8 @@
 
     jsIndexableClass =
         compiler.findInterceptor(const SourceString('JSIndexable'));
+    jsMutableIndexableClass =
+        compiler.findInterceptor(const SourceString('JSMutableIndexable'));
 
     // TODO(kasperl): Some tests do not define the special JSArray
     // subclasses, so we check to see if they are defined before
@@ -910,25 +913,21 @@
       jsExtendableArrayClass.ensureResolved(compiler);
     }
 
-    jsArrayClass.ensureResolved(compiler);
-    jsArrayLength = compiler.lookupElementIn(
-        jsArrayClass, const SourceString('length'));
-    if (jsArrayLength != null && jsArrayLength.isAbstractField()) {
-      AbstractFieldElement element = jsArrayLength;
-      jsArrayLength = element.getter;
+    jsIndexableClass.ensureResolved(compiler);
+    jsIndexableLength = compiler.lookupElementIn(
+        jsIndexableClass, const SourceString('length'));
+    if (jsIndexableLength != null && jsIndexableLength.isAbstractField()) {
+      AbstractFieldElement element = jsIndexableLength;
+      jsIndexableLength = element.getter;
     }
+
+    jsArrayClass.ensureResolved(compiler);
     jsArrayRemoveLast = compiler.lookupElementIn(
         jsArrayClass, const SourceString('removeLast'));
     jsArrayAdd = compiler.lookupElementIn(
         jsArrayClass, const SourceString('add'));
 
     jsStringClass.ensureResolved(compiler);
-    jsStringLength = compiler.lookupElementIn(
-        jsStringClass, const SourceString('length'));
-    if (jsStringLength != null && jsStringLength.isAbstractField()) {
-      AbstractFieldElement element = jsStringLength;
-      jsStringLength = element.getter;
-    }
     jsStringSplit = compiler.lookupElementIn(
         jsStringClass, const SourceString('split'));
     jsStringConcat = compiler.lookupElementIn(
@@ -960,6 +959,7 @@
   void validateInterceptorImplementsAllObjectMethods(
       ClassElement interceptorClass) {
     if (interceptorClass == null) return;
+    interceptorClass.ensureResolved(compiler);
     compiler.objectClass.forEachMember((_, Element member) {
       if (member.isGenerativeConstructor()) return;
       Element interceptorMember = interceptorClass.lookupMember(member.name);
@@ -979,6 +979,7 @@
           Set<Element> set = interceptedElements.putIfAbsent(
               member.name, () => new Set<Element>());
           set.add(member);
+          if (classElement == jsInterceptorClass) return;
           if (!classElement.isNative()) {
             MixinApplicationElement mixinApplication = classElement;
             assert(member.getEnclosingClass() == mixinApplication.mixin);
@@ -1368,6 +1369,11 @@
     return new native.NativeCodegenEnqueuer(world, compiler, emitter);
   }
 
+  ClassElement defaultSuperclass(ClassElement element) {
+    // Native classes inherit from Interceptor.
+    return element.isNative() ? jsInterceptorClass : compiler.objectClass;
+  }
+
   /**
    * Unit test hook that returns code of an element as a String.
    *
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index 92be012..f0c050b 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -57,6 +57,7 @@
 class CodeEmitterTask extends CompilerTask {
   bool needsInheritFunction = false;
   bool needsDefineClass = false;
+  bool needsMixinSupport = false;
   bool needsClosureClass = false;
   bool needsLazyInitializer = false;
   final Namer namer;
@@ -159,6 +160,15 @@
     });
   }
 
+  ClassElement computeMixinClass(MixinApplicationElement mixinApplication) {
+    ClassElement mixin = mixinApplication.mixin;
+    while (mixin.isMixinApplication) {
+      mixinApplication = mixin;
+      mixin = mixinApplication.mixin;
+    }
+    return mixin;
+  }
+
   jsAst.Expression constantReference(Constant value) {
     return constantEmitter.reference(value);
   }
@@ -606,34 +616,40 @@
            * Super;field1,field2 from the null-string property on the
            * descriptor.
            */
-          // var fields = desc[""], supr;
           js('var fields = desc[""], supr'),
 
           js.if_('typeof fields == "string"', [
             js('var s = fields.split(";")'),
-            js('supr = s[0]'),
             js('fields = s[1] == "" ? [] : s[1].split(",")'),
+            js('supr = s[0]'),
           ], /* else */ [
-            js('supr = desc.super')
+            js('supr = desc.super'),
           ]),
 
-          js('isolateProperties[cls] = defineClass(cls, fields, desc)'),
+          optional(needsMixinSupport, js.if_('supr && supr.indexOf("+") > 0', [
+            js('s = supr.split("+")'),
+            js('supr = s[0]'),
+            js('var mixin = collectedClasses[s[1]]'),
+            js.forIn('d', 'mixin', [
+              js.if_('hasOwnProperty.call(mixin, d)'
+                     '&& !hasOwnProperty.call(desc, d)',
+                js('desc[d] = mixin[d]'))
+            ]),
+          ])),
 
-          // if (supr) pendingClasses[cls] = supr;
+          js('isolateProperties[cls] = defineClass(cls, fields, desc)'),
           js.if_('supr', js('pendingClasses[cls] = supr'))
         ])
       ]),
 
       js('var finishedClasses = {}'),
 
-      // function finishClass(cls) { ... }
       buildFinishClass(),
     ];
 
     addTrivialNsmHandlers(statements);
 
     statements.add(
-      // for (var cls in pendingClasses) finishClass(cls);
       js.forIn('cls', 'pendingClasses', js('finishClass(cls)'))
     );
     // function(collectedClasses,
@@ -643,6 +659,10 @@
                    'existingIsolateProperties'], statements);
   }
 
+  jsAst.Node optional(bool condition, jsAst.Node node) {
+    return condition ? node : new jsAst.EmptyStatement();
+  }
+
   jsAst.FunctionDeclaration buildFinishClass() {
     // function finishClass(cls) {
     jsAst.Fun fun = js.fun(['cls'], [
@@ -1174,6 +1194,21 @@
         includeBackendMembers: true,
         includeSuperMembers: false);
 
+    if (identical(classElement, compiler.objectClass)
+        && compiler.enabledNoSuchMethod) {
+      // Emit the noSuchMethod handlers on the Object prototype now,
+      // so that the code in the dynamicFunction helper can find
+      // them. Note that this helper is invoked before analyzing the
+      // full JS script.
+      if (!nativeEmitter.handleNoSuchMethod) {
+        emitNoSuchMethodHandlers(builder.addProperty);
+      }
+    }
+  }
+
+  void emitIsTests(ClassElement classElement, ClassBuilder builder) {
+    assert(invariant(classElement, classElement.isDeclaration));
+
     void generateIsTest(Element other) {
       if (other == compiler.objectClass && other != classElement) {
         // Avoid emitting [:$isObject:] on all classes but [Object].
@@ -1202,17 +1237,6 @@
     }
 
     generateIsTestsOn(classElement, generateIsTest, generateSubstitution);
-
-    if (identical(classElement, compiler.objectClass)
-        && compiler.enabledNoSuchMethod) {
-      // Emit the noSuchMethod handlers on the Object prototype now,
-      // so that the code in the dynamicFunction helper can find
-      // them. Note that this helper is invoked before analyzing the
-      // full JS script.
-      if (!nativeEmitter.handleNoSuchMethod) {
-        emitNoSuchMethodHandlers(builder.addProperty);
-      }
-    }
   }
 
   void emitRuntimeTypeSupport(CodeBuffer buffer) {
@@ -1430,13 +1454,11 @@
   /// Returns `true` if fields added.
   bool emitClassFields(ClassElement classElement,
                        ClassBuilder builder,
-                       { String superClass,
-                         bool classIsNative: false }) {
+                       String superName,
+                       { bool classIsNative: false }) {
+    assert(superName != null);
     String separator = '';
-    StringBuffer buffer = new StringBuffer();
-    if (superClass != null) {
-      buffer.write('$superClass;');
-    }
+    StringBuffer buffer = new StringBuffer('$superName;');
     int bufferClassLength = buffer.length;
 
     visitClassFields(classElement, (Element member,
@@ -1545,14 +1567,21 @@
       superName = namer.getName(superclass);
     }
 
-    ClassBuilder builder = new ClassBuilder();
+    if (classElement.isMixinApplication) {
+      String mixinName = namer.getName(computeMixinClass(classElement));
+      superName = '$superName+$mixinName';
+      needsMixinSupport = true;
+    }
 
+    ClassBuilder builder = new ClassBuilder();
     emitClassConstructor(classElement, builder);
     emitSuper(superName, builder);
-    emitClassFields(classElement, builder,
-                    superClass: superName, classIsNative: false);
+    emitClassFields(classElement, builder, superName);
     emitClassGettersSetters(classElement, builder);
-    emitInstanceMembers(classElement, builder);
+    if (!classElement.isMixinApplication) {
+      emitInstanceMembers(classElement, builder);
+    }
+    emitIsTests(classElement, builder);
 
     jsAst.Expression init =
         js('$classesCollector.$className = #', builder.toObjectInitializer());
@@ -2603,6 +2632,13 @@
       }
     }
 
+    // Then add all classes used as mixins.
+    Set<ClassElement> mixinClasses = neededClasses
+        .where((ClassElement element) => element.isMixinApplication)
+        .map(computeMixinClass)
+        .toSet();
+    neededClasses.addAll(mixinClasses);
+
     // Finally, sort the classes.
     List<ClassElement> sortedClasses = Elements.sortedByPosition(neededClasses);
 
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
index 9814102..3b385b3 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
@@ -30,8 +30,8 @@
 
   bool emitClassFields(ClassElement classElement,
                        ClassBuilder builder,
-                       { String superClass: "",
-                         bool classIsNative: false }) {
+                       String superName,
+                       { bool classIsNative: false }) {
     // Class fields are dynamically generated so they have to be
     // emitted using getters and setters instead.
     return false;
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
index 93e706b..f2f3b73 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
@@ -99,18 +99,9 @@
     return backend.namer.isolateAccess(element);
   }
 
-  bool isNativeGlobal(String quotedName) {
-    return identical(quotedName[1], '@');
-  }
-
-  String toNativeTag(ClassElement cls) {
+  List<String> nativeTagsOfClass(ClassElement cls) {
     String quotedName = cls.nativeTagInfo.slowToString();
-    if (isNativeGlobal(quotedName)) {
-      // Global object, just be like the other types for now.
-      return quotedName.substring(3, quotedName.length - 1);
-    } else {
-      return quotedName.substring(2, quotedName.length - 1);
-    }
+    return quotedName.substring(1, quotedName.length - 1).split(',');
   }
 
   /**
@@ -185,8 +176,8 @@
       // proto chain.
       // TODO(9907): Fix DOM generation. We might need an annotation.
       if (classElement.isNative()) {
-        String nativeTag = toNativeTag(classElement);
-        if (nativeTag == 'HTMLElement') {
+        List<String> nativeTags = nativeTagsOfClass(classElement);
+        if (nativeTags.contains('HTMLElement')) {
           nonleafClasses.add(classElement);
           needed = true;
         }
@@ -207,12 +198,12 @@
         new Map<ClassElement, Set<String>>();
 
     for (ClassElement classElement in classes) {
-      String nativeTag = toNativeTag(classElement);
+      List<String> nativeTags = nativeTagsOfClass(classElement);
 
       if (nonleafClasses.contains(classElement)) {
         nonleafTags
             .putIfAbsent(classElement, () => new Set<String>())
-            .add(nativeTag);
+            .addAll(nativeTags);
       } else {
         ClassElement sufficingInterceptor = classElement;
         while (!neededClasses.contains(sufficingInterceptor)) {
@@ -223,7 +214,7 @@
         }
         leafTags
             .putIfAbsent(sufficingInterceptor, () => new Set<String>())
-            .add(nativeTag);
+            .addAll(nativeTags);
       }
     }
 
@@ -273,12 +264,12 @@
     ClassBuilder builder = new ClassBuilder();
     emitter.emitClassConstructor(classElement, builder);
     emitter.emitSuper(superName, builder);
-    bool hasFields = emitter.emitClassFields(classElement, builder,
-        classIsNative: true,
-        superClass: superName);
+    bool hasFields = emitter.emitClassFields(
+        classElement, builder, superName, classIsNative: true);
     int propertyCount = builder.properties.length;
     emitter.emitClassGettersSetters(classElement, builder);
     emitter.emitInstanceMembers(classElement, builder);
+    emitter.emitIsTests(classElement, builder);
 
     if (!hasFields && builder.properties.length == propertyCount) {
       builder.isTrivial = true;
@@ -290,7 +281,6 @@
   void generateDefineNativeMethods(
       Set<String> tags, ClassElement classElement, String definer) {
     if (tags == null) return;
-
     String tagsString = (tags.toList()..sort()).join('|');
     jsAst.Expression definition =
         js(definer)(
@@ -359,7 +349,6 @@
     //   foo(null, y).
 
     ClassElement classElement = member.enclosingElement;
-    String nativeTagInfo = classElement.nativeTagInfo.slowToString();
 
     List<jsAst.Statement> statements = <jsAst.Statement>[];
     potentiallyConvertDartClosuresToJs(statements, member, stubParameters);
diff --git a/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
index 10afb9a..a5a7b89 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
@@ -265,8 +265,14 @@
     // We only store non-null entries in the table, so we have to
     // change null values to refer to the table itself. Such values
     // will be recognized and mapped back to null on access.
-    if (value == null) value = table;
-    JS('void', '#[#] = #', table, key, value);
+    if (value == null) {
+      // Do not update [value] with [table], otherwise our
+      // optimizations could be confused by this opaque object being
+      // now used for more things than storing and fetching from it.
+      JS('void', '#[#] = #', table, key, table);
+    } else {
+      JS('void', '#[#] = #', table, key, value);
+    }
   }
 
   static void _deleteTableEntry(var table, var key) {
diff --git a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
index 38adaf1..934044a 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
@@ -5,11 +5,10 @@
 // Patch file for dart:core classes.
 import 'dart:_interceptors';
 import 'dart:_js_helper' show checkNull,
-                              getRuntimeTypeString,
+                              getRuntimeType,
                               isJsArray,
                               JSSyntaxRegExp,
                               Primitives,
-                              TypeImpl,
                               stringJoinUnchecked;
 import "dart:_collection-dev" as _symbol_dev;
 
@@ -41,10 +40,7 @@
         _symbolMapToStringMap(invocation.namedArguments));
   }
 
-  patch Type get runtimeType {
-    String type = getRuntimeTypeString(this);
-    return new TypeImpl(type);
-  }
+  patch Type get runtimeType => getRuntimeType(this);
 }
 
 // Patch for Function implementation.
diff --git a/sdk/lib/_internal/compiler/implementation/lib/foreign_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/foreign_helper.dart
index ac14c32..0e72750 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/foreign_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/foreign_helper.dart
@@ -29,7 +29,8 @@
  * by vertical bar `|` symbols, e.g.  `"num|String"` describes the union of
  * numbers and Strings.  There is no type in Dart that is this precise.  The
  * Dart alternative would be `Object` or `dynamic`, but these types imply that
- * the JS-code might also be creating instances of all the DOM types.  The
+ * the JS-code might also be creating instances of all the DOM types.  If `null`
+ * is possible, it must be specified explicitly, e.g. `"String|Null"`.
  * [typeDescription] has several extensions to help describe the behavior more
  * accurately.  In addition to the union type already described:
  *
diff --git a/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart b/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
index c704b03..d56fb0b 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
@@ -15,14 +15,13 @@
                               checkNull,
                               checkNum,
                               checkString,
-                              getRuntimeTypeString,
+                              getRuntimeType,
                               regExpGetNative,
                               stringContainsUnchecked,
                               stringLastIndexOfUnchecked,
                               stringReplaceAllFuncUnchecked,
                               stringReplaceAllUnchecked,
                               stringReplaceFirstUnchecked,
-                              TypeImpl,
                               lookupDispatchRecord;
 import 'dart:_foreign_helper' show JS;
 
@@ -210,7 +209,7 @@
                                 invocation.namedArguments);
   }
 
-  Type get runtimeType;
+  Type get runtimeType => getRuntimeType(this);
 }
 
 /**
@@ -263,8 +262,19 @@
 
 /**
  * The supertype for JSString and JSArray. Used by the backend as to
- * have a type mask that contains the primitive objects that we can
- * use the [] operator on.
+ * have a type mask that contains the objects that we can use the
+ * native JS [] operator and length on.
  */
-class JSIndexable {
+abstract class JSIndexable {
+  int get length;
+  operator[](int index);
+}
+
+/**
+ * The supertype for JSMutableArray and
+ * JavaScriptIndexingBehavior. Used by the backend to have a type mask
+ * that contains the objects we can use the JS []= operator on.
+ */
+abstract class JSMutableIndexable extends JSIndexable {
+  operator[]=(int index, var value);
 }
diff --git a/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
index 9b38456..bb27e82 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
@@ -190,6 +190,13 @@
   }
 }
 
+patch class InternetAddress {
+  patch static Future<List<InternetAddress>> lookup(
+      String host, {InternetAddressType type: InternetAddressType.IPv4}) {
+    throw new UnsupportedError("InternetAddress.lookup");
+  }
+}
+
 patch class RawServerSocket {
   patch static Future<RawServerSocket> bind([String address = "127.0.0.1",
                                              int port = 0,
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
index ca01210..30e0a39 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
@@ -52,14 +52,15 @@
     return JS('var', r'#.pop()', this);
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
     checkGrowable(this, 'remove');
     for (int i = 0; i < this.length; i++) {
       if (this[i] == element) {
         JS('var', r'#.splice(#, 1)', this, i);
-        return;
+        return true;
       }
     }
+    return false;
   }
 
   void removeWhere(bool test(E element)) {
@@ -257,11 +258,6 @@
 
   int get hashCode => Primitives.objectHashCode(this);
 
-  Type get runtimeType {
-    // Call getRuntimeTypeString to get the name including type arguments.
-    return new TypeImpl(getRuntimeTypeString(this));
-  }
-
   int get length => JS('int', r'#.length', this);
 
   void set length(int newLength) {
@@ -293,6 +289,6 @@
  * Dummy subclasses that allow the backend to track more precise
  * information about arrays through their type.
  */
-class JSMutableArray extends JSArray {}
+class JSMutableArray extends JSArray implements JSMutableIndexable {}
 class JSFixedArray extends JSMutableArray {}
 class JSExtendableArray extends JSMutableArray {}
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index d363676..290385f 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -19,7 +19,7 @@
                                  makeDispatchRecord,
                                  setDispatchProperty,
                                  Interceptor,
-                                 JSIndexable;
+                                 JSMutableIndexable;
 import "dart:_collection-dev" as _symbol_dev;
 
 part 'constant_map.dart';
@@ -579,9 +579,11 @@
 /**
  * Called by generated code to throw an index-out-of-range exception,
  * for example, if a bounds check fails in an optimized indexed
- * access.
+ * access.  This may also be called when the index is not an integer, in
+ * which case it throws an illegal-argument exception instead, like [iae].
  */
 ioore(index) {
+  if (index is !int) iae(index);
   throw new RangeError.value(index);
 }
 
@@ -1302,7 +1304,7 @@
  * objects that support integer indexing. This interface is not
  * visible to anyone, and is only injected into special libraries.
  */
-abstract class JavaScriptIndexingBehavior extends JSIndexable {
+abstract class JavaScriptIndexingBehavior extends JSMutableIndexable {
 }
 
 // TODO(lrn): These exceptions should be implemented in core.
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
index b8f4e7d..fd64f48 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
@@ -32,7 +32,7 @@
 }
 
 String getClassName(var object) {
-  return JS('String', r'#.constructor.builtin$cls', object);
+  return JS('String', r'#.constructor.builtin$cls', getInterceptor(object));
 }
 
 String getRuntimeTypeAsString(List runtimeType) {
@@ -80,6 +80,11 @@
   return "$className${joinArguments(typeInfo, 0)}";
 }
 
+Type getRuntimeType(var object) {
+  String type = getRuntimeTypeString(object);
+  return new TypeImpl(type);
+}
+
 bool isJsFunction(var o) => JS('bool', r'typeof # == "function"', o);
 
 Object invoke(function, arguments) {
diff --git a/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
index 8f469a3..1fa69ec 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
@@ -17,9 +17,7 @@
 
 String typeNameInWebKitCommon(tag) {
   String name = JS('String', '#', tag);
-  if (name == 'Window') return 'DOMWindow';
   if (name == 'CanvasPixelArray') return 'Uint8ClampedArray';
-  if (name == 'WebKitMutationObserver') return 'MutationObserver';
   if (name == 'AudioChannelMerger') return 'ChannelMergerNode';
   if (name == 'AudioChannelSplitter') return 'ChannelSplitterNode';
   if (name == 'AudioGainNode') return 'GainNode';
@@ -28,27 +26,21 @@
   if (name == 'Oscillator') return 'OscillatorNode';
   if (name == 'RealtimeAnalyserNode') return 'AnalyserNode';
   if (name == 'IDBVersionChangeRequest') return 'IDBOpenDBRequest';
-  if (name == 'WebKitTransitionEvent') return 'TransitionEvent';
   return name;
 }
 
 String typeNameInOpera(obj) {
   String name = JS('String', '#', constructorNameFallback(obj));
-  if (name == 'Window') return 'DOMWindow';
-  if (name == 'ApplicationCache') return 'DOMApplicationCache';
   return name;
 }
 
 String typeNameInFirefox(obj) {
   String name = JS('String', '#', constructorNameFallback(obj));
-  if (name == 'Window') return 'DOMWindow';
   if (name == 'BeforeUnloadEvent') return 'Event';
   if (name == 'CSS2Properties') return 'CSSStyleDeclaration';
   if (name == 'DataTransfer') return 'Clipboard';
   if (name == 'DragEvent') return 'MouseEvent';
   if (name == 'GeoGeolocation') return 'Geolocation';
-  if (name == 'MouseScrollEvent') return 'WheelEvent';
-  if (name == 'OfflineResourceList') return 'DOMApplicationCache';
   if (name == 'WorkerMessageEvent') return 'MessageEvent';
   if (name == 'XMLDocument') return 'Document';
   return name;
@@ -56,14 +48,12 @@
 
 String typeNameInIE(obj) {
   String name = JS('String', '#', constructorNameFallback(obj));
-  if (name == 'Window') return 'DOMWindow';
   if (name == 'Document') {
     // IE calls both HTML and XML documents 'Document', so we check for the
     // xmlVersion property, which is the empty string on HTML documents.
     if (JS('bool', '!!#.xmlVersion', obj)) return 'Document';
     return 'HTMLDocument';
   }
-  if (name == 'ApplicationCache') return 'DOMApplicationCache';
   if (name == 'BeforeUnloadEvent') return 'Event';
   if (name == 'CanvasPixelArray') return 'Uint8ClampedArray';
   if (name == 'DataTransfer') return 'Clipboard';
@@ -74,7 +64,6 @@
   if (name == 'HTMLTableHeaderCellElement') return 'HTMLTableCellElement';
   if (name == 'HTMLPhraseElement') return 'HTMLElement';
   if (name == 'MSStyleCSSProperties') return 'CSSStyleDeclaration';
-  if (name == 'MouseWheelEvent') return 'WheelEvent';
   if (name == 'Position') return 'Geoposition';
 
   // Patches for types which report themselves as Objects.
diff --git a/sdk/lib/_internal/compiler/implementation/lib/typeddata_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/typed_data_patch.dart
similarity index 96%
rename from sdk/lib/_internal/compiler/implementation/lib/typeddata_patch.dart
rename to sdk/lib/_internal/compiler/implementation/lib/typed_data_patch.dart
index ba50d05d6..1f32792 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/typeddata_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/typed_data_patch.dart
@@ -2,9 +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.
 
-// This is an empty dummy patch file for the VM dart:typeddata library.
+// This is an empty dummy patch file for the VM dart:typed_data library.
 // This is needed in order to be able to generate documentation for the
-// typeddata library.
+// typed_data library.
 
 patch class Int8List {
   patch factory Int8List(int length) {
@@ -199,6 +199,9 @@
   patch factory Float32x4(double x, double y, double z, double w) {
     throw new UnsupportedError('Float32x4');
   }
+  patch factory Float32x4.splat(double v) {
+    throw new UnsupportedError('Float32x4.splat');
+  }
   patch factory Float32x4.zero() {
     throw new UnsupportedError('Float32x4.zero');
   }
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart
index 17f40f6..fbde5f9 100644
--- a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart
@@ -6,25 +6,18 @@
 
 import 'dart:async';
 import 'dart:collection' show LinkedHashMap;
-import 'dart:io' show Path;
 import 'dart:uri';
 
 import '../../compiler.dart' as api;
 import '../elements/elements.dart';
-import '../resolution/resolution.dart' show ResolverTask, ResolverVisitor;
 import '../apiimpl.dart' as apiimpl;
 import '../scanner/scannerlib.dart' hide SourceString;
-import '../ssa/ssa.dart';
 import '../dart2jslib.dart';
 import '../dart_types.dart';
-import '../filenames.dart';
 import '../source_file.dart';
 import '../tree/tree.dart';
-import '../util/util.dart';
-import '../util/uri_extras.dart';
-import '../dart2js.dart';
-import '../util/characters.dart';
-import '../source_file_provider.dart';
+import '../util/util.dart' show Spannable, Link;
+import '../util/characters.dart' show $CR, $LF;
 
 import 'mirrors.dart';
 import 'mirrors_util.dart';
@@ -192,51 +185,20 @@
 }
 
 //------------------------------------------------------------------------------
-// Compilation implementation
+// Analysis entry point.
 //------------------------------------------------------------------------------
 
-// TODO(johnniwinther): Support client configurable providers.
-
-/**
- * Returns a future that completes to a non-null String when [script]
- * has been successfully compiled.
- *
- * TODO(johnniwinther): The method is deprecated but here to support [Path]
- * which is used through dartdoc.
- */
-Future<String> compile(Path script,
-                       Path libraryRoot,
-                       {Path packageRoot,
-                        List<String> options: const <String>[],
-                        api.DiagnosticHandler diagnosticHandler}) {
-  Uri cwd = getCurrentDirectory();
-  SourceFileProvider provider = new SourceFileProvider();
-  if (diagnosticHandler == null) {
-    diagnosticHandler =
-        new FormattingDiagnosticHandler(provider).diagnosticHandler;
-  }
-  Uri scriptUri = cwd.resolve(script.toString());
-  Uri libraryUri = cwd.resolve(appendSlash('$libraryRoot'));
-  Uri packageUri = null;
-  if (packageRoot != null) {
-    packageUri = cwd.resolve(appendSlash('$packageRoot'));
-  }
-  return api.compile(scriptUri, libraryUri, packageUri,
-      provider.readStringFromUri, diagnosticHandler, options);
-}
-
 /**
  * Analyzes set of libraries and provides a mirror system which can be used for
  * static inspection of the source code.
  */
-// TODO(johnniwinther): Move this to [compiler/compiler.dart] and rename to
-// [:analyze:].
-Future<MirrorSystem> analyzeUri(List<Uri> libraries,
-                                Uri libraryRoot,
-                                Uri packageRoot,
-                                api.CompilerInputProvider inputProvider,
-                                api.DiagnosticHandler diagnosticHandler,
-                                [List<String> options = const <String>[]]) {
+// TODO(johnniwinther): Move this to [compiler/compiler.dart].
+Future<MirrorSystem> analyze(List<Uri> libraries,
+                             Uri libraryRoot,
+                             Uri packageRoot,
+                             api.CompilerInputProvider inputProvider,
+                             api.DiagnosticHandler diagnosticHandler,
+                             [List<String> options = const <String>[]]) {
   if (!libraryRoot.path.endsWith("/")) {
     throw new ArgumentError("libraryRoot must end with a /");
   }
@@ -271,36 +233,6 @@
   }
 }
 
-/**
- * Analyzes set of libraries and provides a mirror system which can be used for
- * static inspection of the source code.
- */
-// TODO(johnniwinther): Move dart:io dependent parts outside
-// dart2js_mirror.dart.
-Future<MirrorSystem> analyze(List<Path> libraries,
-                             Path libraryRoot,
-                             {Path packageRoot,
-                              List<String> options: const <String>[],
-                              api.DiagnosticHandler diagnosticHandler}) {
-  Uri cwd = getCurrentDirectory();
-  SourceFileProvider provider = new SourceFileProvider();
-  if (diagnosticHandler == null) {
-    diagnosticHandler =
-        new FormattingDiagnosticHandler(provider).diagnosticHandler;
-  }
-  Uri libraryUri = cwd.resolve(appendSlash('$libraryRoot'));
-  Uri packageUri = null;
-  if (packageRoot != null) {
-    packageUri = cwd.resolve(appendSlash('$packageRoot'));
-  }
-  List<Uri> librariesUri = <Uri>[];
-  for (Path library in libraries) {
-    librariesUri.add(cwd.resolve(library.toString()));
-  }
-  return analyzeUri(librariesUri, libraryUri, packageUri,
-                    provider.readStringFromUri, diagnosticHandler, options);
-}
-
 //------------------------------------------------------------------------------
 // Dart2Js specific extensions of mirror interfaces
 //------------------------------------------------------------------------------
@@ -465,9 +397,9 @@
 // Mirror system implementation.
 //------------------------------------------------------------------------------
 
-class Dart2JsMirrorSystem implements MirrorSystem {
+class Dart2JsMirrorSystem extends MirrorSystem {
   final Compiler compiler;
-  Map<String, Dart2JsLibraryMirror> _libraries;
+  Map<Uri, Dart2JsLibraryMirror> _libraries;
   Map<LibraryElement, Dart2JsLibraryMirror> _libraryMap;
 
   Dart2JsMirrorSystem(this.compiler)
@@ -475,18 +407,18 @@
 
   void _ensureLibraries() {
     if (_libraries == null) {
-      _libraries = <String, Dart2JsLibraryMirror>{};
+      _libraries = new Map<Uri, Dart2JsLibraryMirror>();
       compiler.libraries.forEach((_, LibraryElement v) {
         var mirror = new Dart2JsLibraryMirror(mirrors, v);
-        _libraries[mirror.simpleName] = mirror;
+        _libraries[mirror.uri] = mirror;
         _libraryMap[v] = mirror;
       });
     }
   }
 
-  Map<String, LibraryMirror> get libraries {
+  Map<Uri, LibraryMirror> get libraries {
     _ensureLibraries();
-    return new ImmutableMapWrapper<String, LibraryMirror>(_libraries);
+    return new ImmutableMapWrapper<Uri, LibraryMirror>(_libraries);
   }
 
   Dart2JsLibraryMirror _getLibrary(LibraryElement element) =>
@@ -1551,7 +1483,7 @@
     throw new UnsupportedError('InstanceMirror does not have a reflectee');
   }
 
-  Future<InstanceMirror> getField(String fieldName) {
+  InstanceMirror getField(String fieldName) {
     // TODO(johnniwinther): Which exception/error should be thrown here?
     throw new UnsupportedError('InstanceMirror does not have a reflectee');
   }
@@ -1621,11 +1553,10 @@
 
   int get length => _constant.length;
 
-  Future<InstanceMirror> operator[](int index) {
+  InstanceMirror operator[](int index) {
     if (index < 0) throw new RangeError('Negative index');
     if (index >= _constant.length) throw new RangeError('Index out of bounds');
-    return new Future<InstanceMirror>.value(
-        _convertConstantToInstanceMirror(mirrors, _constant.entries[index]));
+    return _convertConstantToInstanceMirror(mirrors, _constant.entries[index]);
   }
 }
 
@@ -1658,11 +1589,10 @@
     return new List<String>.from(_list);
   }
 
-  Future<InstanceMirror> operator[](String key) {
+  InstanceMirror operator[](String key) {
     int index = _list.indexOf(key);
     if (index == -1) return null;
-    return new Future<InstanceMirror>.value(
-        _convertConstantToInstanceMirror(mirrors, _constant.values[index]));
+    return _convertConstantToInstanceMirror(mirrors, _constant.values[index]);
   }
 }
 
@@ -1704,11 +1634,10 @@
     return _fieldMapCache;
   }
 
-  Future<InstanceMirror> getField(String fieldName) {
+  InstanceMirror getField(String fieldName) {
     Constant fieldConstant = _fieldMap[fieldName];
     if (fieldConstant != null) {
-      return new Future<InstanceMirror>.value(
-          _convertConstantToInstanceMirror(mirrors, fieldConstant));
+      return _convertConstantToInstanceMirror(mirrors, fieldConstant);
     }
     return super.getField(fieldName);
   }
@@ -1741,16 +1670,13 @@
     throw new UnsupportedError('InstanceMirror does not have a reflectee');
   }
 
-  Future<InstanceMirror> getField(String fieldName) {
+  InstanceMirror getField(String fieldName) {
     if (fieldName == 'isDocComment') {
-      return new Future.value(
-          new Dart2JsBoolConstantMirror.fromBool(mirrors, isDocComment));
+      return new Dart2JsBoolConstantMirror.fromBool(mirrors, isDocComment);
     } else if (fieldName == 'text') {
-      return new Future.value(
-          new Dart2JsStringConstantMirror.fromString(mirrors, text));
+      return new Dart2JsStringConstantMirror.fromString(mirrors, text);
     } else if (fieldName == 'trimmedText') {
-      return new Future.value(
-          new Dart2JsStringConstantMirror.fromString(mirrors, trimmedText));
+      return new Dart2JsStringConstantMirror.fromString(mirrors, trimmedText);
     }
     // TODO(johnniwinther): Which exception/error should be thrown here?
     throw new UnsupportedError('InstanceMirror does not have a reflectee');
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
index dd8c70f..1af5f14 100644
--- a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
@@ -7,9 +7,6 @@
 import 'dart:async';
 import 'dart:uri';
 
-// TODO(rnystrom): Use "package:" URL (#4968).
-import 'dart2js_mirror.dart';
-
 /**
  * The main interface for the whole mirror system.
  */
@@ -17,8 +14,16 @@
   /**
    * Returns an unmodifiable map of all libraries in this mirror system.
    */
-  // TODO(johnniwinther): Change to Map<Uri, LibraryMirror>.
-  Map<String, LibraryMirror> get libraries;
+  Map<Uri, LibraryMirror> get libraries;
+
+  /**
+   * Returns an iterable of all libraries in the mirror system whose library
+   * name is [libraryName].
+   */
+  Iterable<LibraryMirror> findLibrary(String libraryName) {
+    return libraries.values.where(
+        (library) => library.simpleName == libraryName);
+  }
 
   /**
    * A mirror on the [:dynamic:] type.
@@ -117,7 +122,7 @@
    * can be the implicit getter for a field or a user-defined getter
    * method.
    */
-  Future<InstanceMirror> getField(String fieldName);
+  InstanceMirror getField(String fieldName);
 }
 
 /**
@@ -158,7 +163,15 @@
  * Specialized [InstanceMirror] used for reflection on constant lists.
  */
 abstract class ListInstanceMirror implements InstanceMirror {
-  Future<InstanceMirror> operator[](int index);
+  /**
+   * Returns an instance mirror of the value at [index] or throws a [RangeError]
+   * if the [index] is out of bounds.
+   */
+  InstanceMirror operator[](int index);
+
+  /**
+   * The number of elements in the list.
+   */
   int get length;
 }
 
@@ -172,10 +185,10 @@
   Iterable<String> get keys;
 
   /**
-   * Returns a future on the instance mirror of the value for the given key or
+   * Returns an instance mirror of the value for the given key or
    * null if key is not in the map.
    */
-  Future<InstanceMirror> operator[](String key);
+  InstanceMirror operator[](String key);
 
   /**
    * The number of {key, value} pairs in the map.
diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart
index 26abc95..9c521a2 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -489,6 +489,7 @@
       || libraryName == 'dart:html_common'
       || libraryName == 'dart:indexed_db'
       || libraryName == 'dart:svg'
+      || libraryName == 'dart:typed_data'
       || libraryName == 'dart:web_audio'
       || libraryName == 'dart:web_gl'
       || libraryName == 'dart:web_sql') {
@@ -509,19 +510,22 @@
  * declared return type, and a callback argument may be called with instances of
  * the callback parameter type (e.g. Event).
  *
- * If there is one or more @Creates annotations, the union of the named types
+ * If there is one or more `@Creates` annotations, the union of the named types
  * replaces the inferred instantiated type, and the return type is ignored for
  * the purpose of inferring instantiated types.
  *
- *     @Creates(IDBCursor)    // Created asynchronously.
- *     @Creates(IDBRequest)   // Created synchronously (for return value).
- *     IDBRequest request = objectStore.openCursor();
+ *     @Creates('IDBCursor')    // Created asynchronously.
+ *     @Creates('IDBRequest')   // Created synchronously (for return value).
+ *     IDBRequest openCursor();
  *
- * If there is one or more @Returns annotations, the union of the named types
+ * If there is one or more `@Returns` annotations, the union of the named types
  * replaces the declared return type.
  *
- *     @Returns(IDBRequest)
- *     IDBRequest request = objectStore.openCursor();
+ *     @Returns('IDBRequest')
+ *     IDBRequest openCursor();
+ *
+ * Types in annotations are non-nullable, so include `@Returns('Null')` if
+ * `null` may be returned.
  */
 class NativeBehavior {
 
@@ -581,6 +585,10 @@
     FunctionType type = method.computeType(compiler);
     var behavior = new NativeBehavior();
     behavior.typesReturned.add(type.returnType);
+    if (!type.returnType.isVoid) {
+      // Declared types are nullable.
+      behavior.typesReturned.add(compiler.nullClass.computeType(compiler));
+    }
     behavior._capture(type, compiler);
 
     // TODO(sra): Optional arguments are currently missing from the
@@ -599,6 +607,8 @@
     DartType type = field.computeType(compiler);
     var behavior = new NativeBehavior();
     behavior.typesReturned.add(type);
+    // Declared types are nullable.
+    behavior.typesReturned.add(compiler.nullClass.computeType(compiler));
     behavior._capture(type, compiler);
     behavior._overrideWithAnnotations(field, compiler);
     return behavior;
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index c890123..8043517 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -143,8 +143,7 @@
         return null;
       } else if (element.isTypedef()) {
         TypedefElement typdef = element;
-        resolveTypedef(typdef);
-        return null;
+        return resolveTypedef(typdef);
       } else if (element.isTypeVariable()) {
         element.computeType(compiler);
         return null;
@@ -435,6 +434,9 @@
         // TODO(ngeoffray): We could do better here by using the
         // constant handler to figure out if it's a lazy field or not.
         compiler.backend.registerLazyField(visitor.mapping);
+      } else {
+        compiler.enqueuer.resolution.registerInstantiatedClass(
+            compiler.nullClass, visitor.mapping);
       }
     }
 
@@ -519,7 +521,9 @@
   void resolveClass(ClassElement element) {
     ClassElement previousResolvedClass = currentlyResolvedClass;
     currentlyResolvedClass = element;
-    resolveClassInternal(element);
+    // TODO(johnniwinther): Store the mapping in the resolution enqueuer.
+    TreeElementMapping mapping = new TreeElementMapping(element);
+    resolveClassInternal(element, mapping);
     if (previousResolvedClass == null) {
       while (!pendingClassesToBeResolved.isEmpty) {
         pendingClassesToBeResolved.removeFirst().ensureResolved(compiler);
@@ -536,7 +540,7 @@
     }
   }
 
-  void resolveClassInternal(ClassElement element) {
+  void resolveClassInternal(ClassElement element, TreeElementMapping mapping) {
     if (!element.isPatch) {
       compiler.withCurrentElement(element, () => measure(() {
         assert(element.resolutionState == STATE_NOT_STARTED);
@@ -545,7 +549,7 @@
         loadSupertypes(element, tree);
 
         ClassResolverVisitor visitor =
-            new ClassResolverVisitor(compiler, element);
+            new ClassResolverVisitor(compiler, element, mapping);
         visitor.visit(tree);
         element.resolutionState = STATE_DONE;
         compiler.onClassResolved(element);
@@ -905,19 +909,20 @@
       compiler, node.parameters, node.returnType, element));
   }
 
-  void resolveTypedef(TypedefElement element) {
-    if (element.isResolved || element.isBeingResolved) return;
-    element.isBeingResolved = true;
+  TreeElements resolveTypedef(TypedefElementX element) {
+    if (element.isResolved) return element.mapping;
+    TreeElementMapping mapping = new TreeElementMapping(element);
+    // TODO(johnniwinther): Store the mapping in the resolution enqueuer.
+    element.mapping = mapping;
     return compiler.withCurrentElement(element, () {
       measure(() {
         Typedef node =
           compiler.parser.measure(() => element.parseNode(compiler));
         TypedefResolverVisitor visitor =
-          new TypedefResolverVisitor(compiler, element);
+          new TypedefResolverVisitor(compiler, element, mapping);
         visitor.visit(node);
 
-        element.isBeingResolved = false;
-        element.isResolved = true;
+        return mapping;
       });
     });
   }
@@ -1412,27 +1417,18 @@
   // TODO(johnniwinther): Change  [onFailure] and [whenResolved] to use boolean
   // flags instead of closures.
   DartType resolveTypeAnnotation(
+      MappingVisitor visitor,
       TypeAnnotation node,
-      Scope scope,
-      Element enclosingElement,
-      {onFailure(Node node, MessageKind kind, [Map arguments]),
-       whenResolved(Node node, DartType type)}) {
+      {onFailure(Node node, MessageKind kind, [Map arguments])}) {
     if (onFailure == null) {
       onFailure = (n, k, [arguments]) {};
     }
-    if (whenResolved == null) {
-      whenResolved = (n, t) {};
-    }
-    if (scope == null) {
-      compiler.internalError('resolveTypeAnnotation: no scope specified');
-    }
-    return resolveTypeAnnotationInContext(scope, node, enclosingElement,
-        onFailure, whenResolved);
+    return resolveTypeAnnotationInContext(visitor, node, onFailure);
   }
 
-  DartType resolveTypeAnnotationInContext(Scope scope, TypeAnnotation node,
-                                          Element enclosingElement,
-                                          onFailure, whenResolved) {
+  DartType resolveTypeAnnotationInContext(MappingVisitor visitor,
+                                          TypeAnnotation node,
+                                          onFailure) {
     Identifier typeName;
     SourceString prefixName;
     Send send = node.typeName.asSend();
@@ -1444,30 +1440,31 @@
       typeName = node.typeName.asIdentifier();
     }
 
-    Element element = resolveTypeName(scope, prefixName, typeName);
+    Element element = resolveTypeName(visitor.scope, prefixName, typeName);
     DartType type;
 
     DartType reportFailureAndCreateType(MessageKind messageKind,
                                         Map messageArguments) {
       onFailure(node, messageKind, messageArguments);
       var erroneousElement = new ErroneousElementX(
-          messageKind, messageArguments, typeName.source, enclosingElement);
+          messageKind, messageArguments, typeName.source,
+          visitor.enclosingElement);
       var arguments = new LinkBuilder<DartType>();
       resolveTypeArguments(
-          node, null, enclosingElement,
-          scope, onFailure, whenResolved, arguments);
+          visitor, node, null,
+          onFailure, arguments);
       return new MalformedType(erroneousElement, null, arguments.toLink());
     }
 
     DartType checkNoTypeArguments(DartType type) {
       var arguments = new LinkBuilder<DartType>();
       bool hashTypeArgumentMismatch = resolveTypeArguments(
-          node, const Link<DartType>(), enclosingElement,
-          scope, onFailure, whenResolved, arguments);
+          visitor, node, const Link<DartType>(),
+          onFailure, arguments);
       if (hashTypeArgumentMismatch) {
         type = new MalformedType(
             new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH,
-                {'type': node}, typeName.source, enclosingElement),
+                {'type': node}, typeName.source, visitor.enclosingElement),
                 type, arguments.toLink());
       }
       return type;
@@ -1493,12 +1490,12 @@
         element.computeType(compiler);
         var arguments = new LinkBuilder<DartType>();
         bool hashTypeArgumentMismatch = resolveTypeArguments(
-            node, cls.typeVariables, enclosingElement,
-            scope, onFailure, whenResolved, arguments);
+            visitor, node, cls.typeVariables,
+            onFailure, arguments);
         if (hashTypeArgumentMismatch) {
           type = new MalformedType(
               new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH,
-                  {'type': node}, typeName.source, enclosingElement),
+                  {'type': node}, typeName.source, visitor.enclosingElement),
               new InterfaceType.userProvidedBadType(cls.declaration,
                                                     arguments.toLink()));
         } else {
@@ -1514,12 +1511,12 @@
         compiler.resolveTypedef(typdef);
         var arguments = new LinkBuilder<DartType>();
         bool hashTypeArgumentMismatch = resolveTypeArguments(
-            node, typdef.typeVariables, enclosingElement,
-            scope, onFailure, whenResolved, arguments);
+            visitor, node, typdef.typeVariables,
+            onFailure, arguments);
         if (hashTypeArgumentMismatch) {
           type = new MalformedType(
               new ErroneousElementX(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH,
-                  {'type': node}, typeName.source, enclosingElement),
+                  {'type': node}, typeName.source, visitor.enclosingElement),
               new TypedefType.userProvidedBadType(typdef, arguments.toLink()));
         } else {
           if (arguments.isEmpty) {
@@ -1529,15 +1526,15 @@
           }
         }
       } else if (element.isTypeVariable()) {
-        Element outer = enclosingElement.getOutermostEnclosingMemberOrTopLevel();
-        bool isInFactoryConstructor = outer != null && outer.isFactoryConstructor();
-        if (!outer.isClass()
-	    && !outer.isTypedef()
-            && !isInFactoryConstructor
-            && Elements.isInStaticContext(enclosingElement)) {
-          compiler.backend.registerThrowRuntimeError(
-              // TODO(ahe): Get the TreeElements for the current element.
-              compiler.globalDependencies);
+        Element outer =
+            visitor.enclosingElement.getOutermostEnclosingMemberOrTopLevel();
+        bool isInFactoryConstructor =
+            outer != null && outer.isFactoryConstructor();
+        if (!outer.isClass() &&
+            !outer.isTypedef() &&
+            !isInFactoryConstructor &&
+            Elements.isInStaticContext(visitor.enclosingElement)) {
+          compiler.backend.registerThrowRuntimeError(visitor.mapping);
           compiler.reportWarning(node,
               MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER.message(
                   {'typeVariableName': node}));
@@ -1545,7 +1542,7 @@
               new ErroneousElementX(
                   MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
                   {'typeVariableName': node},
-                  typeName.source, enclosingElement),
+                  typeName.source, visitor.enclosingElement),
                   element.computeType(compiler));
         } else {
           type = element.computeType(compiler);
@@ -1556,7 +1553,7 @@
                         node: node);
       }
     }
-    whenResolved(node, type);
+    visitor.useType(node, type);
     return type;
   }
 
@@ -1567,11 +1564,10 @@
    * number of type variables.
    */
   bool resolveTypeArguments(
+      MappingVisitor visitor,
       TypeAnnotation node,
       Link<DartType> typeVariables,
-      Element enclosingElement,
-      Scope scope,
-      onFailure, whenResolved,
+      onFailure,
       LinkBuilder<DartType> arguments) {
     if (node.typeArguments == null) {
       return false;
@@ -1584,11 +1580,9 @@
         onFailure(typeArguments.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT);
         typeArgumentCountMismatch = true;
       }
-      DartType argType = resolveTypeAnnotationInContext(scope,
+      DartType argType = resolveTypeAnnotationInContext(visitor,
                                                         typeArguments.head,
-                                                        enclosingElement,
-                                                        onFailure,
-                                                        whenResolved);
+                                                        onFailure);
       arguments.addLast(argType);
       if (typeVariables != null && !typeVariables.isEmpty) {
         typeVariables = typeVariables.tail;
@@ -1603,15 +1597,48 @@
 }
 
 /**
+ * Common supertype for resolver visitors that record resolutions in a
+ * [TreeElements] mapping.
+ */
+abstract class MappingVisitor<T> extends CommonResolverVisitor<T> {
+  final TreeElementMapping mapping;
+  final TypeResolver typeResolver;
+  /// The current enclosing element for the visited AST nodes.
+  Element get enclosingElement;
+  /// The current scope of the visitor.
+  Scope get scope;
+
+  MappingVisitor(Compiler compiler, TreeElementMapping this.mapping)
+      : typeResolver = new TypeResolver(compiler),
+        super(compiler);
+
+  Element useElement(Node node, Element element) {
+    if (element == null) return null;
+    return mapping[node] = element;
+  }
+
+  DartType useType(TypeAnnotation annotation, DartType type) {
+    if (type != null) {
+      mapping.setType(annotation, type);
+      useElement(annotation, type.element);
+    }
+    return type;
+  }
+}
+
+/**
  * Core implementation of resolution.
  *
  * Do not subclass or instantiate this class outside this library
  * except for testing.
  */
-class ResolverVisitor extends CommonResolverVisitor<Element> {
-  final TreeElementMapping mapping;
+class ResolverVisitor extends MappingVisitor<Element> {
+  /**
+   * The current enclosing element for the visited AST nodes.
+   *
+   * This field is updated when nested closures are visited.
+   */
   Element enclosingElement;
-  final TypeResolver typeResolver;
   bool inInstanceContext;
   bool inCheckContext;
   bool inCatchBlock;
@@ -1649,7 +1676,9 @@
                  r'\|'
                  r')$');
 
-  ResolverVisitor(Compiler compiler, Element element, this.mapping)
+  ResolverVisitor(Compiler compiler,
+                  Element element,
+                  TreeElementMapping mapping)
     : this.enclosingElement = element,
       // When the element is a field, we are actually resolving its
       // initial value, which should not have access to instance
@@ -1659,7 +1688,6 @@
       this.currentClass = element.isMember() ? element.getEnclosingClass()
                                              : null,
       this.statementScope = new StatementScope(),
-      typeResolver = new TypeResolver(compiler),
       scope = element.buildScope(),
       // The type annotations on a typedef do not imply type checks.
       // TODO(karlklose): clean this up (dartbug.com/8870).
@@ -1668,7 +1696,7 @@
           (element.enclosingElement == null ||
            !element.enclosingElement.isTypedef()),
       inCatchBlock = false,
-      super(compiler);
+      super(compiler, mapping);
 
   ResolutionEnqueuer get world => compiler.enqueuer.resolution;
 
@@ -1796,19 +1824,6 @@
     return element;
   }
 
-  Element useElement(Node node, Element element) {
-    if (element == null) return null;
-    return mapping[node] = element;
-  }
-
-  DartType useType(TypeAnnotation annotation, DartType type) {
-    if (type != null) {
-      mapping.setType(annotation, type);
-      useElement(annotation, type.element);
-    }
-    return type;
-  }
-
   bool isNamedConstructor(Send node) => node.receiver != null;
 
   Selector getRedirectingThisOrSuperConstructorSelector(Send node) {
@@ -2440,6 +2455,12 @@
     unimplemented(node, 'operator');
   }
 
+  visitRethrow(Rethrow node) {
+    if (!inCatchBlock) {
+      error(node, MessageKind.THROW_WITHOUT_EXPRESSION);
+    }
+  }
+
   visitReturn(Return node) {
     if (node.isRedirectingFactoryBody) {
       handleRedirectingFactoryBody(node);
@@ -2492,12 +2513,9 @@
   }
 
   visitThrow(Throw node) {
-    if (!inCatchBlock && node.expression == null) {
-      error(node, MessageKind.THROW_WITHOUT_EXPRESSION);
-    }
-    // We don't know ahead of time whether we will need the throw in a statement
-    // context or an expression context, so we register both here, even though
-    // we may not need ThrowExpression.
+    // We don't know ahead of time whether we will need the throw in a
+    // statement context or an expression context, so we register both
+    // here, even though we may not need ThrowExpression.
     compiler.backend.registerWrapException(mapping);
     compiler.backend.registerThrowExpression(mapping);
     visit(node.expression);
@@ -2639,8 +2657,7 @@
   DartType resolveTypeAnnotation(TypeAnnotation node) {
     Function report = typeRequired ? error : warning;
     DartType type = typeResolver.resolveTypeAnnotation(
-        node, scope, enclosingElement,
-        onFailure: report, whenResolved: useType);
+        this, node, onFailure: report);
     if (type == null) return null;
     if (inCheckContext) {
       compiler.enqueuer.resolution.registerIsCheck(type, mapping);
@@ -3053,16 +3070,17 @@
   }
 }
 
-class TypeDefinitionVisitor extends CommonResolverVisitor<DartType> {
+class TypeDefinitionVisitor extends MappingVisitor<DartType> {
   Scope scope;
-  TypeDeclarationElement element;
-  TypeResolver typeResolver;
+  final TypeDeclarationElement enclosingElement;
+  TypeDeclarationElement get element => enclosingElement;
 
-  TypeDefinitionVisitor(Compiler compiler, TypeDeclarationElement element)
-      : this.element = element,
+  TypeDefinitionVisitor(Compiler compiler,
+                        TypeDeclarationElement element,
+                        TreeElementMapping mapping)
+      : this.enclosingElement = element,
         scope = Scope.buildEnclosingScope(element),
-        typeResolver = new TypeResolver(compiler),
-        super(compiler);
+        super(compiler, mapping);
 
   void resolveTypeVariableBounds(NodeList node) {
     if (node == null) return;
@@ -3084,7 +3102,7 @@
       TypeVariableElement variableElement = typeVariable.element;
       if (typeNode.bound != null) {
         DartType boundType = typeResolver.resolveTypeAnnotation(
-            typeNode.bound, scope, element, onFailure: warning);
+            this, typeNode.bound, onFailure: warning);
         variableElement.bound = boundType;
 
         void checkTypeVariableBound() {
@@ -3120,10 +3138,12 @@
 }
 
 class TypedefResolverVisitor extends TypeDefinitionVisitor {
-  TypedefElement get element => super.element;
+  TypedefElement get element => enclosingElement;
 
-  TypedefResolverVisitor(Compiler compiler, TypedefElement typedefElement)
-      : super(compiler, typedefElement);
+  TypedefResolverVisitor(Compiler compiler,
+                         TypedefElement typedefElement,
+                         TreeElementMapping mapping)
+      : super(compiler, typedefElement, mapping);
 
   visitTypedef(Typedef node) {
     TypedefType type = element.computeType(compiler);
@@ -3153,10 +3173,12 @@
  * types.
  */
 class ClassResolverVisitor extends TypeDefinitionVisitor {
-  ClassElement get element => super.element;
+  ClassElement get element => enclosingElement;
 
-  ClassResolverVisitor(Compiler compiler, ClassElement classElement)
-    : super(compiler, classElement);
+  ClassResolverVisitor(Compiler compiler,
+                       ClassElement classElement,
+                       TreeElementMapping mapping)
+    : super(compiler, classElement, mapping);
 
   DartType visitClassNode(ClassNode node) {
     compiler.ensure(element != null);
@@ -3185,17 +3207,23 @@
         element.supertype = resolveSupertype(element, node.superclass);
       }
     }
-
-    // If the super type isn't specified, we make it Object.
-    final objectElement = compiler.objectClass;
-    if (!identical(element, objectElement) && element.supertype == null) {
-      if (objectElement == null) {
-        compiler.internalError("Internal error: cannot resolve Object",
-                               node: node);
-      } else {
-        objectElement.ensureResolved(compiler);
+    // If the super type isn't specified, we provide a default.  The language
+    // specifies [Object] but the backend can pick a specific 'implementation'
+    // of Object - the JavaScript backend chooses between Object and
+    // Interceptor.
+    if (element.supertype == null) {
+      ClassElement superElement = compiler.backend.defaultSuperclass(element);
+      // Avoid making the superclass (usually Object) extend itself.
+      if (element != superElement) {
+        if (superElement == null) {
+          compiler.internalError(
+              "Cannot resolve default superclass for $element",
+              node: node);
+        } else {
+          superElement.ensureResolved(compiler);
+        }
+        element.supertype = superElement.computeType(compiler);
       }
-      element.supertype = objectElement.computeType(compiler);
     }
 
     assert(element.interfaces == null);
@@ -3303,7 +3331,8 @@
   }
 
   DartType resolveType(TypeAnnotation node) {
-    return typeResolver.resolveTypeAnnotation(node, scope, element);
+    // TODO(johnniwinther): Report errors/warnings on resolution failures.
+    return typeResolver.resolveTypeAnnotation(this, node);
   }
 
   // TODO(johnniwinther): Remove when default class is no longer supported.
@@ -3354,7 +3383,7 @@
 
   DartType resolveSupertype(ClassElement cls, TypeAnnotation superclass) {
     DartType supertype = typeResolver.resolveTypeAnnotation(
-        superclass, scope, cls, onFailure: error);
+        this, superclass, onFailure: error);
     if (supertype != null) {
       if (identical(supertype.kind, TypeKind.MALFORMED_TYPE)) {
         // Error has already been reported.
@@ -3376,7 +3405,7 @@
     if (interfaces == null) return result;
     for (Link<Node> link = interfaces.nodes; !link.isEmpty; link = link.tail) {
       DartType interfaceType = typeResolver.resolveTypeAnnotation(
-          link.head, scope, element, onFailure: error);
+          this, link.head, onFailure: error);
       if (interfaceType != null) {
         if (identical(interfaceType.kind, TypeKind.MALFORMED_TYPE)) {
           // Error has already been reported.
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart b/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart
index d7f2ddf..1b3b927 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/resolution.dart
@@ -20,7 +20,8 @@
          FunctionSignatureX,
          LabelElementX,
          TargetElementX,
-         MixinApplicationElementX;
+         MixinApplicationElementX,
+         TypedefElementX;
 import '../util/util.dart';
 import '../scanner/scannerlib.dart' show PartialMetadataAnnotation;
 
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart b/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
index 262a64b..9138e0f 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
@@ -28,6 +28,7 @@
       const Keyword("in"),
       const Keyword("new"),
       const Keyword("null"),
+      const Keyword("rethrow"),
       const Keyword("return"),
       const Keyword("super"),
       const Keyword("switch"),
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/listener.dart b/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
index e535f62..6e83386 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
@@ -339,10 +339,13 @@
   void endSwitchBlock(int caseCount, Token beginToken, Token endToken) {
   }
 
-  void beginThrowStatement(Token token) {
+  void beginThrowExpression(Token token) {
   }
 
-  void endThrowStatement(Token throwToken, Token endToken) {
+  void endThrowExpression(Token throwToken, Token endToken) {
+  }
+
+  void beginRethrowStatement(Token token) {
   }
 
   void endRethrowStatement(Token throwToken, Token endToken) {
@@ -1580,13 +1583,16 @@
     pushNode(new Block(makeNodeList(count, beginToken, endToken, null)));
   }
 
-  void endThrowStatement(Token throwToken, Token endToken) {
+  void endThrowExpression(Token throwToken, Token endToken) {
     Expression expression = popNode();
     pushNode(new Throw(expression, throwToken, endToken));
   }
 
   void endRethrowStatement(Token throwToken, Token endToken) {
-    pushNode(new Throw(null, throwToken, endToken));
+    pushNode(new Rethrow(throwToken, endToken));
+    if (identical(throwToken.stringValue, 'throw')) {
+      listener.onDeprecatedFeature(throwToken, 'throw without an expression');
+    }
   }
 
   void handleUnaryPrefixExpression(Token token) {
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
index c2469c3..fc740d6 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
@@ -1197,8 +1197,11 @@
       return parseIfStatement(token);
     } else if (identical(value, 'for')) {
       return parseForStatement(token);
-    } else if (identical(value, 'throw')) {
-      return parseThrowStatement(token);
+    } else if (identical(value, 'rethrow')) {
+      return parseRethrowStatement(token);
+    } else if (identical(value, 'throw') && optional(';', token.next)) {
+      // TODO(kasperl): Stop dealing with throw here.
+      return parseRethrowStatement(token);
     } else if (identical(value, 'void')) {
       return parseExpressionStatementOrDeclaration(token);
     } else if (identical(value, 'while')) {
@@ -1351,11 +1354,15 @@
   }
 
   Token parseExpression(Token token) {
-    return parsePrecedenceExpression(token, ASSIGNMENT_PRECEDENCE, true);
+    return optional('throw', token)
+        ? parseThrowExpression(token, true)
+        : parsePrecedenceExpression(token, ASSIGNMENT_PRECEDENCE, true);
   }
 
   Token parseExpressionWithoutCascade(Token token) {
-    return parsePrecedenceExpression(token, ASSIGNMENT_PRECEDENCE, false);
+    return optional('throw', token)
+        ? parseThrowExpression(token, false)
+        : parsePrecedenceExpression(token, ASSIGNMENT_PRECEDENCE, false);
   }
 
   Token parseConditionalExpressionRest(Token token) {
@@ -2035,18 +2042,28 @@
     return expect('}', token);
   }
 
-  Token parseThrowStatement(Token token) {
+  Token parseThrowExpression(Token token, bool allowCascades) {
     Token throwToken = token;
-    listener.beginThrowStatement(throwToken);
+    listener.beginThrowExpression(throwToken);
     token = expect('throw', token);
-    if (optional(';', token)) {
-      listener.endRethrowStatement(throwToken, token);
-      return token.next;
+    token = allowCascades
+        ? parseExpression(token)
+        : parseExpressionWithoutCascade(token);
+    listener.endThrowExpression(throwToken, token);
+    return token;
+  }
+
+  Token parseRethrowStatement(Token token) {
+    Token throwToken = token;
+    listener.beginRethrowStatement(throwToken);
+    // TODO(kasperl): Disallow throw here.
+    if (identical(throwToken.stringValue, 'throw')) {
+      token = expect('throw', token);
     } else {
-      token = parseExpression(token);
-      listener.endThrowStatement(throwToken, token);
-      return expectSemicolon(token);
+      token = expect('rethrow', token);
     }
+    listener.endRethrowStatement(throwToken, token);
+    return expectSemicolon(token);
   }
 
   Token parseTryStatement(Token token) {
diff --git a/sdk/lib/_internal/compiler/implementation/source_file_provider.dart b/sdk/lib/_internal/compiler/implementation/source_file_provider.dart
index b75ba4a..70659e0 100644
--- a/sdk/lib/_internal/compiler/implementation/source_file_provider.dart
+++ b/sdk/lib/_internal/compiler/implementation/source_file_provider.dart
@@ -27,7 +27,7 @@
 
 class SourceFileProvider {
   bool isWindows = (Platform.operatingSystem == 'windows');
-  Uri cwd = getCurrentDirectory();
+  Uri cwd = currentDirectory;
   Map<String, SourceFile> sourceFiles = <String, SourceFile>{};
   int dartCharactersRead = 0;
 
@@ -43,8 +43,8 @@
             '(${ex.osError}).';
     }
     dartCharactersRead += source.length;
-    sourceFiles[resourceUri.toString()] =
-      new SourceFile(relativize(cwd, resourceUri, isWindows), source);
+    sourceFiles[resourceUri.toString()] = new SourceFile(
+        relativize(cwd, resourceUri, isWindows), source);
     return new Future.value(source);
   }
 }
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/bailout.dart b/sdk/lib/_internal/compiler/implementation/ssa/bailout.dart
index e664654..a60e697 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/bailout.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/bailout.dart
@@ -67,6 +67,7 @@
   final CodegenWorkItem work;
   bool calledInLoop = false;
   bool isRecursiveMethod = false;
+  bool hasInsertedChecks = false;
   int stateId = 1;
   Map<HInstruction, HType> savedTypes = new Map<HInstruction, HType>();
 
@@ -113,6 +114,22 @@
 
   bool get hasTypeGuards => work.guards.length != 0;
 
+  bool isUsedWithIncompatibleSelector(HInstruction instruction,
+                                      HType speculativeType) {
+    for (HInstruction user in instruction.usedBy) {
+      if (user is HCheck
+          && isUsedWithIncompatibleSelector(user, speculativeType)) {
+        return true;
+      } else if (user.selector != null
+                 && user.getDartReceiver(compiler) == instruction
+                 && !speculativeType.computeMask(compiler).willHit(
+                        user.selector, compiler)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
   bool typeGuardWouldBeValuable(HInstruction instruction,
                                 HType speculativeType) {
     // If the type itself is not valuable, do not generate a guard for it.
@@ -133,6 +150,12 @@
       }
     }
 
+    // Do not insert a type guard if one of the calls on it will hit
+    // [NoSuchMethodError].
+    if (isUsedWithIncompatibleSelector(instruction, speculativeType)) {
+      return false;
+    }
+
     // Insert type guards for recursive methods.
     if (isRecursiveMethod) return true;
 
@@ -190,6 +213,30 @@
     return calledInLoop;
   }
 
+  // Returns whether an invocation of [selector] on [receiver] will throw a
+  // [ArgumentError] if the argument is not of the right type.
+  bool willThrowArgumentError(Selector selector, HInstruction receiver) {
+    if (receiver != null && (receiver.isInteger() || receiver.isString())) {
+      return selector.isOperator() && selector.name != const SourceString('==');
+    }
+    return false;
+  }
+
+  // Returns whether an invocation of [selector] will throw a
+  // [NoSuchMethodError] if the receiver is not of the type
+  // [speculativeType].
+  bool willThrowNoSuchMethodErrorIfNot(Selector selector,
+                                       HType speculativeType) {
+    return compiler.world.hasSingleMatch(selector)
+        // In some cases, we want the receiver to be an integer,
+        // but that does not mean we will get a NoSuchMethodError
+        // if it's not: the receiver could be a double.
+        && !speculativeType.isInteger()
+        // We speculate on the [operator==] instruction, but we know it
+        // will never throw a [NoSuchMethodError].
+        && selector.name != const SourceString('==');
+  }
+
   bool shouldInsertTypeGuard(HInstruction instruction, HType speculativeType) {
     if (!speculativeType.isUseful()) return false;
     // If the types agree we don't need to check.
@@ -199,12 +246,77 @@
     return typeGuardWouldBeValuable(instruction, speculativeType);
   }
 
+  HInstruction computeFirstDominatingUserWithSelector(
+      HInstruction instruction) {
+    // TODO(ngeoffray): We currently only look at the instruction's
+    // block, so that we know it will be executed. We should lift this
+    // limitation.
+
+    // For a parameter, we look at the first block that contains
+    // user instructions.
+    HBasicBlock userMustBeInBlock = instruction is HParameterValue
+        ? instruction.block.successors[0]
+        : instruction.block;
+
+    HInstruction firstUser;
+    for (HInstruction user in instruction.usedBy) {
+      if (user.block == userMustBeInBlock && user.selector != null) {
+        if (firstUser == null || user.dominates(firstUser)) {
+          firstUser = user;
+        }
+      }
+    }
+    return firstUser;
+  }
+
+  /**
+   * Tries to insert a type conversion instruction for [instruction]
+   * instead of a type guard if we know an user will throw. Returns
+   * whether it succeeded at adding a type conversion instruction.
+   */
+  bool tryTypeConversion(HInstruction instruction, HType speculativeType) {
+    HInstruction firstUser =
+        computeFirstDominatingUserWithSelector(instruction);
+    if (firstUser == null) return false;
+
+    // If we have found a user with a selector, we find out if it
+    // will throw [NoSuchMethodError] or [ArgumentError].
+    Selector selector = firstUser.selector;
+    Selector receiverSelectorOnThrow = null;
+    HInstruction receiver = firstUser.getDartReceiver(compiler);
+    bool willThrow = false;
+    if (receiver == instruction) {
+      if (willThrowNoSuchMethodErrorIfNot(selector, speculativeType)) {
+        receiverSelectorOnThrow = selector;
+        willThrow = true;
+      }
+    } else if (willThrowArgumentError(selector, receiver)) {
+      willThrow = true;
+    }
+
+    if (!willThrow) return false;
+
+    HTypeConversion check = new HTypeConversion(
+            null,
+            receiverSelectorOnThrow == null
+                ? HTypeConversion.ARGUMENT_TYPE_CHECK
+                : HTypeConversion.RECEIVER_TYPE_CHECK,
+            speculativeType,
+            instruction,
+            receiverSelectorOnThrow);
+    hasInsertedChecks = true;
+    firstUser.block.addBefore(firstUser, check);
+    instruction.replaceAllUsersDominatedBy(firstUser, check);
+    return true;
+  }
+
   bool updateType(HInstruction instruction) {
     bool hasChanged = super.updateType(instruction);
     HType speculativeType = savedTypes[instruction];
     if (speculativeType == null) return hasChanged;
 
-    if (shouldInsertTypeGuard(instruction, speculativeType)) {
+    if (shouldInsertTypeGuard(instruction, speculativeType)
+        && !tryTypeConversion(instruction, speculativeType)) {
       HInstruction insertionPoint;
       if (instruction is HPhi) {
         insertionPoint = instruction.block.first;
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 0da0ae4..6798c57 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -831,6 +831,16 @@
   final List<Element> sourceElementStack;
 
   Element get currentElement => sourceElementStack.last.declaration;
+  Element get currentNonClosureClass {
+    ClassElement cls = currentElement.getEnclosingClass();
+    if (cls != null && cls.isClosure()) {
+      var closureClass = cls;
+      return closureClass.methodElement.getEnclosingClass();
+    } else {
+      return cls;
+    }
+  }
+
   Compiler get compiler => builder.compiler;
   CodeEmitterTask get emitter => builder.emitter;
 
@@ -1039,15 +1049,28 @@
 
     if (isInstanceMember) {
       assert(providedArguments != null);
-      int argumentIndex = 1; // Skip receiver.
       compiledArguments.add(providedArguments[0]);
+      // [providedArguments] contains the arguments given in our
+      // internal order (see [addDynamicSendArgumentsToList]). So we
+      // call [Selector.addArgumentsToList] only for getting the
+      // default values of the optional parameters.
       succeeded = selector.addArgumentsToList(
           argumentsNodes,
           compiledArguments,
           function,
-          (node) => providedArguments[argumentIndex++],
+          (node) => null,
           handleConstantForOptionalParameter,
           compiler);
+      int argumentIndex = 1; // Skip receiver.
+      // [compiledArguments] now only contains the default values of
+      // the optional parameters that were not provided by
+      // [argumentsNodes]. So we iterate over [providedArguments] to fill
+      // in all the arguments.
+      for (int i = 1; i < compiledArguments.length; i++) {
+        if (compiledArguments[i] == null) {
+          compiledArguments[i] = providedArguments[argumentIndex++];
+        }
+      }
     } else {
       assert(providedArguments == null);
       succeeded = addStaticSendArgumentsToList(selector,
@@ -1063,14 +1086,20 @@
     // may have an impact on the state of the current method.
     InliningState state = new InliningState(
         function, returnElement, returnType, elements, stack, localsHandler);
-    localsHandler = new LocalsHandler.from(localsHandler);
+    LocalsHandler newLocalsHandler = new LocalsHandler.from(localsHandler);
+    newLocalsHandler.closureData =
+        compiler.closureToClassMapper.computeClosureToClassMapping(
+            function, function.parseNode(compiler), elements);
+    int argumentIndex = 0;
+    if (isInstanceMember) {
+      newLocalsHandler.updateLocal(newLocalsHandler.closureData.thisElement,
+                                   compiledArguments[argumentIndex++]);
+    }
 
     FunctionSignature signature = function.computeSignature(compiler);
-    int index = 0;
-    if (isInstanceMember) index++;
     signature.orderedForEachParameter((Element parameter) {
-      HInstruction argument = compiledArguments[index++];
-      localsHandler.updateLocal(parameter, argument);
+      HInstruction argument = compiledArguments[argumentIndex++];
+      newLocalsHandler.updateLocal(parameter, argument);
       potentiallyCheckType(argument, parameter.computeType(compiler));
     });
 
@@ -1083,12 +1112,12 @@
         type.typeArguments.forEach((DartType argument) {
           HInstruction instruction =
               analyzeTypeArgument(argument, currentNode);
-          localsHandler.updateLocal(typeVariable.head.element, instruction);
+          newLocalsHandler.updateLocal(typeVariable.head.element, instruction);
           typeVariable = typeVariable.tail;
         });
         while (!typeVariable.isEmpty) {
-          localsHandler.updateLocal(typeVariable.head.element,
-                                    graph.addConstantNull(constantSystem));
+          newLocalsHandler.updateLocal(typeVariable.head.element,
+                                       graph.addConstantNull(constantSystem));
           typeVariable = typeVariable.tail;
         }
       }
@@ -1098,13 +1127,14 @@
     returnElement = new ElementX(const SourceString("result"),
                                  ElementKind.VARIABLE,
                                  function);
-    localsHandler.updateLocal(returnElement,
-                              graph.addConstantNull(constantSystem));
+    newLocalsHandler.updateLocal(returnElement,
+                                 graph.addConstantNull(constantSystem));
     elements = compiler.enqueuer.resolution.getCachedElements(function);
     assert(elements != null);
     returnType = signature.returnType;
     stack = <HInstruction>[];
     inliningStack.add(state);
+    localsHandler = newLocalsHandler;
     return state;
   }
 
@@ -2464,7 +2494,10 @@
       if (value != null) {
         stack.add(graph.addConstant(value));
       } else if (element.isField() && isLazilyInitialized(element)) {
-        push(new HLazyStatic(element));
+        HInstruction instruction = new HLazyStatic(element);
+        instruction.instructionType =
+            new HType.inferredTypeForElement(element, compiler);
+        push(instruction);
       } else {
         if (element.isGetter()) {
           Selector selector = elements.getSelector(send);
@@ -2475,9 +2508,16 @@
         }
         // TODO(5346): Try to avoid the need for calling [declaration] before
         // creating an [HStatic].
-        push(new HStatic(element.declaration));
+        HInstruction instruction = new HStatic(element.declaration);
         if (element.isGetter()) {
-          push(new HInvokeStatic(<HInstruction>[pop()], HType.UNKNOWN));
+          add(instruction);
+          push(new HInvokeStatic(
+              <HInstruction>[instruction],
+              new HType.inferredReturnTypeForElement(element, compiler)));
+        } else {
+          instruction.instructionType =
+              new HType.inferredTypeForElement(element, compiler);
+          push(instruction);
         }
       }
     } else if (Elements.isInstanceSend(send, elements)) {
@@ -2873,18 +2913,42 @@
     inputs.add(receiver);
     addDynamicSendArgumentsToList(node, inputs);
 
-    // TODO(ngeoffray): Also inline for non-this sends. Currently, the
-    // inliner does not work when the receiver is not [:this:].
-    if (isThisSend(node)) {
-      HType receiverType = getTypeOfThis();
-      selector = receiverType.refine(selector, compiler);
-      Element element = compiler.world.locateSingleElement(selector);
-      // TODO(ngeoffray): If [element] is a getter, then this send is
-      // a closure send. We should teach that to [ResolvedVisitor].
-      if (inline && element != null && !element.isGetter()) {
-        if (tryInlineMethod(element, selector, node.arguments, inputs, node)) {
-          return;
-        }
+    // We prefer to not inline certain operations on indexables,
+    // because the constant folder will handle them better and turn
+    // them into simpler instructions that allow further
+    // optimizations.
+    bool isOptimizableOperationOnIndexable(Selector selector, Element element) {
+      bool isLength = selector.isGetter()
+          && selector.name == const SourceString("length");
+      if (isLength || selector.isIndex()) {
+        DartType classType = element.getEnclosingClass().computeType(compiler);
+        HType type = new HType.nonNullExact(classType, compiler);
+        return type.isIndexable(compiler);
+      } else if (selector.isIndexSet()) {
+        DartType classType = element.getEnclosingClass().computeType(compiler);
+        HType type = new HType.nonNullExact(classType, compiler);
+        return type.isMutableIndexable(compiler);
+      } else {
+        return false;
+      }
+    }
+
+    Element element = compiler.world.locateSingleElement(selector);
+    // TODO(ngeoffray): If [element] is a getter, then this send is
+    // a closure send. We should teach that to [ResolvedVisitor].
+    if (inline
+        && element != null
+        && !element.isGetter()
+        // This check is to ensure we don't regress compared to our
+        // previous limited inlining. We currently don't want to
+        // inline methods on intercepted classes because the
+        // optimizers apply their own optimizations on these methods.
+        && (!backend.interceptedClasses.contains(element.getEnclosingClass())
+            || isThisSend(node))
+        // Avoid inlining optimizable operations on indexables.
+        && !isOptimizableOperationOnIndexable(selector, element)) {
+      if (tryInlineMethod(element, selector, node.arguments, inputs, node)) {
+        return;
       }
     }
 
@@ -3142,7 +3206,7 @@
       inputs.add(self);
     }
     inputs.add(pop());
-    push(new HInvokeSuper(inputs));
+    push(new HInvokeSuper(currentNonClosureClass, inputs));
   }
 
   visitSend(Send node) {
@@ -3165,7 +3229,8 @@
     }
     List<HInstruction> inputs = buildSuperAccessorInputs(element);
     if (node.isPropertyAccess) {
-      HInstruction invokeSuper = new HInvokeSuper(inputs);
+      HInstruction invokeSuper =
+          new HInvokeSuper(currentNonClosureClass, inputs);
       invokeSuper.instructionType =
           new HType.inferredTypeForElement(element, compiler);
       push(invokeSuper);
@@ -3178,13 +3243,14 @@
       if (!succeeded) {
         generateWrongArgumentCountError(node, element, node.arguments);
       } else {
-        HInstruction invokeSuper = new HInvokeSuper(inputs);
+        HInstruction invokeSuper =
+            new HInvokeSuper(currentNonClosureClass, inputs);
         invokeSuper.instructionType =
             new HType.inferredReturnTypeForElement(element, compiler);
         push(invokeSuper);
       }
     } else {
-      HInstruction target = new HInvokeSuper(inputs);
+      HInstruction target = new HInvokeSuper(currentNonClosureClass, inputs);
       target.instructionType =
           new HType.inferredTypeForElement(element, compiler);
       add(target);
@@ -3328,7 +3394,7 @@
         ClassElement cls = element.getEnclosingClass();
         return new HType.nonNullExact(cls.thisType, compiler);
       } else {
-        return HType.UNKNOWN;
+        return new HType.inferredTypeForElement(originalElement, compiler);
       }
     }
 
@@ -3733,7 +3799,8 @@
               getterInputs);
           getterInstruction = pop();
         } else {
-          getterInstruction = new HInvokeSuper(getterInputs);
+          getterInstruction = new HInvokeSuper(
+              currentNonClosureClass, getterInputs);
           add(getterInstruction);
         }
         handleComplexOperatorSend(node, getterInstruction, arguments);
@@ -3750,7 +3817,8 @@
             node, elements.getSelector(node), setterInputs);
         pop();
       } else {
-        add(new HInvokeSuper(setterInputs, isSetter: true));
+        add(new HInvokeSuper(
+            currentNonClosureClass, setterInputs, isSetter: true));
       }
       stack.add(result);
     } else if (node.isIndex) {
@@ -3905,6 +3973,17 @@
     open(newBlock);
   }
 
+  visitRethrow(Rethrow node) {
+    HInstruction exception = rethrowableException;
+    if (exception == null) {
+      exception = graph.addConstantNull(constantSystem);
+      compiler.internalError(
+          'rethrowableException should not be null', node: node);
+    }
+    handleInTryStatement();
+    closeAndGotoExit(new HThrow(exception, isRethrow: true));
+  }
+
   visitReturn(Return node) {
     if (identical(node.getBeginToken().stringValue, 'native')) {
       native.handleSsaNative(this, node.expression);
@@ -3930,27 +4009,11 @@
   }
 
   visitThrow(Throw node) {
-    if (node.expression == null) {
-      HInstruction exception = rethrowableException;
-      if (exception == null) {
-        exception = graph.addConstantNull(constantSystem);
-        compiler.internalError(
-            'rethrowableException should not be null', node: node);
-      }
+    visit(node.expression);
+    if (isReachable) {
       handleInTryStatement();
-      closeAndGotoExit(new HThrow(exception, isRethrow: true));
-    } else {
-      visit(node.expression);
-      handleInTryStatement();
-      if (inliningStack.isEmpty) {
-        closeAndGotoExit(new HThrow(pop()));
-      } else if (isReachable) {
-        // We don't close the block when we are inlining, because we could be
-        // inside an expression, and it is rather complicated to close the
-        // block at an arbitrary place in an expression.
-        add(new HThrowExpression(pop()));
-        isReachable = false;
-      }
+      push(new HThrowExpression(pop()));
+      isReachable = false;
     }
   }
 
@@ -4920,9 +4983,15 @@
   }
 
   visitLoop(Node node) {
+    // It's actually not difficult to inline a method with a loop, but
+    // our measurements show that it's currently better to not inline a
+    // method that contains a loop.
+    tooDifficult = true;
+  }
+
+  void visitRethrow(Rethrow node) {
     if (!registerNode()) return;
-    node.visitChildren(this);
-    if (seenReturn) tooDifficult = true;
+    tooDifficult = true;
   }
 
   void visitReturn(Return node) {
@@ -4944,9 +5013,9 @@
 
   void visitThrow(Throw node) {
     if (!registerNode()) return;
-    // We can't inline rethrows and we don't want to handle throw after a return
-    // even if it is in an "if".
-    if (seenReturn || node.expression == null) tooDifficult = true;
+    // For now, we don't want to handle throw after a return even if
+    // it is in an "if".
+    if (seenReturn) tooDifficult = true;
   }
 }
 
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index dcfc9dc..0f48064 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1620,12 +1620,7 @@
     Element superMethod = node.element;
     Element superClass = superMethod.getEnclosingClass();
     if (superMethod.kind == ElementKind.FIELD) {
-      ClassElement currentClass = work.element.getEnclosingClass();
-      if (currentClass.isClosure()) {
-        ClosureClassElement closure = currentClass;
-        currentClass = closure.methodElement.getEnclosingClass();
-      }
-      String fieldName = currentClass.isShadowedByField(superMethod)
+      String fieldName = node.caller.isShadowedByField(superMethod)
           ? backend.namer.shadowedFieldName(superMethod)
           : backend.namer.instanceFieldName(superMethod);
       use(node.inputs[1]);
@@ -1653,7 +1648,7 @@
   visitFieldGet(HFieldGet node) {
     use(node.receiver);
     Element element = node.element;
-    if (element == backend.jsArrayLength || element == backend.jsStringLength) {
+    if (element == backend.jsIndexableLength) {
       // We're accessing a native JavaScript property called 'length'
       // on a JS String or a JS array. Therefore, the name of that
       // property should not be mangled.
@@ -1934,7 +1929,15 @@
       js.Expression over;
       if (node.staticChecks != HBoundsCheck.ALWAYS_ABOVE_ZERO) {
         use(node.index);
-        under = new js.Binary("<", pop(), new js.LiteralNumber("0"));
+        if (node.index.isInteger()) {
+          under = js.js("# < 0", pop());
+        } else {
+          js.Expression jsIndex = pop();
+          under = js.js("# >>> 0 !== #", [jsIndex, jsIndex]);
+        }
+      } else if (!node.index.isInteger()) {
+        checkInt(node.index, '!==');
+        under = pop();
       }
       if (node.staticChecks != HBoundsCheck.ALWAYS_BELOW_LENGTH) {
         var index = node.index;
@@ -1961,22 +1964,6 @@
     }
   }
 
-  visitIntegerCheck(HIntegerCheck node) {
-    if (!node.alwaysFalse) {
-      checkInt(node.value, '!==');
-      js.Expression test = pop();
-      js.Statement thenBody = new js.Block.empty();
-      js.Block oldContainer = currentContainer;
-      currentContainer = thenBody;
-      generateThrowWithHelper('iae', node.value);
-      currentContainer = oldContainer;
-      thenBody = unwrapStatement(thenBody);
-      pushStatement(new js.If.noElse(test, thenBody), node);
-    } else {
-      generateThrowWithHelper('iae', node.value);
-    }
-  }
-
   void generateThrowWithHelper(String helperName, HInstruction argument) {
     Element helper = compiler.findHelper(new SourceString(helperName));
     world.registerStaticUse(helper);
@@ -2411,20 +2398,96 @@
     }
   }
 
+  js.Expression generateTest(HCheck node) {
+    HInstruction input = node.checkedInput;
+    DartType indexingBehavior =
+        backend.jsIndexingBehaviorInterface.computeType(compiler);
+    js.Expression test;
+    if (node.isInteger()) {
+      // input is !int
+      checkInt(input, '!==');
+      test = pop();
+    } else if (node.isNumber()) {
+      // input is !num
+      checkNum(input, '!==');
+      test = pop();
+    } else if (node.isBoolean()) {
+      // input is !bool
+      checkBool(input, '!==');
+      test = pop();
+    } else if (node.isString()) {
+      // input is !string
+      checkString(input, '!==');
+      test = pop();
+    } else if (node.isExtendableArray()) {
+      // input is !Object || input is !Array || input.isFixed
+      checkObject(input, '!==');
+      js.Expression objectTest = pop();
+      checkArray(input, '!==');
+      js.Expression arrayTest = pop();
+      checkFixedArray(input);
+      test = new js.Binary('||', objectTest, arrayTest);
+      test = new js.Binary('||', test, pop());
+    } else if (node.isMutableArray()) {
+      // input is !Object
+      // || ((input is !Array || input.isImmutable)
+      //     && input is !JsIndexingBehavior)
+      checkObject(input, '!==');
+      js.Expression objectTest = pop();
+      checkArray(input, '!==');
+      js.Expression arrayTest = pop();
+      checkImmutableArray(input);
+      js.Binary notArrayOrImmutable = new js.Binary('||', arrayTest, pop());
+      checkType(input, indexingBehavior, negative: true);
+      js.Binary notIndexing = new js.Binary('&&', notArrayOrImmutable, pop());
+      test = new js.Binary('||', objectTest, notIndexing);
+    } else if (node.isReadableArray()) {
+      // input is !Object
+      // || (input is !Array && input is !JsIndexingBehavior)
+      checkObject(input, '!==');
+      js.Expression objectTest = pop();
+      checkArray(input, '!==');
+      js.Expression arrayTest = pop();
+      checkType(input, indexingBehavior, negative: true);
+      js.Expression notIndexing = new js.Binary('&&', arrayTest, pop());
+      test = new js.Binary('||', objectTest, notIndexing);
+    } else if (node.isIndexablePrimitive()) {
+      // input is !String
+      // && (input is !Object
+      //     || (input is !Array && input is !JsIndexingBehavior))
+      checkString(input, '!==');
+      js.Expression stringTest = pop();
+      checkObject(input, '!==');
+      js.Expression objectTest = pop();
+      checkArray(input, '!==');
+      js.Expression arrayTest = pop();
+      checkType(input, indexingBehavior, negative: true);
+      js.Binary notIndexingTest = new js.Binary('&&', arrayTest, pop());
+      js.Binary notObjectOrIndexingTest =
+          new js.Binary('||', objectTest, notIndexingTest);
+      test = new js.Binary('&&', stringTest, notObjectOrIndexingTest);
+    } else {
+      compiler.internalError('Unexpected type guard', instruction: input);
+    }
+    return test;
+  }
+
   void visitTypeConversion(HTypeConversion node) {
     if (node.isChecked) {
-      if (node.isArgumentTypeCheck) {
-        if (node.isInteger()) {
-          checkInt(node.checkedInput, '!==');
-        } else {
-          assert(node.isNumber());
-          checkNum(node.checkedInput, '!==');
-        }
-        js.Expression test = pop();
+      if (node.isArgumentTypeCheck || node.isReceiverTypeCheck) {
+        js.Expression test = generateTest(node);
         js.Block oldContainer = currentContainer;
         js.Statement body = new js.Block.empty();
         currentContainer = body;
-        generateThrowWithHelper('iae', node.checkedInput);
+        if (node.isArgumentTypeCheck) {
+          generateThrowWithHelper('iae', node.checkedInput);
+        } else if (node.isReceiverTypeCheck) {
+          use(node.checkedInput);
+          String methodName =
+              backend.namer.invocationName(node.receiverTypeCheckSelector);
+          js.Expression call = jsPropertyCall(pop(), methodName, []);
+          pushStatement(new js.Throw(call));
+        }
         currentContainer = oldContainer;
         body = unwrapStatement(body);
         pushStatement(new js.If.noElse(test, body), node);
@@ -2493,7 +2556,7 @@
 
   // Called by visitTypeGuard to generate the actual bailout call, something
   // like "return $.foo$bailout(t0, t1);"
-  js.Statement bailout(HTypeGuard guard, String reason) {
+  js.Statement bailout(HTypeGuard guard) {
     HBailoutTarget target = guard.bailoutTarget;
     List<js.Expression> arguments = <js.Expression>[];
     arguments.add(new js.LiteralNumber("${guard.state}"));
@@ -2534,86 +2597,8 @@
   // Generate a type guard, something like "if (typeof t0 == 'number')" and the
   // corresponding bailout call, something like "return $.foo$bailout(t0, t1);"
   void visitTypeGuard(HTypeGuard node) {
-    HInstruction input = node.guarded;
-    DartType indexingBehavior =
-        backend.jsIndexingBehaviorInterface.computeType(compiler);
-    String message;
-    js.Expression test;
-    if (node.isInteger()) {
-      // if (input is !int) bailout
-      checkInt(input, '!==');
-      test = pop();
-      message = 'Not an integer';
-    } else if (node.isNumber()) {
-      // if (input is !num) bailout
-      checkNum(input, '!==');
-      test = pop();
-      message = 'Not a number';
-    } else if (node.isBoolean()) {
-      // if (input is !bool) bailout
-      checkBool(input, '!==');
-      test = pop();
-      message = 'Not a boolean';
-    } else if (node.isString()) {
-      // if (input is !string) bailout
-      checkString(input, '!==');
-      test = pop();
-      message = 'Not a string';
-    } else if (node.isExtendableArray()) {
-      // if (input is !Object || input is !Array || input.isFixed) bailout
-      checkObject(input, '!==');
-      js.Expression objectTest = pop();
-      checkArray(input, '!==');
-      js.Expression arrayTest = pop();
-      checkFixedArray(input);
-      test = new js.Binary('||', objectTest, arrayTest);
-      test = new js.Binary('||', test, pop());
-      message = 'Not an extendable array';
-    } else if (node.isMutableArray()) {
-      // if (input is !Object
-      //     || ((input is !Array || input.isImmutable)
-      //         && input is !JsIndexingBehavior)) bailout
-      checkObject(input, '!==');
-      js.Expression objectTest = pop();
-      checkArray(input, '!==');
-      js.Expression arrayTest = pop();
-      checkImmutableArray(input);
-      js.Binary notArrayOrImmutable = new js.Binary('||', arrayTest, pop());
-      checkType(input, indexingBehavior, negative: true);
-      js.Binary notIndexing = new js.Binary('&&', notArrayOrImmutable, pop());
-      test = new js.Binary('||', objectTest, notIndexing);
-      message = 'Not a mutable array';
-    } else if (node.isReadableArray()) {
-      // if (input is !Object
-      //     || (input is !Array && input is !JsIndexingBehavior)) bailout
-      checkObject(input, '!==');
-      js.Expression objectTest = pop();
-      checkArray(input, '!==');
-      js.Expression arrayTest = pop();
-      checkType(input, indexingBehavior, negative: true);
-      js.Expression notIndexing = new js.Binary('&&', arrayTest, pop());
-      test = new js.Binary('||', objectTest, notIndexing);
-      message = 'Not an array';
-    } else if (node.isIndexablePrimitive()) {
-      // if (input is !String
-      //     && (input is !Object
-      //         || (input is !Array && input is !JsIndexingBehavior))) bailout
-      checkString(input, '!==');
-      js.Expression stringTest = pop();
-      checkObject(input, '!==');
-      js.Expression objectTest = pop();
-      checkArray(input, '!==');
-      js.Expression arrayTest = pop();
-      checkType(input, indexingBehavior, negative: true);
-      js.Binary notIndexingTest = new js.Binary('&&', arrayTest, pop());
-      js.Binary notObjectOrIndexingTest =
-          new js.Binary('||', objectTest, notIndexingTest);
-      test = new js.Binary('&&', stringTest, notObjectOrIndexingTest);
-      message = 'Not a string or array';
-    } else {
-      compiler.internalError('Unexpected type guard', instruction: input);
-    }
-    pushStatement(new js.If.noElse(test, bailout(node, message)), node);
+    js.Expression test = generateTest(node);
+    pushStatement(new js.If.noElse(test, bailout(node)), node);
   }
 
   void visitBailoutTarget(HBailoutTarget target) {
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart
index fac0952..209a5c0 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart
@@ -85,10 +85,6 @@
     analyzeInputs(instruction, 1);
   }
 
-  // An integer check method must not have its input generated at use site,
-  // because it's using it twice.
-  void visitIntegerCheck(HIntegerCheck instruction) {}
-
   // A type guard should not generate its input at use site, otherwise
   // they would not be alive.
   void visitTypeGuard(HTypeGuard instruction) {}
@@ -108,7 +104,8 @@
   void visitTypeConversion(HTypeConversion instruction) {
     if (!instruction.isChecked) {
       markAsGenerateAtUseSite(instruction);
-    } else if (!instruction.isArgumentTypeCheck) {
+    } else if (!instruction.isArgumentTypeCheck
+               && !instruction.isReceiverTypeCheck) {
       assert(instruction.isCheckedModeCheck || instruction.isCastTypeCheck);
       // Checked mode checks and cast checks compile to code that
       // only use their input once, so we can safely visit them
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart b/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart
index 6895f44..9d78bfd 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart
@@ -99,10 +99,11 @@
 
   HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
                                    Compiler compiler) {
-    if (instruction.inputs[1].isMutableArray()) {
+    if (instruction.inputs[1].isMutableIndexable(compiler)) {
       return new HIndexAssign(instruction.inputs[1],
                               instruction.inputs[2],
-                              instruction.inputs[3]);
+                              instruction.inputs[3],
+                              instruction.selector);
     }
     return null;
   }
@@ -128,8 +129,12 @@
 
   HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
                                    Compiler compiler) {
-    if (instruction.inputs[1].isIndexablePrimitive()) {
-      return new HIndex(instruction.inputs[1], instruction.inputs[2]);
+    if (instruction.inputs[1].isIndexable(compiler)) {
+      HInstruction index = new HIndex(
+          instruction.inputs[1], instruction.inputs[2], instruction.selector);
+      index.instructionType =
+          new HType.inferredTypeForSelector(instruction.selector, compiler);
+      return index;
     }
     return null;
   }
@@ -165,7 +170,7 @@
   HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
                                    Compiler compiler) {
     HInstruction input = instruction.inputs[1];
-    if (input.isNumber()) return new HBitNot(input);
+    if (input.isNumber()) return new HBitNot(input, instruction.selector);
     return null;
   }
 }
@@ -201,7 +206,7 @@
   HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
                                    Compiler compiler) {
     HInstruction input = instruction.inputs[1];
-    if (input.isNumber()) return new HNegate(input);
+    if (input.isNumber()) return new HNegate(input, instruction.selector);
     return null;
   }
 }
@@ -257,8 +262,7 @@
   HInstruction tryConvertToBuiltin(HInvokeDynamic instruction,
                                    Compiler compiler) {
     if (isBuiltin(instruction)) {
-      HInstruction builtin =
-          newBuiltinVariant(instruction.inputs[1], instruction.inputs[2]);
+      HInstruction builtin = newBuiltinVariant(instruction);
       if (builtin != null) return builtin;
       // Even if there is no builtin equivalent instruction, we know
       // the instruction does not have any side effect, and that it
@@ -270,7 +274,7 @@
     return null;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction);
 }
 
 class AddSpecializer extends BinaryArithmeticSpecializer {
@@ -280,8 +284,9 @@
     return constantSystem.add;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HAdd(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HAdd(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -309,8 +314,9 @@
         instruction, input, compiler);
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HDivide(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HDivide(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -321,7 +327,7 @@
     return constantSystem.modulo;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
     // Modulo cannot be mapped to the native operator (different semantics).    
     return null;
   }
@@ -334,8 +340,9 @@
     return constantSystem.multiply;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HMultiply(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HMultiply(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -346,8 +353,9 @@
     return constantSystem.subtract;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HSubtract(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HSubtract(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -358,7 +366,7 @@
     return constantSystem.truncatingDivide;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
     // Truncating divide does not have a JS equivalent.    
     return null;
   }
@@ -407,20 +415,21 @@
     IntConstant intConstant = rightConstant.constant;
     int count = intConstant.value;
     if (count >= 0 && count <= 31) {
-      return newBuiltinVariant(left, right);
+      return newBuiltinVariant(instruction);
     }
     return null;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HShiftLeft(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HShiftLeft(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
 class ShiftRightSpecializer extends BinaryBitOpSpecializer {
   const ShiftRightSpecializer();
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
     // Shift right cannot be mapped to the native operator easily.    
     return null;
   }
@@ -437,8 +446,9 @@
     return constantSystem.bitOr;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HBitOr(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HBitOr(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -449,8 +459,9 @@
     return constantSystem.bitAnd;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HBitAnd(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HBitAnd(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -461,8 +472,9 @@
     return constantSystem.bitXor;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HBitXor(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HBitXor(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -499,12 +511,12 @@
     HInstruction left = instruction.inputs[1];
     HInstruction right = instruction.inputs[2];
     if (left.isNumber() && right.isNumber()) {
-      return newBuiltinVariant(left, right);
+      return newBuiltinVariant(instruction);
     }
     return null;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction);
 }
 
 class EqualsSpecializer extends RelationalSpecializer {
@@ -542,7 +554,7 @@
     HInstruction right = instruction.inputs[2];
     HType instructionType = left.instructionType;
     if (right.isConstantNull() || instructionType.isPrimitiveOrNull()) {
-      return newBuiltinVariant(left, right);
+      return newBuiltinVariant(instruction);
     }
     TypeMask mask = instructionType.computeMask(compiler);
     Selector selector = new TypedSelector(mask, instruction.selector);
@@ -553,7 +565,7 @@
     // implemented because if the selector matches by subtype, it still will be
     // a regular object or an interceptor.
     if (matches.every(backend.isDefaultEqualityImplementation)) {
-      return newBuiltinVariant(left, right);
+      return newBuiltinVariant(instruction);
     }
     return null;
   }
@@ -562,8 +574,9 @@
     return constantSystem.equal;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HIdentity(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HIdentity(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -574,8 +587,9 @@
     return constantSystem.less;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HLess(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HLess(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -586,8 +600,9 @@
     return constantSystem.greater;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HGreater(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HGreater(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -598,8 +613,9 @@
     return constantSystem.greaterEqual;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HGreaterEqual(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HGreaterEqual(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
 
@@ -610,7 +626,8 @@
     return constantSystem.lessEqual;
   }
 
-  HInstruction newBuiltinVariant(HInstruction left, HInstruction right) {
-    return new HLessEqual(left, right);
+  HInstruction newBuiltinVariant(HInvokeDynamic instruction) {
+    return new HLessEqual(
+        instruction.inputs[1], instruction.inputs[2], instruction.selector);
   }
 }
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index 278c3a7..3491b3f 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -30,7 +30,6 @@
   R visitIf(HIf node);
   R visitIndex(HIndex node);
   R visitIndexAssign(HIndexAssign node);
-  R visitIntegerCheck(HIntegerCheck node);
   R visitInterceptor(HInterceptor node);
   R visitInvokeClosure(HInvokeClosure node);
   R visitInvokeDynamicGetter(HInvokeDynamicGetter node);
@@ -301,7 +300,6 @@
   visitIf(HIf node) => visitConditionalBranch(node);
   visitIndex(HIndex node) => visitInstruction(node);
   visitIndexAssign(HIndexAssign node) => visitInstruction(node);
-  visitIntegerCheck(HIntegerCheck node) => visitCheck(node);
   visitInterceptor(HInterceptor node) => visitInstruction(node);
   visitInvokeClosure(HInvokeClosure node)
       => visitInvokeDynamic(node);
@@ -892,17 +890,27 @@
   bool isNumber() => instructionType.isNumber();
   bool isNumberOrNull() => instructionType.isNumberOrNull();
   bool isString() => instructionType.isString();
-  bool isIndexablePrimitive() => instructionType.isIndexablePrimitive();
   bool isPrimitive() => instructionType.isPrimitive();
   bool canBeNull() => instructionType.canBeNull();
   bool canBePrimitive(Compiler compiler) =>
       instructionType.canBePrimitive(compiler);
 
+  bool isIndexable(Compiler compiler) =>
+      instructionType.isIndexable(compiler);
+  bool isMutableIndexable(Compiler compiler) =>
+      instructionType.isMutableIndexable(compiler);
+
+  // TODO(kasperl): Get rid of this one.
+  bool isIndexablePrimitive() => instructionType.isIndexablePrimitive();
+
   /**
    * Type of the unstruction.
    */
   HType instructionType = HType.UNKNOWN;
 
+  Selector get selector => null;
+  HInstruction getDartReceiver(Compiler compiler) => null;
+
   bool isInBasicBlock() => block != null;
 
   String inputsToString() {
@@ -1068,6 +1076,14 @@
     return users;
   }
 
+  void replaceAllUsersDominatedBy(HInstruction cursor,
+                                  HInstruction newInstruction) {
+    Set<HInstruction> users = dominatedUsers(cursor);
+    for (HInstruction user in users) {
+      user.changeUse(this, newInstruction);
+    }
+  }
+
   void moveBefore(HInstruction other) {
     assert(this is !HControlFlow);
     assert(this is !HPhi);
@@ -1135,7 +1151,7 @@
     }
   }
 
-    /**
+  /**
    * Return whether the instructions do not belong to a loop or
    * belong to the same loop.
    */
@@ -1227,7 +1243,7 @@
 
   // A [HTypeGuard] cannot be moved anywhere in the graph, otherwise
   // instructions that have side effects could end up before the guard
-  // in the otpimized version, and after the guard in a bailout
+  // in the optimized version, and after the guard in a bailout
   // version.
   bool isPure() => false;
 
@@ -1263,22 +1279,6 @@
   bool dataEquals(HInstruction other) => true;
 }
 
-class HIntegerCheck extends HCheck {
-  bool alwaysFalse = false;
-
-  HIntegerCheck(value) : super(<HInstruction>[value]) {
-    instructionType = HType.INTEGER;
-  }
-
-  HInstruction get value => inputs[0];
-  bool isControlFlow() => true;
-
-  accept(HVisitor visitor) => visitor.visitIntegerCheck(this);
-  int typeCode() => HInstruction.INTEGER_CHECK_TYPECODE;
-  bool typeEquals(other) => other is HIntegerCheck;
-  bool dataEquals(HInstruction other) => true;
-}
-
 abstract class HConditionalBranch extends HControlFlow {
   HConditionalBranch(inputs) : super(inputs);
   HInstruction get condition => inputs[0];
@@ -1429,8 +1429,12 @@
 }
 
 class HInvokeSuper extends HInvokeStatic {
+  /** The class where the call to super is being done. */
+  final ClassElement caller;
   final bool isSetter;
-  HInvokeSuper(inputs, {this.isSetter: false}) : super(inputs, HType.UNKNOWN);
+
+  HInvokeSuper(this.caller, inputs, {this.isSetter: false})
+      : super(inputs, HType.UNKNOWN);
   toString() => 'invoke super: ${element.name}';
   accept(HVisitor visitor) => visitor.visitInvokeSuper(this);
 
@@ -1561,7 +1565,8 @@
 }
 
 abstract class HInvokeBinary extends HInstruction {
-  HInvokeBinary(HInstruction left, HInstruction right)
+  final Selector selector;
+  HInvokeBinary(HInstruction left, HInstruction right, this.selector)
       : super(<HInstruction>[left, right]) {
     clearAllSideEffects();
     setUseGvn();
@@ -1574,12 +1579,12 @@
 }
 
 abstract class HBinaryArithmetic extends HInvokeBinary {
-  HBinaryArithmetic(HInstruction left, HInstruction right) : super(left, right);
+  HBinaryArithmetic(left, right, selector) : super(left, right, selector);
   BinaryOperation operation(ConstantSystem constantSystem);
 }
 
 class HAdd extends HBinaryArithmetic {
-  HAdd(HInstruction left, HInstruction right) : super(left, right);
+  HAdd(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitAdd(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1590,7 +1595,7 @@
 }
 
 class HDivide extends HBinaryArithmetic {
-  HDivide(HInstruction left, HInstruction right) : super(left, right) {
+  HDivide(left, right, selector) : super(left, right, selector) {
     instructionType = HType.DOUBLE;
   }
   accept(HVisitor visitor) => visitor.visitDivide(this);
@@ -1603,7 +1608,7 @@
 }
 
 class HMultiply extends HBinaryArithmetic {
-  HMultiply(HInstruction left, HInstruction right) : super(left, right);
+  HMultiply(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitMultiply(this);
 
   BinaryOperation operation(ConstantSystem operations)
@@ -1614,7 +1619,7 @@
 }
 
 class HSubtract extends HBinaryArithmetic {
-  HSubtract(HInstruction left, HInstruction right) : super(left, right);
+  HSubtract(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitSubtract(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1648,13 +1653,13 @@
 }
 
 abstract class HBinaryBitOp extends HInvokeBinary {
-  HBinaryBitOp(HInstruction left, HInstruction right) : super(left, right) {
+  HBinaryBitOp(left, right, selector) : super(left, right, selector) {
     instructionType = HType.INTEGER;
   }
 }
 
 class HShiftLeft extends HBinaryBitOp {
-  HShiftLeft(HInstruction left, HInstruction right) : super(left, right);
+  HShiftLeft(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitShiftLeft(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1665,7 +1670,7 @@
 }
 
 class HBitOr extends HBinaryBitOp {
-  HBitOr(HInstruction left, HInstruction right) : super(left, right);
+  HBitOr(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitBitOr(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1676,7 +1681,7 @@
 }
 
 class HBitAnd extends HBinaryBitOp {
-  HBitAnd(HInstruction left, HInstruction right) : super(left, right);
+  HBitAnd(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitBitAnd(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1687,7 +1692,7 @@
 }
 
 class HBitXor extends HBinaryBitOp {
-  HBitXor(HInstruction left, HInstruction right) : super(left, right);
+  HBitXor(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitBitXor(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1698,7 +1703,9 @@
 }
 
 abstract class HInvokeUnary extends HInstruction {
-  HInvokeUnary(HInstruction input) : super(<HInstruction>[input]) {
+  final Selector selector;
+  HInvokeUnary(HInstruction input, this.selector)
+      : super(<HInstruction>[input]) {
     clearAllSideEffects();
     setUseGvn();
   }
@@ -1709,7 +1716,7 @@
 }
 
 class HNegate extends HInvokeUnary {
-  HNegate(HInstruction input) : super(input);
+  HNegate(input, selector) : super(input, selector);
   accept(HVisitor visitor) => visitor.visitNegate(this);
 
   UnaryOperation operation(ConstantSystem constantSystem)
@@ -1720,7 +1727,7 @@
 }
 
 class HBitNot extends HInvokeUnary {
-  HBitNot(HInstruction input) : super(input) {
+  HBitNot(input, selector) : super(input, selector) {
     instructionType = HType.INTEGER;
   }
   accept(HVisitor visitor) => visitor.visitBitNot(this);
@@ -1954,13 +1961,13 @@
 
 abstract class HRelational extends HInvokeBinary {
   bool usesBoolifiedInterceptor = false;
-  HRelational(HInstruction left, HInstruction right) : super(left, right) {
+  HRelational(left, right, selector) : super(left, right, selector) {
     instructionType = HType.BOOLEAN;
   }
 }
 
 class HIdentity extends HRelational {
-  HIdentity(HInstruction left, HInstruction right) : super(left, right);
+  HIdentity(left, right, [selector]) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitIdentity(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1971,7 +1978,7 @@
 }
 
 class HGreater extends HRelational {
-  HGreater(HInstruction left, HInstruction right) : super(left, right);
+  HGreater(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitGreater(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1982,7 +1989,7 @@
 }
 
 class HGreaterEqual extends HRelational {
-  HGreaterEqual(HInstruction left, HInstruction right) : super(left, right);
+  HGreaterEqual(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitGreaterEqual(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -1993,7 +2000,7 @@
 }
 
 class HLess extends HRelational {
-  HLess(HInstruction left, HInstruction right) : super(left, right);
+  HLess(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitLess(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -2004,7 +2011,7 @@
 }
 
 class HLessEqual extends HRelational {
-  HLessEqual(HInstruction left, HInstruction right) : super(left, right);
+  HLessEqual(left, right, selector) : super(left, right, selector);
   accept(HVisitor visitor) => visitor.visitLessEqual(this);
 
   BinaryOperation operation(ConstantSystem constantSystem)
@@ -2148,7 +2155,8 @@
  * does not throw because we generate the checks explicitly.
  */
 class HIndex extends HInstruction {
-  HIndex(HInstruction receiver, HInstruction index)
+  final Selector selector;
+  HIndex(HInstruction receiver, HInstruction index, this.selector)
       : super(<HInstruction>[receiver, index]) {
     clearAllSideEffects();
     setDependsOnIndexStore();
@@ -2171,9 +2179,11 @@
  * does not throw because we generate the checks explicitly.
  */
 class HIndexAssign extends HInstruction {
+  final Selector selector;
   HIndexAssign(HInstruction receiver,
                HInstruction index,
-               HInstruction value)
+               HInstruction value,
+               this.selector)
       : super(<HInstruction>[receiver, index, value]) {
     clearAllSideEffects();
     setChangesIndex();
@@ -2235,16 +2245,20 @@
 class HTypeConversion extends HCheck {
   final DartType typeExpression;
   final int kind;
+  final Selector receiverTypeCheckSelector;
 
   static const int NO_CHECK = 0;
   static const int CHECKED_MODE_CHECK = 1;
   static const int ARGUMENT_TYPE_CHECK = 2;
   static const int CAST_TYPE_CHECK = 3;
   static const int BOOLEAN_CONVERSION_CHECK = 4;
+  static const int RECEIVER_TYPE_CHECK = 5;
 
   HTypeConversion(this.typeExpression, this.kind,
-                  HType type, HInstruction input)
+                  HType type, HInstruction input,
+                  [this.receiverTypeCheckSelector])
       : super(<HInstruction>[input]) {
+    assert(!isReceiverTypeCheck || receiverTypeCheckSelector != null);
     sourceElement = input.sourceElement;
     instructionType = type;
   }
@@ -2255,13 +2269,14 @@
         || kind == BOOLEAN_CONVERSION_CHECK;
   }
   bool get isArgumentTypeCheck => kind == ARGUMENT_TYPE_CHECK;
+  bool get isReceiverTypeCheck => kind == RECEIVER_TYPE_CHECK;
   bool get isCastTypeCheck => kind == CAST_TYPE_CHECK;
   bool get isBooleanConversionCheck => kind == BOOLEAN_CONVERSION_CHECK;
 
   accept(HVisitor visitor) => visitor.visitTypeConversion(this);
 
-  bool isJsStatement() => kind == ARGUMENT_TYPE_CHECK;
-  bool isControlFlow() => kind == ARGUMENT_TYPE_CHECK;
+  bool isJsStatement() => isControlFlow();
+  bool isControlFlow() => isArgumentTypeCheck || isReceiverTypeCheck;
   bool canThrow() => isChecked;
 
   int typeCode() => HInstruction.TYPE_CONVERSION_TYPECODE;
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index b5f72b9..e5d7981 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -53,7 +53,7 @@
           new SsaReceiverSpecialization(compiler),
           new SsaGlobalValueNumberer(compiler),
           new SsaCodeMotion(),
-          new SsaValueRangeAnalyzer(constantSystem, work),
+          new SsaValueRangeAnalyzer(compiler, constantSystem, work),
           // Previous optimizations may have generated new
           // opportunities for constant folding.
           new SsaConstantFolder(constantSystem, backend, work),
@@ -73,15 +73,24 @@
     }
     JavaScriptItemCompilationContext context = work.compilationContext;
     return measure(() {
+      SsaTypeGuardInserter inserter = new SsaTypeGuardInserter(compiler, work);
+
       // Run the phases that will generate type guards.
       List<OptimizationPhase> phases = <OptimizationPhase>[
-          new SsaTypeGuardInserter(compiler, work),
+          inserter,
           new SsaEnvironmentBuilder(compiler),
           // Then run the [SsaCheckInserter] because the type propagator also
           // propagated types non-speculatively. For example, it might have
           // propagated the type array for a call to the List constructor.
           new SsaCheckInserter(backend, work, context.boundsChecked)];
       runPhases(graph, phases);
+
+      if (work.guards.isEmpty && inserter.hasInsertedChecks) {
+        // If there is no guard, and we have inserted type checks
+        // instead, we can do the optimizations right away and avoid
+        // the bailout method.
+        optimize(work, graph, false);
+      }
       return !work.guards.isEmpty;
     });
   }
@@ -225,7 +234,7 @@
 
   HInstruction tryOptimizeLengthInterceptedGetter(HInvokeDynamic node) {
     HInstruction actualReceiver = node.inputs[1];
-    if (actualReceiver.isIndexablePrimitive()) {
+    if (actualReceiver.isIndexable(compiler)) {
       if (actualReceiver.isConstantString()) {
         HConstant constantInput = actualReceiver;
         StringConstant constant = constantInput.constant;
@@ -235,15 +244,9 @@
         ListConstant constant = constantInput.constant;
         return graph.addConstantInt(constant.length, constantSystem);
       }
-      Element element;
-      bool isAssignable;
-      if (actualReceiver.isString()) {
-        element = backend.jsStringLength;
-        isAssignable = false;
-      } else {
-        element = backend.jsArrayLength;
-        isAssignable = !actualReceiver.isFixedArray();
-      }
+      Element element = backend.jsIndexableLength;
+      bool isAssignable = !actualReceiver.isFixedArray() &&
+          !actualReceiver.isString();
       HFieldGet result = new HFieldGet(
           element, actualReceiver, isAssignable: isAssignable);
       result.instructionType = HType.INTEGER;
@@ -314,8 +317,7 @@
         return result;
       }
     } else if (selector.isGetter()) {
-      if (selector.applies(backend.jsArrayLength, compiler)
-          || selector.applies(backend.jsStringLength, compiler)) {
+      if (selector.asUntyped.applies(backend.jsIndexableLength, compiler)) {
         HInstruction optimized = tryOptimizeLengthInterceptedGetter(node);
         if (optimized != null) return optimized;
       }
@@ -409,21 +411,25 @@
     HInvokeDynamicMethod result =
         new HInvokeDynamicMethod(node.selector, inputs);
     result.element = method;
-    // TODO(sra): Can the instruction type be strengthened to help optimize
-    // dependent instructions?
-    result.instructionType = node.instructionType;
+
+    // Strengthen instruction type from annotations to help optimize
+    // dependent instructions.
+    native.NativeBehavior nativeBehavior =
+        native.NativeBehavior.ofMethod(method, compiler);
+    HType returnType = new HType.fromNativeBehavior(nativeBehavior, compiler);
+    result.instructionType = returnType;
     return result;
   }
 
-  HInstruction visitIntegerCheck(HIntegerCheck node) {
-    HInstruction value = node.value;
-    if (value.isInteger()) return value;
-    if (value.isConstant()) {
-      HConstant constantInstruction = value;
+  HInstruction visitBoundsCheck(HBoundsCheck node) {
+    HInstruction index = node.index;
+    if (index.isInteger()) return node;
+    if (index.isConstant()) {
+      HConstant constantInstruction = index;
       assert(!constantInstruction.constant.isInt());
       if (!constantSystem.isInt(constantInstruction.constant)) {
         // -0.0 is a double but will pass the runtime integer check.
-        node.alwaysFalse = true;
+        node.staticChecks = HBoundsCheck.ALWAYS_FALSE;
       }
     }
     return node;
@@ -616,7 +622,7 @@
   }
 
   HInstruction visitFieldGet(HFieldGet node) {
-    if (node.element == backend.jsArrayLength) {
+    if (node.element == backend.jsIndexableLength) {
       if (node.receiver is HInvokeStatic) {
         // Try to recognize the length getter with input
         // [:new List(int):].
@@ -631,16 +637,12 @@
             && call.inputs[1].isInteger()) {
           return call.inputs[1];
         }
-      } else if (node.receiver.isConstantList()) {
+      } else if (node.receiver.isConstantList() ||
+                 node.receiver.isConstantString()) {
         var instruction = node.receiver;
         return graph.addConstantInt(
             instruction.constant.length, backend.constantSystem);
       }
-    } else if (node.element == backend.jsStringLength
-               && node.receiver.isConstantString()) {
-        var instruction = node.receiver;
-        return graph.addConstantInt(
-            instruction.constant.length, backend.constantSystem);
     }
     return node;
   }
@@ -688,8 +690,9 @@
         field, receiver, isAssignable: isAssignable);
 
     if (field.getEnclosingClass().isNative()) {
-      result.instructionType =
-          new HType.subtype(field.computeType(compiler), compiler);
+      result.instructionType = new HType.fromNativeBehavior(
+          native.NativeBehavior.ofFieldLoad(field, compiler),
+          compiler);
     } else {
       HType type = new HType.inferredTypeForElement(field, compiler);
       if (type.isUnknown()) {
@@ -857,6 +860,25 @@
           && !intercepted.contains(backend.jsDoubleClass)) {
         constantInterceptor = backend.jsNumberClass;
       }
+    } else {
+      // Try to find constant interceptor for a native class.  If the receiver
+      // is constrained to a leaf native class, we can use the class's
+      // interceptor directly.
+
+      // TODO(sra): Key DOM classes like Node, Element and Event are not leaf
+      // classes.  When the receiver type is not a leaf class, we might still be
+      // able to use the receiver class as a constant interceptor.  It is
+      // usually the case that methods defined on a non-leaf class don't test
+      // for a subclass or call methods defined on a subclass.  Provided the
+      // code is completely insensitive to the specific instance subclasses, we
+      // can use the non-leaf class directly.
+
+      if (!type.canBeNull()) {
+        ClassElement element = type.computeMask(compiler).singleClass(compiler);
+        if (element != null && element.isNative()) {
+          constantInterceptor = element;
+        }
+      }
     }
 
     if (constantInterceptor == null) return null;
@@ -928,54 +950,41 @@
     }
   }
 
-  HBoundsCheck insertBoundsCheck(HInstruction node,
-                                 HInstruction receiver,
-                                 HInstruction index) {
-    bool isAssignable = !receiver.isFixedArray() && !receiver.isString();
-    Element element = receiver.isString()
-        ? backend.jsStringLength
-        : backend.jsArrayLength;
+  HBoundsCheck insertBoundsCheck(HInstruction indexNode,
+                                 HInstruction array,
+                                 HInstruction indexArgument) {
+    bool isAssignable = !array.isFixedArray() && !array.isString();
     HFieldGet length = new HFieldGet(
-        element, receiver, isAssignable: isAssignable);
+        backend.jsIndexableLength, array, isAssignable: isAssignable);
     length.instructionType = HType.INTEGER;
-    length.instructionType = HType.INTEGER;
-    node.block.addBefore(node, length);
+    indexNode.block.addBefore(indexNode, length);
 
-    HBoundsCheck check = new HBoundsCheck(index, length);
-    node.block.addBefore(node, check);
-    boundsChecked.add(node);
-    return check;
-  }
-
-  HIntegerCheck insertIntegerCheck(HInstruction node, HInstruction value) {
-    HIntegerCheck check = new HIntegerCheck(value);
-    node.block.addBefore(node, check);
-    Set<HInstruction> dominatedUsers = value.dominatedUsers(node);
-    for (HInstruction user in dominatedUsers) {
-      user.changeUse(value, check);
+    HBoundsCheck check = new HBoundsCheck(indexArgument, length);
+    indexNode.block.addBefore(indexNode, check);
+    // If the index input to the bounds check was not known to be an integer
+    // then we replace its uses with the bounds check, which is known to be an
+    // integer.  However, if the input was already an integer we don't do this
+    // because putting in a check instruction might obscure the real nature of
+    // the index eg. if it is a constant.  The range information from the
+    // BoundsCheck instruction is attached to the input directly by
+    // visitBoundsCheck in the SsaValueRangeAnalyzer.
+    if (!indexArgument.isInteger()) {
+      indexArgument.replaceAllUsersDominatedBy(indexNode, check);
     }
+    boundsChecked.add(indexNode);
     return check;
   }
 
   void visitIndex(HIndex node) {
     if (boundsChecked.contains(node)) return;
     HInstruction index = node.index;
-    if (!node.index.isInteger()) {
-      index = insertIntegerCheck(node, index);
-    }
     index = insertBoundsCheck(node, node.receiver, index);
-    node.changeUse(node.index, index);
   }
 
   void visitIndexAssign(HIndexAssign node) {
-    if (!node.receiver.isMutableArray()) return;
     if (boundsChecked.contains(node)) return;
     HInstruction index = node.index;
-    if (!node.index.isInteger()) {
-      index = insertIntegerCheck(node, index);
-    }
     index = insertBoundsCheck(node, node.receiver, index);
-    node.changeUse(node.index, index);
   }
 
   void visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart b/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
index 1dc573d..76415a6 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
@@ -329,11 +329,6 @@
     return "IndexAssign: $receiver[$index] = $value";
   }
 
-  String visitIntegerCheck(HIntegerCheck node) {
-    String value = temporaryId(node.value);
-    return "Integer check: $value";
-  }
-
   String visitInterceptor(HInterceptor node) {
     String value = temporaryId(node.inputs[0]);
     return "Intercept: $value";
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/types.dart b/sdk/lib/_internal/compiler/implementation/ssa/types.dart
index 16bc916..da6ad83 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/types.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/types.dart
@@ -121,34 +121,38 @@
         compiler);
   }
 
+  factory HType.fromNativeBehavior(native.NativeBehavior nativeBehavior,
+                                   Compiler compiler) {
+    if (nativeBehavior.typesReturned.isEmpty) return HType.UNKNOWN;
+
+    HType result = nativeBehavior.typesReturned
+        .map((type) => fromNativeType(type, compiler))
+        .reduce((t1, t2) => t1.union(t2, compiler));
+    assert(!result.isConflicting());
+    return result;
+  }
+
   // [type] is either an instance of [DartType] or special objects
   // like [native.SpecialType.JsObject], or [native.SpecialType.JsArray].
-  factory HType.fromNativeType(type, Compiler compiler) {
+  static HType fromNativeType(type, Compiler compiler) {
     if (type == native.SpecialType.JsObject) {
       return new HType.nonNullExact(
           compiler.objectClass.computeType(compiler), compiler);
     } else if (type == native.SpecialType.JsArray) {
       return HType.READABLE_ARRAY;
+    } else if (type.isVoid) {
+      return HType.NULL;
     } else if (type.element == compiler.nullClass) {
       return HType.NULL;
-    } else {
+    } else if (compiler.world.hasAnySubtype(type.element)) {
+      return new HType.nonNullSubtype(type, compiler);
+    } else if (compiler.world.hasAnySubclass(type.element)) {
       return new HType.nonNullSubclass(type, compiler);
+    } else {
+      return new HType.nonNullExact(type, compiler);
     }
   }
 
-  factory HType.fromNativeBehavior(native.NativeBehavior nativeBehavior,
-                                   Compiler compiler) {
-    if (nativeBehavior.typesInstantiated.isEmpty) return HType.UNKNOWN;
-
-    HType ssaType = HType.CONFLICTING;
-    for (final type in nativeBehavior.typesInstantiated) {
-      ssaType = ssaType.union(
-          new HType.fromNativeType(type, compiler), compiler);
-    }
-    assert(!ssaType.isConflicting());
-    return ssaType;
-  }
-
   static const HType CONFLICTING = const HConflictingType();
   static const HType UNKNOWN = const HUnknownType();
   static const HType NON_NULL = const HNonNullType();
@@ -179,7 +183,6 @@
   bool isInteger() => false;
   bool isDouble() => false;
   bool isString() => false;
-  bool isIndexablePrimitive() => false;
   bool isFixedArray() => false;
   bool isReadableArray() => false;
   bool isMutableArray() => false;
@@ -193,6 +196,25 @@
   bool isStringOrNull() => false;
   bool isPrimitiveOrNull() => false;
 
+  // TODO(kasperl): Get rid of this one.
+  bool isIndexablePrimitive() => false;
+
+  bool isIndexable(Compiler compiler) {
+    JavaScriptBackend backend = compiler.backend;
+    return implementsInterface(backend.jsIndexableClass, compiler);
+  }
+
+  bool isMutableIndexable(Compiler compiler) {
+    JavaScriptBackend backend = compiler.backend;
+    return implementsInterface(backend.jsMutableIndexableClass, compiler);
+  }
+
+  bool implementsInterface(ClassElement interfaceElement, Compiler compiler) {
+    DartType interfaceType = interfaceElement.computeType(compiler);
+    TypeMask mask = new TypeMask.subtype(interfaceType);
+    return mask == mask.union(computeMask(compiler), compiler);
+  }
+
   bool canBeNull() => false;
   bool canBePrimitive(Compiler compiler) => false;
   bool canBePrimitiveNumber(Compiler compiler) => false;
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart b/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
index b5accc2..eced1c4 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
@@ -219,10 +219,11 @@
     return HType.UNKNOWN;
   }
 
-  HType visitIntegerCheck(HIntegerCheck instruction) {
+  HType visitBoundsCheck(HBoundsCheck boundsCheck) {
     // If the desired type of the input is already a number, we want
     // to specialize it to an integer.
-    return input.isNumber() ? HType.INTEGER : HType.UNKNOWN;
+    if (input == boundsCheck.index && input.isNumber()) return HType.INTEGER;
+    return HType.UNKNOWN;
   }
 
   HType visitInvokeDynamic(HInvokeDynamic instruction) {
@@ -235,10 +236,21 @@
   }
 
   HType visitPhi(HPhi phi) {
-    HType propagatedType = phi.instructionType;
     // Best case scenario for a phi is, when all inputs have the same type. If
     // there is no desired outgoing type we therefore try to unify the input
     // types (which is basically the [likelyType]).
+    HType propagatedType = phi.instructionType;
+
+    // If the incoming type of a phi is an integer, we don't want to
+    // be too restrictive for the back edge and desire an integer
+    // too. Therefore we only return integer if the phi is used by a
+    // bounds check, which includes an integer check.
+    if (propagatedType.isInteger()) {
+      if (phi.usedBy.any((user) => user is HBoundsCheck && user.index == phi)) {
+        return propagatedType;
+      }
+      return HType.NUMBER;
+    }
     if (propagatedType.isUnknown()) return computeLikelyType(phi);
     // When the desired outgoing type is conflicting we don't need to give any
     // requirements on the inputs.
@@ -304,7 +316,7 @@
   }
 
   HType computeDesiredType(HInstruction instruction) {
-    HType desiredType = HType.UNKNOWN;
+    HType desiredType = instruction.instructionType;
     for (final user in instruction.usedBy) {
       HType userDesiredType =  desiredTypeVisitor.computeDesiredTypeForInput(
           user, instruction);
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart b/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
index 151e3a7..bd2d52f 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
@@ -550,13 +550,14 @@
    */
   final Map<HInstruction, Range> ranges = new Map<HInstruction, Range>();
 
+  final Compiler compiler;
   final ConstantSystem constantSystem;
   final ValueRangeInfo info;
 
   CodegenWorkItem work;
   HGraph graph;
 
-  SsaValueRangeAnalyzer(constantSystem, this.work)
+  SsaValueRangeAnalyzer(this.compiler, constantSystem, this.work)
       : info = new ValueRangeInfo(constantSystem),
         this.constantSystem = constantSystem;
 
@@ -629,7 +630,7 @@
 
   Range visitFieldGet(HFieldGet fieldGet) {
     if (!fieldGet.isInteger()) return info.newUnboundRange();
-    if (!fieldGet.receiver.isIndexablePrimitive()) {
+    if (!fieldGet.receiver.isIndexable(compiler)) {
       return visitInstruction(fieldGet);
     }
     LengthValue value = info.newLengthValue(fieldGet);
@@ -645,7 +646,10 @@
     HInstruction next = check.next;
     Range indexRange = ranges[check.index];
     Range lengthRange = ranges[check.length];
-    assert(check.index.isInteger());
+    if (indexRange == null) {
+      indexRange = info.newUnboundRange();
+      assert(!check.index.isInteger());
+    }
     assert(check.length.isInteger());
 
     // Check if the index is strictly below the upper bound of the length
@@ -690,6 +694,9 @@
       Range newIndexRange = indexRange.intersection(
           info.newNormalizedRange(info.intZero, maxIndex));
       if (indexRange == newIndexRange) return indexRange;
+      // Explicitly attach the range information to the index instruction,
+      // which may be used by other instructions.  Returning the new range will
+      // attach it to this instruction.
       HInstruction instruction = createRangeConversion(next, check.index);
       ranges[instruction] = newIndexRange;
       return newIndexRange;
@@ -785,10 +792,7 @@
     cursor.block.addBefore(cursor, newInstruction);
     // Update the users of the instruction dominated by [cursor] to
     // use the new instruction, that has an narrower range.
-    Set<HInstruction> dominatedUsers = instruction.dominatedUsers(cursor);
-    for (HInstruction user in dominatedUsers) {
-      user.changeUse(instruction, newInstruction);
-    }
+    instruction.replaceAllUsersDominatedBy(cursor, newInstruction);
     return newInstruction;
   }
 
diff --git a/sdk/lib/_internal/compiler/implementation/tools/mini_parser.dart b/sdk/lib/_internal/compiler/implementation/tools/mini_parser.dart
index 3b0c2fb..17578d5 100644
--- a/sdk/lib/_internal/compiler/implementation/tools/mini_parser.dart
+++ b/sdk/lib/_internal/compiler/implementation/tools/mini_parser.dart
@@ -5,7 +5,7 @@
 library parser;
 
 import 'dart:io';
-import 'dart:typeddata';
+import 'dart:typed_data';
 import 'dart:collection';
 import 'dart:utf';
 
diff --git a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
index 7bd2eba1..604ef46 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
@@ -64,6 +64,7 @@
   R visitPartOf(PartOf node) => visitNode(node);
   R visitPostfix(Postfix node) => visitNodeList(node);
   R visitPrefix(Prefix node) => visitNodeList(node);
+  R visitRethrow(Rethrow node) => visitStatement(node);
   R visitReturn(Return node) => visitStatement(node);
   R visitScriptTag(ScriptTag node) => visitNode(node);
   R visitSend(Send node) => visitExpression(node);
@@ -76,7 +77,7 @@
   }
   R visitSwitchCase(SwitchCase node) => visitNode(node);
   R visitSwitchStatement(SwitchStatement node) => visitStatement(node);
-  R visitThrow(Throw node) => visitStatement(node);
+  R visitThrow(Throw node) => visitExpression(node);
   R visitTryStatement(TryStatement node) => visitStatement(node);
   R visitTypeAnnotation(TypeAnnotation node) => visitNode(node);
   R visitTypedef(Typedef node) => visitNode(node);
@@ -178,6 +179,7 @@
   ParenthesizedExpression asParenthesizedExpression() => null;
   Part asPart() => null;
   PartOf asPartOf() => null;
+  Rethrow asRethrow() => null;
   Return asReturn() => null;
   ScriptTag asScriptTag() => null;
   Send asSend() => null;
@@ -1004,7 +1006,7 @@
   Token getEndToken() => endToken;
 }
 
-class Throw extends Statement {
+class Throw extends Expression {
   final Expression expression;
 
   final Token throwToken;
@@ -1017,7 +1019,7 @@
   accept(Visitor visitor) => visitor.visitThrow(this);
 
   visitChildren(Visitor visitor) {
-    if (expression != null) expression.accept(visitor);
+    expression.accept(visitor);
   }
 
   Token getBeginToken() => throwToken;
@@ -1025,6 +1027,21 @@
   Token getEndToken() => endToken;
 }
 
+class Rethrow extends Statement {
+  final Token throwToken;
+  final Token endToken;
+
+  Rethrow(this.throwToken, this.endToken);
+
+  Rethrow asRethrow() => this;
+
+  accept(Visitor visitor) => visitor.visitRethrow(this);
+  visitChildren(Visitor visitor) { }
+
+  Token getBeginToken() => throwToken;
+  Token getEndToken() => endToken;
+}
+
 class TypeAnnotation extends Node {
   final Expression typeName;
   final NodeList typeArguments;
diff --git a/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart b/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
index 62b6744..9f2cfbf 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart
@@ -305,6 +305,10 @@
     visitNodeWithChildren(node, "ParenthesizedExpression");
   }
 
+  visitRethrow(Rethrow node) {
+    visitNodeWithChildren(node, "Rethrow");
+  }
+
   visitReturn(Return node) {
     openNode(node, "Return");
     visitChildNode(node.expression, "expression");
diff --git a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
index 1e1b944..f0f0de3 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
@@ -266,6 +266,10 @@
     visitIdentifier(node);
   }
 
+  visitRethrow(Rethrow node) {
+    sb.write('rethrow;');
+  }
+
   visitReturn(Return node) {
     if (node.isRedirectingFactoryBody) {
       sb.write(' ');
@@ -336,11 +340,8 @@
 
   visitThrow(Throw node) {
     add(node.throwToken.value);
-    if (node.expression != null) {
-      sb.write(' ');
-      visit(node.expression);
-    }
-    node.endToken.value.printOn(sb);
+    sb.write(' ');
+    visit(node.expression);
   }
 
   visitTypeAnnotation(TypeAnnotation node) {
diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart
index 6e79532..62de10d 100644
--- a/sdk/lib/_internal/compiler/implementation/typechecker.dart
+++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart
@@ -586,6 +586,10 @@
     fail(node, 'internal error');
   }
 
+  DartType visitRethrow(Rethrow node) {
+    return StatementType.RETURNING;
+  }
+
   /** Dart Programming Language Specification: 11.10 Return */
   DartType visitReturn(Return node) {
     if (identical(node.getBeginToken().stringValue, 'native')) {
@@ -625,7 +629,7 @@
   }
 
   DartType visitThrow(Throw node) {
-    if (node.expression != null) analyze(node.expression);
+    analyze(node.expression);
     return StatementType.RETURNING;
   }
 
diff --git a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
index 13ea311..b346692 100644
--- a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
@@ -328,7 +328,7 @@
   final BaseType typeOfThis;
 
   ConcreteTypesEnvironment(this.inferrer, [this.typeOfThis]) :
-    this.environment = new Map<Element, ConcreteType>();
+      environment = new Map<Element, ConcreteType>();
   ConcreteTypesEnvironment.of(this.inferrer, this.environment, this.typeOfThis);
 
   ConcreteType lookupType(Element element) => environment[element];
@@ -536,6 +536,12 @@
    */
   final Map<VariableElement, ConcreteType> inferredParameterTypes;
 
+  /**
+   * A map from selectors to their inferred type masks, indexed by the mask
+   * of the receiver. It plays no role in the analysis, it is write only.
+   */
+  final Map<Selector, Map<TypeMask, TypeMask>> inferredSelectorTypes;
+
   ConcreteTypesInferrer(Compiler compiler)
       : this.compiler = compiler,
         cache = new Map<FunctionElement,
@@ -549,7 +555,8 @@
         callers = new Map<FunctionElement, Set<Element>>(),
         readers = new Map<Element, Set<Element>>(),
         seenClasses = new Set<ClassElement>(),
-        dynamicCallers = new Map<SourceString, Set<FunctionElement>>() {
+        dynamicCallers = new Map<SourceString, Set<FunctionElement>>(),
+        inferredSelectorTypes = new Map<Selector, Map<TypeMask, TypeMask>>() {
     unknownConcreteType = new ConcreteType.unknown();
   }
 
@@ -648,18 +655,43 @@
   }
 
   /**
+   * Sets the concrete type associated to [selector] to the union of the
+   * inferred concrete type so far and [type].
+   * Precondition: [:typeOfThis != null:]
+   */
+  void augmentInferredSelectorType(Selector selector, TypeMask typeOfThis,
+                                   TypeMask returnType) {
+    assert(typeOfThis != null);
+    selector = selector.asUntyped;
+    Map<TypeMask, TypeMask> currentMap = inferredSelectorTypes.putIfAbsent(
+        selector, () => new Map<TypeMask, TypeMask>());
+    TypeMask currentReturnType = currentMap[typeOfThis];
+    currentMap[typeOfThis] = (currentReturnType == null)
+        ? returnType
+        : currentReturnType.union(returnType, compiler);
+  }
+
+  /**
    * Returns the current inferred concrete type of [field].
    */
-  ConcreteType getFieldType(Element field) {
+  ConcreteType getFieldType(Selector selector, Element field) {
     ConcreteType result = inferredFieldTypes[field];
-    if (result != null) {
-      return result;
-    } else {
+    if (result == null) {
       // field is a toplevel variable, we trigger its analysis because no object
-      // creation is never going to trigger it
+      // creation is ever going to trigger it
       result = analyzeFieldInitialization(field);
       return (result == null) ? emptyConcreteType : result;
     }
+    if (selector != null) {
+      Element enclosing = field.enclosingElement;
+      if (enclosing.isClass()) {
+        ClassElement cls = enclosing;
+        TypeMask receiverMask = new TypeMask.exact(cls.rawType);
+        TypeMask resultMask = concreteTypeToTypeMask(result);
+        augmentInferredSelectorType(selector, receiverMask, resultMask);
+      }
+    }
+    return result;
   }
 
   /**
@@ -787,42 +819,46 @@
 
   // -- query --
 
-  TypeMask fromClassBaseTypeToTypeMask(ClassBaseType baseType) {
-    ClassBaseType classBaseType = baseType;
-    ClassElement cls = classBaseType.element;
-    return new TypeMask.nonNullExact(cls.rawType);
+  /**
+   * Returns the [TypeMask] representation of [baseType].
+   */
+  TypeMask baseTypeToTypeMask(BaseType baseType) {
+    if (baseType.isUnknown()) {
+      return null;
+    } else if (baseType.isNull()) {
+      return new TypeMask.empty();
+    } else {
+      ClassBaseType classBaseType = baseType;
+      final element = classBaseType.element;
+      if (element != null) {
+        if (element == compiler.numClass) {
+          return new TypeMask.nonNullSubclass(compiler.numClass.rawType);
+        } else {
+          return new TypeMask.nonNullExact(element.rawType);
+        }
+      } else {
+        return null;
+      }
+    }
   }
 
   /**
-   * Returns the [TypeMask] representation of [concreteType]. Returns [:null:]
-   * if and only if [:concreteType.isUnknown():].
+   * Returns the [TypeMask] representation of [concreteType].
    */
-  TypeMask fromConcreteToTypeMask(ConcreteType concreteType) {
+  TypeMask concreteTypeToTypeMask(ConcreteType concreteType) {
     if (concreteType == null) return null;
-    TypeMask typeMask;
-    bool nullable = false;
+    TypeMask typeMask = new TypeMask.nonNullEmpty();
     for (BaseType baseType in concreteType.baseTypes) {
-      if (baseType.isUnknown()) {
-        return null;
-      } else if (baseType.isNull()) {
-        nullable = true;
-      } else {
-        TypeMask current = fromClassBaseTypeToTypeMask(baseType);
-        typeMask = typeMask == null
-            ? current
-            : typeMask.union(current, compiler);
-      }
+      typeMask = typeMask.union(baseTypeToTypeMask(baseType), compiler);
     }
-    return nullable
-        ? typeMask == null ? null : typeMask.nullable()
-        : typeMask;
+    return typeMask;
   }
 
   /**
    * Get the inferred concrete type of [node].
    */
   TypeMask getTypeOfNode(Element owner, Node node) {
-    return fromConcreteToTypeMask(inferredTypes[node]);
+    return concreteTypeToTypeMask(inferredTypes[node]);
   }
 
   /**
@@ -830,7 +866,7 @@
    */
   TypeMask getTypeOfElement(Element element) {
     if (!element.isParameter()) return null;
-    return fromConcreteToTypeMask(inferredParameterTypes[element]);
+    return concreteTypeToTypeMask(inferredParameterTypes[element]);
   }
 
   /**
@@ -844,14 +880,34 @@
     templates.forEach((_, concreteType) {
       returnType = returnType.union(concreteType);
     });
-    return fromConcreteToTypeMask(returnType);
+    return concreteTypeToTypeMask(returnType);
   }
 
   /**
-   * Get the inferred concrete type of [selector].
+   * Get the inferred concrete type of [selector]. A null return value means
+   * "I don't know".
    */
   TypeMask getTypeOfSelector(Selector selector) {
-    return null;
+    Map<TypeMask, TypeMask> candidates =
+        inferredSelectorTypes[selector.asUntyped];
+    if (candidates == null) {
+      return null;
+    }
+    TypeMask result = new TypeMask.nonNullEmpty();
+    if (selector.mask == null) {
+      candidates.forEach((TypeMask receiverType, TypeMask returnType) {
+        result = result.union(returnType, compiler);
+      });
+    } else {
+      candidates.forEach((TypeMask receiverType, TypeMask returnType) {
+        TypeMask intersection =
+            receiverType.intersection(selector.mask, compiler);
+        if (!intersection.isEmpty || intersection.isNullable) {
+          result = result.union(returnType, compiler);
+        }
+      });
+    }
+    return result;
   }
 
   // --- analysis ---
@@ -862,7 +918,8 @@
    * [receiverType] must be null, else [function] must be a member of the class
    * of [receiverType].
    */
-  ConcreteType getSendReturnType(FunctionElement function,
+  ConcreteType getSendReturnType(Selector selector,
+                                 FunctionElement function,
                                  ClassElement receiverType,
                                  ArgumentsTypes argumentsTypes) {
     ConcreteType result = emptyConcreteType;
@@ -880,6 +937,13 @@
       result =
           result.union(getMonomorphicSendReturnType(function, environment));
     }
+
+    if (selector != null && receiverType != null) {
+      TypeMask receiverMask = new TypeMask.exact(receiverType.rawType);
+      TypeMask resultMask = concreteTypeToTypeMask(result);
+      augmentInferredSelectorType(selector, receiverMask, resultMask);
+    }
+
     return result;
   }
 
@@ -1089,10 +1153,11 @@
    * [element] must be either a field with an initializing expression,
    * a generative constructor or a function.
    */
-  ConcreteType analyze(Element element,
+  ConcreteType analyze(Selector selector,
+                       Element element,
                        ConcreteTypesEnvironment environment) {
     if (element.isGenerativeConstructor()) {
-      return analyzeConstructor(element, environment);
+      return analyzeConstructor(selector, element, environment);
     } else if (element.isField()) {
       analyzeFieldInitialization(element);
       return emptyConcreteType;
@@ -1137,7 +1202,8 @@
     return type;
   }
 
-  ConcreteType analyzeConstructor(FunctionElement element,
+  ConcreteType analyzeConstructor(Selector selector,
+                                  FunctionElement element,
                                   ConcreteTypesEnvironment environment) {
     Set<Element> uninitializedFields = new Set<Element>();
 
@@ -1197,7 +1263,7 @@
                 .implementation;
         final superClassConcreteType = singletonConcreteType(
             new ClassBaseType(enclosingClass));
-        getSendReturnType(target, enclosingClass,
+        getSendReturnType(selector, target, enclosingClass,
             new ArgumentsTypes(new List(), new Map()));
       }
     }
@@ -1260,7 +1326,7 @@
       while (!workQueue.isEmpty) {
         InferenceWorkItem item = workQueue.removeFirst();
         ConcreteType concreteType =
-            analyze(item.methodOrField, item.environment);
+            analyze(null, item.methodOrField, item.environment);
         if (item.methodOrField.isField()) continue;
         var template = cache[item.methodOrField];
         if (template[item.environment] == concreteType) continue;
@@ -1300,6 +1366,13 @@
     inferredParameterTypes.forEach((k,v) {
       print("  $k: $v");
     });
+    print("inferred selector types:");
+    inferredSelectorTypes.forEach((selector, map) {
+      print("  $selector:");
+      map.forEach((k, v) {
+        print("    $k: $v");
+      });
+    });
     print("cache:");
     cache.forEach((k,v) {
       print("  $k: $v");
@@ -1463,7 +1536,8 @@
     inferrer.fail(node, 'not yet implemented');
   }
 
-  ConcreteType analyzeSetElement(Element receiver, ConcreteType argumentType) {
+  ConcreteType analyzeSetElement(Selector selector,
+                                 Element receiver, ConcreteType argumentType) {
     environment = environment.put(receiver, argumentType);
     if (receiver.isField()) {
       inferrer.augmentFieldType(receiver, argumentType);
@@ -1475,13 +1549,14 @@
       // exceptions for instance, we need to do it by uncommenting the following
       // line.
       // inferrer.addCaller(setter, currentMethod);
-      inferrer.getSendReturnType(setter, receiver.enclosingElement,
+      inferrer.getSendReturnType(selector, setter, receiver.enclosingElement,
           new ArgumentsTypes([argumentType], new Map()));
     }
     return argumentType;
   }
 
-  ConcreteType analyzeSetNode(Node receiver, ConcreteType argumentType,
+  ConcreteType analyzeSetNode(Selector selector,
+                              Node receiver, ConcreteType argumentType,
                               SourceString name) {
     ConcreteType receiverType = analyze(receiver);
 
@@ -1497,7 +1572,7 @@
         // exceptions for instance, we need to do it by uncommenting the
         // following line.
         // inferrer.addCaller(setter, currentMethod);
-        inferrer.getSendReturnType(setter, receiverType,
+        inferrer.getSendReturnType(selector, setter, receiverType,
             new ArgumentsTypes([argumentType], new Map()));
       }
       // since this is a sendSet we ignore non-fields
@@ -1542,8 +1617,8 @@
     if (node.selector.asIdentifier().source.stringValue == '[]') {
       ConcreteType receiverType = analyze(node.receiver);
       ArgumentsTypes argumentsTypes = analyzeArguments(node.arguments);
-      analyzeDynamicSend(receiverType, const SourceString('[]='),
-                         argumentsTypes);
+      analyzeDynamicSend(elements.getSelector(node), receiverType,
+                         const SourceString('[]='), argumentsTypes);
       return argumentsTypes.positional[1];
     }
 
@@ -1555,7 +1630,8 @@
         canonicalizeCompoundOperator(node.assignmentOperator.source);
     // ++, --, +=, -=, ...
     if (compoundOperatorName != null) {
-      ConcreteType receiverType = visitGetterSend(node);
+      ConcreteType receiverType = visitGetterSendForSelector(node,
+          elements.getGetterSelectorInComplexSendSet(node));
       // argumentsTypes is either computed from the actual arguments or [{int}]
       // in case of ++ or --.
       ArgumentsTypes argumentsTypes;
@@ -1567,8 +1643,11 @@
       } else {
         argumentsTypes = analyzeArguments(node.arguments);
       }
-      argumentType = analyzeDynamicSend(receiverType, compoundOperatorName,
-                                        argumentsTypes);
+      argumentType = analyzeDynamicSend(
+          elements.getOperatorSelectorInComplexSendSet(node),
+          receiverType,
+          compoundOperatorName,
+          argumentsTypes);
     // The simple assignment case: receiver = argument.
     } else {
       argumentType = analyze(node.argumentsNode);
@@ -1576,9 +1655,11 @@
 
     Element element = elements[node];
     if (element != null) {
-      return analyzeSetElement(element, argumentType);
+      return analyzeSetElement(elements.getSelector(node),
+                               element, argumentType);
     } else {
-      return analyzeSetNode(node.receiver, argumentType,
+      return analyzeSetNode(elements.getSelector(node),
+                            node.receiver, argumentType,
                             node.selector.asIdentifier().source);
     }
   }
@@ -1625,7 +1706,7 @@
     Element constructor = elements[node.send];
     inferrer.addCaller(constructor, currentMethodOrField);
     ClassElement cls = constructor.enclosingElement;
-    return inferrer.getSendReturnType(constructor, cls,
+    return inferrer.getSendReturnType(null, constructor, cls,
                                       analyzeArguments(node.send.arguments));
   }
 
@@ -1805,20 +1886,25 @@
     return visitDynamicSend(node);
   }
 
-  ConcreteType analyzeFieldRead(Element field) {
+  ConcreteType analyzeFieldRead(Selector selector, Element field) {
     inferrer.addReader(field, currentMethodOrField);
-    return inferrer.getFieldType(field);
+    return inferrer.getFieldType(selector, field);
   }
 
-  ConcreteType analyzeGetterSend(ClassElement receiverType,
+  ConcreteType analyzeGetterSend(Selector selector,
+                                 ClassElement receiverType,
                                  FunctionElement getter) {
       inferrer.addCaller(getter, currentMethodOrField);
-      return inferrer.getSendReturnType(getter,
-                                        receiverType,
+      return inferrer.getSendReturnType(selector, getter, receiverType,
                                         new ArgumentsTypes([], new Map()));
   }
 
   ConcreteType visitGetterSend(Send node) {
+    Selector selector = elements.getSelector(node);
+    return visitGetterSendForSelector(node, selector);
+  }
+
+  ConcreteType visitGetterSendForSelector(Send node, Selector selector) {
     Element element = elements[node];
     if (element != null) {
       // node is a local variable or a field of this
@@ -1829,11 +1915,11 @@
       } else {
         // node is a field or a getter of this
         if (element.isField()) {
-          return analyzeFieldRead(element);
+          return analyzeFieldRead(selector, element);
         } else {
           assert(element.isGetter());
           ClassElement receiverType = element.enclosingElement;
-          return analyzeGetterSend(receiverType, element);
+          return analyzeGetterSend(selector, receiverType, element);
         }
       }
     } else {
@@ -1843,12 +1929,13 @@
       ConcreteType result = inferrer.emptyConcreteType;
       void augmentResult(ClassElement baseReceiverType, Element member) {
         if (member.isField()) {
-          result = result.union(analyzeFieldRead(member));
+          result = result.union(analyzeFieldRead(selector, member));
         } else if (member.isAbstractField()){
           // call to a getter
           AbstractFieldElement abstractField = member;
           result = result.union(
-              analyzeGetterSend(baseReceiverType, abstractField.getter));
+              analyzeGetterSend(selector,
+                                baseReceiverType, abstractField.getter));
         }
         // since this is a get we ignore non-fields
       }
@@ -1884,7 +1971,8 @@
     inferrer.fail(node, 'not implemented');
   }
 
-  ConcreteType analyzeDynamicSend(ConcreteType receiverType,
+  ConcreteType analyzeDynamicSend(Selector selector,
+                                  ConcreteType receiverType,
                                   SourceString canonicalizedMethodName,
                                   ArgumentsTypes argumentsTypes) {
     ConcreteType result = inferrer.emptyConcreteType;
@@ -1901,7 +1989,7 @@
         inferrer.addCaller(method, currentMethodOrField);
         Element cls = method.enclosingElement;
         result = result.union(
-            inferrer.getSendReturnType(method, cls, argumentsTypes));
+            inferrer.getSendReturnType(selector, method, cls, argumentsTypes));
       }
 
     } else {
@@ -1914,7 +2002,8 @@
             method = method.implementation;
             inferrer.addCaller(method, currentMethodOrField);
             result = result.union(
-                inferrer.getSendReturnType(method, cls, argumentsTypes));
+                inferrer.getSendReturnType(selector, method, cls,
+                                           argumentsTypes));
           }
         }
       }
@@ -1939,14 +2028,16 @@
         canonicalizeMethodName(node.selector.asIdentifier().source);
     ArgumentsTypes argumentsTypes = analyzeArguments(node.arguments);
     if (name.stringValue == '!=') {
-      ConcreteType returnType = analyzeDynamicSend(receiverType,
+      ConcreteType returnType = analyzeDynamicSend(elements.getSelector(node),
+                                                   receiverType,
                                                    const SourceString('=='),
                                                    argumentsTypes);
       return returnType.isEmpty()
           ? returnType
           : inferrer.singletonConcreteType(inferrer.baseTypes.boolBaseType);
     } else {
-      return analyzeDynamicSend(receiverType, name, argumentsTypes);
+      return analyzeDynamicSend(elements.getSelector(node),
+                                receiverType, name, argumentsTypes);
     }
   }
 
@@ -1960,8 +2051,9 @@
     }
     Element element = elements[node].implementation;
     inferrer.addCaller(element, currentMethodOrField);
-    return inferrer.getSendReturnType(element, null,
-        analyzeArguments(node.arguments));
+    return inferrer.getSendReturnType(elements.getSelector(node),
+                                      element, null,
+                                      analyzeArguments(node.arguments));
   }
 
   void internalError(String reason, {Node node}) {
diff --git a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
index 0891574..14b6d44 100644
--- a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
@@ -443,6 +443,14 @@
     Map<int, Set<Element>> methodSizes = new Map<int, Set<Element>>();
     compiler.enqueuer.resolution.resolvedElements.forEach(
       (Element element, TreeElementMapping mapping) {
+        if (element.impliesType()) return;
+        assert(invariant(element,
+            element.isField() ||
+            element.isFunction() ||
+            element.isGenerativeConstructor() ||
+            element.isGetter() ||
+            element.isSetter(),
+            message: 'Unexpected element kind: ${element.kind}'));
         // TODO(ngeoffray): Not sure why the resolver would put a null
         // mapping.
         if (mapping == null) return;
@@ -667,10 +675,8 @@
         if (elementType.kind != TypeKind.FUNCTION) {
           return dynamicType;
         }
-        DartType returnType = elementType.returnType;
-        return returnType.isVoid
-            ? nullType
-            : new TypeMask.subtype(returnType.asRaw());
+        return typeOfNativeBehavior(
+            native.NativeBehavior.ofMethod(element, compiler));
       });
     }
     TypeMask returnType = returnTypeOf[element];
@@ -681,6 +687,48 @@
     return returnType;
   }
 
+  TypeMask typeOfNativeBehavior(native.NativeBehavior nativeBehavior) {
+    if (nativeBehavior == null) return dynamicType;
+    List typesReturned = nativeBehavior.typesReturned;
+    if (typesReturned.isEmpty) return dynamicType;
+    TypeMask returnType;
+    for (var type in typesReturned) {
+      TypeMask mappedType;
+      if (type == native.SpecialType.JsObject) {
+        mappedType = new TypeMask.nonNullExact(rawTypeOf(compiler.objectClass));
+      } else if (type == native.SpecialType.JsArray) {
+        mappedType = listType;
+      } else if (type.element == compiler.stringClass) {
+        mappedType = stringType;
+      } else if (type.element == compiler.intClass) {
+        mappedType = intType;
+      } else if (type.element == compiler.doubleClass) {
+        mappedType = doubleType;
+      } else if (type.element == compiler.numClass) {
+        mappedType = numType;
+      } else if (type.element == compiler.boolClass) {
+        mappedType = boolType;
+      } else if (type.element == compiler.nullClass) {
+        mappedType = nullType;
+      } else if (type.isVoid) {
+        mappedType = nullType;
+      } else if (compiler.world.hasAnySubclass(type.element)) {
+        mappedType = new TypeMask.nonNullSubclass(rawTypeOf(type.element));
+      } else if (compiler.world.hasAnySubtype(type.element)) {
+        mappedType = new TypeMask.nonNullSubtype(rawTypeOf(type.element));
+      } else {
+        mappedType = new TypeMask.nonNullExact(rawTypeOf(type.element));
+      }
+      returnType = computeLUB(returnType, mappedType);
+      if (!isTypeValuable(returnType)) {
+        returnType = dynamicType;
+        break;
+      }
+    }
+    return returnType;
+  }
+
+
   /**
    * Returns the type of [element]. Returns [:dynamic:] if
    * [element] has not been analyzed yet.
@@ -823,7 +871,7 @@
     assert(arguments != null);
     bool isUseful = addArguments(node, callee, arguments);
     if (hasAnalyzedAll && isUseful) {
-      updateArgumentsType(callee);
+      enqueueAgain(callee);
     }
   }
 
@@ -838,13 +886,13 @@
         types.remove(send);
         if (hasAnalyzedAll) updateNonFinalFieldType(callee);
       }
-    } if (callee.isGetter()) {
+    } else if (callee.isGetter()) {
       return;
     } else {
       Map<Node, ArgumentsTypes> types = typeOfArguments[callee];
       if (types == null || !types.containsKey(send)) return;
       types.remove(send);
-      if (hasAnalyzedAll) updateArgumentsType(callee);
+      if (hasAnalyzedAll) enqueueAgain(callee);
     }
   }
 
@@ -862,7 +910,7 @@
     if (element.name == Compiler.NO_SUCH_METHOD) return;
     FunctionSignature signature = element.computeSignature(compiler);
 
-    if (typeOfArguments[element].isEmpty) {
+    if (typeOfArguments[element] == null || typeOfArguments[element].isEmpty) {
       signature.forEachParameter((Element parameter) {
         typeOf.remove(parameter);
       });
@@ -902,6 +950,52 @@
     if (changed) enqueueAgain(element);
   }
 
+  TypeMask handleIntrisifiedSelector(Selector selector,
+                                     ArgumentsTypes arguments) {
+    if (selector.mask != intType) return null;
+    if (!selector.isCall() && !selector.isOperator()) return null;
+    if (!arguments.named.isEmpty) return null;
+    if (arguments.positional.length > 1) return null;
+
+    switch (selector.name) {
+      case const SourceString('*'):
+      case const SourceString('+'):
+      case const SourceString('%'):
+      case const SourceString('remainder'):
+        return arguments.hasOnePositionalArgumentWithType(intType)
+            ? intType
+            : null;
+
+      case const SourceString('-'):
+        if (arguments.hasNoArguments()) return intType;
+        if (arguments.hasOnePositionalArgumentWithType(intType)) return intType;
+        return null;
+
+      case const SourceString('abs'):
+        return arguments.hasNoArguments() ? intType : null;
+    }
+    return null;
+  }
+
+  bool isTargetFor(TypeMask receiverType, Selector selector, Element element) {
+    bool isReceiverDynamic = isDynamicType(receiverType);
+    assert(selector.mask == receiverType
+           || (selector.mask == null && isReceiverDynamic));
+    // TODO(ngeoffray) : The following noSuchMethod handling is a bit
+    // convoluted, we should make it easier to know what we are sure
+    // we cannot hit.
+    if (element.name != selector.name) {
+      assert(element.name == Compiler.NO_SUCH_METHOD);
+      return isReceiverDynamic
+          || (!receiverType.willHit(selector, compiler)
+              && receiverType.canHit(
+                    element, compiler.noSuchMethodSelector, compiler));
+    } else {
+      return isReceiverDynamic
+          || receiverType.canHit(element, selector, compiler);
+    }
+  }
+
   /**
    * Registers that [caller] calls an element matching [selector]
    * with the given [arguments].
@@ -914,21 +1008,20 @@
                                   Selector constraint,
                                   bool inLoop) {
     TypeMask result;
-    iterateOverElements(selector, (Element element) {
+    iterateOverElements(selector.asUntyped, (Element element) {
       assert(element.isImplementation);
-      // TODO(ngeoffray): Enable unregistering by having a
-      // [: TypeMask.appliesTo(element) :] method, that will return
-      // whether [: element :] is a potential target for the type.
-      if (true) {
+      if (isTargetFor(receiverType, selector, element)) {
         registerCalledElement(
             node, selector, caller, element, arguments,
             constraint, inLoop);
+
+        if (!selector.isSetter()) {
+          TypeMask type = handleIntrisifiedSelector(selector, arguments);
+          if (type == null) type = typeOfElementWithSelector(element, selector);
+          result = computeLUB(result, type);
+        }
       } else {
-        unregisterCalledElement(node, selector.asUntyped, caller, element);
-      }
-      if (!selector.isSetter()) {
-        TypeMask type = typeOfElementWithSelector(element, selector);
-        result = computeLUB(result, type);
+        unregisterCalledElement(node, selector, caller, element);
       }
       return true;
     });
@@ -1024,6 +1117,11 @@
     if (isNativeElement(element)) return;
     assert(hasAnalyzedAll);
 
+    if (typeOfFields[element] == null || typeOfFields[element].isEmpty) {
+      typeOf.remove(element);
+      return;
+    }
+
     TypeMask fieldType = computeFieldTypeWithConstraints(
         element, typeOfFields[element]);
 
@@ -1113,8 +1211,11 @@
   final Map<SourceString, TypeMask> named;
   ArgumentsTypes(this.positional, named)
     : this.named = (named == null) ? new Map<SourceString, TypeMask>() : named;
+
   int get length => positional.length + named.length;
+
   String toString() => "{ positional = $positional, named = $named }";
+
   bool operator==(other) {
     if (positional.length != other.positional.length) return false;
     if (named.length != other.named.length) return false;
@@ -1126,6 +1227,12 @@
     });
     return true;
   }
+
+  bool hasNoArguments() => positional.isEmpty && named.isEmpty;
+
+  bool hasOnePositionalArgumentWithType(TypeMask type) {
+    return named.isEmpty && positional.length == 1 && positional[0] == type;
+  }
 }
 
 /**
@@ -1319,6 +1426,9 @@
     }
 
     FunctionElement function = analyzedElement;
+    if (inferrer.hasAnalyzedAll) {
+      inferrer.updateArgumentsType(function);
+    }
     FunctionSignature signature = function.computeSignature(compiler);
     signature.forEachOptionalParameter((element) {
       Node node = element.parseNode(compiler);
@@ -1827,46 +1937,7 @@
     if (name == const SourceString('JS')) {
       native.NativeBehavior nativeBehavior =
           compiler.enqueuer.resolution.nativeEnqueuer.getNativeBehaviorOf(node);
-      if (nativeBehavior == null) return inferrer.dynamicType;
-      List typesReturned = nativeBehavior.typesReturned;
-      if (typesReturned.isEmpty) return inferrer.dynamicType;
-      TypeMask returnType;
-      for (var type in typesReturned) {
-        TypeMask mappedType;
-        if (type == native.SpecialType.JsObject) {
-          mappedType = new TypeMask.nonNullExact(
-              inferrer.rawTypeOf(compiler.objectClass));
-        } else if (type == native.SpecialType.JsArray) {
-          mappedType = inferrer.listType;
-        } else if (type.element == compiler.stringClass) {
-          mappedType = inferrer.stringType;
-        } else if (type.element == compiler.intClass) {
-          mappedType = inferrer.intType;
-        } else if (type.element == compiler.doubleClass) {
-          mappedType = inferrer.doubleType;
-        } else if (type.element == compiler.numClass) {
-          mappedType = inferrer.numType;
-        } else if (type.element == compiler.boolClass) {
-          mappedType = inferrer.boolType;
-        } else if (type.element == compiler.nullClass) {
-          mappedType = inferrer.nullType;
-        } else if (compiler.world.hasAnySubclass(type.element)) {
-          mappedType = new TypeMask.nonNullSubclass(
-              inferrer.rawTypeOf(type.element));
-        } else if (compiler.world.hasAnySubtype(type.element)) {
-          mappedType = new TypeMask.nonNullSubtype(
-              inferrer.rawTypeOf(type.element));
-        } else {
-          mappedType = new TypeMask.nonNullExact(
-              inferrer.rawTypeOf(type.element));
-        }
-        returnType = inferrer.computeLUB(returnType, mappedType);
-        if (!inferrer.isTypeValuable(returnType)) {
-          returnType = inferrer.dynamicType;
-          break;
-        }
-      }
-      return returnType;
+      return inferrer.typeOfNativeBehavior(nativeBehavior);
     } else if (name == const SourceString('JS_OPERATOR_IS_PREFIX')
                || name == const SourceString('JS_OPERATOR_AS_PREFIX')) {
       return inferrer.stringType;
diff --git a/sdk/lib/_internal/compiler/implementation/types/type_mask.dart b/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
index 68676f1..a47240d 100644
--- a/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/type_mask.dart
@@ -103,6 +103,24 @@
   }
 
   /**
+   * Returns the [ClassElement] if this type represents a single class,
+   * otherwise returns `null`.  This method is conservative.
+   */
+  ClassElement singleClass(Compiler compiler) {
+    if (isEmpty) return null;
+    if (isNullable) return null;  // It is Null and some other class.
+    ClassElement element = base.element;
+    if (isExact) {
+      return element;
+    } else if (isSubclass) {
+      return compiler.world.hasAnySubclass(element) ? null : element;
+    } else {
+      assert(isSubtype);
+      return null;
+    }
+  }
+
+  /**
    * Returns whether or not this type mask contains all types.
    */
   bool containsAll(Compiler compiler) {
@@ -390,6 +408,7 @@
    * privacy is taken into account.
    */
   bool canHit(Element element, Selector selector, Compiler compiler) {
+    assert(element.name == selector.name);
     if (isEmpty) {
       if (!isNullable) return false;
       return hasElementIn(
@@ -489,6 +508,10 @@
     return (flags == otherMask.flags) && (base == otherMask.base);
   }
 
+  int get hashCode {
+    return (base == null ? 0 : base.hashCode) + 31 * flags.hashCode;
+  }
+
   String toString() {
     if (isEmpty) return isNullable ? '[null]' : '[empty]';
     StringBuffer buffer = new StringBuffer();
diff --git a/sdk/lib/_internal/compiler/implementation/types/types.dart b/sdk/lib/_internal/compiler/implementation/types/types.dart
index b350519..cd778f6 100644
--- a/sdk/lib/_internal/compiler/implementation/types/types.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/types.dart
@@ -37,8 +37,8 @@
   static final bool DUMP_SURPRISING_RESULTS = false;
 
   final String name = 'Type inference';
-  TypesInferrer typesInferrer;
-  TypesInferrer concreteTypesInferrer;
+  SimpleTypesInferrer typesInferrer;
+  ConcreteTypesInferrer concreteTypesInferrer;
 
   TypesTask(Compiler compiler) : super(compiler) {
     typesInferrer = new SimpleTypesInferrer(compiler);
diff --git a/sdk/lib/_internal/compiler/implementation/world.dart b/sdk/lib/_internal/compiler/implementation/world.dart
index 01f17fd..2ecc117 100644
--- a/sdk/lib/_internal/compiler/implementation/world.dart
+++ b/sdk/lib/_internal/compiler/implementation/world.dart
@@ -164,6 +164,11 @@
     return (receiverTypeElement.isSubclassOf(enclosing)) ? result : null;
   }
 
+  bool hasSingleMatch(Selector selector) {
+    Iterable<Element> targets = allFunctions.filter(selector);
+    return targets.length == 1;
+  }
+
   Iterable<ClassElement> locateNoSuchMethodHolders(Selector selector) {
     Selector noSuchMethodSelector = compiler.noSuchMethodSelector;
     ti.TypeMask mask = selector.mask;
diff --git a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
index f9d5d7e..cf35cd9 100644
--- a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
+++ b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
@@ -35,7 +35,7 @@
 import 'src/json_serializer.dart' as json_serializer;
 
 // TODO(rnystrom): Use "package:" URL (#4968).
-import '../../compiler/implementation/mirrors/dart2js_mirror.dart' as dart2js;
+import 'src/dart2js_mirrors.dart' as dart2js;
 import '../../compiler/implementation/mirrors/mirrors.dart';
 import '../../compiler/implementation/mirrors/mirrors_util.dart';
 import '../../libraries.dart';
@@ -158,7 +158,8 @@
 
       return dart2js.compile(
           new Path(dartPath), new Path(message['libPath']),
-          options: const <String>['--categories=Client,Server']).then((jsCode) {
+          options: const <String>['--categories=Client,Server', '--minify'])
+      .then((jsCode) {
         writeString(new File(jsPath), jsCode);
       });
     }).then((_) {
diff --git a/sdk/lib/_internal/dartdoc/lib/src/dart2js_mirrors.dart b/sdk/lib/_internal/dartdoc/lib/src/dart2js_mirrors.dart
new file mode 100644
index 0000000..8ce26c0
--- /dev/null
+++ b/sdk/lib/_internal/dartdoc/lib/src/dart2js_mirrors.dart
@@ -0,0 +1,74 @@
+// 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 dart2js_util;
+
+import 'dart:async' show Future;
+import 'dart:io' show Path;
+import 'dart:uri';
+
+import '../../../compiler/compiler.dart' as api;
+import '../../../compiler/implementation/mirrors/dart2js_mirror.dart' as dart2js
+    show analyze, Dart2JsMirrorSystem;
+import '../../../compiler/implementation/mirrors/mirrors.dart'
+    show MirrorSystem;
+import '../../../compiler/implementation/source_file_provider.dart'
+    show FormattingDiagnosticHandler, SourceFileProvider;
+import '../../../compiler/implementation/filenames.dart'
+    show appendSlash, currentDirectory;
+
+// TODO(johnniwinther): Support client configurable providers.
+
+/**
+ * Returns a future that completes to a non-null String when [script]
+ * has been successfully compiled.
+ */
+// TODO(amouravski): Remove this method and call dart2js via a process instead.
+Future<String> compile(Path script,
+                       Path libraryRoot,
+                       {Path packageRoot,
+                        List<String> options: const <String>[],
+                        api.DiagnosticHandler diagnosticHandler}) {
+  SourceFileProvider provider = new SourceFileProvider();
+  if (diagnosticHandler == null) {
+    diagnosticHandler =
+        new FormattingDiagnosticHandler(provider).diagnosticHandler;
+  }
+  Uri scriptUri = currentDirectory.resolve(script.toString());
+  Uri libraryUri = currentDirectory.resolve(appendSlash('$libraryRoot'));
+  Uri packageUri = null;
+  if (packageRoot != null) {
+    packageUri = currentDirectory.resolve(appendSlash('$packageRoot'));
+  }
+  return api.compile(scriptUri, libraryUri, packageUri,
+      provider.readStringFromUri, diagnosticHandler, options);
+}
+
+/**
+ * Analyzes set of libraries and provides a mirror system which can be used for
+ * static inspection of the source code.
+ */
+Future<MirrorSystem> analyze(List<Path> libraries,
+                             Path libraryRoot,
+                             {Path packageRoot,
+                              List<String> options: const <String>[],
+                              api.DiagnosticHandler diagnosticHandler}) {
+  SourceFileProvider provider = new SourceFileProvider();
+  if (diagnosticHandler == null) {
+    diagnosticHandler =
+        new FormattingDiagnosticHandler(provider).diagnosticHandler;
+  }
+  Uri libraryUri = currentDirectory.resolve(appendSlash('$libraryRoot'));
+  Uri packageUri = null;
+  if (packageRoot != null) {
+    packageUri = currentDirectory.resolve(appendSlash('$packageRoot'));
+  }
+  List<Uri> librariesUri = <Uri>[];
+  for (Path library in libraries) {
+    librariesUri.add(currentDirectory.resolve(library.toString()));
+  }
+  return dart2js.analyze(librariesUri, libraryUri, packageUri,
+                         provider.readStringFromUri, diagnosticHandler,
+                         options);
+}
diff --git a/sdk/lib/_internal/dartdoc/lib/src/dartdoc/utils.dart b/sdk/lib/_internal/dartdoc/lib/src/dartdoc/utils.dart
index 02b7de7..016a354 100644
--- a/sdk/lib/_internal/dartdoc/lib/src/dartdoc/utils.dart
+++ b/sdk/lib/_internal/dartdoc/lib/src/dartdoc/utils.dart
@@ -117,17 +117,28 @@
   if (uri.scheme != 'file') {
     throw new ArgumentError("Uri $uri must have scheme 'file:'.");
   }
-  if (Platform.operatingSystem != 'windows') return pathos.normalize(uri.path);
-  return pathos.normalize(uri.path.replaceFirst("/", "").replaceAll("/", "\\"));
+  if (Platform.operatingSystem != 'windows') return uri.path;
+  if (uri.path.startsWith("/")) {
+    // Drive-letter paths look like "file:///C:/path/to/file". The replaceFirst
+    // removes the extra initial slash.
+    return uri.path.replaceFirst("/", "").replaceAll("/", "\\");
+  } else {
+    // Network paths look like "file://hostname/path/to/file".
+    return "\\\\${uri.path.replaceAll("/", "\\")}";
+  }
 }
 
 /** Converts a local path string to a `file:` [Uri]. */
-Uri pathToFileUri(String path) {
-  path = pathos.absolute(path);
+Uri pathToFileUri(String pathString) {
+  pathString = pathos.absolute(pathString);
   if (Platform.operatingSystem != 'windows') {
-    return Uri.parse('file://$path');
+    return Uri.parse('file://$pathString');
+  } else if (pathos.rootPrefix(pathString).startsWith('\\\\')) {
+    // Network paths become "file://hostname/path/to/file".
+    return Uri.parse('file:${pathString.replaceAll("\\", "/")}');
   } else {
-    return Uri.parse('file:///${path.replaceAll("\\", "/")}');
+    // Drive-letter paths become "file:///C:/path/to/file".
+    return Uri.parse('file:///${pathString.replaceAll("\\", "/")}');
   }
 }
 
diff --git a/sdk/lib/_internal/libraries.dart b/sdk/lib/_internal/libraries.dart
index f41f2253..551ddab 100644
--- a/sdk/lib/_internal/libraries.dart
+++ b/sdk/lib/_internal/libraries.dart
@@ -86,9 +86,9 @@
       documented: false,
       platforms: VM_PLATFORM),
 
-  "typeddata": const LibraryInfo(
-      "typeddata/typeddata.dart",
-      dart2jsPatchPath: "_internal/compiler/implementation/lib/typeddata_patch.dart"),
+  "typed_data": const LibraryInfo(
+      "typed_data/typed_data.dart",
+      dart2jsPath: "typed_data/dart2js/typed_data_dart2js.dart"),
 
   "svg": const LibraryInfo(
         "svg/dartium/svg_dartium.dart",
diff --git a/sdk/lib/_internal/pub/bin/pub.dart b/sdk/lib/_internal/pub/bin/pub.dart
new file mode 100644
index 0000000..0d6e72a
--- /dev/null
+++ b/sdk/lib/_internal/pub/bin/pub.dart
@@ -0,0 +1,159 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+import 'dart:math' as math;
+
+import 'package:args/args.dart';
+import 'package:pathos/path.dart' as path;
+
+import '../lib/src/command.dart';
+import '../lib/src/exit_codes.dart' as exit_codes;
+import '../lib/src/io.dart';
+import '../lib/src/log.dart' as log;
+import '../lib/src/sdk.dart' as sdk;
+import '../lib/src/system_cache.dart';
+import '../lib/src/utils.dart';
+
+/// The parser for arguments that are global to Pub rather than specific to a
+/// single command.
+ArgParser get pubArgParser {
+  var parser = new ArgParser();
+  parser.addFlag('help', abbr: 'h', negatable: false,
+      help: 'Print this usage information.');
+  parser.addFlag('version', negatable: false,
+      help: 'Print pub version.');
+  parser.addFlag('trace',
+       help: 'Print debugging information when an error occurs.');
+  parser.addOption('verbosity',
+      help: 'Control output verbosity.',
+      allowed: ['normal', 'io', 'solver', 'all'],
+      allowedHelp: {
+        'normal': 'Show errors, warnings, and user messages.',
+        'io':     'Also show IO operations.',
+        'solver': 'Show steps during version resolution.',
+        'all':    'Show all output including internal tracing messages.'
+      });
+  parser.addFlag('verbose', abbr: 'v', negatable: false,
+      help: 'Shortcut for "--verbosity=all"');
+  return parser;
+}
+
+void main() {
+  var globalOptions;
+  try {
+    globalOptions = pubArgParser.parse(new Options().arguments);
+  } on FormatException catch (e) {
+    log.error(e.message);
+    log.error('Run "pub help" to see available options.');
+    exit(exit_codes.USAGE);
+  }
+
+  if (globalOptions['version']) {
+    log.message('Pub ${sdk.version}');
+    return;
+  }
+
+  if (globalOptions['help'] || globalOptions.rest.isEmpty) {
+    printUsage();
+    return;
+  }
+
+  if (globalOptions['trace']) {
+    log.recordTranscript();
+  }
+
+  switch (globalOptions['verbosity']) {
+    case 'normal': log.showNormal(); break;
+    case 'io': log.showIO(); break;
+    case 'solver': log.showSolver(); break;
+    case 'all': log.showAll(); break;
+    default:
+      // No specific verbosity given, so check for the shortcut.
+      if (globalOptions['verbose']) {
+        log.showAll();
+      } else {
+        log.showNormal();
+      }
+      break;
+  }
+
+  var cacheDir;
+  if (Platform.environment.containsKey('PUB_CACHE')) {
+    cacheDir = Platform.environment['PUB_CACHE'];
+  } else if (Platform.operatingSystem == 'windows') {
+    var appData = Platform.environment['APPDATA'];
+    cacheDir = path.join(appData, 'Pub', 'Cache');
+  } else {
+    cacheDir = '${Platform.environment['HOME']}/.pub-cache';
+  }
+
+  validatePlatform().then((_) {
+    var cache = new SystemCache.withSources(cacheDir);
+
+    // Select the command.
+    var command = PubCommand.commands[globalOptions.rest[0]];
+    if (command == null) {
+      log.error('Could not find a command named "${globalOptions.rest[0]}".');
+      log.error('Run "pub help" to see available commands.');
+      exit(exit_codes.USAGE);
+      return;
+    }
+
+    var commandArgs = globalOptions.rest.sublist(1);
+    command.run(cache, globalOptions, commandArgs);
+  });
+}
+
+/// Checks that pub is running on a supported platform. If it isn't, it prints
+/// an error message and exits. Completes when the validation is done.
+Future validatePlatform() {
+  return new Future.sync(() {
+    if (Platform.operatingSystem != 'windows') return;
+
+    return runProcess('ver', []).then((result) {
+      if (result.stdout.join('\n').contains('XP')) {
+        log.error('Sorry, but pub is not supported on Windows XP.');
+        exit(exit_codes.USAGE);
+      }
+    });
+  });
+}
+
+/// Displays usage information for the app.
+void printUsage([String description = 'Pub is a package manager for Dart.']) {
+  // Build up a buffer so it shows up as a single log entry.
+  var buffer = new StringBuffer();
+  buffer.write(description);
+  buffer.write('\n\n');
+  buffer.write('Usage: pub command [arguments]\n\n');
+  buffer.write('Global options:\n');
+  buffer.write('${pubArgParser.getUsage()}\n\n');
+
+  // Show the commands sorted.
+  buffer.write('Available commands:\n');
+
+  // TODO(rnystrom): A sorted map would be nice.
+  int length = 0;
+  var names = <String>[];
+  for (var command in PubCommand.commands.keys) {
+    // Hide aliases.
+    if (PubCommand.commands[command].aliases.indexOf(command) >= 0) continue;
+    length = math.max(length, command.length);
+    names.add(command);
+  }
+
+  names.sort((a, b) => a.compareTo(b));
+
+  for (var name in names) {
+    buffer.write('  ${padRight(name, length)}   '
+        '${PubCommand.commands[name].description}\n');
+  }
+
+  buffer.write('\n');
+  buffer.write(
+      'Use "pub help [command]" for more information about a command.');
+  log.message(buffer.toString());
+}
diff --git a/sdk/lib/_internal/pub/lib/src/command.dart b/sdk/lib/_internal/pub/lib/src/command.dart
new file mode 100644
index 0000000..21ad9b6
--- /dev/null
+++ b/sdk/lib/_internal/pub/lib/src/command.dart
@@ -0,0 +1,192 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:async';
+
+import 'package:args/args.dart';
+import 'package:pathos/path.dart' as path;
+
+import 'command_cache.dart';
+import 'command_help.dart';
+import 'command_install.dart';
+import 'command_lish.dart';
+import 'command_update.dart';
+import 'command_uploader.dart';
+import 'command_version.dart';
+import 'entrypoint.dart';
+import 'exit_codes.dart' as exit_codes;
+import 'http.dart';
+import 'log.dart' as log;
+import 'package.dart';
+import 'system_cache.dart';
+import 'utils.dart';
+
+/// The base class for commands for the pub executable.
+abstract class PubCommand {
+  /// The commands that Pub understands.
+  static Map<String, PubCommand> get commands {
+    var commands = {
+      'cache': new CacheCommand(),
+      'help': new HelpCommand(),
+      'install': new InstallCommand(),
+      'publish': new LishCommand(),
+      'update': new UpdateCommand(),
+      'uploader': new UploaderCommand(),
+      'version': new VersionCommand()
+     };
+    for (var command in commands.values.toList()) {
+      for (var alias in command.aliases) {
+        commands[alias] = command;
+      }
+    }
+    return commands;
+  }
+
+  SystemCache cache;
+  ArgResults globalOptions;
+  ArgResults commandOptions;
+
+  Entrypoint entrypoint;
+
+  /// A one-line description of this command.
+  String get description;
+
+  /// How to invoke this command (e.g. `"pub install [package]"`).
+  String get usage;
+
+  /// Whether or not this command requires [entrypoint] to be defined. If false,
+  /// Pub won't look for a pubspec and [entrypoint] will be null when the
+  /// command runs.
+  final requiresEntrypoint = true;
+
+  /// Alternate names for this command. These names won't be used in the
+  /// documentation, but they will work when invoked on the command line.
+  final aliases = const <String>[];
+
+  /// Override this to define command-specific options. The results will be made
+  /// available in [commandOptions].
+  ArgParser get commandParser => new ArgParser();
+
+  void run(SystemCache cache_, ArgResults globalOptions_,
+      List<String> commandArgs) {
+    cache = cache_;
+    globalOptions = globalOptions_;
+
+    try {
+      commandOptions = commandParser.parse(commandArgs);
+    } on FormatException catch (e) {
+      log.error(e.message);
+      log.error('Use "pub help" for more information.');
+      exit(exit_codes.USAGE);
+    }
+
+    handleError(error) {
+      var trace = getAttachedStackTrace(error);
+
+      // This is basically the top-level exception handler so that we don't
+      // spew a stack trace on our users.
+      var message;
+
+      try {
+        // Most exception types have a "message" property. We prefer this since
+        // it skips the "Exception:", "HttpException:", etc. prefix that calling
+        // toString() adds. But, alas, "message" isn't actually defined in the
+        // base Exception type so there's no easy way to know if it's available
+        // short of a giant pile of type tests for each known exception type.
+        //
+        // So just try it. If it throws, default to toString().
+        message = error.message;
+      } on NoSuchMethodError catch (_) {
+        message = error.toString();
+      }
+
+      log.error(message);
+
+      if (trace != null) {
+        if (globalOptions['trace'] || !isUserFacingException(error)) {
+          log.error(trace);
+        } else {
+          log.fine(trace);
+        }
+      }
+
+      if (globalOptions['trace']) {
+        log.dumpTranscript();
+      } else if (!isUserFacingException(error)) {
+        log.error("""
+This is an unexpected error. Please run
+
+    pub --trace ${new Options().arguments.map((arg) => "'$arg'").join(' ')}
+
+and include the results in a bug report on http://dartbug.com/new.
+""");
+      }
+
+      exit(_chooseExitCode(error));
+    }
+
+    new Future.sync(() {
+      if (requiresEntrypoint) {
+        // TODO(rnystrom): Will eventually need better logic to walk up
+        // subdirectories until we hit one that looks package-like. For now,
+        // just assume the cwd is it.
+        entrypoint = new Entrypoint(path.current, cache);
+      }
+
+      var commandFuture = onRun();
+      if (commandFuture == null) return true;
+
+      return commandFuture;
+    }).whenComplete(() => cache_.deleteTempDir()).catchError((e) {
+      if (e is PubspecNotFoundException && e.name == null) {
+        e = 'Could not find a file named "pubspec.yaml" in the directory '
+          '${path.current}.';
+      } else if (e is PubspecHasNoNameException && e.name == null) {
+        e = 'pubspec.yaml is missing the required "name" field (e.g. "name: '
+          '${path.basename(path.current)}").';
+      }
+
+      handleError(e);
+    }).then((_) {
+      // Explicitly exit on success to ensure that any dangling dart:io handles
+      // don't cause the process to never terminate.
+      exit(0);
+    });
+  }
+
+  /// Override this to perform the specific command. Return a future that
+  /// completes when the command is done or fails if the command fails. If the
+  /// command is synchronous, it may return `null`.
+  Future onRun();
+
+  /// Displays usage information for this command.
+  void printUsage([String description]) {
+    if (description == null) description = this.description;
+
+    var buffer = new StringBuffer();
+    buffer.write('$description\n\nUsage: $usage');
+
+    var commandUsage = commandParser.getUsage();
+    if (!commandUsage.isEmpty) {
+      buffer.write('\n');
+      buffer.write(commandUsage);
+    }
+
+    log.message(buffer.toString());
+  }
+
+  /// Returns the appropriate exit code for [exception], falling back on 1 if no
+  /// appropriate exit code could be found.
+  int _chooseExitCode(exception) {
+    if (exception is HttpException || exception is HttpParserException ||
+        exception is SocketIOException || exception is PubHttpException) {
+      return exit_codes.UNAVAILABLE;
+    } else if (exception is FormatException) {
+      return exit_codes.DATA;
+    } else {
+      return 1;
+    }
+  }
+}
diff --git a/utils/pub/command_cache.dart b/sdk/lib/_internal/pub/lib/src/command_cache.dart
similarity index 97%
rename from utils/pub/command_cache.dart
rename to sdk/lib/_internal/pub/lib/src/command_cache.dart
index eb77fd2..b4131b4 100644
--- a/utils/pub/command_cache.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_cache.dart
@@ -8,10 +8,9 @@
 import 'dart:io';
 import 'dart:json' as json;
 
+import 'command.dart';
 import 'exit_codes.dart' as exit_codes;
 import 'log.dart' as log;
-import 'pub.dart';
-
 
 /// Handles the `cache` pub command.
 class CacheCommand extends PubCommand {
diff --git a/utils/pub/command_help.dart b/sdk/lib/_internal/pub/lib/src/command_help.dart
similarity index 92%
rename from utils/pub/command_help.dart
rename to sdk/lib/_internal/pub/lib/src/command_help.dart
index 961546a..25218bc3 100644
--- a/utils/pub/command_help.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_help.dart
@@ -6,10 +6,11 @@
 
 import 'dart:async';
 import 'dart:io' as io;
+
+import 'command.dart';
 import 'exit_codes.dart' as exit_codes;
 import 'io.dart';
 import 'log.dart' as log;
-import 'pub.dart';
 
 /// Handles the `help` pub command. 
 class HelpCommand extends PubCommand {
@@ -22,7 +23,7 @@
       printUsage();
     } else {
       var name = commandOptions.rest[0];
-      var command = pubCommands[name];
+      var command = PubCommand.commands[name];
       if (command == null) {
         log.error('Could not find a command named "$name".');
         log.error('Run "pub help" to see available commands.');
diff --git a/utils/pub/command_install.dart b/sdk/lib/_internal/pub/lib/src/command_install.dart
similarity index 96%
rename from utils/pub/command_install.dart
rename to sdk/lib/_internal/pub/lib/src/command_install.dart
index 7497a27..d51b553 100644
--- a/utils/pub/command_install.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_install.dart
@@ -6,9 +6,9 @@
 
 import 'dart:async';
 
+import 'command.dart';
 import 'entrypoint.dart';
 import 'log.dart' as log;
-import 'pub.dart';
 
 /// Handles the `install` pub command.
 class InstallCommand extends PubCommand {
diff --git a/utils/pub/command_lish.dart b/sdk/lib/_internal/pub/lib/src/command_lish.dart
similarity index 99%
rename from utils/pub/command_lish.dart
rename to sdk/lib/_internal/pub/lib/src/command_lish.dart
index 1f767c9..cc03118 100644
--- a/utils/pub/command_lish.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_lish.dart
@@ -13,6 +13,7 @@
 import 'package:http/http.dart' as http;
 import 'package:pathos/path.dart' as path;
 
+import 'command.dart';
 import 'directory_tree.dart';
 import 'exit_codes.dart' as exit_codes;
 import 'git.dart' as git;
@@ -20,7 +21,6 @@
 import 'io.dart';
 import 'log.dart' as log;
 import 'oauth2.dart' as oauth2;
-import 'pub.dart';
 import 'utils.dart';
 import 'validator.dart';
 
diff --git a/utils/pub/command_update.dart b/sdk/lib/_internal/pub/lib/src/command_update.dart
similarity index 96%
rename from utils/pub/command_update.dart
rename to sdk/lib/_internal/pub/lib/src/command_update.dart
index b54cb64..147e925 100644
--- a/utils/pub/command_update.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_update.dart
@@ -5,9 +5,10 @@
 library command_update;
 
 import 'dart:async';
+
+import 'command.dart';
 import 'entrypoint.dart';
 import 'log.dart' as log;
-import 'pub.dart';
 
 /// Handles the `update` pub command.
 class UpdateCommand extends PubCommand {
diff --git a/utils/pub/command_uploader.dart b/sdk/lib/_internal/pub/lib/src/command_uploader.dart
similarity index 98%
rename from utils/pub/command_uploader.dart
rename to sdk/lib/_internal/pub/lib/src/command_uploader.dart
index 5bb05f2..958f298 100644
--- a/utils/pub/command_uploader.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_uploader.dart
@@ -11,13 +11,13 @@
 import 'package:args/args.dart';
 import 'package:pathos/path.dart' as path;
 
+import 'command.dart';
 import 'entrypoint.dart';
 import 'exit_codes.dart' as exit_codes;
 import 'http.dart';
 import 'io.dart';
 import 'log.dart' as log;
 import 'oauth2.dart' as oauth2;
-import 'pub.dart';
 import 'utils.dart';
 
 /// Handles the `uploader` pub command.
diff --git a/utils/pub/command_version.dart b/sdk/lib/_internal/pub/lib/src/command_version.dart
similarity index 80%
rename from utils/pub/command_version.dart
rename to sdk/lib/_internal/pub/lib/src/command_version.dart
index 7c9ad63..457eebd 100644
--- a/utils/pub/command_version.dart
+++ b/sdk/lib/_internal/pub/lib/src/command_version.dart
@@ -5,7 +5,10 @@
 library command_version;
 
 import 'dart:async';
-import 'pub.dart';
+
+import 'command.dart';
+import 'log.dart' as log;
+import 'sdk.dart' as sdk;
 
 /// Handles the `version` pub command. 
 class VersionCommand extends PubCommand {
@@ -14,6 +17,6 @@
   bool get requiresEntrypoint => false;
 
   Future onRun() {
-    printVersion();
+    log.message('Pub ${sdk.version}');
   }
 }
diff --git a/utils/pub/directory_tree.dart b/sdk/lib/_internal/pub/lib/src/directory_tree.dart
similarity index 100%
rename from utils/pub/directory_tree.dart
rename to sdk/lib/_internal/pub/lib/src/directory_tree.dart
diff --git a/utils/pub/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
similarity index 100%
rename from utils/pub/entrypoint.dart
rename to sdk/lib/_internal/pub/lib/src/entrypoint.dart
diff --git a/utils/pub/error_group.dart b/sdk/lib/_internal/pub/lib/src/error_group.dart
similarity index 100%
rename from utils/pub/error_group.dart
rename to sdk/lib/_internal/pub/lib/src/error_group.dart
diff --git a/utils/pub/exit_codes.dart b/sdk/lib/_internal/pub/lib/src/exit_codes.dart
similarity index 100%
rename from utils/pub/exit_codes.dart
rename to sdk/lib/_internal/pub/lib/src/exit_codes.dart
diff --git a/utils/pub/git.dart b/sdk/lib/_internal/pub/lib/src/git.dart
similarity index 100%
rename from utils/pub/git.dart
rename to sdk/lib/_internal/pub/lib/src/git.dart
diff --git a/utils/pub/git_source.dart b/sdk/lib/_internal/pub/lib/src/git_source.dart
similarity index 100%
rename from utils/pub/git_source.dart
rename to sdk/lib/_internal/pub/lib/src/git_source.dart
diff --git a/utils/pub/hosted_source.dart b/sdk/lib/_internal/pub/lib/src/hosted_source.dart
similarity index 90%
rename from utils/pub/hosted_source.dart
rename to sdk/lib/_internal/pub/lib/src/hosted_source.dart
index bd017e6..1b4ecda 100644
--- a/utils/pub/hosted_source.dart
+++ b/sdk/lib/_internal/pub/lib/src/hosted_source.dart
@@ -49,11 +49,16 @@
   /// Downloads and parses the pubspec for a specific version of a package that
   /// is available from the site.
   Future<Pubspec> describe(PackageId id) {
+    // Request it from the server.
     var url = _makeVersionUrl(id, (server, package, version) =>
         "$server/packages/$package/versions/$version.yaml");
 
     log.io("Describe package at $url.");
     return httpClient.read(url).then((yaml) {
+      // TODO(rnystrom): After this is pulled down, we could place it in
+      // a secondary cache of just pubspecs. This would let us have a
+      // persistent cache for pubspecs for packages that haven't actually
+      // been installed.
       return new Pubspec.parse(null, yaml, systemCache.sources);
     }).catchError((ex) {
       var parsed = _parseDescription(id.description);
@@ -122,11 +127,19 @@
     var cacheDir = path.join(systemCacheRoot,
                              _getSourceDirectory(_defaultUrl));
     if (!dirExists(cacheDir)) return [];
-  
-    return listDir(path.join(cacheDir)).map((entry) =>
-        new Package.load(null, entry, systemCache.sources)).toList();
+
+    return listDir(path.join(cacheDir)).map((entry) {
+      // TODO(keertip): instead of catching exception in pubspec parse with
+      // sdk dependency, fix to parse and report usage of sdk dependency. 
+      // dartbug.com/10190
+      try {
+        return new Package.load(null, entry, systemCache.sources);
+      }  on ArgumentError catch (e) {
+        log.error(e);         
+      }
+    }).where((package) => package != null).toList();
   }
-  
+
   /// When an error occurs trying to read something about [package] from [url],
   /// this tries to translate into a more user friendly error message. Always
   /// throws an error, either the original one or a better one.
diff --git a/utils/pub/http.dart b/sdk/lib/_internal/pub/lib/src/http.dart
similarity index 95%
rename from utils/pub/http.dart
rename to sdk/lib/_internal/pub/lib/src/http.dart
index 8a98313..123c2060 100644
--- a/utils/pub/http.dart
+++ b/sdk/lib/_internal/pub/lib/src/http.dart
@@ -24,13 +24,21 @@
 /// Headers and field names that should be censored in the log output.
 final _CENSORED_FIELDS = const ['refresh_token', 'authorization'];
 
+/// Whether dart:io's SecureSocket has been initialized with pub's resources
+/// yet.
+bool _initializedSecureSocket = false;
+
 /// An HTTP client that transforms 40* errors and socket exceptions into more
 /// user-friendly error messages.
 class PubHttpClient extends http.BaseClient {
   http.Client inner;
 
   PubHttpClient([http.Client inner])
-    : this.inner = inner == null ? new http.Client() : inner;
+      : this.inner = inner == null ? new http.Client() : inner {
+    if (!_initializedSecureSocket) {
+      SecureSocket.initialize(database: resourcePath('certs'));
+    }
+  }
 
   Future<http.StreamedResponse> send(http.BaseRequest request) {
     _logRequest(request);
diff --git a/utils/pub/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
similarity index 94%
rename from utils/pub/io.dart
rename to sdk/lib/_internal/pub/lib/src/io.dart
index 12121e7..1620837 100644
--- a/utils/pub/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 /// Helper functionality to make working with IO easier.
-library io;
+library pub.io;
 
 import 'dart:async';
 import 'dart:io';
@@ -16,6 +16,7 @@
 import 'error_group.dart';
 import 'exit_codes.dart' as exit_codes;
 import 'log.dart' as log;
+import 'sdk.dart' as sdk;
 import 'utils.dart';
 
 export 'package:http/http.dart' show ByteStream;
@@ -252,23 +253,29 @@
   }
 }
 
-/// Resolves [target] relative to the location of pub.dart.
-String relativeToPub(String target) {
-  var scriptPath = new File(new Options().script).fullPathSync();
+/// Whether pub is running from within the Dart SDK, as opposed to from the Dart
+/// source repository.
+bool get runningFromSdk => path.extension(new Options().script) == '.snapshot';
 
-  // Walk up until we hit the "util(s)" directory. This lets us figure out where
-  // we are if this function is called from pub.dart, or one of the tests,
-  // which also live under "utils", or from the SDK where pub is in "util".
-  var utilDir = path.dirname(scriptPath);
-  while (path.basename(utilDir) != 'utils' &&
-         path.basename(utilDir) != 'util') {
-    if (path.basename(utilDir) == '') {
-      throw new Exception('Could not find path to pub.');
-    }
-    utilDir = path.dirname(utilDir);
+/// Resolves [target] relative to the path to pub's `resource` directory.
+String resourcePath(String target) {
+  if (runningFromSdk) {
+    return path.join(
+        sdk.rootDirectory, 'lib', '_internal', 'pub', 'resource', target);
+  } else {
+    return path.join(
+        path.dirname(libraryPath('pub.io')), '..', '..', 'resource', target);
   }
+}
 
-  return path.normalize(path.join(utilDir, 'pub', target));
+/// Returns the path to the root of the Dart repository. This will throw a
+/// [StateError] if it's called when running pub from the SDK.
+String get repoRoot {
+  if (runningFromSdk) {
+    throw new StateError("Can't get the repo root from the SDK.");
+  }
+  return path.join(
+      path.dirname(libraryPath('pub.io')), '..', '..', '..', '..', '..', '..');
 }
 
 /// A line-by-line stream of standard input.
@@ -553,6 +560,11 @@
   });
 }
 
+String get pathTo7zip {
+  if (runningFromSdk) return resourcePath(path.join('7zip', '7za.exe'));
+  return path.join(repoRoot, 'third_party', '7zip', '7za.exe');
+}
+
 Future<bool> _extractTarGzWindows(Stream<List<int>> stream,
     String destination) {
   // TODO(rnystrom): In the repo's history, there is an older implementation of
@@ -562,11 +574,6 @@
   // read from stdin instead of a file. Consider resurrecting that version if
   // we can figure out why it fails.
 
-  // Note: This line of code gets munged by create_sdk.py to be the correct
-  // relative path to 7zip in the SDK.
-  var pathTo7zip = '../../third_party/7zip/7za.exe';
-  var command = relativeToPub(pathTo7zip);
-
   return withTempDir((tempDir) {
     // Write the archive to a temp file.
     var dataFile = path.join(tempDir, 'data.tar.gz');
@@ -575,7 +582,7 @@
       // first we un-gzip it to a tar file.
       // Note: Setting the working directory instead of passing in a full file
       // path because 7zip says "A full path is not allowed here."
-      return runProcess(command, ['e', 'data.tar.gz'], workingDir: tempDir);
+      return runProcess(pathTo7zip, ['e', 'data.tar.gz'], workingDir: tempDir);
     }).then((result) {
       if (result.exitCode != 0) {
         throw new Exception('Could not un-gzip (exit code ${result.exitCode}). '
@@ -592,7 +599,7 @@
       });
 
       // Untar the archive into the destination directory.
-      return runProcess(command, ['x', tarFile], workingDir: destination);
+      return runProcess(pathTo7zip, ['x', tarFile], workingDir: destination);
     }).then((result) {
       if (result.exitCode != 0) {
         throw new Exception('Could not un-tar (exit code ${result.exitCode}). '
@@ -650,20 +657,15 @@
     var args = ["a", "-w$baseDir", tarFile];
     args.addAll(contents.map((entry) => '-i!"$entry"'));
 
-    // Note: This line of code gets munged by create_sdk.py to be the correct
-    // relative path to 7zip in the SDK.
-    var pathTo7zip = '../../third_party/7zip/7za.exe';
-    var command = relativeToPub(pathTo7zip);
-
     // We're passing 'baseDir' both as '-w' and setting it as the working
     // directory explicitly here intentionally. The former ensures that the
     // files added to the archive have the correct relative path in the archive.
     // The latter enables relative paths in the "-i" args to be resolved.
-    return runProcess(command, args, workingDir: baseDir).then((_) {
+    return runProcess(pathTo7zip, args, workingDir: baseDir).then((_) {
       // GZIP it. 7zip doesn't support doing both as a single operation. Send
       // the output to stdout.
       args = ["a", "unused", "-tgzip", "-so", tarFile];
-      return startProcess(command, args);
+      return startProcess(pathTo7zip, args);
     }).then((process) {
       // Ignore 7zip's stderr. 7zip writes its normal output to stderr. We don't
       // want to show that since it's meaningless.
diff --git a/utils/pub/lock_file.dart b/sdk/lib/_internal/pub/lib/src/lock_file.dart
similarity index 100%
rename from utils/pub/lock_file.dart
rename to sdk/lib/_internal/pub/lib/src/lock_file.dart
diff --git a/utils/pub/log.dart b/sdk/lib/_internal/pub/lib/src/log.dart
similarity index 100%
rename from utils/pub/log.dart
rename to sdk/lib/_internal/pub/lib/src/log.dart
diff --git a/utils/pub/oauth2.dart b/sdk/lib/_internal/pub/lib/src/oauth2.dart
similarity index 100%
rename from utils/pub/oauth2.dart
rename to sdk/lib/_internal/pub/lib/src/oauth2.dart
diff --git a/utils/pub/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart
similarity index 98%
rename from utils/pub/package.dart
rename to sdk/lib/_internal/pub/lib/src/package.dart
index f1f65d3..ce1ad35 100644
--- a/utils/pub/package.dart
+++ b/sdk/lib/_internal/pub/lib/src/package.dart
@@ -146,7 +146,7 @@
   }
 
   /// Returns the pubspec for this package.
-  Future<Pubspec> describe() => source.describe(this);
+  Future<Pubspec> describe() => source.systemCache.describe(this);
 
   /// Returns a future that completes to the resovled [PackageId] for this id.
   Future<PackageId> get resolved => source.resolveId(this);
diff --git a/utils/pub/path_source.dart b/sdk/lib/_internal/pub/lib/src/path_source.dart
similarity index 100%
rename from utils/pub/path_source.dart
rename to sdk/lib/_internal/pub/lib/src/path_source.dart
diff --git a/utils/pub/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart
similarity index 100%
rename from utils/pub/pubspec.dart
rename to sdk/lib/_internal/pub/lib/src/pubspec.dart
diff --git a/utils/pub/safe_http_server.dart b/sdk/lib/_internal/pub/lib/src/safe_http_server.dart
similarity index 100%
rename from utils/pub/safe_http_server.dart
rename to sdk/lib/_internal/pub/lib/src/safe_http_server.dart
diff --git a/utils/pub/sdk.dart b/sdk/lib/_internal/pub/lib/src/sdk.dart
similarity index 82%
rename from utils/pub/sdk.dart
rename to sdk/lib/_internal/pub/lib/src/sdk.dart
index 3222c9e..0fbe5f9 100644
--- a/utils/pub/sdk.dart
+++ b/sdk/lib/_internal/pub/lib/src/sdk.dart
@@ -28,15 +28,19 @@
     return dir;
   }
 
-  var pubDir = path.dirname(new Options().script);
-  dir = path.normalize(path.join(pubDir, "../../"));
-  log.fine("Located SDK at $dir");
-  return dir;
+  // Assume the Dart executable is always coming from the SDK.
+  return path.dirname(path.dirname(new Options().executable));
 }
 
 /// Gets the SDK's revision number formatted to be a semantic version.
 Version version = _getVersion();
 
+/// Is `true` if the current SDK is an unreleased bleeding edge version.
+bool get isBleedingEdge {
+  // The live build is locked to the magical old number "0.1.2+<stuff>".
+  return version.major == 0 && version.minor == 1 && version.patch == 2;
+}
+
 /// Determine the SDK's version number.
 Version _getVersion() {
   var revisionPath = path.join(rootDirectory, "version");
diff --git a/utils/pub/solver/backtracking_solver.dart b/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
similarity index 98%
rename from utils/pub/solver/backtracking_solver.dart
rename to sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
index 4e5baa0..a5e3e3c 100644
--- a/utils/pub/solver/backtracking_solver.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
@@ -588,6 +588,12 @@
 /// Ensures that if [pubspec] has an SDK constraint, then it is compatible
 /// with the current SDK. Throws a [SolverFailure] if not.
 void _validateSdkConstraint(Pubspec pubspec) {
+  // If the user is running a continouous build of the SDK, just disable SDK
+  // constraint checking entirely. The actual version number you get is
+  // impossibly old and not correct. We'll just assume users on continuous
+  // know what they're doing.
+  if (sdk.isBleedingEdge) return;
+
   if (pubspec.environment.sdkVersion.allows(sdk.version)) return;
 
   throw new CouldNotSolveException(
diff --git a/utils/pub/solver/version_solver.dart b/sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
similarity index 100%
rename from utils/pub/solver/version_solver.dart
rename to sdk/lib/_internal/pub/lib/src/solver/version_solver.dart
diff --git a/utils/pub/source.dart b/sdk/lib/_internal/pub/lib/src/source.dart
similarity index 100%
rename from utils/pub/source.dart
rename to sdk/lib/_internal/pub/lib/src/source.dart
diff --git a/utils/pub/source_registry.dart b/sdk/lib/_internal/pub/lib/src/source_registry.dart
similarity index 100%
rename from utils/pub/source_registry.dart
rename to sdk/lib/_internal/pub/lib/src/source_registry.dart
diff --git a/utils/pub/system_cache.dart b/sdk/lib/_internal/pub/lib/src/system_cache.dart
similarity index 95%
rename from utils/pub/system_cache.dart
rename to sdk/lib/_internal/pub/lib/src/system_cache.dart
index 4c0e176..8a51912 100644
--- a/utils/pub/system_cache.dart
+++ b/sdk/lib/_internal/pub/lib/src/system_cache.dart
@@ -70,13 +70,16 @@
     // Try to get it from the system cache first.
     if (id.source.shouldCache) {
       return id.systemCacheDirectory.then((packageDir) {
-        if (!dirExists(packageDir)) return id.describe();
+        if (!fileExists(path.join(packageDir, "pubspec.yaml"))) {
+          return id.source.describe(id);
+        }
+
         return new Pubspec.load(id.name, packageDir, sources);
       });
     }
 
     // Not cached, so get it from the source.
-    return id.describe();
+    return id.source.describe(id);
   }
 
   /// Ensures that the package identified by [id] is installed to the cache,
diff --git a/utils/pub/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart
similarity index 92%
rename from utils/pub/utils.dart
rename to sdk/lib/_internal/pub/lib/src/utils.dart
index 36cc371..c631381 100644
--- a/utils/pub/utils.dart
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart
@@ -9,6 +9,7 @@
 import 'dart:crypto';
 import 'dart:io';
 import 'dart:isolate';
+import 'dart:mirrors';
 import 'dart:uri';
 
 /// A pair of values.
@@ -360,6 +361,29 @@
   });
 }
 
+/// Returns the path to the library named [libraryName]. The library name must
+/// be globally unique, or the wrong library path may be returned.
+String libraryPath(String libraryName) {
+  var libraries = currentMirrorSystem().findLibrary(new Symbol(libraryName));
+  return fileUriToPath(libraries.single.uri);
+}
+
+/// Converts a `file:` [Uri] to a local path string.
+String fileUriToPath(Uri uri) {
+  if (uri.scheme != 'file') {
+    throw new ArgumentError("Uri $uri must have scheme 'file:'.");
+  }
+  if (Platform.operatingSystem != 'windows') return uri.path;
+  if (uri.path.startsWith("/")) {
+    // Drive-letter paths look like "file:///C:/path/to/file". The replaceFirst
+    // removes the extra initial slash.
+    return uri.path.replaceFirst("/", "").replaceAll("/", "\\");
+  } else {
+    // Network paths look like "file://hostname/path/to/file".
+    return "\\\\${uri.path.replaceAll("/", "\\")}";
+  }
+}
+
 /// An exception class for exceptions that are intended to be seen by the user.
 /// These exceptions won't have any debugging information printed when they're
 /// thrown.
diff --git a/utils/pub/validator.dart b/sdk/lib/_internal/pub/lib/src/validator.dart
similarity index 100%
rename from utils/pub/validator.dart
rename to sdk/lib/_internal/pub/lib/src/validator.dart
diff --git a/utils/pub/validator/compiled_dartdoc.dart b/sdk/lib/_internal/pub/lib/src/validator/compiled_dartdoc.dart
similarity index 100%
rename from utils/pub/validator/compiled_dartdoc.dart
rename to sdk/lib/_internal/pub/lib/src/validator/compiled_dartdoc.dart
diff --git a/utils/pub/validator/dependency.dart b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
similarity index 100%
rename from utils/pub/validator/dependency.dart
rename to sdk/lib/_internal/pub/lib/src/validator/dependency.dart
diff --git a/utils/pub/validator/directory.dart b/sdk/lib/_internal/pub/lib/src/validator/directory.dart
similarity index 100%
rename from utils/pub/validator/directory.dart
rename to sdk/lib/_internal/pub/lib/src/validator/directory.dart
diff --git a/utils/pub/validator/lib.dart b/sdk/lib/_internal/pub/lib/src/validator/lib.dart
similarity index 100%
rename from utils/pub/validator/lib.dart
rename to sdk/lib/_internal/pub/lib/src/validator/lib.dart
diff --git a/utils/pub/validator/license.dart b/sdk/lib/_internal/pub/lib/src/validator/license.dart
similarity index 100%
rename from utils/pub/validator/license.dart
rename to sdk/lib/_internal/pub/lib/src/validator/license.dart
diff --git a/utils/pub/validator/name.dart b/sdk/lib/_internal/pub/lib/src/validator/name.dart
similarity index 100%
rename from utils/pub/validator/name.dart
rename to sdk/lib/_internal/pub/lib/src/validator/name.dart
diff --git a/utils/pub/validator/pubspec_field.dart b/sdk/lib/_internal/pub/lib/src/validator/pubspec_field.dart
similarity index 100%
rename from utils/pub/validator/pubspec_field.dart
rename to sdk/lib/_internal/pub/lib/src/validator/pubspec_field.dart
diff --git a/utils/pub/validator/size.dart b/sdk/lib/_internal/pub/lib/src/validator/size.dart
similarity index 100%
rename from utils/pub/validator/size.dart
rename to sdk/lib/_internal/pub/lib/src/validator/size.dart
diff --git a/utils/pub/validator/utf8_readme.dart b/sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart
similarity index 100%
rename from utils/pub/validator/utf8_readme.dart
rename to sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart
diff --git a/utils/pub/version.dart b/sdk/lib/_internal/pub/lib/src/version.dart
similarity index 100%
rename from utils/pub/version.dart
rename to sdk/lib/_internal/pub/lib/src/version.dart
diff --git a/utils/tests/pub/pub.status b/sdk/lib/_internal/pub/pub.status
similarity index 65%
rename from utils/tests/pub/pub.status
rename to sdk/lib/_internal/pub/pub.status
index 5d194b4..93d4029 100644
--- a/utils/tests/pub/pub.status
+++ b/sdk/lib/_internal/pub/pub.status
@@ -2,8 +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.
 
-pub_uploader_test: Pass, Fail # Issue 9357
-oauth2/with_server_rejected_credentials_authenticates_again_test: Pass, Fail # Issue 9839.
+test/pub_uploader_test: Pass, Fail # Issue 9357
+test/oauth2/with_server_rejected_credentials_authenticates_again_test: Pass, Fail # Issue 9839.
 
 # Pub only runs on the VM, so just rule out all compilers.
 [ $compiler == dart2js || $compiler == dart2dart ]
@@ -14,5 +14,5 @@
 *: Skip
 
 [ $system == windows ]
-io_test: Fail # Issue 7505
-install/hosted/fail_gracefully_on_url_resolve_test: Pass, Fail # Issue 9503
+test/io_test: Fail # Issue 7505
+test/install/hosted/fail_gracefully_on_url_resolve_test: Pass, Fail # Issue 9503
diff --git a/utils/pub/resource/certs/cert9.db b/sdk/lib/_internal/pub/resource/certs/cert9.db
similarity index 100%
rename from utils/pub/resource/certs/cert9.db
rename to sdk/lib/_internal/pub/resource/certs/cert9.db
Binary files differ
diff --git a/utils/pub/resource/certs/key4.db b/sdk/lib/_internal/pub/resource/certs/key4.db
similarity index 100%
rename from utils/pub/resource/certs/key4.db
rename to sdk/lib/_internal/pub/resource/certs/key4.db
Binary files differ
diff --git a/utils/pub/resource/certs/pkcs11.txt b/sdk/lib/_internal/pub/resource/certs/pkcs11.txt
similarity index 100%
rename from utils/pub/resource/certs/pkcs11.txt
rename to sdk/lib/_internal/pub/resource/certs/pkcs11.txt
diff --git a/utils/tests/pub/command_line_config.dart b/sdk/lib/_internal/pub/test/command_line_config.dart
similarity index 97%
rename from utils/tests/pub/command_line_config.dart
rename to sdk/lib/_internal/pub/test/command_line_config.dart
index 9a60951..8a929e4 100644
--- a/utils/tests/pub/command_line_config.dart
+++ b/sdk/lib/_internal/pub/test/command_line_config.dart
@@ -9,7 +9,7 @@
 
 import 'package:pathos/path.dart' as path;
 import 'package:unittest/unittest.dart';
-import '../../pub/utils.dart';
+import '../lib/src/utils.dart';
 
 /// Gets a "special" string (ANSI escape or Unicode). On Windows, returns
 /// something else since those aren't supported.
@@ -154,7 +154,7 @@
     if (match == null) {
       match = coreRegExp.firstMatch(text);
       if (match == null) {
-        throw FormatException("Couldn't parse stack trace line '$text'.");
+        throw new FormatException("Couldn't parse stack trace line '$text'.");
       }
       isCore = true;
     }
diff --git a/utils/tests/pub/descriptor.dart b/sdk/lib/_internal/pub/test/descriptor.dart
similarity index 98%
rename from utils/tests/pub/descriptor.dart
rename to sdk/lib/_internal/pub/test/descriptor.dart
index 17d352a..4122bbf 100644
--- a/utils/tests/pub/descriptor.dart
+++ b/sdk/lib/_internal/pub/test/descriptor.dart
@@ -10,7 +10,7 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/descriptor.dart';
 
-import '../../pub/utils.dart';
+import '../lib/src/utils.dart';
 import 'descriptor/git.dart';
 import 'descriptor/tar.dart';
 import 'test_pub.dart';
diff --git a/utils/tests/pub/descriptor/git.dart b/sdk/lib/_internal/pub/test/descriptor/git.dart
similarity index 98%
rename from utils/tests/pub/descriptor/git.dart
rename to sdk/lib/_internal/pub/test/descriptor/git.dart
index 5ef6e98..f2f7557 100644
--- a/utils/tests/pub/descriptor/git.dart
+++ b/sdk/lib/_internal/pub/test/descriptor/git.dart
@@ -10,7 +10,7 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/descriptor.dart';
 
-import '../../../pub/git.dart' as git;
+import '../../lib/src/git.dart' as git;
 
 /// Describes a Git repository and its contents.
 class GitRepoDescriptor extends DirectoryDescriptor {
diff --git a/utils/tests/pub/descriptor/tar.dart b/sdk/lib/_internal/pub/test/descriptor/tar.dart
similarity index 95%
rename from utils/tests/pub/descriptor/tar.dart
rename to sdk/lib/_internal/pub/test/descriptor/tar.dart
index c4f1d8f..02eca7c 100644
--- a/utils/tests/pub/descriptor/tar.dart
+++ b/sdk/lib/_internal/pub/test/descriptor/tar.dart
@@ -11,8 +11,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/descriptor.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 
 /// Describes a tar file and its contents.
 class TarFileDescriptor extends DirectoryDescriptor {
diff --git a/utils/tests/pub/dev_dependency_test.dart b/sdk/lib/_internal/pub/test/dev_dependency_test.dart
similarity index 100%
rename from utils/tests/pub/dev_dependency_test.dart
rename to sdk/lib/_internal/pub/test/dev_dependency_test.dart
diff --git a/utils/tests/pub/directory_tree_test.dart b/sdk/lib/_internal/pub/test/directory_tree_test.dart
similarity index 98%
rename from utils/tests/pub/directory_tree_test.dart
rename to sdk/lib/_internal/pub/test/directory_tree_test.dart
index 5adf785..0009f8e 100644
--- a/utils/tests/pub/directory_tree_test.dart
+++ b/sdk/lib/_internal/pub/test/directory_tree_test.dart
@@ -6,7 +6,7 @@
 
 import 'package:unittest/unittest.dart';
 
-import '../../pub/directory_tree.dart';
+import '../lib/src/directory_tree.dart';
 
 main() {
   test('no files', () {
diff --git a/utils/tests/pub/error_group_test.dart b/sdk/lib/_internal/pub/test/error_group_test.dart
similarity index 99%
rename from utils/tests/pub/error_group_test.dart
rename to sdk/lib/_internal/pub/test/error_group_test.dart
index 3460ddd..db952c8 100644
--- a/utils/tests/pub/error_group_test.dart
+++ b/sdk/lib/_internal/pub/test/error_group_test.dart
@@ -8,8 +8,8 @@
 
 import 'package:unittest/unittest.dart';
 
-import '../../pub/error_group.dart';
-import '../../pub/utils.dart';
+import '../lib/src/error_group.dart';
+import '../lib/src/utils.dart';
 
 ErrorGroup errorGroup;
 
diff --git a/utils/tests/pub/install/broken_symlink_test.dart b/sdk/lib/_internal/pub/test/install/broken_symlink_test.dart
similarity index 100%
rename from utils/tests/pub/install/broken_symlink_test.dart
rename to sdk/lib/_internal/pub/test/install/broken_symlink_test.dart
diff --git a/utils/tests/pub/install/git/check_out_and_update_test.dart b/sdk/lib/_internal/pub/test/install/git/check_out_and_update_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/check_out_and_update_test.dart
rename to sdk/lib/_internal/pub/test/install/git/check_out_and_update_test.dart
diff --git a/utils/tests/pub/install/git/check_out_branch_test.dart b/sdk/lib/_internal/pub/test/install/git/check_out_branch_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/check_out_branch_test.dart
rename to sdk/lib/_internal/pub/test/install/git/check_out_branch_test.dart
diff --git a/utils/tests/pub/install/git/check_out_revision_test.dart b/sdk/lib/_internal/pub/test/install/git/check_out_revision_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/check_out_revision_test.dart
rename to sdk/lib/_internal/pub/test/install/git/check_out_revision_test.dart
diff --git a/utils/tests/pub/install/git/check_out_test.dart b/sdk/lib/_internal/pub/test/install/git/check_out_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/check_out_test.dart
rename to sdk/lib/_internal/pub/test/install/git/check_out_test.dart
diff --git a/utils/tests/pub/install/git/check_out_transitive_test.dart b/sdk/lib/_internal/pub/test/install/git/check_out_transitive_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/check_out_transitive_test.dart
rename to sdk/lib/_internal/pub/test/install/git/check_out_transitive_test.dart
diff --git a/utils/tests/pub/install/git/check_out_twice_test.dart b/sdk/lib/_internal/pub/test/install/git/check_out_twice_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/check_out_twice_test.dart
rename to sdk/lib/_internal/pub/test/install/git/check_out_twice_test.dart
diff --git a/utils/tests/pub/install/git/check_out_with_trailing_slash_test.dart b/sdk/lib/_internal/pub/test/install/git/check_out_with_trailing_slash_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/check_out_with_trailing_slash_test.dart
rename to sdk/lib/_internal/pub/test/install/git/check_out_with_trailing_slash_test.dart
diff --git a/utils/tests/pub/install/git/dependency_name_match_pubspec_test.dart b/sdk/lib/_internal/pub/test/install/git/dependency_name_match_pubspec_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/dependency_name_match_pubspec_test.dart
rename to sdk/lib/_internal/pub/test/install/git/dependency_name_match_pubspec_test.dart
diff --git a/utils/tests/pub/install/git/different_repo_name_test.dart b/sdk/lib/_internal/pub/test/install/git/different_repo_name_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/different_repo_name_test.dart
rename to sdk/lib/_internal/pub/test/install/git/different_repo_name_test.dart
diff --git a/utils/tests/pub/install/git/lock_version_test.dart b/sdk/lib/_internal/pub/test/install/git/lock_version_test.dart
similarity index 97%
rename from utils/tests/pub/install/git/lock_version_test.dart
rename to sdk/lib/_internal/pub/test/install/git/lock_version_test.dart
index 444ff38..ed4994b 100644
--- a/utils/tests/pub/install/git/lock_version_test.dart
+++ b/sdk/lib/_internal/pub/test/install/git/lock_version_test.dart
@@ -9,7 +9,7 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../../pub/io.dart';
+import '../../../lib/src/io.dart';
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/git/require_pubspec_name_test.dart b/sdk/lib/_internal/pub/test/install/git/require_pubspec_name_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/require_pubspec_name_test.dart
rename to sdk/lib/_internal/pub/test/install/git/require_pubspec_name_test.dart
diff --git a/utils/tests/pub/install/git/require_pubspec_test.dart b/sdk/lib/_internal/pub/test/install/git/require_pubspec_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/require_pubspec_test.dart
rename to sdk/lib/_internal/pub/test/install/git/require_pubspec_test.dart
diff --git a/utils/tests/pub/install/git/stay_locked_if_compatible_test.dart b/sdk/lib/_internal/pub/test/install/git/stay_locked_if_compatible_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/stay_locked_if_compatible_test.dart
rename to sdk/lib/_internal/pub/test/install/git/stay_locked_if_compatible_test.dart
diff --git a/utils/tests/pub/install/git/unlock_if_incompatible_test.dart b/sdk/lib/_internal/pub/test/install/git/unlock_if_incompatible_test.dart
similarity index 100%
rename from utils/tests/pub/install/git/unlock_if_incompatible_test.dart
rename to sdk/lib/_internal/pub/test/install/git/unlock_if_incompatible_test.dart
diff --git a/sdk/lib/_internal/pub/test/install/hosted/cached_pubspec_test.dart b/sdk/lib/_internal/pub/test/install/hosted/cached_pubspec_test.dart
new file mode 100644
index 0000000..153431a
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/install/hosted/cached_pubspec_test.dart
@@ -0,0 +1,43 @@
+// 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 pub_tests;
+
+import 'package:pathos/path.dart' as path;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../../../lib/src/io.dart';
+import '../../descriptor.dart' as d;
+import '../../test_pub.dart';
+
+main() {
+  initConfig();
+
+  integration('does not request a pubspec for a cached package', () {
+    servePackages([packageMap("foo", "1.2.3")]);
+
+    d.appDir([dependencyMap("foo", "1.2.3")]).create();
+
+    // Run install once so it gets cached.
+    schedulePub(args: ['install'],
+        output: new RegExp("Dependencies installed!\$"));
+
+    // Clear the cache. We don't care about anything that was served during
+    // the initial install.
+    getRequestedPaths();
+
+    d.cacheDir({"foo": "1.2.3"}).validate();
+    d.packagesDir({"foo": "1.2.3"}).validate();
+
+    // Run the solver again now that it's cached.
+    schedulePub(args: ['install'],
+        output: new RegExp("Dependencies installed!\$"));
+
+    // The update should not have requested the pubspec since it's installed
+    // locally already.
+    getRequestedPaths().then((paths) {
+      expect(paths, isNot(contains("packages/foo/versions/1.2.3.yaml")));
+    });
+  });
+}
diff --git a/utils/tests/pub/install/hosted/do_not_update_on_removed_constraints_test.dart b/sdk/lib/_internal/pub/test/install/hosted/do_not_update_on_removed_constraints_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/do_not_update_on_removed_constraints_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/do_not_update_on_removed_constraints_test.dart
diff --git a/utils/tests/pub/install/hosted/fail_gracefully_on_missing_package_test.dart b/sdk/lib/_internal/pub/test/install/hosted/fail_gracefully_on_missing_package_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/fail_gracefully_on_missing_package_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/fail_gracefully_on_missing_package_test.dart
diff --git a/utils/tests/pub/install/hosted/fail_gracefully_on_url_resolve_test.dart b/sdk/lib/_internal/pub/test/install/hosted/fail_gracefully_on_url_resolve_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/fail_gracefully_on_url_resolve_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/fail_gracefully_on_url_resolve_test.dart
diff --git a/utils/tests/pub/install/hosted/install_test.dart b/sdk/lib/_internal/pub/test/install/hosted/install_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/install_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/install_test.dart
diff --git a/utils/tests/pub/install/hosted/install_transitive_test.dart b/sdk/lib/_internal/pub/test/install/hosted/install_transitive_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/install_transitive_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/install_transitive_test.dart
diff --git a/utils/tests/pub/install/hosted/remove_removed_dependency_test.dart b/sdk/lib/_internal/pub/test/install/hosted/remove_removed_dependency_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/remove_removed_dependency_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/remove_removed_dependency_test.dart
diff --git a/utils/tests/pub/install/hosted/remove_removed_transitive_dependency_test.dart b/sdk/lib/_internal/pub/test/install/hosted/remove_removed_transitive_dependency_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/remove_removed_transitive_dependency_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/remove_removed_transitive_dependency_test.dart
diff --git a/utils/tests/pub/install/hosted/repair_cache_test.dart b/sdk/lib/_internal/pub/test/install/hosted/repair_cache_test.dart
similarity index 97%
rename from utils/tests/pub/install/hosted/repair_cache_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/repair_cache_test.dart
index 7d808d6..a343cc4 100644
--- a/utils/tests/pub/install/hosted/repair_cache_test.dart
+++ b/sdk/lib/_internal/pub/test/install/hosted/repair_cache_test.dart
@@ -6,7 +6,7 @@
 
 import 'package:pathos/path.dart' as path;
 
-import '../../../../pub/io.dart';
+import '../../../lib/src/io.dart';
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/hosted/resolve_constraints_test.dart b/sdk/lib/_internal/pub/test/install/hosted/resolve_constraints_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/resolve_constraints_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/resolve_constraints_test.dart
diff --git a/utils/tests/pub/install/hosted/stay_locked_if_compatible_test.dart b/sdk/lib/_internal/pub/test/install/hosted/stay_locked_if_compatible_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/stay_locked_if_compatible_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/stay_locked_if_compatible_test.dart
diff --git a/utils/tests/pub/install/hosted/stay_locked_if_new_is_satisfied_test.dart b/sdk/lib/_internal/pub/test/install/hosted/stay_locked_if_new_is_satisfied_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/stay_locked_if_new_is_satisfied_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/stay_locked_if_new_is_satisfied_test.dart
diff --git a/utils/tests/pub/install/hosted/stay_locked_test.dart b/sdk/lib/_internal/pub/test/install/hosted/stay_locked_test.dart
similarity index 97%
rename from utils/tests/pub/install/hosted/stay_locked_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/stay_locked_test.dart
index 6deaf5d..188012e 100644
--- a/utils/tests/pub/install/hosted/stay_locked_test.dart
+++ b/sdk/lib/_internal/pub/test/install/hosted/stay_locked_test.dart
@@ -9,7 +9,7 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../../pub/io.dart';
+import '../../../lib/src/io.dart';
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/hosted/unlock_if_incompatible_test.dart b/sdk/lib/_internal/pub/test/install/hosted/unlock_if_incompatible_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/unlock_if_incompatible_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/unlock_if_incompatible_test.dart
diff --git a/utils/tests/pub/install/hosted/unlock_if_new_is_unsatisfied_test.dart b/sdk/lib/_internal/pub/test/install/hosted/unlock_if_new_is_unsatisfied_test.dart
similarity index 100%
rename from utils/tests/pub/install/hosted/unlock_if_new_is_unsatisfied_test.dart
rename to sdk/lib/_internal/pub/test/install/hosted/unlock_if_new_is_unsatisfied_test.dart
diff --git a/utils/tests/pub/install/path/absolute_path_test.dart b/sdk/lib/_internal/pub/test/install/path/absolute_path_test.dart
similarity index 97%
rename from utils/tests/pub/install/path/absolute_path_test.dart
rename to sdk/lib/_internal/pub/test/install/path/absolute_path_test.dart
index dfe0492..9d12d16 100644
--- a/utils/tests/pub/install/path/absolute_path_test.dart
+++ b/sdk/lib/_internal/pub/test/install/path/absolute_path_test.dart
@@ -5,7 +5,7 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../../pub/io.dart';
+import '../../../lib/src/io.dart';
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/path/absolute_symlink_test.dart b/sdk/lib/_internal/pub/test/install/path/absolute_symlink_test.dart
similarity index 95%
rename from utils/tests/pub/install/path/absolute_symlink_test.dart
rename to sdk/lib/_internal/pub/test/install/path/absolute_symlink_test.dart
index 392b09b..4e4b196 100644
--- a/utils/tests/pub/install/path/absolute_symlink_test.dart
+++ b/sdk/lib/_internal/pub/test/install/path/absolute_symlink_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:pathos/path.dart' as path;
 
-import '../../../../pub/exit_codes.dart' as exit_codes;
+import '../../../lib/src/exit_codes.dart' as exit_codes;
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/path/no_pubspec_test.dart b/sdk/lib/_internal/pub/test/install/path/no_pubspec_test.dart
similarity index 100%
rename from utils/tests/pub/install/path/no_pubspec_test.dart
rename to sdk/lib/_internal/pub/test/install/path/no_pubspec_test.dart
diff --git a/utils/tests/pub/install/path/nonexistent_dir_test.dart b/sdk/lib/_internal/pub/test/install/path/nonexistent_dir_test.dart
similarity index 95%
rename from utils/tests/pub/install/path/nonexistent_dir_test.dart
rename to sdk/lib/_internal/pub/test/install/path/nonexistent_dir_test.dart
index d93da4a..7220cb9 100644
--- a/utils/tests/pub/install/path/nonexistent_dir_test.dart
+++ b/sdk/lib/_internal/pub/test/install/path/nonexistent_dir_test.dart
@@ -7,7 +7,7 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../../pub/exit_codes.dart' as exit_codes;
+import '../../../lib/src/exit_codes.dart' as exit_codes;
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/path/path_is_file_test.dart b/sdk/lib/_internal/pub/test/install/path/path_is_file_test.dart
similarity index 95%
rename from utils/tests/pub/install/path/path_is_file_test.dart
rename to sdk/lib/_internal/pub/test/install/path/path_is_file_test.dart
index 9635575..32f7180 100644
--- a/utils/tests/pub/install/path/path_is_file_test.dart
+++ b/sdk/lib/_internal/pub/test/install/path/path_is_file_test.dart
@@ -5,7 +5,7 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../../pub/exit_codes.dart' as exit_codes;
+import '../../../lib/src/exit_codes.dart' as exit_codes;
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/path/relative_path_test.dart b/sdk/lib/_internal/pub/test/install/path/relative_path_test.dart
similarity index 96%
rename from utils/tests/pub/install/path/relative_path_test.dart
rename to sdk/lib/_internal/pub/test/install/path/relative_path_test.dart
index 59dcd12..b9c9c31 100644
--- a/utils/tests/pub/install/path/relative_path_test.dart
+++ b/sdk/lib/_internal/pub/test/install/path/relative_path_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:pathos/path.dart' as path;
 
-import '../../../../pub/exit_codes.dart' as exit_codes;
+import '../../../lib/src/exit_codes.dart' as exit_codes;
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/path/relative_symlink_test.dart b/sdk/lib/_internal/pub/test/install/path/relative_symlink_test.dart
similarity index 96%
rename from utils/tests/pub/install/path/relative_symlink_test.dart
rename to sdk/lib/_internal/pub/test/install/path/relative_symlink_test.dart
index e5917af..859f12c 100644
--- a/utils/tests/pub/install/path/relative_symlink_test.dart
+++ b/sdk/lib/_internal/pub/test/install/path/relative_symlink_test.dart
@@ -6,7 +6,7 @@
 
 import 'package:pathos/path.dart' as path;
 
-import '../../../../pub/exit_codes.dart' as exit_codes;
+import '../../../lib/src/exit_codes.dart' as exit_codes;
 import '../../descriptor.dart' as d;
 import '../../test_pub.dart';
 
diff --git a/utils/tests/pub/install/path/shared_dependency_symlink_test.dart b/sdk/lib/_internal/pub/test/install/path/shared_dependency_symlink_test.dart
similarity index 100%
rename from utils/tests/pub/install/path/shared_dependency_symlink_test.dart
rename to sdk/lib/_internal/pub/test/install/path/shared_dependency_symlink_test.dart
diff --git a/utils/tests/pub/install/path/shared_dependency_test.dart b/sdk/lib/_internal/pub/test/install/path/shared_dependency_test.dart
similarity index 100%
rename from utils/tests/pub/install/path/shared_dependency_test.dart
rename to sdk/lib/_internal/pub/test/install/path/shared_dependency_test.dart
diff --git a/utils/tests/pub/install/pub_install_test.dart b/sdk/lib/_internal/pub/test/install/pub_install_test.dart
similarity index 99%
rename from utils/tests/pub/install/pub_install_test.dart
rename to sdk/lib/_internal/pub/test/install/pub_install_test.dart
index d683378..a20f26ef 100644
--- a/utils/tests/pub/install/pub_install_test.dart
+++ b/sdk/lib/_internal/pub/test/install/pub_install_test.dart
@@ -9,7 +9,7 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/io.dart';
+import '../../lib/src/io.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 
diff --git a/utils/tests/pub/install/relative_symlink_test.dart b/sdk/lib/_internal/pub/test/install/relative_symlink_test.dart
similarity index 100%
rename from utils/tests/pub/install/relative_symlink_test.dart
rename to sdk/lib/_internal/pub/test/install/relative_symlink_test.dart
diff --git a/utils/tests/pub/install/switch_source_test.dart b/sdk/lib/_internal/pub/test/install/switch_source_test.dart
similarity index 100%
rename from utils/tests/pub/install/switch_source_test.dart
rename to sdk/lib/_internal/pub/test/install/switch_source_test.dart
diff --git a/utils/tests/pub/io_test.dart b/sdk/lib/_internal/pub/test/io_test.dart
similarity index 98%
rename from utils/tests/pub/io_test.dart
rename to sdk/lib/_internal/pub/test/io_test.dart
index 54e165f..3a0506c 100644
--- a/utils/tests/pub/io_test.dart
+++ b/sdk/lib/_internal/pub/test/io_test.dart
@@ -9,8 +9,8 @@
 import 'package:pathos/path.dart' as path;
 import 'package:unittest/unittest.dart';
 
-import '../../pub/io.dart';
-import '../../pub/utils.dart';
+import '../lib/src/io.dart';
+import '../lib/src/utils.dart';
 import 'test_pub.dart';
 
 main() {
diff --git a/utils/tests/pub/lish/archives_and_uploads_a_package_test.dart b/sdk/lib/_internal/pub/test/lish/archives_and_uploads_a_package_test.dart
similarity index 100%
rename from utils/tests/pub/lish/archives_and_uploads_a_package_test.dart
rename to sdk/lib/_internal/pub/test/lish/archives_and_uploads_a_package_test.dart
diff --git a/utils/tests/pub/lish/cloud_storage_upload_doesnt_redirect_test.dart b/sdk/lib/_internal/pub/test/lish/cloud_storage_upload_doesnt_redirect_test.dart
similarity index 96%
rename from utils/tests/pub/lish/cloud_storage_upload_doesnt_redirect_test.dart
rename to sdk/lib/_internal/pub/test/lish/cloud_storage_upload_doesnt_redirect_test.dart
index 0fecead..82550f1 100644
--- a/utils/tests/pub/lish/cloud_storage_upload_doesnt_redirect_test.dart
+++ b/sdk/lib/_internal/pub/test/lish/cloud_storage_upload_doesnt_redirect_test.dart
@@ -7,7 +7,7 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
+import '../../lib/src/io.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/lish/cloud_storage_upload_provides_an_error_test.dart b/sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart
similarity index 97%
rename from utils/tests/pub/lish/cloud_storage_upload_provides_an_error_test.dart
rename to sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart
index 6ec271c..348f80d 100644
--- a/utils/tests/pub/lish/cloud_storage_upload_provides_an_error_test.dart
+++ b/sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart
@@ -8,7 +8,7 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
+import '../../lib/src/io.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/lish/force_cannot_be_combined_with_dry_run_test.dart b/sdk/lib/_internal/pub/test/lish/force_cannot_be_combined_with_dry_run_test.dart
similarity index 92%
rename from utils/tests/pub/lish/force_cannot_be_combined_with_dry_run_test.dart
rename to sdk/lib/_internal/pub/test/lish/force_cannot_be_combined_with_dry_run_test.dart
index 088f636..4f0ddca 100644
--- a/utils/tests/pub/lish/force_cannot_be_combined_with_dry_run_test.dart
+++ b/sdk/lib/_internal/pub/test/lish/force_cannot_be_combined_with_dry_run_test.dart
@@ -7,7 +7,7 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/exit_codes.dart' as exit_codes;
+import '../../lib/src/exit_codes.dart' as exit_codes;
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/lish/force_does_not_publish_if_there_are_errors_test.dart b/sdk/lib/_internal/pub/test/lish/force_does_not_publish_if_there_are_errors_test.dart
similarity index 100%
rename from utils/tests/pub/lish/force_does_not_publish_if_there_are_errors_test.dart
rename to sdk/lib/_internal/pub/test/lish/force_does_not_publish_if_there_are_errors_test.dart
diff --git a/utils/tests/pub/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart b/sdk/lib/_internal/pub/test/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart
similarity index 100%
rename from utils/tests/pub/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart
rename to sdk/lib/_internal/pub/test/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart
diff --git a/utils/tests/pub/lish/force_publishes_if_there_are_warnings_test.dart b/sdk/lib/_internal/pub/test/lish/force_publishes_if_there_are_warnings_test.dart
similarity index 100%
rename from utils/tests/pub/lish/force_publishes_if_there_are_warnings_test.dart
rename to sdk/lib/_internal/pub/test/lish/force_publishes_if_there_are_warnings_test.dart
diff --git a/utils/tests/pub/lish/package_creation_provides_a_malformed_error_test.dart b/sdk/lib/_internal/pub/test/lish/package_creation_provides_a_malformed_error_test.dart
similarity index 100%
rename from utils/tests/pub/lish/package_creation_provides_a_malformed_error_test.dart
rename to sdk/lib/_internal/pub/test/lish/package_creation_provides_a_malformed_error_test.dart
diff --git a/utils/tests/pub/lish/package_creation_provides_a_malformed_success_test.dart b/sdk/lib/_internal/pub/test/lish/package_creation_provides_a_malformed_success_test.dart
similarity index 100%
rename from utils/tests/pub/lish/package_creation_provides_a_malformed_success_test.dart
rename to sdk/lib/_internal/pub/test/lish/package_creation_provides_a_malformed_success_test.dart
diff --git a/utils/tests/pub/lish/package_creation_provides_an_error_test.dart b/sdk/lib/_internal/pub/test/lish/package_creation_provides_an_error_test.dart
similarity index 100%
rename from utils/tests/pub/lish/package_creation_provides_an_error_test.dart
rename to sdk/lib/_internal/pub/test/lish/package_creation_provides_an_error_test.dart
diff --git a/utils/tests/pub/lish/package_creation_provides_invalid_json_test.dart b/sdk/lib/_internal/pub/test/lish/package_creation_provides_invalid_json_test.dart
similarity index 100%
rename from utils/tests/pub/lish/package_creation_provides_invalid_json_test.dart
rename to sdk/lib/_internal/pub/test/lish/package_creation_provides_invalid_json_test.dart
diff --git a/utils/tests/pub/lish/package_validation_has_a_warning_and_continues_test.dart b/sdk/lib/_internal/pub/test/lish/package_validation_has_a_warning_and_continues_test.dart
similarity index 100%
rename from utils/tests/pub/lish/package_validation_has_a_warning_and_continues_test.dart
rename to sdk/lib/_internal/pub/test/lish/package_validation_has_a_warning_and_continues_test.dart
diff --git a/utils/tests/pub/lish/package_validation_has_a_warning_and_is_canceled_test.dart b/sdk/lib/_internal/pub/test/lish/package_validation_has_a_warning_and_is_canceled_test.dart
similarity index 100%
rename from utils/tests/pub/lish/package_validation_has_a_warning_and_is_canceled_test.dart
rename to sdk/lib/_internal/pub/test/lish/package_validation_has_a_warning_and_is_canceled_test.dart
diff --git a/utils/tests/pub/lish/package_validation_has_an_error_test.dart b/sdk/lib/_internal/pub/test/lish/package_validation_has_an_error_test.dart
similarity index 100%
rename from utils/tests/pub/lish/package_validation_has_an_error_test.dart
rename to sdk/lib/_internal/pub/test/lish/package_validation_has_an_error_test.dart
diff --git a/utils/tests/pub/lish/preview_package_validation_has_a_warning_test.dart b/sdk/lib/_internal/pub/test/lish/preview_package_validation_has_a_warning_test.dart
similarity index 100%
rename from utils/tests/pub/lish/preview_package_validation_has_a_warning_test.dart
rename to sdk/lib/_internal/pub/test/lish/preview_package_validation_has_a_warning_test.dart
diff --git a/utils/tests/pub/lish/preview_package_validation_has_no_warnings_test.dart b/sdk/lib/_internal/pub/test/lish/preview_package_validation_has_no_warnings_test.dart
similarity index 100%
rename from utils/tests/pub/lish/preview_package_validation_has_no_warnings_test.dart
rename to sdk/lib/_internal/pub/test/lish/preview_package_validation_has_no_warnings_test.dart
diff --git a/utils/tests/pub/lish/upload_form_fields_has_a_non_string_value_test.dart b/sdk/lib/_internal/pub/test/lish/upload_form_fields_has_a_non_string_value_test.dart
similarity index 100%
rename from utils/tests/pub/lish/upload_form_fields_has_a_non_string_value_test.dart
rename to sdk/lib/_internal/pub/test/lish/upload_form_fields_has_a_non_string_value_test.dart
diff --git a/utils/tests/pub/lish/upload_form_fields_is_not_a_map_test.dart b/sdk/lib/_internal/pub/test/lish/upload_form_fields_is_not_a_map_test.dart
similarity index 100%
rename from utils/tests/pub/lish/upload_form_fields_is_not_a_map_test.dart
rename to sdk/lib/_internal/pub/test/lish/upload_form_fields_is_not_a_map_test.dart
diff --git a/utils/tests/pub/lish/upload_form_is_missing_fields_test.dart b/sdk/lib/_internal/pub/test/lish/upload_form_is_missing_fields_test.dart
similarity index 100%
rename from utils/tests/pub/lish/upload_form_is_missing_fields_test.dart
rename to sdk/lib/_internal/pub/test/lish/upload_form_is_missing_fields_test.dart
diff --git a/utils/tests/pub/lish/upload_form_is_missing_url_test.dart b/sdk/lib/_internal/pub/test/lish/upload_form_is_missing_url_test.dart
similarity index 100%
rename from utils/tests/pub/lish/upload_form_is_missing_url_test.dart
rename to sdk/lib/_internal/pub/test/lish/upload_form_is_missing_url_test.dart
diff --git a/utils/tests/pub/lish/upload_form_provides_an_error_test.dart b/sdk/lib/_internal/pub/test/lish/upload_form_provides_an_error_test.dart
similarity index 100%
rename from utils/tests/pub/lish/upload_form_provides_an_error_test.dart
rename to sdk/lib/_internal/pub/test/lish/upload_form_provides_an_error_test.dart
diff --git a/utils/tests/pub/lish/upload_form_provides_invalid_json_test.dart b/sdk/lib/_internal/pub/test/lish/upload_form_provides_invalid_json_test.dart
similarity index 100%
rename from utils/tests/pub/lish/upload_form_provides_invalid_json_test.dart
rename to sdk/lib/_internal/pub/test/lish/upload_form_provides_invalid_json_test.dart
diff --git a/utils/tests/pub/lish/upload_form_url_is_not_a_string_test.dart b/sdk/lib/_internal/pub/test/lish/upload_form_url_is_not_a_string_test.dart
similarity index 100%
rename from utils/tests/pub/lish/upload_form_url_is_not_a_string_test.dart
rename to sdk/lib/_internal/pub/test/lish/upload_form_url_is_not_a_string_test.dart
diff --git a/utils/tests/pub/lish/utils.dart b/sdk/lib/_internal/pub/test/lish/utils.dart
similarity index 97%
rename from utils/tests/pub/lish/utils.dart
rename to sdk/lib/_internal/pub/test/lish/utils.dart
index 3f21f92..ba921e2 100644
--- a/utils/tests/pub/lish/utils.dart
+++ b/sdk/lib/_internal/pub/test/lish/utils.dart
@@ -10,7 +10,7 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
+import '../../lib/src/io.dart';
 import '../test_pub.dart';
 
 void handleUploadForm(ScheduledServer server, [Map body]) {
diff --git a/utils/tests/pub/lock_file_test.dart b/sdk/lib/_internal/pub/test/lock_file_test.dart
similarity index 95%
rename from utils/tests/pub/lock_file_test.dart
rename to sdk/lib/_internal/pub/test/lock_file_test.dart
index 715cff6..95fcd71 100644
--- a/utils/tests/pub/lock_file_test.dart
+++ b/sdk/lib/_internal/pub/test/lock_file_test.dart
@@ -7,12 +7,12 @@
 import 'package:unittest/unittest.dart';
 import 'package:yaml/yaml.dart';
 
-import '../../pub/lock_file.dart';
-import '../../pub/package.dart';
-import '../../pub/source.dart';
-import '../../pub/source_registry.dart';
-import '../../pub/utils.dart';
-import '../../pub/version.dart';
+import '../lib/src/lock_file.dart';
+import '../lib/src/package.dart';
+import '../lib/src/source.dart';
+import '../lib/src/source_registry.dart';
+import '../lib/src/utils.dart';
+import '../lib/src/version.dart';
 
 class MockSource extends Source {
   final String name = 'mock';
diff --git a/utils/tests/pub/oauth2/utils.dart b/sdk/lib/_internal/pub/test/oauth2/utils.dart
similarity index 96%
rename from utils/tests/pub/oauth2/utils.dart
rename to sdk/lib/_internal/pub/test/oauth2/utils.dart
index c0b7e97..5fa2dd6 100644
--- a/utils/tests/pub/oauth2/utils.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/utils.dart
@@ -13,8 +13,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 import '../test_pub.dart';
 
 void authorizePub(ScheduledProcess pub, ScheduledServer server,
diff --git a/utils/tests/pub/oauth2/with_a_malformed_credentials_authenticates_again_test.dart b/sdk/lib/_internal/pub/test/oauth2/with_a_malformed_credentials_authenticates_again_test.dart
similarity index 94%
rename from utils/tests/pub/oauth2/with_a_malformed_credentials_authenticates_again_test.dart
rename to sdk/lib/_internal/pub/test/oauth2/with_a_malformed_credentials_authenticates_again_test.dart
index 3a0be34..e207d1b 100644
--- a/utils/tests/pub/oauth2/with_a_malformed_credentials_authenticates_again_test.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/with_a_malformed_credentials_authenticates_again_test.dart
@@ -8,8 +8,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart b/sdk/lib/_internal/pub/test/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart
similarity index 93%
rename from utils/tests/pub/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart
rename to sdk/lib/_internal/pub/test/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart
index bcfe774..853d7d9 100644
--- a/utils/tests/pub/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart
@@ -8,8 +8,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart b/sdk/lib/_internal/pub/test/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart
similarity index 95%
rename from utils/tests/pub/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart
rename to sdk/lib/_internal/pub/test/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart
index 6d900a1..154388b 100644
--- a/utils/tests/pub/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart
@@ -8,8 +8,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart b/sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart
similarity index 96%
rename from utils/tests/pub/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart
rename to sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart
index 4f8a741..7622e474 100644
--- a/utils/tests/pub/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart
@@ -8,8 +8,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart b/sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart
similarity index 95%
rename from utils/tests/pub/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart
rename to sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart
index 7cfcc29..a844eff 100644
--- a/utils/tests/pub/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart
@@ -8,8 +8,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart b/sdk/lib/_internal/pub/test/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart
similarity index 94%
rename from utils/tests/pub/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart
rename to sdk/lib/_internal/pub/test/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart
index e2d0c21..ebba5dc 100644
--- a/utils/tests/pub/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart
@@ -7,8 +7,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/oauth2/with_server_rejected_credentials_authenticates_again_test.dart b/sdk/lib/_internal/pub/test/oauth2/with_server_rejected_credentials_authenticates_again_test.dart
similarity index 95%
rename from utils/tests/pub/oauth2/with_server_rejected_credentials_authenticates_again_test.dart
rename to sdk/lib/_internal/pub/test/oauth2/with_server_rejected_credentials_authenticates_again_test.dart
index 0dbc6e8..a5a8e04 100644
--- a/utils/tests/pub/oauth2/with_server_rejected_credentials_authenticates_again_test.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/with_server_rejected_credentials_authenticates_again_test.dart
@@ -8,8 +8,8 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/scheduled_server.dart';
 
-import '../../../pub/io.dart';
-import '../../../pub/utils.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/utils.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/pub_cache_test.dart b/sdk/lib/_internal/pub/test/pub_cache_test.dart
similarity index 98%
rename from utils/tests/pub/pub_cache_test.dart
rename to sdk/lib/_internal/pub/test/pub_cache_test.dart
index ce4ce84..6166514 100644
--- a/utils/tests/pub/pub_cache_test.dart
+++ b/sdk/lib/_internal/pub/test/pub_cache_test.dart
@@ -9,7 +9,7 @@
 
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../pub/io.dart';
+import '../lib/src/io.dart';
 import 'descriptor.dart' as d;
 import 'test_pub.dart';
 
diff --git a/utils/tests/pub/pub_test.dart b/sdk/lib/_internal/pub/test/pub_test.dart
similarity index 100%
rename from utils/tests/pub/pub_test.dart
rename to sdk/lib/_internal/pub/test/pub_test.dart
diff --git a/utils/tests/pub/pub_uploader_test.dart b/sdk/lib/_internal/pub/test/pub_uploader_test.dart
similarity index 98%
rename from utils/tests/pub/pub_uploader_test.dart
rename to sdk/lib/_internal/pub/test/pub_uploader_test.dart
index 1085e02..7da77c2 100644
--- a/utils/tests/pub/pub_uploader_test.dart
+++ b/sdk/lib/_internal/pub/test/pub_uploader_test.dart
@@ -11,8 +11,8 @@
 import 'package:scheduled_test/scheduled_server.dart';
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../pub/io.dart';
-import '../../pub/utils.dart';
+import '../lib/src/io.dart';
+import '../lib/src/utils.dart';
 import 'descriptor.dart' as d;
 import 'test_pub.dart';
 
diff --git a/utils/tests/pub/pubspec_test.dart b/sdk/lib/_internal/pub/test/pubspec_test.dart
similarity index 96%
rename from utils/tests/pub/pubspec_test.dart
rename to sdk/lib/_internal/pub/test/pubspec_test.dart
index a52aab9..19f62d4 100644
--- a/utils/tests/pub/pubspec_test.dart
+++ b/sdk/lib/_internal/pub/test/pubspec_test.dart
@@ -6,11 +6,11 @@
 
 import 'package:unittest/unittest.dart';
 
-import '../../pub/pubspec.dart';
-import '../../pub/source.dart';
-import '../../pub/source_registry.dart';
-import '../../pub/utils.dart';
-import '../../pub/version.dart';
+import '../lib/src/pubspec.dart';
+import '../lib/src/source.dart';
+import '../lib/src/source_registry.dart';
+import '../lib/src/utils.dart';
+import '../lib/src/version.dart';
 import 'test_pub.dart';
 
 class MockSource extends Source {
diff --git a/utils/tests/pub/real_version_test.dart b/sdk/lib/_internal/pub/test/real_version_test.dart
similarity index 69%
rename from utils/tests/pub/real_version_test.dart
rename to sdk/lib/_internal/pub/test/real_version_test.dart
index e42fedc..50857a4 100644
--- a/utils/tests/pub/real_version_test.dart
+++ b/sdk/lib/_internal/pub/test/real_version_test.dart
@@ -6,8 +6,11 @@
 
 import 'dart:io';
 
+import '../lib/src/sdk.dart' as sdk;
+
 import 'package:pathos/path.dart' as path;
-import 'package:unittest/unittest.dart';
+import 'package:scheduled_test/scheduled_process.dart';
+import 'package:scheduled_test/scheduled_test.dart';
 import 'test_pub.dart';
 
 main() {
@@ -25,15 +28,13 @@
   // Note that this test expects to be invoked from a Dart executable that is
   // in the built SDK's "bin" directory. Note also that this invokes pub from
   // the built SDK directory, and not the live pub code directly in the repo.
-  test('parse the real SDK "version" file', () {
+  integration('parse the real SDK "version" file', () {
     // Get the path to the pub binary in the SDK.
-    var dartPath = new Options().executable;
-    var pubPath = path.join(path.dirname(dartPath), "pub");
-    if (Platform.operatingSystem == "windows") pubPath = '$pubPath.bat';
+    var pubPath = path.join(sdk.rootDirectory, 'bin',
+        Platform.operatingSystem == "windows" ? "pub.bat" : "pub");
 
-    Process.run(pubPath, ['version']).then(expectAsync1((result) {
-      expect(result.stdout, startsWith("Pub"));
-      expect(result.exitCode, equals(0));
-    }));
+    var pub = new ScheduledProcess.start(pubPath, ['version']);
+    expect(pub.nextLine(), completion(startsWith("Pub")));
+    pub.shouldExit(0);
   });
 }
diff --git a/utils/tests/pub/test_pub.dart b/sdk/lib/_internal/pub/test/test_pub.dart
similarity index 93%
rename from utils/tests/pub/test_pub.dart
rename to sdk/lib/_internal/pub/test/test_pub.dart
index d7fdb1d..b978d54 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/sdk/lib/_internal/pub/test/test_pub.dart
@@ -24,20 +24,20 @@
 import 'package:scheduled_test/scheduled_test.dart';
 import 'package:yaml/yaml.dart';
 
-import '../../pub/entrypoint.dart';
+import '../lib/src/entrypoint.dart';
 // TODO(rnystrom): Using "gitlib" as the prefix here is ugly, but "git" collides
 // with the git descriptor method. Maybe we should try to clean up the top level
 // scope a bit?
-import '../../pub/git.dart' as gitlib;
-import '../../pub/git_source.dart';
-import '../../pub/hosted_source.dart';
-import '../../pub/http.dart';
-import '../../pub/io.dart';
-import '../../pub/path_source.dart';
-import '../../pub/safe_http_server.dart';
-import '../../pub/system_cache.dart';
-import '../../pub/utils.dart';
-import '../../pub/validator.dart';
+import '../lib/src/git.dart' as gitlib;
+import '../lib/src/git_source.dart';
+import '../lib/src/hosted_source.dart';
+import '../lib/src/http.dart';
+import '../lib/src/io.dart';
+import '../lib/src/path_source.dart';
+import '../lib/src/safe_http_server.dart';
+import '../lib/src/system_cache.dart';
+import '../lib/src/utils.dart';
+import '../lib/src/validator.dart';
 import 'command_line_config.dart';
 import 'descriptor.dart' as d;
 
@@ -57,6 +57,10 @@
 /// The current [HttpServer] created using [serve].
 var _server;
 
+/// The list of paths that have been requested from the server since the last
+/// call to [getRequestedPaths].
+final _requestedPaths = <String>[];
+
 /// The cached value for [_portCompleter].
 Completer<int> _portCompleterCache;
 
@@ -73,6 +77,16 @@
 /// A future that will complete to the port used for the current server.
 Future<int> get port => _portCompleter.future;
 
+/// Gets the list of paths that have been requested from the server since the
+/// last time this was called (or since the server was first spun up).
+Future<List<String>> getRequestedPaths() {
+  return schedule(() {
+    var paths = _requestedPaths.toList();
+    _requestedPaths.clear();
+    return paths;
+  });
+}
+
 /// Creates an HTTP server to serve [contents] as static files. This server will
 /// exist only for the duration of the pub run.
 ///
@@ -88,6 +102,10 @@
           var response = request.response;
           try {
             var path = request.uri.path.replaceFirst("/", "");
+
+            if (_requestedPaths == null) _requestedPaths = <String>[];
+            _requestedPaths.add(path);
+
             response.persistentConnection = false;
             var stream = baseDir.load(path);
 
@@ -252,14 +270,10 @@
   });
 }
 
-/// Get the path to the root "util/test/pub" directory containing the pub
+/// Get the path to the root "pub/test" directory containing the pub
 /// tests.
-String get testDirectory {
-  var dir = new Options().script;
-  while (path.basename(dir) != 'pub') dir = path.dirname(dir);
-
-  return path.absolute(dir);
-}
+String get testDirectory =>
+  path.absolute(path.dirname(libraryPath('test_pub')));
 
 /// Schedules renaming (moving) the directory at [from] to [to], both of which
 /// are assumed to be relative to [sandboxDir].
@@ -350,7 +364,7 @@
   }
 
   // Find the main pub entrypoint.
-  var pubPath = path.join(testDirectory, '..', '..', 'pub', 'pub.dart');
+  var pubPath = path.join(testDirectory, '..', 'bin', 'pub.dart');
 
   var dartArgs = ['--package-root=$_packageRoot/', '--checked', pubPath,
       '--trace'];
@@ -375,20 +389,12 @@
       description: args.isEmpty ? 'pub' : 'pub ${args.first}');
 }
 
-/// Whether pub is running from within the Dart SDK, as opposed to from the Dart
-/// source repository.
-bool get _runningFromSdk => path.dirname(relativeToPub('..')) == 'util';
-
 // TODO(nweiz): use the built-in mechanism for accessing this once it exists
 // (issue 9119).
 /// The path to the `packages` directory from which pub loads its dependencies.
 String get _packageRoot {
-  if (_runningFromSdk) {
-    return path.absolute(relativeToPub(path.join('..', '..', 'packages')));
-  } else {
-    return path.absolute(path.join(
-        path.dirname(new Options().executable), '..', '..', 'packages'));
-  }
+  return path.absolute(path.join(
+      path.dirname(new Options().executable), '..', '..', 'packages'));
 }
 
 /// Skips the current test if Git is not installed. This validates that the
diff --git a/utils/tests/pub/update/git/do_not_update_if_unneeded_test.dart b/sdk/lib/_internal/pub/test/update/git/do_not_update_if_unneeded_test.dart
similarity index 100%
rename from utils/tests/pub/update/git/do_not_update_if_unneeded_test.dart
rename to sdk/lib/_internal/pub/test/update/git/do_not_update_if_unneeded_test.dart
diff --git a/utils/tests/pub/update/git/update_locked_test.dart b/sdk/lib/_internal/pub/test/update/git/update_locked_test.dart
similarity index 100%
rename from utils/tests/pub/update/git/update_locked_test.dart
rename to sdk/lib/_internal/pub/test/update/git/update_locked_test.dart
diff --git a/utils/tests/pub/update/git/update_one_locked_test.dart b/sdk/lib/_internal/pub/test/update/git/update_one_locked_test.dart
similarity index 100%
rename from utils/tests/pub/update/git/update_one_locked_test.dart
rename to sdk/lib/_internal/pub/test/update/git/update_one_locked_test.dart
diff --git a/utils/tests/pub/update/git/update_to_incompatible_pubspec_test.dart b/sdk/lib/_internal/pub/test/update/git/update_to_incompatible_pubspec_test.dart
similarity index 100%
rename from utils/tests/pub/update/git/update_to_incompatible_pubspec_test.dart
rename to sdk/lib/_internal/pub/test/update/git/update_to_incompatible_pubspec_test.dart
diff --git a/utils/tests/pub/update/git/update_to_nonexistent_pubspec_test.dart b/sdk/lib/_internal/pub/test/update/git/update_to_nonexistent_pubspec_test.dart
similarity index 100%
rename from utils/tests/pub/update/git/update_to_nonexistent_pubspec_test.dart
rename to sdk/lib/_internal/pub/test/update/git/update_to_nonexistent_pubspec_test.dart
diff --git a/utils/tests/pub/update/hosted/fail_gracefully_on_missing_package_test.dart b/sdk/lib/_internal/pub/test/update/hosted/fail_gracefully_on_missing_package_test.dart
similarity index 100%
rename from utils/tests/pub/update/hosted/fail_gracefully_on_missing_package_test.dart
rename to sdk/lib/_internal/pub/test/update/hosted/fail_gracefully_on_missing_package_test.dart
diff --git a/utils/tests/pub/update/hosted/fail_gracefully_on_url_resolve_test.dart b/sdk/lib/_internal/pub/test/update/hosted/fail_gracefully_on_url_resolve_test.dart
similarity index 100%
rename from utils/tests/pub/update/hosted/fail_gracefully_on_url_resolve_test.dart
rename to sdk/lib/_internal/pub/test/update/hosted/fail_gracefully_on_url_resolve_test.dart
diff --git a/utils/tests/pub/update/hosted/remove_removed_dependency_test.dart b/sdk/lib/_internal/pub/test/update/hosted/remove_removed_dependency_test.dart
similarity index 100%
rename from utils/tests/pub/update/hosted/remove_removed_dependency_test.dart
rename to sdk/lib/_internal/pub/test/update/hosted/remove_removed_dependency_test.dart
diff --git a/utils/tests/pub/update/hosted/remove_removed_transitive_dependency_test.dart b/sdk/lib/_internal/pub/test/update/hosted/remove_removed_transitive_dependency_test.dart
similarity index 100%
rename from utils/tests/pub/update/hosted/remove_removed_transitive_dependency_test.dart
rename to sdk/lib/_internal/pub/test/update/hosted/remove_removed_transitive_dependency_test.dart
diff --git a/utils/tests/pub/update/hosted/unlock_dependers_test.dart b/sdk/lib/_internal/pub/test/update/hosted/unlock_dependers_test.dart
similarity index 100%
rename from utils/tests/pub/update/hosted/unlock_dependers_test.dart
rename to sdk/lib/_internal/pub/test/update/hosted/unlock_dependers_test.dart
diff --git a/utils/tests/pub/update/hosted/unlock_if_necessary_test.dart b/sdk/lib/_internal/pub/test/update/hosted/unlock_if_necessary_test.dart
similarity index 100%
rename from utils/tests/pub/update/hosted/unlock_if_necessary_test.dart
rename to sdk/lib/_internal/pub/test/update/hosted/unlock_if_necessary_test.dart
diff --git a/utils/tests/pub/update/hosted/update_removed_constraints_test.dart b/sdk/lib/_internal/pub/test/update/hosted/update_removed_constraints_test.dart
similarity index 100%
rename from utils/tests/pub/update/hosted/update_removed_constraints_test.dart
rename to sdk/lib/_internal/pub/test/update/hosted/update_removed_constraints_test.dart
diff --git a/utils/tests/pub/update/pub_update_test.dart b/sdk/lib/_internal/pub/test/update/pub_update_test.dart
similarity index 100%
rename from utils/tests/pub/update/pub_update_test.dart
rename to sdk/lib/_internal/pub/test/update/pub_update_test.dart
diff --git a/utils/tests/pub/validator/compiled_dartdoc_test.dart b/sdk/lib/_internal/pub/test/validator/compiled_dartdoc_test.dart
similarity index 91%
rename from utils/tests/pub/validator/compiled_dartdoc_test.dart
rename to sdk/lib/_internal/pub/test/validator/compiled_dartdoc_test.dart
index 257d783..425ad83 100644
--- a/utils/tests/pub/validator/compiled_dartdoc_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/compiled_dartdoc_test.dart
@@ -4,9 +4,9 @@
 
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/compiled_dartdoc.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/compiled_dartdoc.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/dependency_test.dart b/sdk/lib/_internal/pub/test/validator/dependency_test.dart
similarity index 98%
rename from utils/tests/pub/validator/dependency_test.dart
rename to sdk/lib/_internal/pub/test/validator/dependency_test.dart
index 4001330..9eba069 100644
--- a/utils/tests/pub/validator/dependency_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/dependency_test.dart
@@ -10,9 +10,9 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/dependency.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/dependency.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/directory_test.dart b/sdk/lib/_internal/pub/test/validator/directory_test.dart
similarity index 90%
rename from utils/tests/pub/validator/directory_test.dart
rename to sdk/lib/_internal/pub/test/validator/directory_test.dart
index 987a7d4..e3acfb4 100644
--- a/utils/tests/pub/validator/directory_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/directory_test.dart
@@ -5,9 +5,9 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/directory.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/directory.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/lib_test.dart b/sdk/lib/_internal/pub/test/validator/lib_test.dart
similarity index 91%
rename from utils/tests/pub/validator/lib_test.dart
rename to sdk/lib/_internal/pub/test/validator/lib_test.dart
index 6f9a38a..4b038a9 100644
--- a/utils/tests/pub/validator/lib_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/lib_test.dart
@@ -5,10 +5,10 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/io.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/lib.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/lib.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/license_test.dart b/sdk/lib/_internal/pub/test/validator/license_test.dart
similarity index 90%
rename from utils/tests/pub/validator/license_test.dart
rename to sdk/lib/_internal/pub/test/validator/license_test.dart
index 35c9d7c..c009c1c 100644
--- a/utils/tests/pub/validator/license_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/license_test.dart
@@ -5,10 +5,10 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/io.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/license.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/license.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/name_test.dart b/sdk/lib/_internal/pub/test/validator/name_test.dart
similarity index 95%
rename from utils/tests/pub/validator/name_test.dart
rename to sdk/lib/_internal/pub/test/validator/name_test.dart
index 9f0085b..eeeb738 100644
--- a/utils/tests/pub/validator/name_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/name_test.dart
@@ -5,10 +5,10 @@
 import 'package:pathos/path.dart' as path;
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/io.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/name.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/io.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/name.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/pubspec_field_test.dart b/sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart
similarity index 95%
rename from utils/tests/pub/validator/pubspec_field_test.dart
rename to sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart
index 2ae8439..15ed04e 100644
--- a/utils/tests/pub/validator/pubspec_field_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart
@@ -4,9 +4,9 @@
 
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/pubspec_field.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/pubspec_field.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/size_test.dart b/sdk/lib/_internal/pub/test/validator/size_test.dart
similarity index 87%
rename from utils/tests/pub/validator/size_test.dart
rename to sdk/lib/_internal/pub/test/validator/size_test.dart
index 3dd1e21..50b7375 100644
--- a/utils/tests/pub/validator/size_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/size_test.dart
@@ -7,9 +7,9 @@
 
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/size.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/size.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/utf8_readme_test.dart b/sdk/lib/_internal/pub/test/validator/utf8_readme_test.dart
similarity index 89%
rename from utils/tests/pub/validator/utf8_readme_test.dart
rename to sdk/lib/_internal/pub/test/validator/utf8_readme_test.dart
index 8d63c78..60e65fd 100644
--- a/utils/tests/pub/validator/utf8_readme_test.dart
+++ b/sdk/lib/_internal/pub/test/validator/utf8_readme_test.dart
@@ -4,9 +4,9 @@
 
 import 'package:scheduled_test/scheduled_test.dart';
 
-import '../../../pub/entrypoint.dart';
-import '../../../pub/validator.dart';
-import '../../../pub/validator/utf8_readme.dart';
+import '../../lib/src/entrypoint.dart';
+import '../../lib/src/validator.dart';
+import '../../lib/src/validator/utf8_readme.dart';
 import '../descriptor.dart' as d;
 import '../test_pub.dart';
 import 'utils.dart';
diff --git a/utils/tests/pub/validator/utils.dart b/sdk/lib/_internal/pub/test/validator/utils.dart
similarity index 100%
rename from utils/tests/pub/validator/utils.dart
rename to sdk/lib/_internal/pub/test/validator/utils.dart
diff --git a/utils/tests/pub/version_solver_test.dart b/sdk/lib/_internal/pub/test/version_solver_test.dart
similarity index 95%
rename from utils/tests/pub/version_solver_test.dart
rename to sdk/lib/_internal/pub/test/version_solver_test.dart
index d4d85a6..380803a 100644
--- a/utils/tests/pub/version_solver_test.dart
+++ b/sdk/lib/_internal/pub/test/version_solver_test.dart
@@ -9,16 +9,16 @@
 
 import 'package:unittest/unittest.dart';
 
-import '../../pub/lock_file.dart';
-import '../../pub/package.dart';
-import '../../pub/pubspec.dart';
-import '../../pub/sdk.dart' as sdk;
-import '../../pub/source.dart';
-import '../../pub/source_registry.dart';
-import '../../pub/system_cache.dart';
-import '../../pub/utils.dart';
-import '../../pub/version.dart';
-import '../../pub/solver/version_solver.dart';
+import '../lib/src/lock_file.dart';
+import '../lib/src/package.dart';
+import '../lib/src/pubspec.dart';
+import '../lib/src/sdk.dart' as sdk;
+import '../lib/src/source.dart';
+import '../lib/src/source_registry.dart';
+import '../lib/src/system_cache.dart';
+import '../lib/src/utils.dart';
+import '../lib/src/version.dart';
+import '../lib/src/solver/version_solver.dart';
 import 'test_pub.dart';
 
 MockSource source1;
@@ -611,11 +611,19 @@
     'foo': '2.0.0',
     'bar': '2.0.0'
   }, maxTries: 3);
+
+  testResolve('ignores SDK constraints on bleeding edge', {
+    'myapp 0.0.0': {'sdk': badVersion }
+  }, result: {
+    'myapp from root': '0.0.0'
+  }, useBleedingEdgeSdkVersion: true);
 }
 
 testResolve(description, packages,
-            {lockfile, result, FailMatcherBuilder error, int maxTries}) {
+            {lockfile, result, FailMatcherBuilder error, int maxTries,
+             bool useBleedingEdgeSdkVersion}) {
   if (maxTries == null) maxTries = 1;
+  if (useBleedingEdgeSdkVersion == null) useBleedingEdgeSdkVersion = false;
 
   test(description, () {
     var cache = new SystemCache('.');
@@ -666,6 +674,12 @@
       });
     }
 
+    // Make a version number like the continuous build's version.
+    var previousVersion = sdk.version;
+    if (useBleedingEdgeSdkVersion) {
+      sdk.version = new Version(0, 1, 2, build: '0_r12345_juser');
+    }
+
     // Resolve the versions.
     var future = resolveVersions(cache.sources, root,
         lockFile: realLockFile);
@@ -677,6 +691,12 @@
       matcher = error(maxTries);
     }
 
+    future = future.whenComplete(() {
+      if (useBleedingEdgeSdkVersion) {
+        sdk.version = previousVersion;
+      }
+    });
+
     expect(future, completion(matcher));
   });
 }
@@ -868,6 +888,10 @@
 
   MockSource(this.name);
 
+  Future<String> systemCacheDirectory(PackageId id) {
+    return new Future.value('${id.name}-${id.version}');
+  }
+
   Future<List<Version>> getVersions(String name, String description) {
     return new Future.sync(() {
       // Make sure the solver doesn't request the same thing twice.
diff --git a/utils/tests/pub/version_test.dart b/sdk/lib/_internal/pub/test/version_test.dart
similarity index 99%
rename from utils/tests/pub/version_test.dart
rename to sdk/lib/_internal/pub/test/version_test.dart
index 5e3fb08..e4a1b0c 100644
--- a/utils/tests/pub/version_test.dart
+++ b/sdk/lib/_internal/pub/test/version_test.dart
@@ -6,8 +6,8 @@
 
 import 'package:unittest/unittest.dart';
 import 'test_pub.dart';
-import '../../pub/utils.dart';
-import '../../pub/version.dart';
+import '../lib/src/utils.dart';
+import '../lib/src/version.dart';
 
 main() {
   initConfig();
diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart
index 2f00717..fb9a94b 100644
--- a/sdk/lib/collection/collections.dart
+++ b/sdk/lib/collection/collections.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
@@ -11,7 +11,7 @@
  * efficient [Iterable.length] and [Iterable.elementAt].
  */
 class UnmodifiableListView<E> extends UnmodifiableListBase<E> {
-  Iterable<E> _source;
+  final Iterable<E> _source;
   /** Create an unmodifiable list backed by [source]. */
   UnmodifiableListView(Iterable<E> source) : _source = source;
   int get length => _source.length;
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index ccde096..aab99d8 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -242,14 +242,15 @@
     }
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
     for (int i = 0; i < this.length; i++) {
       if (this[i] == element) {
-        this.setRange(i, i + this.length - 1, this, i + 1);
+        this.setRange(i, this.length - 1, this, i + 1);
         this.length -= 1;
-        return;
+        return true;
       }
     }
+    return false;
   }
 
   void removeWhere(bool test(E element)) {
@@ -293,7 +294,11 @@
     return result;
   }
 
-  void sort([Comparator<E> compare]) {
+  void sort([int compare(E a, E b)]) {
+    if (compare == null) {
+      var defaultCompare = Comparable.compare;
+      compare = defaultCompare;
+    }
     Sort.sort(this, compare);
   }
 
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index a66248e..7bc65ca 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -50,6 +50,15 @@
   void add(E value);
 
   /**
+   * Remove a single instance of [value] from the queue.
+   *
+   * Returns `true` if a value was removed, or `false` if the queue
+   * contained no element equal to [value].
+   */
+  bool remove(Object object);
+
+
+  /**
    * Adds all elements of [iterable] at the end of the queue. The
    * length of the queue is extended by the length of [iterable].
    */
@@ -212,41 +221,24 @@
     return result;
   }
 
-  void remove(Object o) {
+  bool remove(Object o) {
     DoubleLinkedQueueEntry<E> entry = firstEntry();
     while (!identical(entry, _sentinel)) {
       if (entry.element == o) {
         entry.remove();
         _elementCount--;
-        return;
+        return true;
       }
       entry = entry._next;
     }
+    return false;
   }
 
-  void retainAll(Iterable elements) {
-    _filterIterable(elements, true);
-  }
-
-  void removeAll(Iterable elements) {
-    _filterIterable(elements, false);
-  }
-
-  void _filterIterable(Iterable elements, bool retainMatching) {
-    Set elementSet;
-    if (elements is Set) {
-      elementSet = elements;
-    } else {
-      elementSet = elements.toSet();
-    }
-    _filter(elementSet.contains, retainMatching);
-  }
-
-  void _filter(bool test(E element), bool retainMatching) {
+  void _filter(bool test(E element), bool removeMatching) {
     DoubleLinkedQueueEntry<E> entry = firstEntry();
     while (!identical(entry, _sentinel)) {
       DoubleLinkedQueueEntry<E> next = entry._next;
-      if (test(entry.element) != retainMatching) {
+      if (identical(removeMatching, test(entry.element))) {
         entry.remove();
         _elementCount--;
       }
@@ -255,11 +247,11 @@
   }
 
   void removeWhere(bool test(E element)) {
-    _filter(test, false);
+    _filter(test, true);
   }
 
   void retainWhere(bool test(E element)) {
-    _filter(test, true);
+    _filter(test, false);
   }
 
   E get first {
@@ -479,15 +471,16 @@
     }
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     for (int i = _head; i != _tail; i = (i + 1) & (_table.length - 1)) {
       E element = _table[i];
       if (element == object) {
         _remove(i);
-        return;
+        _modificationCount++;
+        return true;
       }
     }
-    _modificationCount++;
+    return false;
   }
 
   void _filterWhere(bool test(E element), bool removeMatching) {
@@ -496,7 +489,7 @@
     int i = _head;
     while (i != _tail) {
       E element = _table[i];
-      bool remove = (test(element) == removeMatching);
+      bool remove = identical(removeMatching, test(element));
       _checkModification(modificationCount);
       if (remove) {
         i = _remove(i);
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index b7978ff..59a1563 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -33,6 +33,18 @@
  *    unmodifiableList.length = 0;  // throws.
  *    unmodifiableList.add(499);  // throws
  *    unmodifiableList[0] = 87;  // throws.
+ *
+ * Lists are [Iterable].
+ * List iteration iterates over values in index order.
+ * Changing the values will not affect iteration,
+ * but changing the valid indices -
+ * that is, changing the list's length -
+ * between iteration steps
+ * will cause a [ConcurrentModificationError].
+ * This means that only growable lists can throw [ConcurrentModificationError].
+ * If the length changes temporarily
+ * and is restored before continuing the iteration,
+ * the iterator will not detect it.
  */
 abstract class List<E> implements Iterable<E> {
   /**
@@ -40,6 +52,8 @@
    *
    * The list is a fixed-length list if [length] is provided, and an empty
    * growable list if [length] is omitted.
+   *
+   * It is an error if [length] is not a non-negative integer.
    */
   external factory List([int length]);
 
@@ -50,8 +64,10 @@
   external factory List.filled(int length, E fill);
 
   /**
-   * Creates an list with the elements of [other]. The order in
-   * the list will be the order provided by the iterator of [other].
+   * Creates an list with the elements of [other].
+   *
+   * The order in the list will be
+   * the order provided by the iterator of [other].
    *
    * The returned list is growable if [growable] is true, otherwise it's
    * a fixed length list.
@@ -71,11 +87,12 @@
   }
 
   /**
-   * Generate a `List` of elements.
+   * Generate a `List` of values.
    *
-   * Generates a list of values, where the values are created by
-   * calling the [generator] function for each index in the range
-   * 0 .. [length] - 1.
+   * Creates a list with [length] positions
+   * and fills them by values created by calling [generator]
+   * for each index in the range `0` .. `[length] - 1`
+   * in increasing order.
    *
    * The created length's length is fixed unless [growable] is true.
    */
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 6a656c6..2a3bd0f 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -9,10 +9,11 @@
 import 'dart:isolate';
 import 'dart:json' as json;
 import 'dart:math';
-import 'dart:web_sql';
+import 'dart:typed_data';
 import 'dart:svg' as svg;
 import 'dart:web_audio' as web_audio;
 import 'dart:web_gl' as gl;
+import 'dart:web_sql';
 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
 import 'dart:_isolate_helper' show IsolateNatives;
 import 'dart:_foreign_helper' show JS;
@@ -46,7 +47,7 @@
 
 // Workaround for tags like <cite> that lack their own Element subclass --
 // Dart issue 1990.
-class _HTMLElement extends Element native "*HTMLElement" {
+class _HTMLElement extends Element native "HTMLElement" {
 }
 
 // Support for Send/ReceivePortSync.
@@ -70,7 +71,7 @@
 
 @DocsEditable
 @DomName('AbstractWorker')
-class AbstractWorker extends EventTarget native "*AbstractWorker" {
+class AbstractWorker extends EventTarget native "AbstractWorker" {
 
   @DomName('AbstractWorker.errorEvent')
   @DocsEditable
@@ -101,7 +102,7 @@
 
 @DocsEditable
 @DomName('HTMLAnchorElement')
-class AnchorElement extends Element native "*HTMLAnchorElement" {
+class AnchorElement extends Element native "HTMLAnchorElement" {
 
   @DomName('HTMLAnchorElement.HTMLAnchorElement')
   @DocsEditable
@@ -186,7 +187,7 @@
 
 @DocsEditable
 @DomName('WebKitAnimationEvent')
-class AnimationEvent extends Event native "*WebKitAnimationEvent" {
+class AnimationEvent extends Event native "WebKitAnimationEvent" {
 
   @DomName('AnimationEvent.animationName')
   @DocsEditable
@@ -208,7 +209,7 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.OPERA)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class ApplicationCache extends EventTarget native "*DOMApplicationCache" {
+class ApplicationCache extends EventTarget native "ApplicationCache,DOMApplicationCache,OfflineResourceList" {
 
   @DomName('DOMApplicationCache.cachedEvent')
   @DocsEditable
@@ -336,7 +337,7 @@
  * on MDN.
  */
 @DomName('HTMLAreaElement')
-class AreaElement extends Element native "*HTMLAreaElement" {
+class AreaElement extends Element native "HTMLAreaElement" {
 
   @DomName('HTMLAreaElement.HTMLAreaElement')
   @DocsEditable
@@ -394,85 +395,6 @@
   @DocsEditable
   String target;
 }
-// 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.
-
-
-@DomName('ArrayBuffer')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class ArrayBuffer native "*ArrayBuffer" {
-
-  @DomName('ArrayBuffer.ArrayBuffer')
-  @DocsEditable
-  factory ArrayBuffer(int length) {
-    return ArrayBuffer._create_1(length);
-  }
-  static ArrayBuffer _create_1(length) => JS('ArrayBuffer', 'new ArrayBuffer(#)', length);
-
-  @DomName('ArrayBuffer.byteLength')
-  @DocsEditable
-  final int byteLength;
-
-  @DomName('ArrayBuffer.slice')
-  ArrayBuffer slice(int begin, [int end]) {
-    // IE10 supports ArrayBuffers but does not have the slice method.
-    if (JS('bool', '!!#.slice', this)) {
-      if (?end) {
-        return JS('ArrayBuffer', '#.slice(#, #)', this, begin, end);
-      }
-      return JS('ArrayBuffer', '#.slice(#)', this, begin);
-    } else {
-      var start = begin;
-      // Negative values go from end.
-      if (start < 0) {
-        start = this.byteLength + start;
-      }
-      var finish = ?end ? min(end, byteLength) : byteLength;
-      if (finish < 0) {
-        finish = this.byteLength + finish;
-      }
-      var length = max(finish - start, 0);
-
-      var clone = new Int8Array(length);
-      var source = new Int8Array.fromBuffer(this, start);
-      for (var i = 0; i < length; ++i) {
-        clone[i] = source[i];
-      }
-      return clone.buffer;
-    }
-  }
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('ArrayBufferView')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class ArrayBufferView native "*ArrayBufferView" {
-
-  @DomName('ArrayBufferView.buffer')
-  @DocsEditable
-  @Creates('ArrayBuffer')
-  @Returns('ArrayBuffer|Null')
-  final dynamic buffer;
-
-  @DomName('ArrayBufferView.byteLength')
-  @DocsEditable
-  final int byteLength;
-
-  @DomName('ArrayBufferView.byteOffset')
-  @DocsEditable
-  final int byteOffset;
-}
 // 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.
@@ -480,7 +402,7 @@
 
 @DocsEditable
 @DomName('Attr')
-class Attr extends Node native "*Attr" {
+class Attr extends Node native "Attr" {
 }
 // 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
@@ -489,7 +411,7 @@
 
 @DocsEditable
 @DomName('HTMLAudioElement')
-class AudioElement extends MediaElement native "*HTMLAudioElement" {
+class AudioElement extends MediaElement native "HTMLAudioElement" {
 
   @DomName('HTMLAudioElement.HTMLAudioElement')
   @DocsEditable
@@ -509,7 +431,7 @@
 
 @DocsEditable
 @DomName('AutocompleteErrorEvent')
-class AutocompleteErrorEvent extends Event native "*AutocompleteErrorEvent" {
+class AutocompleteErrorEvent extends Event native "AutocompleteErrorEvent" {
 
   @DomName('AutocompleteErrorEvent.reason')
   @DocsEditable
@@ -522,7 +444,7 @@
 
 @DocsEditable
 @DomName('HTMLBRElement')
-class BRElement extends Element native "*HTMLBRElement" {
+class BRElement extends Element native "HTMLBRElement" {
 
   @DomName('HTMLBRElement.HTMLBRElement')
   @DocsEditable
@@ -535,7 +457,7 @@
 
 @DocsEditable
 @DomName('BarInfo')
-class BarInfo native "*BarInfo" {
+class BarInfo native "BarInfo" {
 
   @DomName('BarInfo.visible')
   @DocsEditable
@@ -548,7 +470,7 @@
 
 @DocsEditable
 @DomName('HTMLBaseElement')
-class BaseElement extends Element native "*HTMLBaseElement" {
+class BaseElement extends Element native "HTMLBaseElement" {
 
   @DomName('HTMLBaseElement.HTMLBaseElement')
   @DocsEditable
@@ -569,7 +491,7 @@
 
 @DocsEditable
 @DomName('BeforeLoadEvent')
-class BeforeLoadEvent extends Event native "*BeforeLoadEvent" {
+class BeforeLoadEvent extends Event native "BeforeLoadEvent" {
 
   @DomName('BeforeLoadEvent.url')
   @DocsEditable
@@ -581,7 +503,7 @@
 
 
 @DomName('Blob')
-class Blob native "*Blob" {
+class Blob native "Blob" {
 
   @DomName('Blob.size')
   @DocsEditable
@@ -622,7 +544,7 @@
 
 @DocsEditable
 @DomName('HTMLBodyElement')
-class BodyElement extends Element native "*HTMLBodyElement" {
+class BodyElement extends Element native "HTMLBodyElement" {
 
   @DomName('HTMLBodyElement.blurEvent')
   @DocsEditable
@@ -731,7 +653,7 @@
 
 @DocsEditable
 @DomName('HTMLButtonElement')
-class ButtonElement extends Element native "*HTMLButtonElement" {
+class ButtonElement extends Element native "HTMLButtonElement" {
 
   @DomName('HTMLButtonElement.HTMLButtonElement')
   @DocsEditable
@@ -814,7 +736,7 @@
 
 @DocsEditable
 @DomName('CDATASection')
-class CDataSection extends Text native "*CDATASection" {
+class CDataSection extends Text native "CDATASection" {
 }
 // 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
@@ -822,7 +744,7 @@
 
 
 @DomName('HTMLCanvasElement')
-class CanvasElement extends Element implements CanvasImageSource native "*HTMLCanvasElement" {
+class CanvasElement extends Element implements CanvasImageSource native "HTMLCanvasElement" {
 
   @DomName('HTMLCanvasElement.HTMLCanvasElement')
   @DocsEditable
@@ -970,7 +892,7 @@
  * * [CanvasGradient](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvasgradient) from W3C.
  */
 @DomName('CanvasGradient')
-class CanvasGradient native "*CanvasGradient" {
+class CanvasGradient native "CanvasGradient" {
 
   /**
    * Adds a color stop to this gradient at the offset.
@@ -1019,7 +941,7 @@
  * * [CanvasPattern](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvaspattern) from W3C.
  */
 @DomName('CanvasPattern')
-class CanvasPattern native "*CanvasPattern" {
+class CanvasPattern native "CanvasPattern" {
 }
 // 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
@@ -1028,7 +950,7 @@
 
 @DocsEditable
 @DomName('CanvasProxy')
-class CanvasProxy native "*CanvasProxy" {
+class CanvasProxy native "CanvasProxy" {
 }
 // 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
@@ -1043,7 +965,7 @@
  * [WebGLRenderingContext].
  */
 @DomName('CanvasRenderingContext')
-class CanvasRenderingContext native "*CanvasRenderingContext" {
+class CanvasRenderingContext native "CanvasRenderingContext" {
 
   /// Reference to the canvas element to which this context belongs.
   @DomName('CanvasRenderingContext.canvas')
@@ -1056,7 +978,7 @@
 
 
 @DomName('CanvasRenderingContext2D')
-class CanvasRenderingContext2D extends CanvasRenderingContext native "*CanvasRenderingContext2D" {
+class CanvasRenderingContext2D extends CanvasRenderingContext native "CanvasRenderingContext2D" {
 
   @DomName('CanvasRenderingContext2D.currentPath')
   @DocsEditable
@@ -1600,7 +1522,7 @@
 
 @DocsEditable
 @DomName('CharacterData')
-class CharacterData extends Node native "*CharacterData" {
+class CharacterData extends Node native "CharacterData" {
 
   @DomName('CharacterData.data')
   @DocsEditable
@@ -1637,7 +1559,7 @@
 
 @DocsEditable
 @DomName('CloseEvent')
-class CloseEvent extends Event native "*CloseEvent" {
+class CloseEvent extends Event native "CloseEvent" {
 
   @DomName('CloseEvent.code')
   @DocsEditable
@@ -1658,7 +1580,7 @@
 
 @DocsEditable
 @DomName('Comment')
-class Comment extends CharacterData native "*Comment" {
+class Comment extends CharacterData native "Comment" {
 }
 // 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
@@ -1668,7 +1590,7 @@
 
 
 @DomName('CompositionEvent')
-class CompositionEvent extends UIEvent native "*CompositionEvent" {
+class CompositionEvent extends UIEvent native "CompositionEvent" {
   factory CompositionEvent(String type,
       {bool canBubble: false, bool cancelable: false, Window view,
       String data}) {
@@ -1804,7 +1726,7 @@
 @DomName('HTMLContentElement')
 @SupportedBrowser(SupportedBrowser.CHROME, '26')
 @Experimental
-class ContentElement extends Element native "*HTMLContentElement" {
+class ContentElement extends Element native "HTMLContentElement" {
 
   @DomName('HTMLContentElement.HTMLContentElement')
   @DocsEditable
@@ -1834,7 +1756,7 @@
 
 @DocsEditable
 @DomName('Coordinates')
-class Coordinates native "*Coordinates" {
+class Coordinates native "Coordinates" {
 
   @DomName('Coordinates.accuracy')
   @DocsEditable
@@ -1874,16 +1796,16 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class Crypto native "*Crypto" {
+class Crypto native "Crypto" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(window.crypto && window.crypto.getRandomValues)');
 
   @DomName('Crypto.getRandomValues')
   @DocsEditable
-  @Creates('ArrayBufferView')
-  @Returns('ArrayBufferView|Null')
-  dynamic getRandomValues(/*ArrayBufferView*/ array) native;
+  @Creates('TypedData')
+  @Returns('TypedData|Null')
+  TypedData getRandomValues(TypedData array) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1892,7 +1814,7 @@
 
 @DocsEditable
 @DomName('CSSCharsetRule')
-class CssCharsetRule extends CssRule native "*CSSCharsetRule" {
+class CssCharsetRule extends CssRule native "CSSCharsetRule" {
 
   @DomName('CSSCharsetRule.encoding')
   @DocsEditable
@@ -1905,7 +1827,7 @@
 
 @DocsEditable
 @DomName('CSSFontFaceLoadEvent')
-class CssFontFaceLoadEvent extends Event native "*CSSFontFaceLoadEvent" {
+class CssFontFaceLoadEvent extends Event native "CSSFontFaceLoadEvent" {
 
   @DomName('CSSFontFaceLoadEvent.error')
   @DocsEditable
@@ -1922,7 +1844,7 @@
 
 @DocsEditable
 @DomName('CSSFontFaceRule')
-class CssFontFaceRule extends CssRule native "*CSSFontFaceRule" {
+class CssFontFaceRule extends CssRule native "CSSFontFaceRule" {
 
   @DomName('CSSFontFaceRule.style')
   @DocsEditable
@@ -1937,7 +1859,7 @@
 @DomName('CSSHostRule')
 @SupportedBrowser(SupportedBrowser.CHROME, '26')
 @Experimental
-class CssHostRule extends CssRule native "*CSSHostRule" {
+class CssHostRule extends CssRule native "CSSHostRule" {
 
   @DomName('CSSHostRule.cssRules')
   @DocsEditable
@@ -1960,7 +1882,7 @@
 
 @DocsEditable
 @DomName('CSSImportRule')
-class CssImportRule extends CssRule native "*CSSImportRule" {
+class CssImportRule extends CssRule native "CSSImportRule" {
 
   @DomName('CSSImportRule.href')
   @DocsEditable
@@ -1981,7 +1903,7 @@
 
 @DocsEditable
 @DomName('WebKitCSSKeyframeRule')
-class CssKeyframeRule extends CssRule native "*WebKitCSSKeyframeRule" {
+class CssKeyframeRule extends CssRule native "WebKitCSSKeyframeRule" {
 
   @DomName('WebKitCSSKeyframeRule.keyText')
   @DocsEditable
@@ -1998,7 +1920,7 @@
 
 @DocsEditable
 @DomName('WebKitCSSKeyframesRule')
-class CssKeyframesRule extends CssRule native "*WebKitCSSKeyframesRule" {
+class CssKeyframesRule extends CssRule native "WebKitCSSKeyframesRule" {
 
   @DomName('WebKitCSSKeyframesRule.cssRules')
   @DocsEditable
@@ -2029,7 +1951,7 @@
 
 @DocsEditable
 @DomName('CSSMediaRule')
-class CssMediaRule extends CssRule native "*CSSMediaRule" {
+class CssMediaRule extends CssRule native "CSSMediaRule" {
 
   @DomName('CSSMediaRule.cssRules')
   @DocsEditable
@@ -2056,7 +1978,7 @@
 
 @DocsEditable
 @DomName('CSSPageRule')
-class CssPageRule extends CssRule native "*CSSPageRule" {
+class CssPageRule extends CssRule native "CSSPageRule" {
 
   @DomName('CSSPageRule.selectorText')
   @DocsEditable
@@ -2073,7 +1995,7 @@
 
 @DocsEditable
 @DomName('CSSRule')
-class CssRule native "*CSSRule" {
+class CssRule native "CSSRule" {
 
   static const int CHARSET_RULE = 2;
 
@@ -2121,7 +2043,7 @@
 
 
 @DomName('CSSStyleDeclaration')
-class CssStyleDeclaration native "*CSSStyleDeclaration" {
+class CssStyleDeclaration native "CSSStyleDeclaration" {
   factory CssStyleDeclaration() => _CssStyleDeclarationFactoryProvider.createCssStyleDeclaration();
   factory CssStyleDeclaration.css(String css) =>
       _CssStyleDeclarationFactoryProvider.createCssStyleDeclaration_css(css);
@@ -5358,7 +5280,7 @@
 
 @DocsEditable
 @DomName('CSSStyleRule')
-class CssStyleRule extends CssRule native "*CSSStyleRule" {
+class CssStyleRule extends CssRule native "CSSStyleRule" {
 
   @DomName('CSSStyleRule.selectorText')
   @DocsEditable
@@ -5375,7 +5297,7 @@
 
 @DocsEditable
 @DomName('CSSStyleSheet')
-class CssStyleSheet extends StyleSheet native "*CSSStyleSheet" {
+class CssStyleSheet extends StyleSheet native "CSSStyleSheet" {
 
   @DomName('CSSStyleSheet.cssRules')
   @DocsEditable
@@ -5416,7 +5338,7 @@
 
 @DocsEditable
 @DomName('CSSUnknownRule')
-class CssUnknownRule extends CssRule native "*CSSUnknownRule" {
+class CssUnknownRule extends CssRule native "CSSUnknownRule" {
 }
 // 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
@@ -5425,7 +5347,7 @@
 
 @DocsEditable
 @DomName('CustomElementConstructor')
-class CustomElementConstructor native "*CustomElementConstructor" {
+class CustomElementConstructor native "CustomElementConstructor" {
 }
 // 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
@@ -5435,7 +5357,7 @@
 
 
 @DomName('CustomEvent')
-class CustomEvent extends Event native "*CustomEvent" {
+class CustomEvent extends Event native "CustomEvent" {
   factory CustomEvent(String type,
       {bool canBubble: true, bool cancelable: true, Object detail}) {
 
@@ -5462,7 +5384,7 @@
 
 @DocsEditable
 @DomName('HTMLDListElement')
-class DListElement extends Element native "*HTMLDListElement" {
+class DListElement extends Element native "HTMLDListElement" {
 
   @DomName('HTMLDListElement.HTMLDListElement')
   @DocsEditable
@@ -5479,7 +5401,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class DataListElement extends Element native "*HTMLDataListElement" {
+class DataListElement extends Element native "HTMLDataListElement" {
 
   @DomName('HTMLDataListElement.HTMLDataListElement')
   @DocsEditable
@@ -5499,7 +5421,7 @@
 
 @DocsEditable
 @DomName('Clipboard')
-class DataTransfer native "*Clipboard" {
+class DataTransfer native "Clipboard" {
 
   @DomName('Clipboard.dropEffect')
   @DocsEditable
@@ -5562,7 +5484,7 @@
 
 @DocsEditable
 @DomName('DataTransferItem')
-class DataTransferItem native "*DataTransferItem" {
+class DataTransferItem native "DataTransferItem" {
 
   @DomName('DataTransferItem.kind')
   @DocsEditable
@@ -5606,7 +5528,7 @@
 
 @DocsEditable
 @DomName('DataTransferItemList')
-class DataTransferItemList native "*DataTransferItemList" {
+class DataTransferItemList native "DataTransferItemList" {
 
   @DomName('DataTransferItemList.length')
   @DocsEditable
@@ -5628,94 +5550,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-
-@DocsEditable
-@DomName('DataView')
-class DataView extends ArrayBufferView native "*DataView" {
-
-  @DomName('DataView.DataView')
-  @DocsEditable
-  factory DataView(/*ArrayBuffer*/ buffer, [int byteOffset, int byteLength]) {
-    if (?byteLength) {
-      return DataView._create_1(buffer, byteOffset, byteLength);
-    }
-    if (?byteOffset) {
-      return DataView._create_2(buffer, byteOffset);
-    }
-    return DataView._create_3(buffer);
-  }
-  static DataView _create_1(buffer, byteOffset, byteLength) => JS('DataView', 'new DataView(#,#,#)', buffer, byteOffset, byteLength);
-  static DataView _create_2(buffer, byteOffset) => JS('DataView', 'new DataView(#,#)', buffer, byteOffset);
-  static DataView _create_3(buffer) => JS('DataView', 'new DataView(#)', buffer);
-
-  @DomName('DataView.getFloat32')
-  @DocsEditable
-  num getFloat32(int byteOffset, {bool littleEndian}) native;
-
-  @DomName('DataView.getFloat64')
-  @DocsEditable
-  num getFloat64(int byteOffset, {bool littleEndian}) native;
-
-  @DomName('DataView.getInt16')
-  @DocsEditable
-  int getInt16(int byteOffset, {bool littleEndian}) native;
-
-  @DomName('DataView.getInt32')
-  @DocsEditable
-  int getInt32(int byteOffset, {bool littleEndian}) native;
-
-  @DomName('DataView.getInt8')
-  @DocsEditable
-  int getInt8(int byteOffset) native;
-
-  @DomName('DataView.getUint16')
-  @DocsEditable
-  int getUint16(int byteOffset, {bool littleEndian}) native;
-
-  @DomName('DataView.getUint32')
-  @DocsEditable
-  int getUint32(int byteOffset, {bool littleEndian}) native;
-
-  @DomName('DataView.getUint8')
-  @DocsEditable
-  int getUint8(int byteOffset) native;
-
-  @DomName('DataView.setFloat32')
-  @DocsEditable
-  void setFloat32(int byteOffset, num value, {bool littleEndian}) native;
-
-  @DomName('DataView.setFloat64')
-  @DocsEditable
-  void setFloat64(int byteOffset, num value, {bool littleEndian}) native;
-
-  @DomName('DataView.setInt16')
-  @DocsEditable
-  void setInt16(int byteOffset, int value, {bool littleEndian}) native;
-
-  @DomName('DataView.setInt32')
-  @DocsEditable
-  void setInt32(int byteOffset, int value, {bool littleEndian}) native;
-
-  @DomName('DataView.setInt8')
-  @DocsEditable
-  void setInt8(int byteOffset, int value) native;
-
-  @DomName('DataView.setUint16')
-  @DocsEditable
-  void setUint16(int byteOffset, int value, {bool littleEndian}) native;
-
-  @DomName('DataView.setUint32')
-  @DocsEditable
-  void setUint32(int byteOffset, int value, {bool littleEndian}) native;
-
-  @DomName('DataView.setUint8')
-  @DocsEditable
-  void setUint8(int byteOffset, int value) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
 // WARNING: Do not edit - generated code.
 
 
@@ -5730,7 +5564,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class DetailsElement extends Element native "*HTMLDetailsElement" {
+class DetailsElement extends Element native "HTMLDetailsElement" {
 
   @DomName('HTMLDetailsElement.HTMLDetailsElement')
   @DocsEditable
@@ -5750,7 +5584,7 @@
 
 @DocsEditable
 @DomName('DeviceAcceleration')
-class DeviceAcceleration native "*DeviceAcceleration" {
+class DeviceAcceleration native "DeviceAcceleration" {
 
   @DomName('DeviceAcceleration.x')
   @DocsEditable
@@ -5771,7 +5605,7 @@
 
 @DocsEditable
 @DomName('DeviceMotionEvent')
-class DeviceMotionEvent extends Event native "*DeviceMotionEvent" {
+class DeviceMotionEvent extends Event native "DeviceMotionEvent" {
 
   @DomName('DeviceMotionEvent.acceleration')
   @DocsEditable
@@ -5797,7 +5631,7 @@
 
 @DomName('DeviceOrientationEvent')
 
-class DeviceOrientationEvent extends Event native "*DeviceOrientationEvent" {
+class DeviceOrientationEvent extends Event native "DeviceOrientationEvent" {
   factory DeviceOrientationEvent(String type,
       {bool canBubble: true, bool cancelable: true, num alpha: 0, num beta: 0,
       num gamma: 0, bool absolute: false}) {
@@ -5836,7 +5670,7 @@
 
 @DocsEditable
 @DomName('DeviceRotationRate')
-class DeviceRotationRate native "*DeviceRotationRate" {
+class DeviceRotationRate native "DeviceRotationRate" {
 
   @DomName('DeviceRotationRate.alpha')
   @DocsEditable
@@ -5857,7 +5691,7 @@
 
 @DocsEditable
 @DomName('HTMLDialogElement')
-class DialogElement extends Element native "*HTMLDialogElement" {
+class DialogElement extends Element native "HTMLDialogElement" {
 
   @DomName('HTMLDialogElement.open')
   @DocsEditable
@@ -5881,7 +5715,7 @@
 
 
 @DomName('DirectoryEntry')
-class DirectoryEntry extends Entry native "*DirectoryEntry" {
+class DirectoryEntry extends Entry native "DirectoryEntry" {
   
   /**
    * Create a new directory with the specified `path`. If `exclusive` is true,
@@ -6047,7 +5881,7 @@
 
 @DocsEditable
 @DomName('DirectoryReader')
-class DirectoryReader native "*DirectoryReader" {
+class DirectoryReader native "DirectoryReader" {
 
   @JSName('readEntries')
   @DomName('DirectoryReader.readEntries')
@@ -6093,7 +5927,7 @@
  * * [Inline-level element](http://www.w3.org/TR/CSS2/visuren.html#inline-boxes) from W3C.
  */
 @DomName('HTMLDivElement')
-class DivElement extends Element native "*HTMLDivElement" {
+class DivElement extends Element native "HTMLDivElement" {
 
   @DomName('HTMLDivElement.HTMLDivElement')
   @DocsEditable
@@ -6114,7 +5948,7 @@
  * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connect-dart-html/).
  */
 @DomName('Document')
-class Document extends Node  native "*Document"
+class Document extends Node  native "Document"
 {
 
 
@@ -6707,7 +6541,7 @@
 
 
 @DomName('DocumentFragment')
-class DocumentFragment extends Node native "*DocumentFragment" {
+class DocumentFragment extends Node native "DocumentFragment" {
   factory DocumentFragment() => _DocumentFragmentFactoryProvider.createDocumentFragment();
 
   factory DocumentFragment.html(String html) =>
@@ -6798,7 +6632,7 @@
 
 @DocsEditable
 @DomName('DocumentType')
-class DocumentType extends Node native "*DocumentType" {
+class DocumentType extends Node native "DocumentType" {
 }
 // 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
@@ -6807,7 +6641,7 @@
 
 @DocsEditable
 @DomName('DOMError')
-class DomError native "*DOMError" {
+class DomError native "DOMError" {
 
   @DomName('DOMError.name')
   @DocsEditable
@@ -6819,7 +6653,7 @@
 
 
 @DomName('DOMException')
-class DomException native "*DOMException" {
+class DomException native "DOMException" {
 
   static const String INDEX_SIZE = 'IndexSizeError';
   static const String HIERARCHY_REQUEST = 'HierarchyRequestError';
@@ -6870,7 +6704,7 @@
 
 @DocsEditable
 @DomName('DOMImplementation')
-class DomImplementation native "*DOMImplementation" {
+class DomImplementation native "DOMImplementation" {
 
   @JSName('createCSSStyleSheet')
   @DomName('DOMImplementation.createCSSStyleSheet')
@@ -6901,7 +6735,7 @@
 
 @DocsEditable
 @DomName('MimeType')
-class DomMimeType native "*MimeType" {
+class DomMimeType native "MimeType" {
 
   @DomName('DOMMimeType.description')
   @DocsEditable
@@ -6926,7 +6760,7 @@
 
 @DocsEditable
 @DomName('MimeTypeArray')
-class DomMimeTypeArray implements JavaScriptIndexingBehavior, List<DomMimeType> native "*MimeTypeArray" {
+class DomMimeTypeArray implements JavaScriptIndexingBehavior, List<DomMimeType> native "MimeTypeArray" {
 
   @DomName('DOMMimeTypeArray.length')
   @DocsEditable
@@ -7084,7 +6918,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -7096,7 +6930,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<DomMimeType> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<DomMimeType> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -7147,7 +6981,7 @@
 
 @DocsEditable
 @DomName('WebKitNamedFlowCollection')
-class DomNamedFlowCollection native "*WebKitNamedFlowCollection" {
+class DomNamedFlowCollection native "WebKitNamedFlowCollection" {
 
   @DomName('DOMNamedFlowCollection.length')
   @DocsEditable
@@ -7168,7 +7002,7 @@
 
 @DocsEditable
 @DomName('DOMParser')
-class DomParser native "*DOMParser" {
+class DomParser native "DOMParser" {
 
   @DomName('DOMParser.DOMParser')
   @DocsEditable
@@ -7188,7 +7022,7 @@
 
 @DocsEditable
 @DomName('Path')
-class DomPath native "*Path" {
+class DomPath native "Path" {
 
   @DomName('DOMPath.DOMPath')
   @DocsEditable
@@ -7247,7 +7081,7 @@
 
 @DocsEditable
 @DomName('Plugin')
-class DomPlugin native "*Plugin" {
+class DomPlugin native "Plugin" {
 
   @DomName('DOMPlugin.description')
   @DocsEditable
@@ -7280,7 +7114,7 @@
 
 @DocsEditable
 @DomName('PluginArray')
-class DomPluginArray implements JavaScriptIndexingBehavior, List<DomPlugin> native "*PluginArray" {
+class DomPluginArray implements JavaScriptIndexingBehavior, List<DomPlugin> native "PluginArray" {
 
   @DomName('DOMPluginArray.length')
   @DocsEditable
@@ -7438,7 +7272,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -7450,7 +7284,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<DomPlugin> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<DomPlugin> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -7505,7 +7339,7 @@
 
 @DocsEditable
 @DomName('SecurityPolicy')
-class DomSecurityPolicy native "*SecurityPolicy" {
+class DomSecurityPolicy native "SecurityPolicy" {
 
   @DomName('DOMSecurityPolicy.allowsEval')
   @DocsEditable
@@ -7576,7 +7410,7 @@
 
 @DocsEditable
 @DomName('Selection')
-class DomSelection native "*Selection" {
+class DomSelection native "Selection" {
 
   @DomName('DOMSelection.anchorNode')
   @DocsEditable
@@ -7689,7 +7523,7 @@
 
 @DocsEditable
 @DomName('DOMSettableTokenList')
-class DomSettableTokenList extends DomTokenList native "*DOMSettableTokenList" {
+class DomSettableTokenList extends DomTokenList native "DOMSettableTokenList" {
 
   @DomName('DOMSettableTokenList.value')
   @DocsEditable
@@ -7702,7 +7536,7 @@
 
 @DocsEditable
 @DomName('DOMStringList')
-class DomStringList implements JavaScriptIndexingBehavior, List<String> native "*DOMStringList" {
+class DomStringList implements JavaScriptIndexingBehavior, List<String> native "DOMStringList" {
 
   @DomName('DOMStringList.length')
   @DocsEditable
@@ -7860,7 +7694,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -7872,7 +7706,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<String> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<String> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -7931,7 +7765,7 @@
 
 @DocsEditable
 @DomName('DOMTokenList')
-class DomTokenList native "*DOMTokenList" {
+class DomTokenList native "DOMTokenList" {
 
   @DomName('DOMTokenList.length')
   @DocsEditable
@@ -8133,13 +7967,15 @@
     throw new UnimplementedError();
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     if (object is Element) {
       Element element = object;
       if (identical(element.parentNode, _element)) {
         _element.$dom_removeChild(element);
+        return true;
       }
     }
+    return false;
   }
 
   void removeWhere(bool test(Element element)) {
@@ -8300,7 +8136,7 @@
     throw new UnsupportedError('');
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
     throw new UnsupportedError('');
   }
 
@@ -8355,7 +8191,7 @@
  * An abstract class, which all HTML elements extend.
  */
 @DomName('Element')
-abstract class Element extends Node implements ElementTraversal native "*Element" {
+abstract class Element extends Node implements ElementTraversal native "Element" {
 
   /**
    * Creates an HTML element from a valid fragment of HTML.
@@ -9696,7 +9532,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.IE)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class EmbedElement extends Element native "*HTMLEmbedElement" {
+class EmbedElement extends Element native "HTMLEmbedElement" {
 
   @DomName('HTMLEmbedElement.HTMLEmbedElement')
   @DocsEditable
@@ -9736,7 +9572,7 @@
 
 @DocsEditable
 @DomName('EntityReference')
-class EntityReference extends Node native "*EntityReference" {
+class EntityReference extends Node native "EntityReference" {
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9753,7 +9589,7 @@
 
 @DocsEditable
 @DomName('Entry')
-class Entry native "*Entry" {
+class Entry native "Entry" {
 
   @DomName('Entry.filesystem')
   @DocsEditable
@@ -9883,7 +9719,7 @@
 
 @DocsEditable
 @DomName('ErrorEvent')
-class ErrorEvent extends Event native "*ErrorEvent" {
+class ErrorEvent extends Event native "ErrorEvent" {
 
   @DomName('ErrorEvent.filename')
   @DocsEditable
@@ -9905,7 +9741,7 @@
 
 
 @DomName('Event')
-class Event native "*Event" {
+class Event native "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)).
@@ -10049,7 +9885,7 @@
 
 @DocsEditable
 @DomName('EventException')
-class EventException native "*EventException" {
+class EventException native "EventException" {
 
   static const int DISPATCH_REQUEST_ERR = 1;
 
@@ -10077,7 +9913,7 @@
 
 
 @DomName('EventSource')
-class EventSource extends EventTarget native "*EventSource" {
+class EventSource extends EventTarget native "EventSource" {
   factory EventSource(String title, {withCredentials: false}) {
     var parsedOptions = {
       'withCredentials': withCredentials,
@@ -10217,7 +10053,7 @@
  * for compile-time type checks and a more concise API.
  */
 @DomName('EventTarget')
-class EventTarget native "*EventTarget" {
+class EventTarget native "EventTarget" {
 
   /**
    * This is an ease-of-use accessor for event streams which should only be
@@ -10247,7 +10083,7 @@
 
 @DocsEditable
 @DomName('HTMLFieldSetElement')
-class FieldSetElement extends Element native "*HTMLFieldSetElement" {
+class FieldSetElement extends Element native "HTMLFieldSetElement" {
 
   @DomName('HTMLFieldSetElement.HTMLFieldSetElement')
   @DocsEditable
@@ -10300,7 +10136,7 @@
 
 @DocsEditable
 @DomName('File')
-class File extends Blob native "*File" {
+class File extends Blob native "File" {
 
   DateTime get lastModifiedDate => _convertNativeToDart_DateTime(this._get_lastModifiedDate);
   @JSName('lastModifiedDate')
@@ -10335,7 +10171,7 @@
 
 @DocsEditable
 @DomName('FileEntry')
-class FileEntry extends Entry native "*FileEntry" {
+class FileEntry extends Entry native "FileEntry" {
 
   @JSName('createWriter')
   @DomName('FileEntry.createWriter')
@@ -10376,7 +10212,7 @@
 
 @DocsEditable
 @DomName('FileError')
-class FileError native "*FileError" {
+class FileError native "FileError" {
 
   static const int ABORT_ERR = 3;
 
@@ -10413,7 +10249,7 @@
 
 @DocsEditable
 @DomName('FileException')
-class FileException native "*FileException" {
+class FileException native "FileException" {
 
   static const int ABORT_ERR = 3;
 
@@ -10462,7 +10298,7 @@
 
 @DocsEditable
 @DomName('FileList')
-class FileList implements JavaScriptIndexingBehavior, List<File> native "*FileList" {
+class FileList implements JavaScriptIndexingBehavior, List<File> native "FileList" {
 
   @DomName('FileList.length')
   @DocsEditable
@@ -10620,7 +10456,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -10632,7 +10468,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<File> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<File> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -10679,7 +10515,7 @@
 
 @DocsEditable
 @DomName('FileReader')
-class FileReader extends EventTarget native "*FileReader" {
+class FileReader extends EventTarget native "FileReader" {
 
   @DomName('FileReader.abortEvent')
   @DocsEditable
@@ -10728,7 +10564,7 @@
 
   @DomName('FileReader.result')
   @DocsEditable
-  @Creates('String|ArrayBuffer|Null')
+  @Creates('String|ByteBuffer|Null')
   final Object result;
 
   @DomName('FileReader.abort')
@@ -10799,7 +10635,7 @@
 @DomName('DOMFileSystem')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class FileSystem native "*DOMFileSystem" {
+class FileSystem native "DOMFileSystem" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(window.webkitRequestFileSystem)');
@@ -10827,7 +10663,7 @@
 
 @DocsEditable
 @DomName('FileWriter')
-class FileWriter extends EventTarget native "*FileWriter" {
+class FileWriter extends EventTarget native "FileWriter" {
 
   @DomName('FileWriter.abortEvent')
   @DocsEditable
@@ -10943,484 +10779,8 @@
 
 
 @DocsEditable
-@DomName('Float32Array')
-class Float32Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<double> native "*Float32Array" {
-
-  @DomName('Float32Array.Float32Array')
-  @DocsEditable
-  factory Float32Array(int length) =>
-    _TypedArrayFactoryProvider.createFloat32Array(length);
-
-  @DomName('Float32Array.fromList')
-  @DocsEditable
-  factory Float32Array.fromList(List<num> list) =>
-    _TypedArrayFactoryProvider.createFloat32Array_fromList(list);
-
-  @DomName('Float32Array.fromBuffer')
-  @DocsEditable
-  factory Float32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createFloat32Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 4;
-
-  @DomName('Float32Array.length')
-  @DocsEditable
-  int get length => JS("int", "#.length", this);
-
-  num operator[](int index) => JS("num", "#[#]", this, index);
-
-  void operator[]=(int index, num value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<num> mixins.
-  // num is the element type.
-
-  // From Iterable<num>:
-
-  Iterator<num> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<num>(this);
-  }
-
-  num reduce(num combine(num value, num element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, num element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(num element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(num element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<num> where(bool f(num element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(num element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
-
-  List<num> toList({ bool growable: true }) =>
-      new List<num>.from(this, growable: growable);
-
-  Set<num> toSet() => new Set<num>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<num> takeWhile(bool test(num value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<num> skipWhile(bool test(num value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  num firstWhere(bool test(num value), { num orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  num lastWhere(bool test(num value), {num orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  num singleWhere(bool test(num value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  num elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<num>:
-
-  void add(num value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<num>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<num> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(num a, num b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(num element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(num element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  num get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  num get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  num get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, num element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  num removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  num removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(num element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(num element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<num> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [num fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<num> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<num> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <num>[]);
-  }
-
-  Map<int, num> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<num> mixins.
-
-  @JSName('set')
-  @DomName('Float32Array.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Float32Array.subarray')
-  @DocsEditable
-  @Returns('Float32Array')
-  @Creates('Float32Array')
-  List<double> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Float64Array')
-class Float64Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<double> native "*Float64Array" {
-
-  @DomName('Float64Array.Float64Array')
-  @DocsEditable
-  factory Float64Array(int length) =>
-    _TypedArrayFactoryProvider.createFloat64Array(length);
-
-  @DomName('Float64Array.fromList')
-  @DocsEditable
-  factory Float64Array.fromList(List<num> list) =>
-    _TypedArrayFactoryProvider.createFloat64Array_fromList(list);
-
-  @DomName('Float64Array.fromBuffer')
-  @DocsEditable
-  factory Float64Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createFloat64Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 8;
-
-  @DomName('Float64Array.length')
-  @DocsEditable
-  int get length => JS("int", "#.length", this);
-
-  num operator[](int index) => JS("num", "#[#]", this, index);
-
-  void operator[]=(int index, num value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<num> mixins.
-  // num is the element type.
-
-  // From Iterable<num>:
-
-  Iterator<num> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<num>(this);
-  }
-
-  num reduce(num combine(num value, num element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, num element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(num element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(num element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<num> where(bool f(num element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(num element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
-
-  List<num> toList({ bool growable: true }) =>
-      new List<num>.from(this, growable: growable);
-
-  Set<num> toSet() => new Set<num>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<num> takeWhile(bool test(num value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<num> skipWhile(bool test(num value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  num firstWhere(bool test(num value), { num orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  num lastWhere(bool test(num value), {num orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  num singleWhere(bool test(num value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  num elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<num>:
-
-  void add(num value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<num>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<num> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(num a, num b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(num element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(num element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  num get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  num get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  num get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, num element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  num removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  num removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(num element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(num element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<num> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [num fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<num> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<num> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <num>[]);
-  }
-
-  Map<int, num> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<num> mixins.
-
-  @JSName('set')
-  @DomName('Float64Array.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Float64Array.subarray')
-  @DocsEditable
-  @Returns('Float64Array')
-  @Creates('Float64Array')
-  List<double> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
 @DomName('FocusEvent')
-class FocusEvent extends UIEvent native "*FocusEvent" {
+class FocusEvent extends UIEvent native "FocusEvent" {
 
   EventTarget get relatedTarget => _convertNativeToDart_EventTarget(this._get_relatedTarget);
   @JSName('relatedTarget')
@@ -11435,7 +10795,7 @@
 
 @DocsEditable
 @DomName('FontLoader')
-class FontLoader extends EventTarget native "*FontLoader" {
+class FontLoader extends EventTarget native "FontLoader" {
 
   @DomName('FontLoader.errorEvent')
   @DocsEditable
@@ -11502,7 +10862,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FormData native "*FormData" {
+class FormData native "FormData" {
 
   @DomName('DOMFormData.DOMFormData')
   @DocsEditable
@@ -11529,7 +10889,7 @@
 
 @DocsEditable
 @DomName('HTMLFormElement')
-class FormElement extends Element native "*HTMLFormElement" {
+class FormElement extends Element native "HTMLFormElement" {
 
   @DomName('HTMLFormElement.HTMLFormElement')
   @DocsEditable
@@ -11598,7 +10958,7 @@
 
 @DocsEditable
 @DomName('Gamepad')
-class Gamepad native "*Gamepad" {
+class Gamepad native "Gamepad" {
 
   @DomName('Gamepad.axes')
   @DocsEditable
@@ -11627,7 +10987,7 @@
 
 @DocsEditable
 @DomName('Geolocation')
-class Geolocation native "*Geolocation" {
+class Geolocation native "Geolocation" {
 
   @DomName('Geolocation.getCurrentPosition')
   Future<Geoposition> getCurrentPosition({bool enableHighAccuracy,
@@ -11743,7 +11103,7 @@
 
 @DocsEditable
 @DomName('Geoposition')
-class Geoposition native "*Geoposition" {
+class Geoposition native "Geoposition" {
 
   @DomName('Geoposition.coords')
   @DocsEditable
@@ -11763,7 +11123,7 @@
  * An `<hr>` tag.
  */
 @DomName('HTMLHRElement')
-class HRElement extends Element native "*HTMLHRElement" {
+class HRElement extends Element native "HTMLHRElement" {
 
   @DomName('HTMLHRElement.HTMLHRElement')
   @DocsEditable
@@ -11780,7 +11140,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 
-class HashChangeEvent extends Event native "*HashChangeEvent" {
+class HashChangeEvent extends Event native "HashChangeEvent" {
   factory HashChangeEvent(String type,
       {bool canBubble: true, bool cancelable: true, String oldUrl,
       String newUrl}) {
@@ -11815,7 +11175,7 @@
 
 @DocsEditable
 @DomName('HTMLHeadElement')
-class HeadElement extends Element native "*HTMLHeadElement" {
+class HeadElement extends Element native "HTMLHeadElement" {
 
   @DomName('HTMLHeadElement.HTMLHeadElement')
   @DocsEditable
@@ -11828,7 +11188,7 @@
 
 @DocsEditable
 @DomName('HTMLHeadingElement')
-class HeadingElement extends Element native "*HTMLHeadingElement" {
+class HeadingElement extends Element native "HTMLHeadingElement" {
 
   @DomName('HTMLHeadingElement.HTMLHeadingElement')
   @DocsEditable
@@ -11860,7 +11220,7 @@
 
 
 @DomName('History')
-class History implements HistoryBase native "*History" {
+class History implements HistoryBase native "History" {
 
   /**
    * Checks if the State APIs are supported on the current platform.
@@ -11920,7 +11280,7 @@
 
 @DocsEditable
 @DomName('HTMLAllCollection')
-class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native "*HTMLAllCollection" {
+class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native "HTMLAllCollection" {
 
   @DomName('HTMLAllCollection.length')
   @DocsEditable
@@ -12078,7 +11438,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -12090,7 +11450,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -12147,7 +11507,7 @@
 
 @DocsEditable
 @DomName('HTMLCollection')
-class HtmlCollection implements JavaScriptIndexingBehavior, List<Node> native "*HTMLCollection" {
+class HtmlCollection implements JavaScriptIndexingBehavior, List<Node> native "HTMLCollection" {
 
   @DomName('HTMLCollection.length')
   @DocsEditable
@@ -12305,7 +11665,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -12317,7 +11677,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -12369,7 +11729,7 @@
 
 
 @DomName('HTMLDocument')
-class HtmlDocument extends Document native "*HTMLDocument" {
+class HtmlDocument extends Document native "HTMLDocument" {
 
   @DomName('HTMLDocument.activeElement')
   @DocsEditable
@@ -12526,7 +11886,7 @@
 
 @DocsEditable
 @DomName('HTMLHtmlElement')
-class HtmlElement extends Element native "*HTMLHtmlElement" {
+class HtmlElement extends Element native "HTMLHtmlElement" {
 
   @DomName('HTMLHtmlElement.HTMLHtmlElement')
   @DocsEditable
@@ -12539,7 +11899,7 @@
 
 @DocsEditable
 @DomName('HTMLFormControlsCollection')
-class HtmlFormControlsCollection extends HtmlCollection native "*HTMLFormControlsCollection" {
+class HtmlFormControlsCollection extends HtmlCollection native "HTMLFormControlsCollection" {
 
   @DomName('HTMLFormControlsCollection.namedItem')
   @DocsEditable
@@ -12552,7 +11912,7 @@
 
 @DocsEditable
 @DomName('HTMLOptionsCollection')
-class HtmlOptionsCollection extends HtmlCollection native "*HTMLOptionsCollection" {
+class HtmlOptionsCollection extends HtmlCollection native "HTMLOptionsCollection" {
 }
 // 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
@@ -12586,7 +11946,7 @@
  * * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest)
  */
 @DomName('XMLHttpRequest')
-class HttpRequest extends EventTarget native "*XMLHttpRequest" {
+class HttpRequest extends EventTarget native "XMLHttpRequest" {
 
   /**
    * Creates a URL get request for the specified [url].
@@ -12816,7 +12176,7 @@
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @SupportedBrowser(SupportedBrowser.IE, '10')
   @SupportedBrowser(SupportedBrowser.SAFARI)
-  @Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')
+  @Creates('ByteBuffer|Blob|Document|=Object|=List|String|num')
   final Object response;
 
   /**
@@ -12964,7 +12324,8 @@
    * Send the request with any given `data`.
    *
    * See also:
-   * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send())
+   *
+   *   * [send](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send%28%29)
    * from MDN.
    */
   @DomName('XMLHttpRequest.send')
@@ -13050,7 +12411,7 @@
 
 @DocsEditable
 @DomName('XMLHttpRequestException')
-class HttpRequestException native "*XMLHttpRequestException" {
+class HttpRequestException native "XMLHttpRequestException" {
 
   static const int ABORT_ERR = 102;
 
@@ -13082,7 +12443,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class HttpRequestProgressEvent extends ProgressEvent native "*XMLHttpRequestProgressEvent" {
+class HttpRequestProgressEvent extends ProgressEvent native "XMLHttpRequestProgressEvent" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => Device.isEventTypeSupported('XMLHttpRequestProgressEvent');
@@ -13102,7 +12463,7 @@
 
 @DocsEditable
 @DomName('XMLHttpRequestUpload')
-class HttpRequestUpload extends EventTarget native "*XMLHttpRequestUpload" {
+class HttpRequestUpload extends EventTarget native "XMLHttpRequestUpload" {
 
   @DomName('XMLHttpRequestUpload.abortEvent')
   @DocsEditable
@@ -13173,7 +12534,7 @@
 
 @DocsEditable
 @DomName('HTMLIFrameElement')
-class IFrameElement extends Element native "*HTMLIFrameElement" {
+class IFrameElement extends Element native "HTMLIFrameElement" {
 
   @DomName('HTMLIFrameElement.HTMLIFrameElement')
   @DocsEditable
@@ -13221,7 +12582,7 @@
 
 @DomName('ImageData')
 
-class ImageData native "*ImageData" {
+class ImageData native "ImageData" {
 
 
   @DomName('ImageData.data')
@@ -13243,7 +12604,7 @@
 
 
 @DomName('HTMLImageElement')
-class ImageElement extends Element implements CanvasImageSource native "*HTMLImageElement" {
+class ImageElement extends Element implements CanvasImageSource native "HTMLImageElement" {
 
   @DomName('HTMLImageElement.HTMLImageElement')
   @DocsEditable
@@ -13340,7 +12701,7 @@
     ImageButtonInputElement,
     ResetButtonInputElement,
     ButtonInputElement
-     native "*HTMLInputElement" {
+     native "HTMLInputElement" {
 
   factory InputElement({String type}) {
     var e = document.$dom_createElement("input");
@@ -14181,722 +13542,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
-@DocsEditable
-@DomName('Int16Array')
-class Int16Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Int16Array" {
-
-  @DomName('Int16Array.Int16Array')
-  @DocsEditable
-  factory Int16Array(int length) =>
-    _TypedArrayFactoryProvider.createInt16Array(length);
-
-  @DomName('Int16Array.fromList')
-  @DocsEditable
-  factory Int16Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createInt16Array_fromList(list);
-
-  @DomName('Int16Array.fromBuffer')
-  @DocsEditable
-  factory Int16Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createInt16Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 2;
-
-  @DomName('Int16Array.length')
-  @DocsEditable
-  int get length => JS("int", "#.length", this);
-
-  int operator[](int index) => JS("int", "#[#]", this, index);
-
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @JSName('set')
-  @DomName('Int16Array.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Int16Array.subarray')
-  @DocsEditable
-  @Returns('Int16Array')
-  @Creates('Int16Array')
-  List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Int32Array')
-class Int32Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Int32Array" {
-
-  @DomName('Int32Array.Int32Array')
-  @DocsEditable
-  factory Int32Array(int length) =>
-    _TypedArrayFactoryProvider.createInt32Array(length);
-
-  @DomName('Int32Array.fromList')
-  @DocsEditable
-  factory Int32Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createInt32Array_fromList(list);
-
-  @DomName('Int32Array.fromBuffer')
-  @DocsEditable
-  factory Int32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createInt32Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 4;
-
-  @DomName('Int32Array.length')
-  @DocsEditable
-  int get length => JS("int", "#.length", this);
-
-  int operator[](int index) => JS("int", "#[#]", this, index);
-
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @JSName('set')
-  @DomName('Int32Array.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Int32Array.subarray')
-  @DocsEditable
-  @Returns('Int32Array')
-  @Creates('Int32Array')
-  List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Int8Array')
-class Int8Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Int8Array" {
-
-  @DomName('Int8Array.Int8Array')
-  @DocsEditable
-  factory Int8Array(int length) =>
-    _TypedArrayFactoryProvider.createInt8Array(length);
-
-  @DomName('Int8Array.fromList')
-  @DocsEditable
-  factory Int8Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createInt8Array_fromList(list);
-
-  @DomName('Int8Array.fromBuffer')
-  @DocsEditable
-  factory Int8Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createInt8Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 1;
-
-  @DomName('Int8Array.length')
-  @DocsEditable
-  int get length => JS("int", "#.length", this);
-
-  int operator[](int index) => JS("int", "#[#]", this, index);
-
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @JSName('set')
-  @DomName('Int8Array.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Int8Array.subarray')
-  @DocsEditable
-  @Returns('Int8Array')
-  @Creates('Int8Array')
-  List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
 @DomName('KeyboardEvent')
-class KeyboardEvent extends UIEvent native "*KeyboardEvent" {
+class KeyboardEvent extends UIEvent native "KeyboardEvent" {
 
   factory KeyboardEvent(String type,
       {Window view, bool canBubble: true, bool cancelable: true,
@@ -14978,7 +13625,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class KeygenElement extends Element native "*HTMLKeygenElement" {
+class KeygenElement extends Element native "HTMLKeygenElement" {
 
   @DomName('HTMLKeygenElement.HTMLKeygenElement')
   @DocsEditable
@@ -15048,7 +13695,7 @@
 
 @DocsEditable
 @DomName('HTMLLIElement')
-class LIElement extends Element native "*HTMLLIElement" {
+class LIElement extends Element native "HTMLLIElement" {
 
   @DomName('HTMLLIElement.HTMLLIElement')
   @DocsEditable
@@ -15069,7 +13716,7 @@
 
 @DocsEditable
 @DomName('HTMLLabelElement')
-class LabelElement extends Element native "*HTMLLabelElement" {
+class LabelElement extends Element native "HTMLLabelElement" {
 
   @DomName('HTMLLabelElement.HTMLLabelElement')
   @DocsEditable
@@ -15094,7 +13741,7 @@
 
 @DocsEditable
 @DomName('HTMLLegendElement')
-class LegendElement extends Element native "*HTMLLegendElement" {
+class LegendElement extends Element native "HTMLLegendElement" {
 
   @DomName('HTMLLegendElement.HTMLLegendElement')
   @DocsEditable
@@ -15111,7 +13758,7 @@
 
 @DocsEditable
 @DomName('HTMLLinkElement')
-class LinkElement extends Element native "*HTMLLinkElement" {
+class LinkElement extends Element native "HTMLLinkElement" {
 
   @DomName('HTMLLinkElement.HTMLLinkElement')
   @DocsEditable
@@ -15158,7 +13805,7 @@
 @DomName('LocalMediaStream')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class LocalMediaStream extends MediaStream implements EventTarget native "*LocalMediaStream" {
+class LocalMediaStream extends MediaStream implements EventTarget native "LocalMediaStream" {
 
   @DomName('LocalMediaStream.stop')
   @DocsEditable
@@ -15171,7 +13818,7 @@
 
 @DocsEditable
 @DomName('Location')
-class Location implements LocationBase native "*Location" {
+class Location implements LocationBase native "Location" {
 
   @DomName('Location.ancestorOrigins')
   @DocsEditable
@@ -15242,7 +13889,7 @@
 
 @DocsEditable
 @DomName('HTMLMapElement')
-class MapElement extends Element native "*HTMLMapElement" {
+class MapElement extends Element native "HTMLMapElement" {
 
   @DomName('HTMLMapElement.HTMLMapElement')
   @DocsEditable
@@ -15263,7 +13910,7 @@
 
 @DocsEditable
 @DomName('MediaController')
-class MediaController extends EventTarget native "*MediaController" {
+class MediaController extends EventTarget native "MediaController" {
 
   @DomName('MediaController.MediaController')
   @DocsEditable
@@ -15349,7 +13996,7 @@
 
 @DocsEditable
 @DomName('HTMLMediaElement')
-class MediaElement extends Element native "*HTMLMediaElement" {
+class MediaElement extends Element native "HTMLMediaElement" {
 
   @DomName('HTMLMediaElement.canplayEvent')
   @DocsEditable
@@ -15655,7 +14302,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental
-  void addKey(String keySystem, Uint8Array key, [Uint8Array initData, String sessionId]) native;
+  void addKey(String keySystem, Uint8List key, [Uint8List initData, String sessionId]) native;
 
   @JSName('webkitCancelKeyRequest')
   @DomName('HTMLMediaElement.webkitCancelKeyRequest')
@@ -15671,7 +14318,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental
-  void generateKeyRequest(String keySystem, [Uint8Array initData]) native;
+  void generateKeyRequest(String keySystem, [Uint8List initData]) native;
 
   @DomName('HTMLMediaElement.oncanplay')
   @DocsEditable
@@ -15780,7 +14427,7 @@
 
 @DocsEditable
 @DomName('MediaError')
-class MediaError native "*MediaError" {
+class MediaError native "MediaError" {
 
   static const int MEDIA_ERR_ABORTED = 1;
 
@@ -15803,7 +14450,7 @@
 
 @DocsEditable
 @DomName('MediaKeyError')
-class MediaKeyError native "*MediaKeyError" {
+class MediaKeyError native "MediaKeyError" {
 
   static const int MEDIA_KEYERR_CLIENT = 2;
 
@@ -15828,7 +14475,7 @@
 
 @DocsEditable
 @DomName('MediaKeyEvent')
-class MediaKeyEvent extends Event native "*MediaKeyEvent" {
+class MediaKeyEvent extends Event native "MediaKeyEvent" {
 
   @JSName('defaultURL')
   @DomName('MediaKeyEvent.defaultURL')
@@ -15841,8 +14488,8 @@
 
   @DomName('MediaKeyEvent.initData')
   @DocsEditable
-  @Returns('Uint8Array')
-  @Creates('Uint8Array')
+  @Returns('Uint8List')
+  @Creates('Uint8List')
   final List<int> initData;
 
   @DomName('MediaKeyEvent.keySystem')
@@ -15851,8 +14498,8 @@
 
   @DomName('MediaKeyEvent.message')
   @DocsEditable
-  @Returns('Uint8Array')
-  @Creates('Uint8Array')
+  @Returns('Uint8List')
+  @Creates('Uint8List')
   final List<int> message;
 
   @DomName('MediaKeyEvent.sessionId')
@@ -15870,7 +14517,7 @@
 
 @DocsEditable
 @DomName('MediaList')
-class MediaList native "*MediaList" {
+class MediaList native "MediaList" {
 
   @DomName('MediaList.length')
   @DocsEditable
@@ -15899,7 +14546,7 @@
 
 @DocsEditable
 @DomName('MediaQueryList')
-class MediaQueryList native "*MediaQueryList" {
+class MediaQueryList native "MediaQueryList" {
 
   @DomName('MediaQueryList.matches')
   @DocsEditable
@@ -15934,7 +14581,7 @@
 
 @DocsEditable
 @DomName('MediaSource')
-class MediaSource extends EventTarget native "*MediaSource" {
+class MediaSource extends EventTarget native "MediaSource" {
 
   @DomName('MediaSource.MediaSource')
   @DocsEditable
@@ -15997,7 +14644,7 @@
 @DomName('MediaStream')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class MediaStream extends EventTarget native "*MediaStream" {
+class MediaStream extends EventTarget native "MediaStream" {
 
   @DomName('MediaStream.addtrackEvent')
   @DocsEditable
@@ -16112,7 +14759,7 @@
 @DomName('MediaStreamEvent')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class MediaStreamEvent extends Event native "*MediaStreamEvent" {
+class MediaStreamEvent extends Event native "MediaStreamEvent" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => Device.isEventTypeSupported('MediaStreamEvent');
@@ -16130,7 +14777,7 @@
 @DomName('MediaStreamTrack')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class MediaStreamTrack extends EventTarget native "*MediaStreamTrack" {
+class MediaStreamTrack extends EventTarget native "MediaStreamTrack" {
 
   @DomName('MediaStreamTrack.endedEvent')
   @DocsEditable
@@ -16199,7 +14846,7 @@
 @DomName('MediaStreamTrackEvent')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class MediaStreamTrackEvent extends Event native "*MediaStreamTrackEvent" {
+class MediaStreamTrackEvent extends Event native "MediaStreamTrackEvent" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => Device.isEventTypeSupported('MediaStreamTrackEvent');
@@ -16215,7 +14862,7 @@
 
 @DocsEditable
 @DomName('MemoryInfo')
-class MemoryInfo native "*MemoryInfo" {
+class MemoryInfo native "MemoryInfo" {
 
   @DomName('MemoryInfo.jsHeapSizeLimit')
   @DocsEditable
@@ -16246,7 +14893,7 @@
  *  * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-element) from the W3C.
  */
 @DomName('HTMLMenuElement')
-class MenuElement extends Element native "*HTMLMenuElement" {
+class MenuElement extends Element native "HTMLMenuElement" {
 
   @DomName('HTMLMenuElement.HTMLMenuElement')
   @DocsEditable
@@ -16259,7 +14906,7 @@
 
 @DocsEditable
 @DomName('MessageChannel')
-class MessageChannel native "*MessageChannel" {
+class MessageChannel native "MessageChannel" {
 
   @DomName('MessageChannel.MessageChannel')
   @DocsEditable
@@ -16284,7 +14931,7 @@
 
 
 @DomName('MessageEvent')
-class MessageEvent extends Event native "*MessageEvent" {
+class MessageEvent extends Event native "MessageEvent" {
   factory MessageEvent(String type,
       {bool canBubble: false, bool cancelable: false, Object data,
       String origin, String lastEventId,
@@ -16340,7 +14987,7 @@
 
 @DocsEditable
 @DomName('MessagePort')
-class MessagePort extends EventTarget native "*MessagePort" {
+class MessagePort extends EventTarget native "MessagePort" {
 
   @DomName('MessagePort.messageEvent')
   @DocsEditable
@@ -16400,7 +15047,7 @@
 
 @DocsEditable
 @DomName('HTMLMetaElement')
-class MetaElement extends Element native "*HTMLMetaElement" {
+class MetaElement extends Element native "HTMLMetaElement" {
 
   @DomName('HTMLMetaElement.content')
   @DocsEditable
@@ -16421,7 +15068,7 @@
 
 @DocsEditable
 @DomName('Metadata')
-class Metadata native "*Metadata" {
+class Metadata native "Metadata" {
 
   DateTime get modificationTime => _convertNativeToDart_DateTime(this._get_modificationTime);
   @JSName('modificationTime')
@@ -16451,7 +15098,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class MeterElement extends Element native "*HTMLMeterElement" {
+class MeterElement extends Element native "HTMLMeterElement" {
 
   @DomName('HTMLMeterElement.HTMLMeterElement')
   @DocsEditable
@@ -16497,7 +15144,7 @@
 
 @DocsEditable
 @DomName('HTMLModElement')
-class ModElement extends Element native "*HTMLModElement" {
+class ModElement extends Element native "HTMLModElement" {
 
   @DomName('HTMLModElement.cite')
   @DocsEditable
@@ -16513,7 +15160,7 @@
 
 
 @DomName('MouseEvent')
-class MouseEvent extends UIEvent native "*MouseEvent" {
+class MouseEvent extends UIEvent native "MouseEvent" {
   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,
@@ -16689,7 +15336,7 @@
 
 
 @DomName('MutationEvent')
-class MutationEvent extends Event native "*MutationEvent" {
+class MutationEvent extends Event native "MutationEvent" {
   factory MutationEvent(String type,
       {bool canBubble: false, bool cancelable: false, Node relatedNode,
       String prevValue, String newValue, String attrName, int attrChange: 0}) {
@@ -16745,7 +15392,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class MutationObserver native "*MutationObserver" {
+class MutationObserver native "MutationObserver,WebKitMutationObserver" {
 
   @DomName('MutationObserver.observe')
   @DocsEditable
@@ -16841,7 +15488,7 @@
 
 @DocsEditable
 @DomName('MutationRecord')
-class MutationRecord native "*MutationRecord" {
+class MutationRecord native "MutationRecord" {
 
   @DomName('MutationRecord.addedNodes')
   @DocsEditable
@@ -16890,7 +15537,7 @@
 
 @DocsEditable
 @DomName('WebKitNamedFlow')
-class NamedFlow extends EventTarget native "*WebKitNamedFlow" {
+class NamedFlow extends EventTarget native "WebKitNamedFlow" {
 
   @DomName('NamedFlow.firstEmptyRegionIndex')
   @DocsEditable
@@ -16942,7 +15589,7 @@
 
 
 @DomName('Navigator')
-class Navigator native "*Navigator" {
+class Navigator native "Navigator" {
 
   @DomName('Navigator.language')
   String get language => JS('String', '#.language || #.userLanguage', this,
@@ -17122,7 +15769,7 @@
 
 @DocsEditable
 @DomName('NavigatorUserMediaError')
-class NavigatorUserMediaError native "*NavigatorUserMediaError" {
+class NavigatorUserMediaError native "NavigatorUserMediaError" {
 
   static const int PERMISSION_DENIED = 1;
 
@@ -17234,11 +15881,12 @@
     return result;
   }
 
-  void remove(Object object) {
-    if (object is! Node) return;
+  bool remove(Object object) {
+    if (object is! Node) return false;
     Node node = object;
-    if (!identical(_this, node.parentNode)) return;
+    if (!identical(_this, node.parentNode)) return false;
     _this.$dom_removeChild(node);
+    return true;
   }
 
   void _filter(bool test(Node node), bool removeMatching) {
@@ -17336,7 +15984,7 @@
 }
 
 @DomName('Node')
-class Node extends EventTarget native "*Node" {
+class Node extends EventTarget native "Node" {
   List<Node> get nodes {
     return new _ChildNodeListLazy(this);
   }
@@ -17493,6 +16141,30 @@
       (nodeValue == null ? super.toString() : nodeValue) : localName;
 
 
+  static const int ATTRIBUTE_NODE = 2;
+
+  static const int CDATA_SECTION_NODE = 4;
+
+  static const int COMMENT_NODE = 8;
+
+  static const int DOCUMENT_FRAGMENT_NODE = 11;
+
+  static const int DOCUMENT_NODE = 9;
+
+  static const int DOCUMENT_TYPE_NODE = 10;
+
+  static const int ELEMENT_NODE = 1;
+
+  static const int ENTITY_NODE = 6;
+
+  static const int ENTITY_REFERENCE_NODE = 5;
+
+  static const int NOTATION_NODE = 12;
+
+  static const int PROCESSING_INSTRUCTION_NODE = 7;
+
+  static const int TEXT_NODE = 3;
+
   @JSName('childNodes')
   @DomName('Node.childNodes')
   @DocsEditable
@@ -17610,7 +16282,7 @@
 
 @DocsEditable
 @DomName('NodeFilter')
-class NodeFilter native "*NodeFilter" {
+class NodeFilter native "NodeFilter" {
 
   static const int FILTER_ACCEPT = 1;
 
@@ -17655,7 +16327,7 @@
 
 @DocsEditable
 @DomName('NodeIterator')
-class NodeIterator native "*NodeIterator" {
+class NodeIterator native "NodeIterator" {
 
   @DomName('NodeIterator.expandEntityReferences')
   @DocsEditable
@@ -17700,7 +16372,7 @@
 
 @DocsEditable
 @DomName('NodeList')
-class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeList" {
+class NodeList implements JavaScriptIndexingBehavior, List<Node> native "NodeList,RadioNodeList" {
 
   @DomName('NodeList.length')
   @DocsEditable
@@ -17858,7 +16530,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -17870,7 +16542,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -17918,7 +16590,7 @@
 
 @DocsEditable
 @DomName('Notation')
-class Notation extends Node native "*Notation" {
+class Notation extends Node native "Notation" {
 
   @DomName('Notation.publicId')
   @DocsEditable
@@ -17934,7 +16606,7 @@
 
 
 @DomName('Notification')
-class Notification extends EventTarget native "*Notification" {
+class Notification extends EventTarget native "Notification" {
 
   factory Notification(String title, {String titleDir: null, String body: null, 
       String bodyDir: null, String tag: null, String iconUrl: null}) {
@@ -18068,7 +16740,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class NotificationCenter native "*NotificationCenter" {
+class NotificationCenter native "NotificationCenter" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(window.webkitNotifications)');
@@ -18116,7 +16788,7 @@
 
 @DocsEditable
 @DomName('HTMLOListElement')
-class OListElement extends Element native "*HTMLOListElement" {
+class OListElement extends Element native "HTMLOListElement" {
 
   @DomName('HTMLOListElement.HTMLOListElement')
   @DocsEditable
@@ -18144,7 +16816,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.IE)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class ObjectElement extends Element native "*HTMLObjectElement" {
+class ObjectElement extends Element native "HTMLObjectElement" {
 
   @DomName('HTMLObjectElement.HTMLObjectElement')
   @DocsEditable
@@ -18212,7 +16884,7 @@
 
 @DocsEditable
 @DomName('HTMLOptGroupElement')
-class OptGroupElement extends Element native "*HTMLOptGroupElement" {
+class OptGroupElement extends Element native "HTMLOptGroupElement" {
 
   @DomName('HTMLOptGroupElement.HTMLOptGroupElement')
   @DocsEditable
@@ -18233,7 +16905,7 @@
 
 @DocsEditable
 @DomName('HTMLOptionElement')
-class OptionElement extends Element native "*HTMLOptionElement" {
+class OptionElement extends Element native "HTMLOptionElement" {
 
   @DomName('HTMLOptionElement.HTMLOptionElement')
   @DocsEditable
@@ -18296,7 +16968,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class OutputElement extends Element native "*HTMLOutputElement" {
+class OutputElement extends Element native "HTMLOutputElement" {
 
   @DomName('HTMLOutputElement.HTMLOutputElement')
   @DocsEditable
@@ -18362,7 +17034,7 @@
 
 @DocsEditable
 @DomName('OverflowEvent')
-class OverflowEvent extends Event native "*OverflowEvent" {
+class OverflowEvent extends Event native "OverflowEvent" {
 
   static const int BOTH = 2;
 
@@ -18389,7 +17061,7 @@
 
 @DocsEditable
 @DomName('PagePopupController')
-class PagePopupController native "*PagePopupController" {
+class PagePopupController native "PagePopupController" {
 
   @DomName('PagePopupController.closePopup')
   @DocsEditable
@@ -18426,7 +17098,7 @@
 
 @DocsEditable
 @DomName('PageTransitionEvent')
-class PageTransitionEvent extends Event native "*PageTransitionEvent" {
+class PageTransitionEvent extends Event native "PageTransitionEvent" {
 
   @DomName('PageTransitionEvent.persisted')
   @DocsEditable
@@ -18439,7 +17111,7 @@
 
 @DocsEditable
 @DomName('HTMLParagraphElement')
-class ParagraphElement extends Element native "*HTMLParagraphElement" {
+class ParagraphElement extends Element native "HTMLParagraphElement" {
 
   @DomName('HTMLParagraphElement.HTMLParagraphElement')
   @DocsEditable
@@ -18452,7 +17124,7 @@
 
 @DocsEditable
 @DomName('HTMLParamElement')
-class ParamElement extends Element native "*HTMLParamElement" {
+class ParamElement extends Element native "HTMLParamElement" {
 
   @DomName('HTMLParamElement.HTMLParamElement')
   @DocsEditable
@@ -18476,7 +17148,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE)
-class Performance extends EventTarget native "*Performance" {
+class Performance extends EventTarget native "Performance" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(window.performance)');
@@ -18527,7 +17199,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental
-  PerformanceEntryList getEntries() native;
+  List<PerformanceEntry> getEntries() native;
 
   @JSName('webkitGetEntriesByName')
   @DomName('Performance.webkitGetEntriesByName')
@@ -18535,7 +17207,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental
-  PerformanceEntryList getEntriesByName(String name, String entryType) native;
+  List<PerformanceEntry> getEntriesByName(String name, String entryType) native;
 
   @JSName('webkitGetEntriesByType')
   @DomName('Performance.webkitGetEntriesByType')
@@ -18543,7 +17215,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental
-  PerformanceEntryList getEntriesByType(String entryType) native;
+  List<PerformanceEntry> getEntriesByType(String entryType) native;
 
   @JSName('webkitMark')
   @DomName('Performance.webkitMark')
@@ -18576,7 +17248,7 @@
 
 @DocsEditable
 @DomName('PerformanceEntry')
-class PerformanceEntry native "*PerformanceEntry" {
+class PerformanceEntry native "PerformanceEntry" {
 
   @DomName('PerformanceEntry.duration')
   @DocsEditable
@@ -18601,7 +17273,7 @@
 
 @DocsEditable
 @DomName('PerformanceEntryList')
-class PerformanceEntryList native "*PerformanceEntryList" {
+class PerformanceEntryList native "PerformanceEntryList" {
 
   @DomName('PerformanceEntryList.length')
   @DocsEditable
@@ -18618,7 +17290,7 @@
 
 @DocsEditable
 @DomName('PerformanceMark')
-class PerformanceMark extends PerformanceEntry native "*PerformanceMark" {
+class PerformanceMark extends PerformanceEntry native "PerformanceMark" {
 }
 // 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
@@ -18627,7 +17299,7 @@
 
 @DocsEditable
 @DomName('PerformanceMeasure')
-class PerformanceMeasure extends PerformanceEntry native "*PerformanceMeasure" {
+class PerformanceMeasure extends PerformanceEntry native "PerformanceMeasure" {
 }
 // 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
@@ -18636,7 +17308,7 @@
 
 @DocsEditable
 @DomName('PerformanceNavigation')
-class PerformanceNavigation native "*PerformanceNavigation" {
+class PerformanceNavigation native "PerformanceNavigation" {
 
   static const int TYPE_BACK_FORWARD = 2;
 
@@ -18661,7 +17333,7 @@
 
 @DocsEditable
 @DomName('PerformanceResourceTiming')
-class PerformanceResourceTiming extends PerformanceEntry native "*PerformanceResourceTiming" {
+class PerformanceResourceTiming extends PerformanceEntry native "PerformanceResourceTiming" {
 
   @DomName('PerformanceResourceTiming.connectEnd')
   @DocsEditable
@@ -18718,7 +17390,7 @@
 
 @DocsEditable
 @DomName('PerformanceTiming')
-class PerformanceTiming native "*PerformanceTiming" {
+class PerformanceTiming native "PerformanceTiming" {
 
   @DomName('PerformanceTiming.connectEnd')
   @DocsEditable
@@ -18815,7 +17487,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class PopStateEvent extends Event native "*PopStateEvent" {
+class PopStateEvent extends Event native "PopStateEvent" {
 
   dynamic get state => convertNativeToDart_SerializedScriptValue(this._get_state);
   @JSName('state')
@@ -18840,7 +17512,7 @@
 
 @DocsEditable
 @DomName('PositionError')
-class PositionError native "*PositionError" {
+class PositionError native "PositionError" {
 
   static const int PERMISSION_DENIED = 1;
 
@@ -18871,7 +17543,7 @@
 
 @DocsEditable
 @DomName('HTMLPreElement')
-class PreElement extends Element native "*HTMLPreElement" {
+class PreElement extends Element native "HTMLPreElement" {
 
   @DomName('HTMLPreElement.HTMLPreElement')
   @DocsEditable
@@ -18888,7 +17560,7 @@
 
 @DocsEditable
 @DomName('ProcessingInstruction')
-class ProcessingInstruction extends Node native "*ProcessingInstruction" {
+class ProcessingInstruction extends Node native "ProcessingInstruction" {
 
   @DomName('ProcessingInstruction.data')
   @DocsEditable
@@ -18913,7 +17585,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class ProgressElement extends Element native "*HTMLProgressElement" {
+class ProgressElement extends Element native "HTMLProgressElement" {
 
   @DomName('HTMLProgressElement.HTMLProgressElement')
   @DocsEditable
@@ -18947,7 +17619,7 @@
 
 @DocsEditable
 @DomName('ProgressEvent')
-class ProgressEvent extends Event native "*ProgressEvent" {
+class ProgressEvent extends Event native "ProgressEvent" {
 
   @DomName('ProgressEvent.lengthComputable')
   @DocsEditable
@@ -18968,7 +17640,7 @@
 
 @DocsEditable
 @DomName('HTMLQuoteElement')
-class QuoteElement extends Element native "*HTMLQuoteElement" {
+class QuoteElement extends Element native "HTMLQuoteElement" {
 
   @DomName('HTMLQuoteElement.cite')
   @DocsEditable
@@ -19002,24 +17674,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.
 
-
-@DocsEditable
-@DomName('RadioNodeList')
-class RadioNodeList extends NodeList native "*RadioNodeList" {
-
-  @DomName('RadioNodeList.value')
-  @DocsEditable
-  String 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.
-
 // WARNING: Do not edit - generated code.
 
 
 @DomName('Range')
-class Range native "*Range" {
+class Range native "Range" {
   factory Range() => document.$dom_createRange();
 
 
@@ -19173,7 +17832,7 @@
 
 @DocsEditable
 @DomName('RangeException')
-class RangeException native "*RangeException" {
+class RangeException native "RangeException" {
 
   static const int BAD_BOUNDARYPOINTS_ERR = 1;
 
@@ -19210,7 +17869,7 @@
 
 @DocsEditable
 @DomName('RTCDataChannel')
-class RtcDataChannel extends EventTarget native "*RTCDataChannel" {
+class RtcDataChannel extends EventTarget native "RTCDataChannel" {
 
   @DomName('RTCDataChannel.closeEvent')
   @DocsEditable
@@ -19293,7 +17952,7 @@
 
 @DocsEditable
 @DomName('RTCDataChannelEvent')
-class RtcDataChannelEvent extends Event native "*RTCDataChannelEvent" {
+class RtcDataChannelEvent extends Event native "RTCDataChannelEvent" {
 
   @DomName('RTCDataChannelEvent.channel')
   @DocsEditable
@@ -19306,7 +17965,7 @@
 
 @DocsEditable
 @DomName('RTCDTMFSender')
-class RtcDtmfSender extends EventTarget native "*RTCDTMFSender" {
+class RtcDtmfSender extends EventTarget native "RTCDTMFSender" {
 
   @DomName('RTCDTMFSender.tonechangeEvent')
   @DocsEditable
@@ -19363,7 +18022,7 @@
 
 @DocsEditable
 @DomName('RTCDTMFToneChangeEvent')
-class RtcDtmfToneChangeEvent extends Event native "*RTCDTMFToneChangeEvent" {
+class RtcDtmfToneChangeEvent extends Event native "RTCDTMFToneChangeEvent" {
 
   @DomName('RTCDTMFToneChangeEvent.tone')
   @DocsEditable
@@ -19377,7 +18036,7 @@
 @DomName('RTCIceCandidate')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class RtcIceCandidate native "*RTCIceCandidate" {
+class RtcIceCandidate native "RTCIceCandidate" {
   factory RtcIceCandidate(Map dictionary) {
     return JS('RtcIceCandidate', 'new RTCIceCandidate(#)',
         convertDartToNative_SerializedScriptValue(dictionary));
@@ -19403,7 +18062,7 @@
 
 @DocsEditable
 @DomName('RTCIceCandidateEvent')
-class RtcIceCandidateEvent extends Event native "*RTCIceCandidateEvent" {
+class RtcIceCandidateEvent extends Event native "RTCIceCandidateEvent" {
 
   @DomName('RTCIceCandidateEvent.candidate')
   @DocsEditable
@@ -19417,7 +18076,7 @@
 @DomName('RTCPeerConnection')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class RtcPeerConnection extends EventTarget native "*RTCPeerConnection" {
+class RtcPeerConnection extends EventTarget native "RTCPeerConnection" {
   factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
     var constructorName = JS('RtcPeerConnection', 'window[#]',
         '${Device.propertyPrefix}RTCPeerConnection');
@@ -19736,7 +18395,7 @@
 @DomName('RTCSessionDescription')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-class RtcSessionDescription native "*RTCSessionDescription" {
+class RtcSessionDescription native "RTCSessionDescription" {
   factory RtcSessionDescription(Map dictionary) {
     return JS('RtcSessionDescription', 'new RTCSessionDescription(#)',
         convertDartToNative_SerializedScriptValue(dictionary));
@@ -19758,7 +18417,7 @@
 
 @DocsEditable
 @DomName('RTCStatsReport')
-class RtcStatsReport native "*RTCStatsReport" {
+class RtcStatsReport native "RTCStatsReport" {
 
   @DomName('RTCStatsReport.id')
   @DocsEditable
@@ -19797,7 +18456,7 @@
 
 @DocsEditable
 @DomName('RTCStatsResponse')
-class RtcStatsResponse native "*RTCStatsResponse" {
+class RtcStatsResponse native "RTCStatsResponse" {
 
   @DomName('RTCStatsResponse.namedItem')
   @DocsEditable
@@ -19814,7 +18473,7 @@
 
 @DocsEditable
 @DomName('Screen')
-class Screen native "*Screen" {
+class Screen native "Screen" {
 
   @DomName('Screen.availHeight')
   @DomName('Screen.availLeft')
@@ -19866,7 +18525,7 @@
 
 @DocsEditable
 @DomName('HTMLScriptElement')
-class ScriptElement extends Element native "*HTMLScriptElement" {
+class ScriptElement extends Element native "HTMLScriptElement" {
 
   @DomName('HTMLScriptElement.HTMLScriptElement')
   @DocsEditable
@@ -19915,7 +18574,7 @@
 
 @DocsEditable
 @DomName('ScriptProfile')
-class ScriptProfile native "*ScriptProfile" {
+class ScriptProfile native "ScriptProfile" {
 
   @DomName('ScriptProfile.head')
   @DocsEditable
@@ -19940,7 +18599,7 @@
 
 @DocsEditable
 @DomName('ScriptProfileNode')
-class ScriptProfileNode native "*ScriptProfileNode" {
+class ScriptProfileNode native "ScriptProfileNode" {
 
   @JSName('callUID')
   @DomName('ScriptProfileNode.callUID')
@@ -19986,7 +18645,7 @@
 
 @DocsEditable
 @DomName('SecurityPolicyViolationEvent')
-class SecurityPolicyViolationEvent extends Event native "*SecurityPolicyViolationEvent" {
+class SecurityPolicyViolationEvent extends Event native "SecurityPolicyViolationEvent" {
 
   @JSName('blockedURI')
   @DomName('SecurityPolicyViolationEvent.blockedURI')
@@ -20028,7 +18687,7 @@
 
 
 @DomName('HTMLSelectElement')
-class SelectElement extends Element native "*HTMLSelectElement" {
+class SelectElement extends Element native "HTMLSelectElement" {
 
   @DomName('HTMLSelectElement.HTMLSelectElement')
   @DocsEditable
@@ -20139,7 +18798,7 @@
 @DomName('HTMLShadowElement')
 @SupportedBrowser(SupportedBrowser.CHROME, '26')
 @Experimental
-class ShadowElement extends Element native "*HTMLShadowElement" {
+class ShadowElement extends Element native "HTMLShadowElement" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => Element.isTagSupported('shadow');
@@ -20162,7 +18821,7 @@
 @DomName('ShadowRoot')
 @SupportedBrowser(SupportedBrowser.CHROME, '26')
 @Experimental
-class ShadowRoot extends DocumentFragment native "*ShadowRoot" {
+class ShadowRoot extends DocumentFragment native "ShadowRoot" {
 
   @DomName('ShadowRoot.activeElement')
   @DocsEditable
@@ -20220,7 +18879,7 @@
 
 @DocsEditable
 @DomName('SourceBuffer')
-class SourceBuffer native "*SourceBuffer" {
+class SourceBuffer native "SourceBuffer" {
 
   @DomName('SourceBuffer.buffered')
   @DocsEditable
@@ -20236,7 +18895,7 @@
 
   @DomName('SourceBuffer.append')
   @DocsEditable
-  void append(Uint8Array data) native;
+  void append(Uint8List data) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -20245,7 +18904,7 @@
 
 @DocsEditable
 @DomName('SourceBufferList')
-class SourceBufferList extends EventTarget implements JavaScriptIndexingBehavior, List<SourceBuffer> native "*SourceBufferList" {
+class SourceBufferList extends EventTarget implements JavaScriptIndexingBehavior, List<SourceBuffer> native "SourceBufferList" {
 
   @DomName('SourceBufferList.length')
   @DocsEditable
@@ -20403,7 +19062,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -20415,7 +19074,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<SourceBuffer> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<SourceBuffer> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -20476,7 +19135,7 @@
 
 @DocsEditable
 @DomName('HTMLSourceElement')
-class SourceElement extends Element native "*HTMLSourceElement" {
+class SourceElement extends Element native "HTMLSourceElement" {
 
   @DomName('HTMLSourceElement.HTMLSourceElement')
   @DocsEditable
@@ -20501,7 +19160,7 @@
 
 @DocsEditable
 @DomName('HTMLSpanElement')
-class SpanElement extends Element native "*HTMLSpanElement" {
+class SpanElement extends Element native "HTMLSpanElement" {
 
   @DomName('HTMLSpanElement.HTMLSpanElement')
   @DocsEditable
@@ -20514,7 +19173,7 @@
 
 @DocsEditable
 @DomName('SpeechGrammar')
-class SpeechGrammar native "*SpeechGrammar" {
+class SpeechGrammar native "SpeechGrammar" {
 
   @DomName('SpeechGrammar.SpeechGrammar')
   @DocsEditable
@@ -20538,7 +19197,7 @@
 
 @DocsEditable
 @DomName('SpeechGrammarList')
-class SpeechGrammarList implements JavaScriptIndexingBehavior, List<SpeechGrammar> native "*SpeechGrammarList" {
+class SpeechGrammarList implements JavaScriptIndexingBehavior, List<SpeechGrammar> native "SpeechGrammarList" {
 
   @DomName('SpeechGrammarList.SpeechGrammarList')
   @DocsEditable
@@ -20703,7 +19362,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -20715,7 +19374,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<SpeechGrammar> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<SpeechGrammar> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -20770,7 +19429,7 @@
 
 @DocsEditable
 @DomName('SpeechInputEvent')
-class SpeechInputEvent extends Event native "*SpeechInputEvent" {
+class SpeechInputEvent extends Event native "SpeechInputEvent" {
 
   @DomName('SpeechInputEvent.results')
   @DocsEditable
@@ -20785,7 +19444,7 @@
 
 @DocsEditable
 @DomName('SpeechInputResult')
-class SpeechInputResult native "*SpeechInputResult" {
+class SpeechInputResult native "SpeechInputResult" {
 
   @DomName('SpeechInputResult.confidence')
   @DocsEditable
@@ -20803,7 +19462,7 @@
 @DomName('SpeechRecognition')
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental
-class SpeechRecognition extends EventTarget native "*SpeechRecognition" {
+class SpeechRecognition extends EventTarget native "SpeechRecognition" {
 
   @DomName('SpeechRecognition.audioendEvent')
   @DocsEditable
@@ -20956,7 +19615,7 @@
 @DomName('SpeechRecognitionAlternative')
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental
-class SpeechRecognitionAlternative native "*SpeechRecognitionAlternative" {
+class SpeechRecognitionAlternative native "SpeechRecognitionAlternative" {
 
   @DomName('SpeechRecognitionAlternative.confidence')
   @DocsEditable
@@ -20975,7 +19634,7 @@
 @DomName('SpeechRecognitionError')
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental
-class SpeechRecognitionError extends Event native "*SpeechRecognitionError" {
+class SpeechRecognitionError extends Event native "SpeechRecognitionError" {
 
   @DomName('SpeechRecognitionError.error')
   @DocsEditable
@@ -20994,7 +19653,7 @@
 @DomName('SpeechRecognitionEvent')
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental
-class SpeechRecognitionEvent extends Event native "*SpeechRecognitionEvent" {
+class SpeechRecognitionEvent extends Event native "SpeechRecognitionEvent" {
 
   @DomName('SpeechRecognitionEvent.emma')
   @DocsEditable
@@ -21023,7 +19682,7 @@
 @DomName('SpeechRecognitionResult')
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental
-class SpeechRecognitionResult native "*SpeechRecognitionResult" {
+class SpeechRecognitionResult native "SpeechRecognitionResult" {
 
   @DomName('SpeechRecognitionResult.isFinal')
   @DocsEditable
@@ -21069,7 +19728,7 @@
  */
 @DomName('Storage')
 class Storage implements Map<String, String>
-     native "*Storage" {
+     native "Storage" {
 
   // TODO(nweiz): update this when maps support lazy iteration
   bool containsValue(String value) => values.any((e) => e == value);
@@ -21165,7 +19824,7 @@
 
 
 @DomName('StorageEvent')
-class StorageEvent extends Event native "*StorageEvent" {
+class StorageEvent extends Event native "StorageEvent" {
   factory StorageEvent(String type,
     {bool canBubble: false, bool cancelable: false, String key, String oldValue,
     String newValue, String url, Storage storageArea}) {
@@ -21208,7 +19867,7 @@
 
 
 @DomName('StorageInfo')
-class StorageInfo native "*StorageInfo" {
+class StorageInfo native "StorageInfo" {
 
   static const int PERSISTENT = 1;
 
@@ -21263,7 +19922,7 @@
 
 @DocsEditable
 @DomName('StorageQuota')
-class StorageQuota native "*StorageQuota" {
+class StorageQuota native "StorageQuota" {
 
   @DomName('StorageQuota.queryUsageAndQuota')
   @DocsEditable
@@ -21304,7 +19963,7 @@
 
 @DocsEditable
 @DomName('HTMLStyleElement')
-class StyleElement extends Element native "*HTMLStyleElement" {
+class StyleElement extends Element native "HTMLStyleElement" {
 
   @DomName('HTMLStyleElement.HTMLStyleElement')
   @DocsEditable
@@ -21337,7 +19996,7 @@
 
 @DocsEditable
 @DomName('StyleMedia')
-class StyleMedia native "*StyleMedia" {
+class StyleMedia native "StyleMedia" {
 
   @DomName('StyleMedia.type')
   @DocsEditable
@@ -21354,7 +20013,7 @@
 
 @DocsEditable
 @DomName('StyleSheet')
-class StyleSheet native "*StyleSheet" {
+class StyleSheet native "StyleSheet" {
 
   @DomName('StyleSheet.disabled')
   @DocsEditable
@@ -21391,7 +20050,7 @@
 
 @DocsEditable
 @DomName('HTMLTableCaptionElement')
-class TableCaptionElement extends Element native "*HTMLTableCaptionElement" {
+class TableCaptionElement extends Element native "HTMLTableCaptionElement" {
 
   @DomName('HTMLTableCaptionElement.HTMLTableCaptionElement')
   @DocsEditable
@@ -21404,7 +20063,7 @@
 
 @DocsEditable
 @DomName('HTMLTableCellElement')
-class TableCellElement extends Element native "*HTMLTableCellElement" {
+class TableCellElement extends Element native "HTMLTableCellElement" {
 
   @DomName('HTMLTableCellElement.HTMLTableCellElement')
   @DocsEditable
@@ -21433,7 +20092,7 @@
 
 @DocsEditable
 @DomName('HTMLTableColElement')
-class TableColElement extends Element native "*HTMLTableColElement" {
+class TableColElement extends Element native "HTMLTableColElement" {
 
   @DomName('HTMLTableColElement.HTMLTableColElement')
   @DocsEditable
@@ -21450,7 +20109,7 @@
 
 @DocsEditable
 @DomName('HTMLTableElement')
-class TableElement extends Element native "*HTMLTableElement" {
+class TableElement extends Element native "HTMLTableElement" {
 
   @DomName('HTMLTableElement.tBodies')
   List<TableSectionElement> get tBodies =>
@@ -21556,7 +20215,7 @@
 
 @DocsEditable
 @DomName('HTMLTableRowElement')
-class TableRowElement extends Element native "*HTMLTableRowElement" {
+class TableRowElement extends Element native "HTMLTableRowElement" {
 
   @DomName('HTMLTableRowElement.cells')
   List<TableCellElement> get cells =>
@@ -21602,7 +20261,7 @@
 
 @DocsEditable
 @DomName('HTMLTableSectionElement')
-class TableSectionElement extends Element native "*HTMLTableSectionElement" {
+class TableSectionElement extends Element native "HTMLTableSectionElement" {
 
   @DomName('HTMLTableSectionElement.rows')
   List<TableRowElement> get rows =>
@@ -21636,7 +20295,7 @@
 
 @DocsEditable
 @DomName('HTMLTemplateElement')
-class TemplateElement extends Element native "*HTMLTemplateElement" {
+class TemplateElement extends Element native "HTMLTemplateElement" {
 
   @DomName('HTMLTemplateElement.content')
   @DocsEditable
@@ -21650,7 +20309,7 @@
 
 
 @DomName('Text')
-class Text extends CharacterData native "*Text" {
+class Text extends CharacterData native "Text" {
   factory Text(String data) => _TextFactoryProvider.createText(data);
 
   @JSName('webkitInsertionParent')
@@ -21681,7 +20340,7 @@
 
 @DocsEditable
 @DomName('HTMLTextAreaElement')
-class TextAreaElement extends Element native "*HTMLTextAreaElement" {
+class TextAreaElement extends Element native "HTMLTextAreaElement" {
 
   @DomName('HTMLTextAreaElement.HTMLTextAreaElement')
   @DocsEditable
@@ -21809,7 +20468,7 @@
 
 
 @DomName('TextEvent')
-class TextEvent extends UIEvent native "*TextEvent" {
+class TextEvent extends UIEvent native "TextEvent" {
   factory TextEvent(String type,
     {bool canBubble: false, bool cancelable: false, Window view, String data}) {
     if (view == null) {
@@ -21837,7 +20496,7 @@
 
 @DocsEditable
 @DomName('TextMetrics')
-class TextMetrics native "*TextMetrics" {
+class TextMetrics native "TextMetrics" {
 
   @DomName('TextMetrics.width')
   @DocsEditable
@@ -21850,7 +20509,7 @@
 
 @DocsEditable
 @DomName('TextTrack')
-class TextTrack extends EventTarget native "*TextTrack" {
+class TextTrack extends EventTarget native "TextTrack" {
 
   @DomName('TextTrack.cuechangeEvent')
   @DocsEditable
@@ -21913,7 +20572,7 @@
 
 @DocsEditable
 @DomName('TextTrackCue')
-class TextTrackCue extends EventTarget native "*TextTrackCue" {
+class TextTrackCue extends EventTarget native "TextTrackCue" {
 
   @DomName('TextTrackCue.enterEvent')
   @DocsEditable
@@ -22012,7 +20671,7 @@
 
 @DocsEditable
 @DomName('TextTrackCueList')
-class TextTrackCueList implements List<TextTrackCue>, JavaScriptIndexingBehavior native "*TextTrackCueList" {
+class TextTrackCueList implements List<TextTrackCue>, JavaScriptIndexingBehavior native "TextTrackCueList" {
 
   @DomName('TextTrackCueList.length')
   @DocsEditable
@@ -22170,7 +20829,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -22182,7 +20841,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<TextTrackCue> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<TextTrackCue> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -22233,7 +20892,7 @@
 
 @DocsEditable
 @DomName('TextTrackList')
-class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, List<TextTrack> native "*TextTrackList" {
+class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, List<TextTrack> native "TextTrackList" {
 
   @DomName('TextTrackList.addtrackEvent')
   @DocsEditable
@@ -22395,7 +21054,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -22407,7 +21066,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<TextTrack> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<TextTrack> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -22472,7 +21131,7 @@
 
 @DocsEditable
 @DomName('TimeRanges')
-class TimeRanges native "*TimeRanges" {
+class TimeRanges native "TimeRanges" {
 
   @DomName('TimeRanges.length')
   @DocsEditable
@@ -22501,7 +21160,7 @@
 
 @DocsEditable
 @DomName('HTMLTitleElement')
-class TitleElement extends Element native "*HTMLTitleElement" {
+class TitleElement extends Element native "HTMLTitleElement" {
 
   @DomName('HTMLTitleElement.HTMLTitleElement')
   @DocsEditable
@@ -22514,7 +21173,7 @@
 
 @DocsEditable
 @DomName('Touch')
-class Touch native "*Touch" {
+class Touch native "Touch" {
 
   @JSName('clientX')
   @DomName('Touch.clientX')
@@ -22611,7 +21270,7 @@
 
 
 @DomName('TouchEvent')
-class TouchEvent extends UIEvent native "*TouchEvent" {
+class TouchEvent extends UIEvent native "TouchEvent" {
   factory TouchEvent(TouchList touches, TouchList targetTouches,
       TouchList changedTouches, String type,
       {Window view, int screenX: 0, int screenY: 0, int clientX: 0,
@@ -22681,7 +21340,7 @@
 
 
 @DomName('TouchList')
-class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*TouchList" {
+class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "TouchList" {
   /// 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.
@@ -22846,7 +21505,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -22858,7 +21517,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Touch> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Touch> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -22909,7 +21568,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class TrackElement extends Element native "*HTMLTrackElement" {
+class TrackElement extends Element native "HTMLTrackElement" {
 
   @DomName('HTMLTrackElement.HTMLTrackElement')
   @DocsEditable
@@ -22962,7 +21621,7 @@
 
 @DocsEditable
 @DomName('TrackEvent')
-class TrackEvent extends Event native "*TrackEvent" {
+class TrackEvent extends Event native "TrackEvent" {
 
   @DomName('TrackEvent.track')
   @DocsEditable
@@ -22975,7 +21634,7 @@
 
 @DocsEditable
 @DomName('TransitionEvent')
-class TransitionEvent extends Event native "*TransitionEvent" {
+class TransitionEvent extends Event native "TransitionEvent,WebKitTransitionEvent" {
 
   @DomName('TransitionEvent.elapsedTime')
   @DocsEditable
@@ -22996,7 +21655,7 @@
 
 @DocsEditable
 @DomName('TreeWalker')
-class TreeWalker native "*TreeWalker" {
+class TreeWalker native "TreeWalker" {
 
   @DomName('TreeWalker.currentNode')
   @DocsEditable
@@ -23054,7 +21713,7 @@
 
 
 @DomName('UIEvent')
-class UIEvent extends Event native "*UIEvent" {
+class UIEvent extends Event native "UIEvent" {
   // 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)).
@@ -23149,7 +21808,7 @@
 
 @DocsEditable
 @DomName('HTMLUListElement')
-class UListElement extends Element native "*HTMLUListElement" {
+class UListElement extends Element native "HTMLUListElement" {
 
   @DomName('HTMLUListElement.HTMLUListElement')
   @DocsEditable
@@ -23161,957 +21820,8 @@
 
 
 @DocsEditable
-@DomName('Uint16Array')
-class Uint16Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Uint16Array" {
-
-  @DomName('Uint16Array.Uint16Array')
-  @DocsEditable
-  factory Uint16Array(int length) =>
-    _TypedArrayFactoryProvider.createUint16Array(length);
-
-  @DomName('Uint16Array.fromList')
-  @DocsEditable
-  factory Uint16Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createUint16Array_fromList(list);
-
-  @DomName('Uint16Array.fromBuffer')
-  @DocsEditable
-  factory Uint16Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createUint16Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 2;
-
-  @DomName('Uint16Array.length')
-  @DocsEditable
-  int get length => JS("int", "#.length", this);
-
-  int operator[](int index) => JS("int", "#[#]", this, index);
-
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @JSName('set')
-  @DomName('Uint16Array.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Uint16Array.subarray')
-  @DocsEditable
-  @Returns('Uint16Array')
-  @Creates('Uint16Array')
-  List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Uint32Array')
-class Uint32Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Uint32Array" {
-
-  @DomName('Uint32Array.Uint32Array')
-  @DocsEditable
-  factory Uint32Array(int length) =>
-    _TypedArrayFactoryProvider.createUint32Array(length);
-
-  @DomName('Uint32Array.fromList')
-  @DocsEditable
-  factory Uint32Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createUint32Array_fromList(list);
-
-  @DomName('Uint32Array.fromBuffer')
-  @DocsEditable
-  factory Uint32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createUint32Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 4;
-
-  @DomName('Uint32Array.length')
-  @DocsEditable
-  int get length => JS("int", "#.length", this);
-
-  int operator[](int index) => JS("int", "#[#]", this, index);
-
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @JSName('set')
-  @DomName('Uint32Array.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Uint32Array.subarray')
-  @DocsEditable
-  @Returns('Uint32Array')
-  @Creates('Uint32Array')
-  List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Uint8Array')
-class Uint8Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Uint8Array" {
-
-  @DomName('Uint8Array.Uint8Array')
-  @DocsEditable
-  factory Uint8Array(int length) =>
-    _TypedArrayFactoryProvider.createUint8Array(length);
-
-  @DomName('Uint8Array.fromList')
-  @DocsEditable
-  factory Uint8Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createUint8Array_fromList(list);
-
-  @DomName('Uint8Array.fromBuffer')
-  @DocsEditable
-  factory Uint8Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createUint8Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 1;
-
-  @DomName('Uint8Array.length')
-  @DocsEditable
-  int get length => JS("int", "#.length", this);
-
-  int operator[](int index) => JS("int", "#[#]", this, index);
-
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @JSName('set')
-  @DomName('Uint8Array.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Uint8Array.subarray')
-  @DocsEditable
-  @Returns('Uint8Array')
-  @Creates('Uint8Array')
-  List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Uint8ClampedArray')
-class Uint8ClampedArray extends Uint8Array implements JavaScriptIndexingBehavior, List<int> native "*Uint8ClampedArray" {
-
-  @DomName('Uint8ClampedArray.Uint8ClampedArray')
-  @DocsEditable
-  factory Uint8ClampedArray(int length) =>
-    _TypedArrayFactoryProvider.createUint8ClampedArray(length);
-
-  @DomName('Uint8ClampedArray.fromList')
-  @DocsEditable
-  factory Uint8ClampedArray.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createUint8ClampedArray_fromList(list);
-
-  @DomName('Uint8ClampedArray.fromBuffer')
-  @DocsEditable
-  factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createUint8ClampedArray_fromBuffer(buffer, byteOffset, length);
-
-  // Use implementation from Uint8Array.
-  // final int length;
-
-  int operator[](int index) => JS("int", "#[#]", this, index);
-
-  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @JSName('set')
-  @DomName('Uint8ClampedArray.set')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native;
-
-  @DomName('Uint8ClampedArray.subarray')
-  @DocsEditable
-  @Returns('Uint8ClampedArray')
-  @Creates('Uint8ClampedArray')
-  List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
 @DomName('HTMLUnknownElement')
-class UnknownElement extends Element native "*HTMLUnknownElement" {
+class UnknownElement extends Element native "HTMLUnknownElement" {
 }
 // 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
@@ -24119,7 +21829,7 @@
 
 
 @DomName('URL')
-class Url native "*URL" {
+class Url native "URL" {
 
   static String createObjectUrl(blob_OR_source_OR_stream) =>
       JS('String',
@@ -24138,7 +21848,7 @@
 
 @DocsEditable
 @DomName('ValidityState')
-class ValidityState native "*ValidityState" {
+class ValidityState native "ValidityState" {
 
   @DomName('ValidityState.badInput')
   @DocsEditable
@@ -24186,7 +21896,7 @@
 
 
 @DomName('HTMLVideoElement')
-class VideoElement extends MediaElement implements CanvasImageSource native "*HTMLVideoElement" {
+class VideoElement extends MediaElement implements CanvasImageSource native "HTMLVideoElement" {
 
   @DomName('HTMLVideoElement.HTMLVideoElement')
   @DocsEditable
@@ -24292,7 +22002,7 @@
 
 @DocsEditable
 @DomName('WebKitCSSFilterRule')
-class WebKitCssFilterRule extends CssRule native "*WebKitCSSFilterRule" {
+class WebKitCssFilterRule extends CssRule native "WebKitCSSFilterRule" {
 
   @DomName('WebKitCSSFilterRule.style')
   @DocsEditable
@@ -24305,7 +22015,7 @@
 
 @DocsEditable
 @DomName('WebKitCSSRegionRule')
-class WebKitCssRegionRule extends CssRule native "*WebKitCSSRegionRule" {
+class WebKitCssRegionRule extends CssRule native "WebKitCSSRegionRule" {
 
   @DomName('WebKitCSSRegionRule.cssRules')
   @DocsEditable
@@ -24358,7 +22068,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class WebSocket extends EventTarget native "*WebSocket" {
+class WebSocket extends EventTarget native "WebSocket" {
 
   @DomName('WebSocket.closeEvent')
   @DocsEditable
@@ -24478,7 +22188,7 @@
 
 
 @DomName('WheelEvent')
-class WheelEvent extends MouseEvent native "*WheelEvent" {
+class WheelEvent extends MouseEvent native "WheelEvent,MouseWheelEvent,MouseScrollEvent" {
 
   factory WheelEvent(String type,
       {Window view, int deltaX: 0, int deltaY: 0,
@@ -24710,7 +22420,7 @@
 
 
 @DomName('Window')
-class Window extends EventTarget implements WindowBase native "@*DOMWindow" {
+class Window extends EventTarget implements WindowBase native "Window,DOMWindow" {
 
   /**
    * Executes a [callback] after the immediate execution stack has completed.
@@ -24901,7 +22611,7 @@
   @SupportedBrowser(SupportedBrowser.IE, '10.0')
   @Experimental
   IdbFactory get indexedDB =>
-      JS('IdbFactory',
+      JS('IdbFactory|Null',  // If not supported, returns `null`.
          '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
          this, this, this);
 
@@ -25738,7 +23448,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class Worker extends AbstractWorker native "*Worker" {
+class Worker extends AbstractWorker native "Worker" {
 
   @DomName('Worker.messageEvent')
   @DocsEditable
@@ -25773,7 +23483,7 @@
 
 @DocsEditable
 @DomName('XPathEvaluator')
-class XPathEvaluator native "*XPathEvaluator" {
+class XPathEvaluator native "XPathEvaluator" {
 
   @DomName('XPathEvaluator.XPathEvaluator')
   @DocsEditable
@@ -25801,7 +23511,7 @@
 
 @DocsEditable
 @DomName('XPathException')
-class XPathException native "*XPathException" {
+class XPathException native "XPathException" {
 
   static const int INVALID_EXPRESSION_ERR = 51;
 
@@ -25830,7 +23540,7 @@
 
 @DocsEditable
 @DomName('XPathExpression')
-class XPathExpression native "*XPathExpression" {
+class XPathExpression native "XPathExpression" {
 
   @DomName('XPathExpression.evaluate')
   @DocsEditable
@@ -25843,7 +23553,7 @@
 
 @DocsEditable
 @DomName('XPathNSResolver')
-class XPathNSResolver native "*XPathNSResolver" {
+class XPathNSResolver native "XPathNSResolver" {
 
   @JSName('lookupNamespaceURI')
   @DomName('XPathNSResolver.lookupNamespaceURI')
@@ -25857,7 +23567,7 @@
 
 @DocsEditable
 @DomName('XPathResult')
-class XPathResult native "*XPathResult" {
+class XPathResult native "XPathResult" {
 
   static const int ANY_TYPE = 0;
 
@@ -25922,7 +23632,7 @@
 
 @DocsEditable
 @DomName('XMLSerializer')
-class XmlSerializer native "*XMLSerializer" {
+class XmlSerializer native "XMLSerializer" {
 
   @DomName('XMLSerializer.XMLSerializer')
   @DocsEditable
@@ -25945,7 +23655,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class XsltProcessor native "*XSLTProcessor" {
+class XsltProcessor native "XSLTProcessor" {
 
   @DomName('XSLTProcessor.XSLTProcessor')
   @DocsEditable
@@ -25996,7 +23706,7 @@
 
 @DocsEditable
 @DomName('CSSPrimitiveValue')
-abstract class _CSSPrimitiveValue extends _CSSValue native "*CSSPrimitiveValue" {
+abstract class _CSSPrimitiveValue extends _CSSValue native "CSSPrimitiveValue" {
 }
 // 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
@@ -26005,7 +23715,7 @@
 
 @DocsEditable
 @DomName('CSSValue')
-abstract class _CSSValue native "*CSSValue" {
+abstract class _CSSValue native "CSSValue" {
 }
 // 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
@@ -26014,7 +23724,7 @@
 
 @DocsEditable
 @DomName('ClientRect')
-class _ClientRect implements Rect native "*ClientRect" {
+class _ClientRect implements Rect native "ClientRect" {
 
   // NOTE! All code below should be common with Rect.
   // TODO(blois): implement with mixins when available.
@@ -26139,7 +23849,7 @@
 
 @DocsEditable
 @DomName('ClientRectList')
-class _ClientRectList implements JavaScriptIndexingBehavior, List<Rect> native "*ClientRectList" {
+class _ClientRectList implements JavaScriptIndexingBehavior, List<Rect> native "ClientRectList" {
 
   @DomName('ClientRectList.length')
   @DocsEditable
@@ -26297,7 +24007,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -26309,7 +24019,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Rect> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Rect> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -26356,7 +24066,7 @@
 
 @DocsEditable
 @DomName('Counter')
-abstract class _Counter native "*Counter" {
+abstract class _Counter native "Counter" {
 }
 // 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
@@ -26365,7 +24075,7 @@
 
 @DocsEditable
 @DomName('CSSRuleList')
-class _CssRuleList implements JavaScriptIndexingBehavior, List<CssRule> native "*CSSRuleList" {
+class _CssRuleList implements JavaScriptIndexingBehavior, List<CssRule> native "CSSRuleList" {
 
   @DomName('CSSRuleList.length')
   @DocsEditable
@@ -26523,7 +24233,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -26535,7 +24245,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<CssRule> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<CssRule> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -26582,7 +24292,7 @@
 
 @DocsEditable
 @DomName('CSSValueList')
-class _CssValueList extends _CSSValue implements JavaScriptIndexingBehavior, List<_CSSValue> native "*CSSValueList" {
+class _CssValueList extends _CSSValue implements JavaScriptIndexingBehavior, List<_CSSValue> native "CSSValueList" {
 
   @DomName('CSSValueList.length')
   @DocsEditable
@@ -26740,7 +24450,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -26752,7 +24462,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<_CSSValue> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<_CSSValue> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -26801,7 +24511,7 @@
 @DomName('DOMFileSystemSync')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental
-abstract class _DOMFileSystemSync native "*DOMFileSystemSync" {
+abstract class _DOMFileSystemSync native "DOMFileSystemSync" {
 }
 // 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
@@ -26813,7 +24523,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-abstract class _DatabaseSync native "*DatabaseSync" {
+abstract class _DatabaseSync native "DatabaseSync" {
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -26822,7 +24532,7 @@
 
 @DocsEditable
 @DomName('DedicatedWorkerContext')
-abstract class _DedicatedWorkerContext extends _WorkerContext native "*DedicatedWorkerContext" {
+abstract class _DedicatedWorkerContext extends _WorkerContext native "DedicatedWorkerContext" {
 }
 // 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
@@ -26831,7 +24541,7 @@
 
 @DocsEditable
 @DomName('DirectoryEntrySync')
-abstract class _DirectoryEntrySync extends _EntrySync native "*DirectoryEntrySync" {
+abstract class _DirectoryEntrySync extends _EntrySync native "DirectoryEntrySync" {
 }
 // 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
@@ -26840,7 +24550,7 @@
 
 @DocsEditable
 @DomName('DirectoryReaderSync')
-abstract class _DirectoryReaderSync native "*DirectoryReaderSync" {
+abstract class _DirectoryReaderSync native "DirectoryReaderSync" {
 }
 // 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
@@ -26852,7 +24562,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class _DomPoint native "*WebKitPoint" {
+class _DomPoint native "WebKitPoint" {
 
   @DomName('DOMPoint.DOMPoint')
   @DocsEditable
@@ -26879,7 +24589,7 @@
 
 @DocsEditable
 @DomName('EntryArray')
-class _EntryArray implements JavaScriptIndexingBehavior, List<Entry> native "*EntryArray" {
+class _EntryArray implements JavaScriptIndexingBehavior, List<Entry> native "EntryArray" {
 
   @DomName('EntryArray.length')
   @DocsEditable
@@ -27037,7 +24747,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -27049,7 +24759,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Entry> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Entry> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -27096,7 +24806,7 @@
 
 @DocsEditable
 @DomName('EntryArraySync')
-class _EntryArraySync implements JavaScriptIndexingBehavior, List<_EntrySync> native "*EntryArraySync" {
+class _EntryArraySync implements JavaScriptIndexingBehavior, List<_EntrySync> native "EntryArraySync" {
 
   @DomName('EntryArraySync.length')
   @DocsEditable
@@ -27254,7 +24964,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -27266,7 +24976,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<_EntrySync> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<_EntrySync> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -27313,7 +25023,7 @@
 
 @DocsEditable
 @DomName('EntrySync')
-abstract class _EntrySync native "*EntrySync" {
+abstract class _EntrySync native "EntrySync" {
 }
 // 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
@@ -27322,7 +25032,7 @@
 
 @DocsEditable
 @DomName('FileEntrySync')
-abstract class _FileEntrySync extends _EntrySync native "*FileEntrySync" {
+abstract class _FileEntrySync extends _EntrySync native "FileEntrySync" {
 }
 // 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
@@ -27331,7 +25041,7 @@
 
 @DocsEditable
 @DomName('FileReaderSync')
-abstract class _FileReaderSync native "*FileReaderSync" {
+abstract class _FileReaderSync native "FileReaderSync" {
 
   @DomName('FileReaderSync.FileReaderSync')
   @DocsEditable
@@ -27347,7 +25057,7 @@
 
 @DocsEditable
 @DomName('FileWriterSync')
-abstract class _FileWriterSync native "*FileWriterSync" {
+abstract class _FileWriterSync native "FileWriterSync" {
 }
 // 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
@@ -27356,7 +25066,7 @@
 
 @DocsEditable
 @DomName('GamepadList')
-class _GamepadList implements JavaScriptIndexingBehavior, List<Gamepad> native "*GamepadList" {
+class _GamepadList implements JavaScriptIndexingBehavior, List<Gamepad> native "GamepadList" {
 
   @DomName('GamepadList.length')
   @DocsEditable
@@ -27514,7 +25224,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -27526,7 +25236,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Gamepad> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Gamepad> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -27573,7 +25283,7 @@
 
 @DocsEditable
 @DomName('HTMLAppletElement')
-abstract class _HTMLAppletElement extends Element native "*HTMLAppletElement" {
+abstract class _HTMLAppletElement extends Element native "HTMLAppletElement" {
 }
 // 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
@@ -27582,7 +25292,7 @@
 
 @DocsEditable
 @DomName('HTMLBaseFontElement')
-abstract class _HTMLBaseFontElement extends Element native "*HTMLBaseFontElement" {
+abstract class _HTMLBaseFontElement extends Element native "HTMLBaseFontElement" {
 }
 // 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
@@ -27591,7 +25301,7 @@
 
 @DocsEditable
 @DomName('HTMLDirectoryElement')
-abstract class _HTMLDirectoryElement extends Element native "*HTMLDirectoryElement" {
+abstract class _HTMLDirectoryElement extends Element native "HTMLDirectoryElement" {
 }
 // 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
@@ -27600,7 +25310,7 @@
 
 @DocsEditable
 @DomName('HTMLFontElement')
-abstract class _HTMLFontElement extends Element native "*HTMLFontElement" {
+abstract class _HTMLFontElement extends Element native "HTMLFontElement" {
 }
 // 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
@@ -27609,7 +25319,7 @@
 
 @DocsEditable
 @DomName('HTMLFrameElement')
-abstract class _HTMLFrameElement extends Element native "*HTMLFrameElement" {
+abstract class _HTMLFrameElement extends Element native "HTMLFrameElement" {
 }
 // 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
@@ -27618,7 +25328,7 @@
 
 @DocsEditable
 @DomName('HTMLFrameSetElement')
-abstract class _HTMLFrameSetElement extends Element native "*HTMLFrameSetElement" {
+abstract class _HTMLFrameSetElement extends Element native "HTMLFrameSetElement" {
 }
 // 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
@@ -27627,7 +25337,7 @@
 
 @DocsEditable
 @DomName('HTMLMarqueeElement')
-abstract class _HTMLMarqueeElement extends Element native "*HTMLMarqueeElement" {
+abstract class _HTMLMarqueeElement extends Element native "HTMLMarqueeElement" {
 }
 // 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
@@ -27636,7 +25346,7 @@
 
 @DocsEditable
 @DomName('NamedNodeMap')
-class _NamedNodeMap implements JavaScriptIndexingBehavior, List<Node> native "*NamedNodeMap" {
+class _NamedNodeMap implements JavaScriptIndexingBehavior, List<Node> native "NamedNodeMap" {
 
   @DomName('NamedNodeMap.length')
   @DocsEditable
@@ -27794,7 +25504,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -27806,7 +25516,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -27877,8 +25587,17 @@
 
 @DocsEditable
 @DomName('RGBColor')
-abstract class _RGBColor native "*RGBColor" {
+abstract class _RGBColor native "RGBColor" {
 }
+// 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.
+
+
+// Omit RadioNodeList for dart2js.  The Dart Form and FieldSet APIs don't
+// currently expose an API the returns RadioNodeList.  The only use of a
+// RadioNodeList is to get the selected value and it will be cleaner to
+// introduce a different API for that purpose.
 // 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.
@@ -27886,7 +25605,7 @@
 
 @DocsEditable
 @DomName('Rect')
-abstract class _Rect native "*Rect" {
+abstract class _Rect native "Rect" {
 }
 // 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
@@ -27895,7 +25614,7 @@
 
 @DocsEditable
 @DomName('SharedWorker')
-abstract class _SharedWorker extends AbstractWorker native "*SharedWorker" {
+abstract class _SharedWorker extends AbstractWorker native "SharedWorker" {
 
   @DomName('SharedWorker.SharedWorker')
   @DocsEditable
@@ -27915,7 +25634,7 @@
 
 @DocsEditable
 @DomName('SharedWorkerContext')
-abstract class _SharedWorkerContext extends _WorkerContext native "*SharedWorkerContext" {
+abstract class _SharedWorkerContext extends _WorkerContext native "SharedWorkerContext" {
 }
 // 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
@@ -27924,7 +25643,7 @@
 
 @DocsEditable
 @DomName('SpeechInputResultList')
-class _SpeechInputResultList implements JavaScriptIndexingBehavior, List<SpeechInputResult> native "*SpeechInputResultList" {
+class _SpeechInputResultList implements JavaScriptIndexingBehavior, List<SpeechInputResult> native "SpeechInputResultList" {
 
   @DomName('SpeechInputResultList.length')
   @DocsEditable
@@ -28082,7 +25801,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -28094,7 +25813,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<SpeechInputResult> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<SpeechInputResult> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -28141,7 +25860,7 @@
 
 @DocsEditable
 @DomName('SpeechRecognitionResultList')
-class _SpeechRecognitionResultList implements JavaScriptIndexingBehavior, List<SpeechRecognitionResult> native "*SpeechRecognitionResultList" {
+class _SpeechRecognitionResultList implements JavaScriptIndexingBehavior, List<SpeechRecognitionResult> native "SpeechRecognitionResultList" {
 
   @DomName('SpeechRecognitionResultList.length')
   @DocsEditable
@@ -28299,7 +26018,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -28311,7 +26030,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<SpeechRecognitionResult> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<SpeechRecognitionResult> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -28358,7 +26077,7 @@
 
 @DocsEditable
 @DomName('StyleSheetList')
-class _StyleSheetList implements JavaScriptIndexingBehavior, List<StyleSheet> native "*StyleSheetList" {
+class _StyleSheetList implements JavaScriptIndexingBehavior, List<StyleSheet> native "StyleSheetList" {
 
   @DomName('StyleSheetList.length')
   @DocsEditable
@@ -28516,7 +26235,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -28528,7 +26247,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<StyleSheet> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<StyleSheet> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -28575,7 +26294,7 @@
 
 @DocsEditable
 @DomName('WebKitCSSFilterValue')
-abstract class _WebKitCSSFilterValue extends _CssValueList native "*WebKitCSSFilterValue" {
+abstract class _WebKitCSSFilterValue extends _CssValueList native "WebKitCSSFilterValue" {
 }
 // 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
@@ -28587,7 +26306,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-abstract class _WebKitCSSMatrix native "*WebKitCSSMatrix" {
+abstract class _WebKitCSSMatrix native "WebKitCSSMatrix" {
 
   @DomName('WebKitCSSMatrix.WebKitCSSMatrix')
   @DocsEditable
@@ -28607,7 +26326,7 @@
 
 @DocsEditable
 @DomName('WebKitCSSMixFunctionValue')
-abstract class _WebKitCSSMixFunctionValue extends _CssValueList native "*WebKitCSSMixFunctionValue" {
+abstract class _WebKitCSSMixFunctionValue extends _CssValueList native "WebKitCSSMixFunctionValue" {
 }
 // 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
@@ -28616,7 +26335,7 @@
 
 @DocsEditable
 @DomName('WebKitCSSTransformValue')
-abstract class _WebKitCSSTransformValue extends _CssValueList native "*WebKitCSSTransformValue" {
+abstract class _WebKitCSSTransformValue extends _CssValueList native "WebKitCSSTransformValue" {
 }
 // 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
@@ -28625,7 +26344,7 @@
 
 @DocsEditable
 @DomName('WorkerContext')
-abstract class _WorkerContext extends EventTarget native "*WorkerContext" {
+abstract class _WorkerContext extends EventTarget native "WorkerContext" {
 }
 // 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
@@ -28634,7 +26353,7 @@
 
 @DocsEditable
 @DomName('WorkerLocation')
-abstract class _WorkerLocation native "*WorkerLocation" {
+abstract class _WorkerLocation native "WorkerLocation" {
 }
 // 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
@@ -28643,7 +26362,7 @@
 
 @DocsEditable
 @DomName('WorkerNavigator')
-abstract class _WorkerNavigator native "*WorkerNavigator" {
+abstract class _WorkerNavigator native "WorkerNavigator" {
 }
 // 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
@@ -31799,7 +29518,7 @@
 // On Firefox, the returned ImageData is a plain object.
 
 class _TypedImageData implements ImageData {
-  final Uint8ClampedArray data;
+  final Uint8ClampedList data;
   final int height;
   final int width;
 
@@ -32141,156 +29860,6 @@
 class Platform {
   static final supportsTypedData = JS('bool', '!!(window.ArrayBuffer)');
 }
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-class _TypedArrayFactoryProvider {
-
-  static Float32Array createFloat32Array(int length) => _F32(length);
-  static Float32Array createFloat32Array_fromList(List<num> list) =>
-      _F32(ensureNative(list));
-  static Float32Array createFloat32Array_fromBuffer(ArrayBuffer buffer,
-                                  [int byteOffset = 0, int length]) {
-    if (length == null) return _F32_2(buffer, byteOffset);
-    return _F32_3(buffer, byteOffset, length);
-  }
-
-  static Float64Array createFloat64Array(int length) => _F64(length);
-  static Float64Array createFloat64Array_fromList(List<num> list) =>
-      _F64(ensureNative(list));
-  static Float64Array createFloat64Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) {
-    if (length == null) return _F64_2(buffer, byteOffset);
-    return _F64_3(buffer, byteOffset, length);
-  }
-
-  static Int8Array createInt8Array(int length) => _I8(length);
-  static Int8Array createInt8Array_fromList(List<num> list) =>
-      _I8(ensureNative(list));
-  static Int8Array createInt8Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) {
-    if (length == null) return _I8_2(buffer, byteOffset);
-    return _I8_3(buffer, byteOffset, length);
-  }
-
-  static Int16Array createInt16Array(int length) => _I16(length);
-  static Int16Array createInt16Array_fromList(List<num> list) =>
-      _I16(ensureNative(list));
-  static Int16Array createInt16Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) {
-    if (length == null) return _I16_2(buffer, byteOffset);
-    return _I16_3(buffer, byteOffset, length);
-  }
-
-  static Int32Array createInt32Array(int length) => _I32(length);
-  static Int32Array createInt32Array_fromList(List<num> list) =>
-      _I32(ensureNative(list));
-  static Int32Array createInt32Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) {
-    if (length == null) return _I32_2(buffer, byteOffset);
-    return _I32_3(buffer, byteOffset, length);
-  }
-
-  static Uint8Array createUint8Array(int length) => _U8(length);
-  static Uint8Array createUint8Array_fromList(List<num> list) =>
-      _U8(ensureNative(list));
-  static Uint8Array createUint8Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) {
-    if (length == null) return _U8_2(buffer, byteOffset);
-    return _U8_3(buffer, byteOffset, length);
-  }
-
-  static Uint16Array createUint16Array(int length) => _U16(length);
-  static Uint16Array createUint16Array_fromList(List<num> list) =>
-      _U16(ensureNative(list));
-  static Uint16Array createUint16Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) {
-    if (length == null) return _U16_2(buffer, byteOffset);
-    return _U16_3(buffer, byteOffset, length);
-  }
-
-  static Uint32Array createUint32Array(int length) => _U32(length);
-  static Uint32Array createUint32Array_fromList(List<num> list) =>
-      _U32(ensureNative(list));
-  static Uint32Array createUint32Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) {
-    if (length == null) return _U32_2(buffer, byteOffset);
-    return _U32_3(buffer, byteOffset, length);
-  }
-
-  static Uint8ClampedArray createUint8ClampedArray(int length) => _U8C(length);
-  static Uint8ClampedArray createUint8ClampedArray_fromList(List<num> list) =>
-      _U8C(ensureNative(list));
-  static Uint8ClampedArray createUint8ClampedArray_fromBuffer(
-        ArrayBuffer buffer, [int byteOffset = 0, int length]) {
-    if (length == null) return _U8C_2(buffer, byteOffset);
-    return _U8C_3(buffer, byteOffset, length);
-  }
-
-  static Float32Array _F32(arg) =>
-      JS('Float32Array', 'new Float32Array(#)', arg);
-  static Float64Array _F64(arg) =>
-      JS('Float64Array', 'new Float64Array(#)', arg);
-  static Int8Array _I8(arg) =>
-      JS('Int8Array', 'new Int8Array(#)', arg);
-  static Int16Array _I16(arg) =>
-      JS('Int16Array', 'new Int16Array(#)', arg);
-  static Int32Array _I32(arg) =>
-      JS('Int32Array', 'new Int32Array(#)', arg);
-  static Uint8Array _U8(arg) =>
-      JS('Uint8Array', 'new Uint8Array(#)', arg);
-  static Uint16Array _U16(arg) =>
-      JS('Uint16Array', 'new Uint16Array(#)', arg);
-  static Uint32Array _U32(arg) =>
-      JS('Uint32Array', 'new Uint32Array(#)', arg);
-  static Uint8ClampedArray _U8C(arg) =>
-      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#)', arg);
-
-  static Float32Array _F32_2(arg1, arg2) =>
-      JS('Float32Array', 'new Float32Array(#, #)', arg1, arg2);
-  static Float64Array _F64_2(arg1, arg2) =>
-      JS('Float64Array', 'new Float64Array(#, #)', arg1, arg2);
-  static Int8Array _I8_2(arg1, arg2) =>
-      JS('Int8Array', 'new Int8Array(#, #)', arg1, arg2);
-  static Int16Array _I16_2(arg1, arg2) =>
-      JS('Int16Array', 'new Int16Array(#, #)', arg1, arg2);
-  static Int32Array _I32_2(arg1, arg2) =>
-      JS('Int32Array', 'new Int32Array(#, #)', arg1, arg2);
-  static Uint8Array _U8_2(arg1, arg2) =>
-      JS('Uint8Array', 'new Uint8Array(#, #)', arg1, arg2);
-  static Uint16Array _U16_2(arg1, arg2) =>
-      JS('Uint16Array', 'new Uint16Array(#, #)', arg1, arg2);
-  static Uint32Array _U32_2(arg1, arg2) =>
-      JS('Uint32Array', 'new Uint32Array(#, #)', arg1, arg2);
-  static Uint8ClampedArray _U8C_2(arg1, arg2) =>
-      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #)', arg1, arg2);
-
-  static Float32Array _F32_3(arg1, arg2, arg3) =>
-      JS('Float32Array', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
-  static Float64Array _F64_3(arg1, arg2, arg3) =>
-      JS('Float64Array', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
-  static Int8Array _I8_3(arg1, arg2, arg3) =>
-      JS('Int8Array', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
-  static Int16Array _I16_3(arg1, arg2, arg3) =>
-      JS('Int16Array', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
-  static Int32Array _I32_3(arg1, arg2, arg3) =>
-      JS('Int32Array', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
-  static Uint8Array _U8_3(arg1, arg2, arg3) =>
-      JS('Uint8Array', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
-  static Uint16Array _U16_3(arg1, arg2, arg3) =>
-      JS('Uint16Array', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
-  static Uint32Array _U32_3(arg1, arg2, arg3) =>
-      JS('Uint32Array', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
-  static Uint8ClampedArray _U8C_3(arg1, arg2, arg3) =>
-      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3);
-
-
-  // Ensures that [list] is a JavaScript Array or a typed array.  If necessary,
-  // copies the list.
-  static ensureNative(List list) => list;  // TODO: make sure.
-}
 // 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.
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 2a139ff..78cd7cb 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -10,7 +10,7 @@
 import 'dart:json' as json;
 import 'dart:math';
 import 'dart:nativewrappers';
-import 'dart:typeddata' as _typeddata;
+import 'dart:typed_data';
 import 'dart:web_gl' as gl;
 import 'dart:web_sql';
 import 'dart:svg' as svg;
@@ -510,75 +510,6 @@
 
 
 @DocsEditable
-@DomName('ArrayBuffer')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class ArrayBuffer extends NativeFieldWrapperClass1 {
-  ArrayBuffer.internal();
-  factory ArrayBuffer(int length) => _create(length);
-
-  @DocsEditable
-  static ArrayBuffer _create(length) native "ArrayBuffer_constructorCallback";
-
-  @DomName('ArrayBuffer.byteLength')
-  @DocsEditable
-  int get byteLength native "ArrayBuffer_byteLength_Getter";
-
-  dynamic slice(int begin, [int end]) {
-    if (?end) {
-      return _slice_1(begin, end);
-    }
-    return _slice_2(begin);
-  }
-
-  @DomName('ArrayBuffer._slice_1')
-  @DocsEditable
-  dynamic _slice_1(begin, end) native "ArrayBuffer__slice_1_Callback";
-
-  @DomName('ArrayBuffer._slice_2')
-  @DocsEditable
-  dynamic _slice_2(begin) native "ArrayBuffer__slice_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('ArrayBufferView')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class ArrayBufferView extends NativeFieldWrapperClass1 {
-  ArrayBufferView.internal();
-
-  @DomName('ArrayBufferView.buffer')
-  @DocsEditable
-  dynamic get buffer native "ArrayBufferView_buffer_Getter";
-
-  @DomName('ArrayBufferView.byteLength')
-  @DocsEditable
-  int get byteLength native "ArrayBufferView_byteLength_Getter";
-
-  @DomName('ArrayBufferView.byteOffset')
-  @DocsEditable
-  int get byteOffset native "ArrayBufferView_byteOffset_Getter";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
 @DomName('Attr')
 class Attr extends Node {
   Attr.internal() : super.internal();
@@ -2307,7 +2238,7 @@
 
   @DomName('Crypto.getRandomValues')
   @DocsEditable
-  dynamic getRandomValues(/*ArrayBufferView*/ array) native "Crypto_getRandomValues_Callback";
+  TypedData getRandomValues(TypedData array) native "Crypto_getRandomValues_Callback";
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -6165,231 +6096,6 @@
 // WARNING: Do not edit - generated code.
 
 
-@DocsEditable
-@DomName('DataView')
-class DataView extends ArrayBufferView {
-  DataView.internal() : super.internal();
-  factory DataView(/*ArrayBuffer*/ buffer, [int byteOffset, int byteLength]) => _create(buffer, byteOffset, byteLength);
-
-  @DocsEditable
-  static DataView _create(buffer, byteOffset, byteLength) native "DataView_constructorCallback";
-
-  num getFloat32(int byteOffset, {bool littleEndian}) {
-    if (?littleEndian) {
-      return _getFloat32_1(byteOffset, littleEndian);
-    }
-    return _getFloat32_2(byteOffset);
-  }
-
-  @DomName('DataView._getFloat32_1')
-  @DocsEditable
-  num _getFloat32_1(byteOffset, littleEndian) native "DataView__getFloat32_1_Callback";
-
-  @DomName('DataView._getFloat32_2')
-  @DocsEditable
-  num _getFloat32_2(byteOffset) native "DataView__getFloat32_2_Callback";
-
-  num getFloat64(int byteOffset, {bool littleEndian}) {
-    if (?littleEndian) {
-      return _getFloat64_1(byteOffset, littleEndian);
-    }
-    return _getFloat64_2(byteOffset);
-  }
-
-  @DomName('DataView._getFloat64_1')
-  @DocsEditable
-  num _getFloat64_1(byteOffset, littleEndian) native "DataView__getFloat64_1_Callback";
-
-  @DomName('DataView._getFloat64_2')
-  @DocsEditable
-  num _getFloat64_2(byteOffset) native "DataView__getFloat64_2_Callback";
-
-  int getInt16(int byteOffset, {bool littleEndian}) {
-    if (?littleEndian) {
-      return _getInt16_1(byteOffset, littleEndian);
-    }
-    return _getInt16_2(byteOffset);
-  }
-
-  @DomName('DataView._getInt16_1')
-  @DocsEditable
-  int _getInt16_1(byteOffset, littleEndian) native "DataView__getInt16_1_Callback";
-
-  @DomName('DataView._getInt16_2')
-  @DocsEditable
-  int _getInt16_2(byteOffset) native "DataView__getInt16_2_Callback";
-
-  int getInt32(int byteOffset, {bool littleEndian}) {
-    if (?littleEndian) {
-      return _getInt32_1(byteOffset, littleEndian);
-    }
-    return _getInt32_2(byteOffset);
-  }
-
-  @DomName('DataView._getInt32_1')
-  @DocsEditable
-  int _getInt32_1(byteOffset, littleEndian) native "DataView__getInt32_1_Callback";
-
-  @DomName('DataView._getInt32_2')
-  @DocsEditable
-  int _getInt32_2(byteOffset) native "DataView__getInt32_2_Callback";
-
-  @DomName('DataView.getInt8')
-  @DocsEditable
-  int getInt8(int byteOffset) native "DataView_getInt8_Callback";
-
-  int getUint16(int byteOffset, {bool littleEndian}) {
-    if (?littleEndian) {
-      return _getUint16_1(byteOffset, littleEndian);
-    }
-    return _getUint16_2(byteOffset);
-  }
-
-  @DomName('DataView._getUint16_1')
-  @DocsEditable
-  int _getUint16_1(byteOffset, littleEndian) native "DataView__getUint16_1_Callback";
-
-  @DomName('DataView._getUint16_2')
-  @DocsEditable
-  int _getUint16_2(byteOffset) native "DataView__getUint16_2_Callback";
-
-  int getUint32(int byteOffset, {bool littleEndian}) {
-    if (?littleEndian) {
-      return _getUint32_1(byteOffset, littleEndian);
-    }
-    return _getUint32_2(byteOffset);
-  }
-
-  @DomName('DataView._getUint32_1')
-  @DocsEditable
-  int _getUint32_1(byteOffset, littleEndian) native "DataView__getUint32_1_Callback";
-
-  @DomName('DataView._getUint32_2')
-  @DocsEditable
-  int _getUint32_2(byteOffset) native "DataView__getUint32_2_Callback";
-
-  @DomName('DataView.getUint8')
-  @DocsEditable
-  int getUint8(int byteOffset) native "DataView_getUint8_Callback";
-
-  void setFloat32(int byteOffset, num value, {bool littleEndian}) {
-    if (?littleEndian) {
-      _setFloat32_1(byteOffset, value, littleEndian);
-      return;
-    }
-    _setFloat32_2(byteOffset, value);
-    return;
-  }
-
-  @DomName('DataView._setFloat32_1')
-  @DocsEditable
-  void _setFloat32_1(byteOffset, value, littleEndian) native "DataView__setFloat32_1_Callback";
-
-  @DomName('DataView._setFloat32_2')
-  @DocsEditable
-  void _setFloat32_2(byteOffset, value) native "DataView__setFloat32_2_Callback";
-
-  void setFloat64(int byteOffset, num value, {bool littleEndian}) {
-    if (?littleEndian) {
-      _setFloat64_1(byteOffset, value, littleEndian);
-      return;
-    }
-    _setFloat64_2(byteOffset, value);
-    return;
-  }
-
-  @DomName('DataView._setFloat64_1')
-  @DocsEditable
-  void _setFloat64_1(byteOffset, value, littleEndian) native "DataView__setFloat64_1_Callback";
-
-  @DomName('DataView._setFloat64_2')
-  @DocsEditable
-  void _setFloat64_2(byteOffset, value) native "DataView__setFloat64_2_Callback";
-
-  void setInt16(int byteOffset, int value, {bool littleEndian}) {
-    if (?littleEndian) {
-      _setInt16_1(byteOffset, value, littleEndian);
-      return;
-    }
-    _setInt16_2(byteOffset, value);
-    return;
-  }
-
-  @DomName('DataView._setInt16_1')
-  @DocsEditable
-  void _setInt16_1(byteOffset, value, littleEndian) native "DataView__setInt16_1_Callback";
-
-  @DomName('DataView._setInt16_2')
-  @DocsEditable
-  void _setInt16_2(byteOffset, value) native "DataView__setInt16_2_Callback";
-
-  void setInt32(int byteOffset, int value, {bool littleEndian}) {
-    if (?littleEndian) {
-      _setInt32_1(byteOffset, value, littleEndian);
-      return;
-    }
-    _setInt32_2(byteOffset, value);
-    return;
-  }
-
-  @DomName('DataView._setInt32_1')
-  @DocsEditable
-  void _setInt32_1(byteOffset, value, littleEndian) native "DataView__setInt32_1_Callback";
-
-  @DomName('DataView._setInt32_2')
-  @DocsEditable
-  void _setInt32_2(byteOffset, value) native "DataView__setInt32_2_Callback";
-
-  @DomName('DataView.setInt8')
-  @DocsEditable
-  void setInt8(int byteOffset, int value) native "DataView_setInt8_Callback";
-
-  void setUint16(int byteOffset, int value, {bool littleEndian}) {
-    if (?littleEndian) {
-      _setUint16_1(byteOffset, value, littleEndian);
-      return;
-    }
-    _setUint16_2(byteOffset, value);
-    return;
-  }
-
-  @DomName('DataView._setUint16_1')
-  @DocsEditable
-  void _setUint16_1(byteOffset, value, littleEndian) native "DataView__setUint16_1_Callback";
-
-  @DomName('DataView._setUint16_2')
-  @DocsEditable
-  void _setUint16_2(byteOffset, value) native "DataView__setUint16_2_Callback";
-
-  void setUint32(int byteOffset, int value, {bool littleEndian}) {
-    if (?littleEndian) {
-      _setUint32_1(byteOffset, value, littleEndian);
-      return;
-    }
-    _setUint32_2(byteOffset, value);
-    return;
-  }
-
-  @DomName('DataView._setUint32_1')
-  @DocsEditable
-  void _setUint32_1(byteOffset, value, littleEndian) native "DataView__setUint32_1_Callback";
-
-  @DomName('DataView._setUint32_2')
-  @DocsEditable
-  void _setUint32_2(byteOffset, value) native "DataView__setUint32_2_Callback";
-
-  @DomName('DataView.setUint8')
-  @DocsEditable
-  void setUint8(int byteOffset, int value) native "DataView_setUint8_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
 typedef void DatabaseCallback(database);
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -7695,7 +7401,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -7707,7 +7413,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<DomMimeType> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<DomMimeType> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -8077,7 +7783,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -8089,7 +7795,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<DomPlugin> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<DomPlugin> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -8517,7 +8223,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -8529,7 +8235,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<String> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<String> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -8811,13 +8517,15 @@
     throw new UnimplementedError();
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     if (object is Element) {
       Element element = object;
       if (identical(element.parentNode, _element)) {
         _element.$dom_removeChild(element);
+        return true;
       }
     }
+    return false;
   }
 
   void removeWhere(bool test(Element element)) {
@@ -8978,7 +8686,7 @@
     throw new UnsupportedError('');
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
     throw new UnsupportedError('');
   }
 
@@ -11222,7 +10930,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -11234,7 +10942,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<File> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<File> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -11569,516 +11277,6 @@
 
 
 @DocsEditable
-@DomName('Float32Array')
-class Float32Array extends ArrayBufferView implements List<double> {
-  Float32Array.internal() : super.internal();
-
-  @DomName('Float32Array.Float32Array')
-  @DocsEditable
-  factory Float32Array(int length) =>
-    _TypedArrayFactoryProvider.createFloat32Array(length);
-
-  @DomName('Float32Array.fromList')
-  @DocsEditable
-  factory Float32Array.fromList(List<num> list) =>
-    _TypedArrayFactoryProvider.createFloat32Array_fromList(list);
-
-  @DomName('Float32Array.fromBuffer')
-  @DocsEditable
-  factory Float32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createFloat32Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 4;
-
-  @DomName('Float32Array.length')
-  @DocsEditable
-  int get length native "Float32Array_length_Getter";
-
-  @DomName('Float32Array.numericIndexGetter')
-  @DocsEditable
-  num operator[](int index) native "Float32Array_numericIndexGetter_Callback";
-
-  @DomName('Float32Array.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, num value) native "Float32Array_numericIndexSetter_Callback";
-  // -- start List<num> mixins.
-  // num is the element type.
-
-  // From Iterable<num>:
-
-  Iterator<num> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<num>(this);
-  }
-
-  num reduce(num combine(num value, num element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, num element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(num element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(num element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<num> where(bool f(num element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(num element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
-
-  List<num> toList({ bool growable: true }) =>
-      new List<num>.from(this, growable: growable);
-
-  Set<num> toSet() => new Set<num>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<num> takeWhile(bool test(num value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<num> skipWhile(bool test(num value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  num firstWhere(bool test(num value), { num orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  num lastWhere(bool test(num value), {num orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  num singleWhere(bool test(num value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  num elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<num>:
-
-  void add(num value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<num>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<num> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(num a, num b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(num element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(num element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  num get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  num get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  num get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, num element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  num removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  num removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(num element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(num element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<num> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [num fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<num> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<num> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <num>[]);
-  }
-
-  Map<int, num> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<num> mixins.
-
-  @DomName('Float32Array.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Float32Array_setElements_Callback";
-
-  List<double> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Float32Array._subarray_1')
-  @DocsEditable
-  List<double> _subarray_1(start, end) native "Float32Array__subarray_1_Callback";
-
-  @DomName('Float32Array._subarray_2')
-  @DocsEditable
-  List<double> _subarray_2(start) native "Float32Array__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('Float64Array')
-class Float64Array extends ArrayBufferView implements List<double> {
-  Float64Array.internal() : super.internal();
-
-  @DomName('Float64Array.Float64Array')
-  @DocsEditable
-  factory Float64Array(int length) =>
-    _TypedArrayFactoryProvider.createFloat64Array(length);
-
-  @DomName('Float64Array.fromList')
-  @DocsEditable
-  factory Float64Array.fromList(List<num> list) =>
-    _TypedArrayFactoryProvider.createFloat64Array_fromList(list);
-
-  @DomName('Float64Array.fromBuffer')
-  @DocsEditable
-  factory Float64Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createFloat64Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 8;
-
-  @DomName('Float64Array.length')
-  @DocsEditable
-  int get length native "Float64Array_length_Getter";
-
-  @DomName('Float64Array.numericIndexGetter')
-  @DocsEditable
-  num operator[](int index) native "Float64Array_numericIndexGetter_Callback";
-
-  @DomName('Float64Array.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, num value) native "Float64Array_numericIndexSetter_Callback";
-  // -- start List<num> mixins.
-  // num is the element type.
-
-  // From Iterable<num>:
-
-  Iterator<num> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<num>(this);
-  }
-
-  num reduce(num combine(num value, num element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, num element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(num element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(num element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<num> where(bool f(num element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(num element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
-
-  List<num> toList({ bool growable: true }) =>
-      new List<num>.from(this, growable: growable);
-
-  Set<num> toSet() => new Set<num>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<num> takeWhile(bool test(num value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<num> skipWhile(bool test(num value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  num firstWhere(bool test(num value), { num orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  num lastWhere(bool test(num value), {num orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  num singleWhere(bool test(num value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  num elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<num>:
-
-  void add(num value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<num>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<num> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(num a, num b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(num element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(num element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  num get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  num get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  num get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, num element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  num removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  num removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(num element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(num element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<num> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<num> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [num fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<num> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<num> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <num>[]);
-  }
-
-  Map<int, num> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<num> mixins.
-
-  @DomName('Float64Array.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Float64Array_setElements_Callback";
-
-  List<double> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Float64Array._subarray_1')
-  @DocsEditable
-  List<double> _subarray_1(start, end) native "Float64Array__subarray_1_Callback";
-
-  @DomName('Float64Array._subarray_2')
-  @DocsEditable
-  List<double> _subarray_2(start) native "Float64Array__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
 @DomName('FocusEvent')
 class FocusEvent extends UIEvent {
   FocusEvent.internal() : super.internal();
@@ -12767,7 +11965,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -12779,7 +11977,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -12996,7 +12194,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -13008,7 +12206,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -13682,7 +12880,8 @@
    * Send the request with any given `data`.
    *
    * See also:
-   * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send())
+   *
+   *   * [send](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send%28%29)
    * from MDN.
    */
   @DomName('XMLHttpRequest.send')
@@ -15183,771 +14382,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('Int16Array')
-class Int16Array extends ArrayBufferView implements List<int> {
-  Int16Array.internal() : super.internal();
-
-  @DomName('Int16Array.Int16Array')
-  @DocsEditable
-  factory Int16Array(int length) =>
-    _TypedArrayFactoryProvider.createInt16Array(length);
-
-  @DomName('Int16Array.fromList')
-  @DocsEditable
-  factory Int16Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createInt16Array_fromList(list);
-
-  @DomName('Int16Array.fromBuffer')
-  @DocsEditable
-  factory Int16Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createInt16Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 2;
-
-  @DomName('Int16Array.length')
-  @DocsEditable
-  int get length native "Int16Array_length_Getter";
-
-  @DomName('Int16Array.numericIndexGetter')
-  @DocsEditable
-  int operator[](int index) native "Int16Array_numericIndexGetter_Callback";
-
-  @DomName('Int16Array.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, int value) native "Int16Array_numericIndexSetter_Callback";
-  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @DomName('Int16Array.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Int16Array_setElements_Callback";
-
-  List<int> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Int16Array._subarray_1')
-  @DocsEditable
-  List<int> _subarray_1(start, end) native "Int16Array__subarray_1_Callback";
-
-  @DomName('Int16Array._subarray_2')
-  @DocsEditable
-  List<int> _subarray_2(start) native "Int16Array__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('Int32Array')
-class Int32Array extends ArrayBufferView implements List<int> {
-  Int32Array.internal() : super.internal();
-
-  @DomName('Int32Array.Int32Array')
-  @DocsEditable
-  factory Int32Array(int length) =>
-    _TypedArrayFactoryProvider.createInt32Array(length);
-
-  @DomName('Int32Array.fromList')
-  @DocsEditable
-  factory Int32Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createInt32Array_fromList(list);
-
-  @DomName('Int32Array.fromBuffer')
-  @DocsEditable
-  factory Int32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createInt32Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 4;
-
-  @DomName('Int32Array.length')
-  @DocsEditable
-  int get length native "Int32Array_length_Getter";
-
-  @DomName('Int32Array.numericIndexGetter')
-  @DocsEditable
-  int operator[](int index) native "Int32Array_numericIndexGetter_Callback";
-
-  @DomName('Int32Array.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, int value) native "Int32Array_numericIndexSetter_Callback";
-  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @DomName('Int32Array.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Int32Array_setElements_Callback";
-
-  List<int> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Int32Array._subarray_1')
-  @DocsEditable
-  List<int> _subarray_1(start, end) native "Int32Array__subarray_1_Callback";
-
-  @DomName('Int32Array._subarray_2')
-  @DocsEditable
-  List<int> _subarray_2(start) native "Int32Array__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('Int8Array')
-class Int8Array extends ArrayBufferView implements List<int> {
-  Int8Array.internal() : super.internal();
-
-  @DomName('Int8Array.Int8Array')
-  @DocsEditable
-  factory Int8Array(int length) =>
-    _TypedArrayFactoryProvider.createInt8Array(length);
-
-  @DomName('Int8Array.fromList')
-  @DocsEditable
-  factory Int8Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createInt8Array_fromList(list);
-
-  @DomName('Int8Array.fromBuffer')
-  @DocsEditable
-  factory Int8Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createInt8Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 1;
-
-  @DomName('Int8Array.length')
-  @DocsEditable
-  int get length native "Int8Array_length_Getter";
-
-  @DomName('Int8Array.numericIndexGetter')
-  @DocsEditable
-  int operator[](int index) native "Int8Array_numericIndexGetter_Callback";
-
-  @DomName('Int8Array.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, int value) native "Int8Array_numericIndexSetter_Callback";
-  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @DomName('Int8Array.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Int8Array_setElements_Callback";
-
-  List<int> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Int8Array._subarray_1')
-  @DocsEditable
-  List<int> _subarray_1(start, end) native "Int8Array__subarray_1_Callback";
-
-  @DomName('Int8Array._subarray_2')
-  @DocsEditable
-  List<int> _subarray_2(start) native "Int8Array__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
 
 @DomName('KeyboardEvent')
 class KeyboardEvent extends UIEvent {
@@ -18561,11 +16995,12 @@
     return result;
   }
 
-  void remove(Object object) {
-    if (object is! Node) return;
+  bool remove(Object object) {
+    if (object is! Node) return false;
     Node node = object;
-    if (!identical(_this, node.parentNode)) return;
+    if (!identical(_this, node.parentNode)) return false;
     _this.$dom_removeChild(node);
+    return true;
   }
 
   void _filter(bool test(Node node), bool removeMatching) {
@@ -18820,6 +17255,30 @@
 
   Node.internal() : super.internal();
 
+  static const int ATTRIBUTE_NODE = 2;
+
+  static const int CDATA_SECTION_NODE = 4;
+
+  static const int COMMENT_NODE = 8;
+
+  static const int DOCUMENT_FRAGMENT_NODE = 11;
+
+  static const int DOCUMENT_NODE = 9;
+
+  static const int DOCUMENT_TYPE_NODE = 10;
+
+  static const int ELEMENT_NODE = 1;
+
+  static const int ENTITY_NODE = 6;
+
+  static const int ENTITY_REFERENCE_NODE = 5;
+
+  static const int NOTATION_NODE = 12;
+
+  static const int PROCESSING_INSTRUCTION_NODE = 7;
+
+  static const int TEXT_NODE = 3;
+
   @DomName('Node.childNodes')
   @DocsEditable
   List<Node> get $dom_childNodes native "Node_childNodes_Getter";
@@ -19183,7 +17642,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -19195,7 +17654,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -19971,21 +18430,21 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental
-  PerformanceEntryList getEntries() native "Performance_webkitGetEntries_Callback";
+  List<PerformanceEntry> getEntries() native "Performance_webkitGetEntries_Callback";
 
   @DomName('Performance.webkitGetEntriesByName')
   @DocsEditable
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental
-  PerformanceEntryList getEntriesByName(String name, String entryType) native "Performance_webkitGetEntriesByName_Callback";
+  List<PerformanceEntry> getEntriesByName(String name, String entryType) native "Performance_webkitGetEntriesByName_Callback";
 
   @DomName('Performance.webkitGetEntriesByType')
   @DocsEditable
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental
-  PerformanceEntryList getEntriesByType(String entryType) native "Performance_webkitGetEntriesByType_Callback";
+  List<PerformanceEntry> getEntriesByType(String entryType) native "Performance_webkitGetEntriesByType_Callback";
 
   @DomName('Performance.webkitMark')
   @DocsEditable
@@ -20515,27 +18974,6 @@
 // WARNING: Do not edit - generated code.
 
 
-@DocsEditable
-@DomName('RadioNodeList')
-class RadioNodeList extends NodeList {
-  RadioNodeList.internal() : super.internal();
-
-  @DomName('RadioNodeList.value')
-  @DocsEditable
-  String get value native "RadioNodeList_value_Getter";
-
-  @DomName('RadioNodeList.value')
-  @DocsEditable
-  void set value(String value) native "RadioNodeList_value_Setter";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
 @DomName('Range')
 class Range extends NativeFieldWrapperClass1 {
   factory Range() => document.$dom_createRange();
@@ -20793,11 +19231,11 @@
   void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "RTCDataChannel_removeEventListener_Callback";
 
   void send(data) {
-    if ((data is ArrayBufferView || data is _typeddata.TypedData || data == null)) {
+    if ((data is TypedData || data == null)) {
       _send_1(data);
       return;
     }
-    if ((data is ArrayBuffer || data is _typeddata.ByteBuffer || data == null)) {
+    if ((data is ByteBuffer || data == null)) {
       _send_2(data);
       return;
     }
@@ -22022,7 +20460,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -22034,7 +20472,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<SourceBuffer> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<SourceBuffer> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -22360,7 +20798,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -22372,7 +20810,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<SpeechGrammar> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<SpeechGrammar> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -24117,7 +22555,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -24129,7 +22567,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<TextTrackCue> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<TextTrackCue> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -24346,7 +22784,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -24358,7 +22796,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<TextTrack> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<TextTrack> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -24792,7 +23230,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -24804,7 +23242,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Touch> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Touch> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -25142,1024 +23580,6 @@
 
 
 @DocsEditable
-@DomName('Uint16Array')
-class Uint16Array extends ArrayBufferView implements List<int> {
-  Uint16Array.internal() : super.internal();
-
-  @DomName('Uint16Array.Uint16Array')
-  @DocsEditable
-  factory Uint16Array(int length) =>
-    _TypedArrayFactoryProvider.createUint16Array(length);
-
-  @DomName('Uint16Array.fromList')
-  @DocsEditable
-  factory Uint16Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createUint16Array_fromList(list);
-
-  @DomName('Uint16Array.fromBuffer')
-  @DocsEditable
-  factory Uint16Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createUint16Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 2;
-
-  @DomName('Uint16Array.length')
-  @DocsEditable
-  int get length native "Uint16Array_length_Getter";
-
-  @DomName('Uint16Array.numericIndexGetter')
-  @DocsEditable
-  int operator[](int index) native "Uint16Array_numericIndexGetter_Callback";
-
-  @DomName('Uint16Array.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, int value) native "Uint16Array_numericIndexSetter_Callback";
-  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @DomName('Uint16Array.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Uint16Array_setElements_Callback";
-
-  List<int> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Uint16Array._subarray_1')
-  @DocsEditable
-  List<int> _subarray_1(start, end) native "Uint16Array__subarray_1_Callback";
-
-  @DomName('Uint16Array._subarray_2')
-  @DocsEditable
-  List<int> _subarray_2(start) native "Uint16Array__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('Uint32Array')
-class Uint32Array extends ArrayBufferView implements List<int> {
-  Uint32Array.internal() : super.internal();
-
-  @DomName('Uint32Array.Uint32Array')
-  @DocsEditable
-  factory Uint32Array(int length) =>
-    _TypedArrayFactoryProvider.createUint32Array(length);
-
-  @DomName('Uint32Array.fromList')
-  @DocsEditable
-  factory Uint32Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createUint32Array_fromList(list);
-
-  @DomName('Uint32Array.fromBuffer')
-  @DocsEditable
-  factory Uint32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createUint32Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 4;
-
-  @DomName('Uint32Array.length')
-  @DocsEditable
-  int get length native "Uint32Array_length_Getter";
-
-  @DomName('Uint32Array.numericIndexGetter')
-  @DocsEditable
-  int operator[](int index) native "Uint32Array_numericIndexGetter_Callback";
-
-  @DomName('Uint32Array.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, int value) native "Uint32Array_numericIndexSetter_Callback";
-  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @DomName('Uint32Array.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Uint32Array_setElements_Callback";
-
-  List<int> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Uint32Array._subarray_1')
-  @DocsEditable
-  List<int> _subarray_1(start, end) native "Uint32Array__subarray_1_Callback";
-
-  @DomName('Uint32Array._subarray_2')
-  @DocsEditable
-  List<int> _subarray_2(start) native "Uint32Array__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('Uint8Array')
-class Uint8Array extends ArrayBufferView implements List<int> {
-  Uint8Array.internal() : super.internal();
-
-  @DomName('Uint8Array.Uint8Array')
-  @DocsEditable
-  factory Uint8Array(int length) =>
-    _TypedArrayFactoryProvider.createUint8Array(length);
-
-  @DomName('Uint8Array.fromList')
-  @DocsEditable
-  factory Uint8Array.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createUint8Array_fromList(list);
-
-  @DomName('Uint8Array.fromBuffer')
-  @DocsEditable
-  factory Uint8Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createUint8Array_fromBuffer(buffer, byteOffset, length);
-
-  static const int BYTES_PER_ELEMENT = 1;
-
-  @DomName('Uint8Array.length')
-  @DocsEditable
-  int get length native "Uint8Array_length_Getter";
-
-  @DomName('Uint8Array.numericIndexGetter')
-  @DocsEditable
-  int operator[](int index) native "Uint8Array_numericIndexGetter_Callback";
-
-  @DomName('Uint8Array.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, int value) native "Uint8Array_numericIndexSetter_Callback";
-  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @DomName('Uint8Array.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Uint8Array_setElements_Callback";
-
-  List<int> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Uint8Array._subarray_1')
-  @DocsEditable
-  List<int> _subarray_1(start, end) native "Uint8Array__subarray_1_Callback";
-
-  @DomName('Uint8Array._subarray_2')
-  @DocsEditable
-  List<int> _subarray_2(start) native "Uint8Array__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('Uint8ClampedArray')
-class Uint8ClampedArray extends Uint8Array implements List<int> {
-  Uint8ClampedArray.internal() : super.internal();
-
-  @DomName('Uint8ClampedArray.Uint8ClampedArray')
-  @DocsEditable
-  factory Uint8ClampedArray(int length) =>
-    _TypedArrayFactoryProvider.createUint8ClampedArray(length);
-
-  @DomName('Uint8ClampedArray.fromList')
-  @DocsEditable
-  factory Uint8ClampedArray.fromList(List<int> list) =>
-    _TypedArrayFactoryProvider.createUint8ClampedArray_fromList(list);
-
-  @DomName('Uint8ClampedArray.fromBuffer')
-  @DocsEditable
-  factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) => 
-    _TypedArrayFactoryProvider.createUint8ClampedArray_fromBuffer(buffer, byteOffset, length);
-
-  @DomName('Uint8ClampedArray.length')
-  @DocsEditable
-  int get length native "Uint8ClampedArray_length_Getter";
-
-  @DomName('Uint8ClampedArray.numericIndexGetter')
-  @DocsEditable
-  int operator[](int index) native "Uint8ClampedArray_numericIndexGetter_Callback";
-
-  @DomName('Uint8ClampedArray.numericIndexSetter')
-  @DocsEditable
-  void operator[]=(int index, int value) native "Uint8ClampedArray_numericIndexSetter_Callback";
-  // -- start List<int> mixins.
-  // int is the element type.
-
-  // From Iterable<int>:
-
-  Iterator<int> get iterator {
-    // Note: NodeLists are not fixed size. And most probably length shouldn't
-    // be cached in both iterator _and_ forEach method. For now caching it
-    // for consistency.
-    return new FixedSizeListIterator<int>(this);
-  }
-
-  int reduce(int combine(int value, int element)) {
-    return IterableMixinWorkaround.reduce(this, combine);
-  }
-
-  dynamic fold(dynamic initialValue,
-               dynamic combine(dynamic previousValue, int element)) {
-    return IterableMixinWorkaround.fold(this, initialValue, combine);
-  }
-
-  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
-  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
-  String join([String separator = ""]) =>
-      IterableMixinWorkaround.joinList(this, separator);
-
-  Iterable map(f(int element)) =>
-      IterableMixinWorkaround.mapList(this, f);
-
-  Iterable<int> where(bool f(int element)) =>
-      IterableMixinWorkaround.where(this, f);
-
-  Iterable expand(Iterable f(int element)) =>
-      IterableMixinWorkaround.expand(this, f);
-
-  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
-  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
-  List<int> toList({ bool growable: true }) =>
-      new List<int>.from(this, growable: growable);
-
-  Set<int> toSet() => new Set<int>.from(this);
-
-  bool get isEmpty => this.length == 0;
-
-  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
-  Iterable<int> takeWhile(bool test(int value)) {
-    return IterableMixinWorkaround.takeWhile(this, test);
-  }
-
-  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
-  Iterable<int> skipWhile(bool test(int value)) {
-    return IterableMixinWorkaround.skipWhile(this, test);
-  }
-
-  int firstWhere(bool test(int value), { int orElse() }) {
-    return IterableMixinWorkaround.firstWhere(this, test, orElse);
-  }
-
-  int lastWhere(bool test(int value), {int orElse()}) {
-    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
-  }
-
-  int singleWhere(bool test(int value)) {
-    return IterableMixinWorkaround.singleWhere(this, test);
-  }
-
-  int elementAt(int index) {
-    return this[index];
-  }
-
-  // From Collection<int>:
-
-  void add(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void addAll(Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  // From List<int>:
-  void set length(int value) {
-    throw new UnsupportedError("Cannot resize immutable List.");
-  }
-
-  void clear() {
-    throw new UnsupportedError("Cannot clear immutable List.");
-  }
-
-  Iterable<int> get reversed {
-    return IterableMixinWorkaround.reversedList(this);
-  }
-
-  void sort([int compare(int a, int b)]) {
-    throw new UnsupportedError("Cannot sort immutable List.");
-  }
-
-  int indexOf(int element, [int start = 0]) =>
-      Lists.indexOf(this, element, start, this.length);
-
-  int lastIndexOf(int element, [int start]) {
-    if (start == null) start = length - 1;
-    return Lists.lastIndexOf(this, element, start);
-  }
-
-  int get first {
-    if (this.length > 0) return this[0];
-    throw new StateError("No elements");
-  }
-
-  int get last {
-    if (this.length > 0) return this[this.length - 1];
-    throw new StateError("No elements");
-  }
-
-  int get single {
-    if (length == 1) return this[0];
-    if (length == 0) throw new StateError("No elements");
-    throw new StateError("More than one element");
-  }
-
-  void insert(int index, int element) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void insertAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
-  void setAll(int index, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  int removeAt(int pos) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  int removeLast() {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void remove(Object object) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void removeWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void retainWhere(bool test(int element)) {
-    throw new UnsupportedError("Cannot remove from immutable List.");
-  }
-
-  void setRange(int start, int end, Iterable<int> iterable, [int skipCount]) {
-    throw new UnsupportedError("Cannot setRange on immutable List.");
-  }
-
-  void removeRange(int start, int end) {
-    throw new UnsupportedError("Cannot removeRange on immutable List.");
-  }
-
-  void replaceRange(int start, int end, Iterable<int> iterable) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  void fillRange(int start, int end, [int fillValue]) {
-    throw new UnsupportedError("Cannot modify an immutable List.");
-  }
-
-  Iterable<int> getRange(int start, int end) =>
-    IterableMixinWorkaround.getRangeList(this, start, end);
-
-  List<int> sublist(int start, [int end]) {
-    if (end == null) end = length;
-    return Lists.getRange(this, start, end, <int>[]);
-  }
-
-  Map<int, int> asMap() =>
-    IterableMixinWorkaround.asMapList(this);
-
-  String toString() {
-    StringBuffer buffer = new StringBuffer('[');
-    buffer.writeAll(this, ', ');
-    buffer.write(']');
-    return buffer.toString();
-  }
-
-  // -- end List<int> mixins.
-
-  @DomName('Uint8ClampedArray.setElements')
-  @DocsEditable
-  void setElements(Object array, [int offset]) native "Uint8ClampedArray_setElements_Callback";
-
-  List<int> subarray(int start, [int end]) {
-    if (?end) {
-      return _subarray_1(start, end);
-    }
-    return _subarray_2(start);
-  }
-
-  @DomName('Uint8ClampedArray._subarray_1')
-  @DocsEditable
-  List<int> _subarray_1(start, end) native "Uint8ClampedArray__subarray_1_Callback";
-
-  @DomName('Uint8ClampedArray._subarray_2')
-  @DocsEditable
-  List<int> _subarray_2(start) native "Uint8ClampedArray__subarray_2_Callback";
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
 @DomName('HTMLUnknownElement')
 class UnknownElement extends _Element_Merged {
   UnknownElement.internal() : super.internal();
@@ -28174,7 +25594,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -28186,7 +25606,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Rect> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Rect> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -28408,7 +25828,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -28420,7 +25840,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<CssRule> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<CssRule> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -28629,7 +26049,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -28641,7 +26061,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<_CSSValue> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<_CSSValue> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -29102,7 +26522,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -29114,7 +26534,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Entry> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Entry> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -29323,7 +26743,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -29335,7 +26755,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<_EntrySync> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<_EntrySync> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -29605,7 +27025,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -29617,7 +27037,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Gamepad> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Gamepad> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -29765,9 +27185,7 @@
   @DocsEditable
   int get length native "NamedNodeMap_length_Getter";
 
-  @DomName('NamedNodeMap.numericIndexGetter')
-  @DocsEditable
-  Node operator[](int index) native "NamedNodeMap_numericIndexGetter_Callback";
+  Node operator[](int index) native "NamedNodeMap_item_Callback";
 
   void operator[]=(int index, Node value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
@@ -29919,7 +27337,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -29931,7 +27349,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -30009,6 +27427,16 @@
   _RGBColor.internal();
 
 }
+// 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.
+
+
+@DomName('RadioNodeList')
+class _RadioNodeList extends NodeList {
+  _RadioNodeList.internal() : super.internal();
+
+}
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -30225,7 +27653,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -30237,7 +27665,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<SpeechInputResult> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<SpeechInputResult> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -30446,7 +27874,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -30458,7 +27886,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<SpeechRecognitionResult> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<SpeechRecognitionResult> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -30667,7 +28095,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -30679,7 +28107,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<StyleSheet> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<StyleSheet> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -33477,74 +30905,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
-class _TypedArrayFactoryProvider {
-  static Float32Array createFloat32Array(int length) => _F32(length);
-  static Float32Array createFloat32Array_fromList(List<num> list) =>
-      _F32(ensureNative(list));
-  static Float32Array createFloat32Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _F32(buffer, byteOffset, length);
-  static _F32(arg0, [arg1, arg2]) native "Float32Array_constructor_Callback";
-
-  static Float64Array createFloat64Array(int length) => _F64(length);
-  static Float64Array createFloat64Array_fromList(List<num> list) =>
-      _F64(ensureNative(list));
-  static Float64Array createFloat64Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _F64(buffer, byteOffset, length);
-  static _F64(arg0, [arg1, arg2]) native "Float64Array_constructor_Callback";
-
-  static Int8Array createInt8Array(int length) => _I8(length);
-  static Int8Array createInt8Array_fromList(List<num> list) =>
-      _I8(ensureNative(list));
-  static Int8Array createInt8Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _I8(buffer, byteOffset, length);
-  static _I8(arg0, [arg1, arg2]) native "Int8Array_constructor_Callback";
-
-  static Int16Array createInt16Array(int length) => _I16(length);
-  static Int16Array createInt16Array_fromList(List<num> list) =>
-      _I16(ensureNative(list));
-  static Int16Array createInt16Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _I16(buffer, byteOffset, length);
-  static _I16(arg0, [arg1, arg2]) native "Int16Array_constructor_Callback";
-
-  static Int32Array createInt32Array(int length) => _I32(length);
-  static Int32Array createInt32Array_fromList(List<num> list) =>
-      _I32(ensureNative(list));
-  static Int32Array createInt32Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _I32(buffer, byteOffset, length);
-  static _I32(arg0, [arg1, arg2]) native "Int32Array_constructor_Callback";
-
-  static Uint8Array createUint8Array(int length) => _U8(length);
-  static Uint8Array createUint8Array_fromList(List<num> list) =>
-      _U8(ensureNative(list));
-  static Uint8Array createUint8Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _U8(buffer, byteOffset, length);
-  static _U8(arg0, [arg1, arg2]) native "Uint8Array_constructor_Callback";
-
-  static Uint16Array createUint16Array(int length) => _U16(length);
-  static Uint16Array createUint16Array_fromList(List<num> list) =>
-      _U16(ensureNative(list));
-  static Uint16Array createUint16Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _U16(buffer, byteOffset, length);
-  static _U16(arg0, [arg1, arg2]) native "Uint16Array_constructor_Callback";
-
-  static Uint32Array createUint32Array(int length) => _U32(length);
-  static Uint32Array createUint32Array_fromList(List<num> list) =>
-      _U32(ensureNative(list));
-  static Uint32Array createUint32Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _U32(buffer, byteOffset, length);
-  static _U32(arg0, [arg1, arg2]) native "Uint32Array_constructor_Callback";
-
-  static Uint8ClampedArray createUint8ClampedArray(int length) => _U8C(length);
-  static Uint8ClampedArray createUint8ClampedArray_fromList(
-      List<num> list) => _U8C(ensureNative(list));
-  static Uint8ClampedArray createUint8ClampedArray_fromBuffer(
-      ArrayBuffer buffer, [int byteOffset = 0, int length]) =>
-      _U8C(buffer, byteOffset, length);
-  static _U8C(arg0, [arg1, arg2]) native "Uint8ClampedArray_constructor_Callback";
-
-  static ensureNative(List list) => list;  // TODO: make sure.
-}
-
 class _TextFactoryProvider {
   static Text createText(String data) => document.$dom_createTextNode(data);
 }
diff --git a/sdk/lib/html/html_common/conversions.dart b/sdk/lib/html/html_common/conversions.dart
index b8d9183..2892b7d 100644
--- a/sdk/lib/html/html_common/conversions.dart
+++ b/sdk/lib/html/html_common/conversions.dart
@@ -139,9 +139,9 @@
 
     // TODO(sra): Firefox: How to convert _TypedImageData on the other end?
     if (e is ImageData) return e;
-    if (e is ArrayBuffer) return e;
+    if (e is ByteBuffer) return e;
 
-    if (e is ArrayBufferView) return e;
+    if (e is TypedData) return e;
 
     if (e is Map) {
       var slot = findSlot(e);
@@ -328,7 +328,7 @@
 const String _serializedScriptValue =
     'num|String|bool|'
     '=List|=Object|'
-    'Blob|File|ArrayBuffer|ArrayBufferView'
+    'Blob|File|ByteBuffer|TypedData'
     // TODO(sra): Add Date, RegExp.
     ;
 const annotation_Creates_SerializedScriptValue =
diff --git a/sdk/lib/html/html_common/filtered_element_list.dart b/sdk/lib/html/html_common/filtered_element_list.dart
index 0efe3d5..4315a2f 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.dart
@@ -120,15 +120,16 @@
     return result;
   }
 
-  void remove(Object element) {
-    if (element is! Element) return;
+  bool remove(Object element) {
+    if (element is! Element) return false;
     for (int i = 0; i < length; i++) {
       Element indexElement = this[i];
       if (identical(indexElement, element)) {
         indexElement.remove();
-        return;
+        return true;
       }
     }
+    return false;
   }
 
 
diff --git a/sdk/lib/html/html_common/html_common_dart2js.dart b/sdk/lib/html/html_common/html_common_dart2js.dart
index a27b3a0..1f0a19f 100644
--- a/sdk/lib/html/html_common/html_common_dart2js.dart
+++ b/sdk/lib/html/html_common/html_common_dart2js.dart
@@ -6,6 +6,7 @@
 
 import 'dart:collection';
 import 'dart:html';
+import 'dart:typed_data';
 import 'dart:_js_helper' show Creates, Returns;
 import 'dart:_foreign_helper' show JS;
 
diff --git a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
index cdd2742..a67b5d3 100644
--- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
@@ -3,6 +3,7 @@
 import 'dart:async';
 import 'dart:html';
 import 'dart:html_common';
+import 'dart:typed_data';
 import 'dart:_js_helper' show Creates, Returns, JSName, Null;
 import 'dart:_foreign_helper' show JS;
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -137,7 +138,7 @@
 
 
 @DomName('IDBCursor')
-class Cursor native "*IDBCursor" {
+class Cursor native "IDBCursor" {
   @DomName('IDBCursor.delete')
   Future delete() {
    try {
@@ -208,7 +209,7 @@
 
 @DocsEditable
 @DomName('IDBCursorWithValue')
-class CursorWithValue extends Cursor native "*IDBCursorWithValue" {
+class CursorWithValue extends Cursor native "IDBCursorWithValue" {
 
   dynamic get value => _convertNativeToDart_IDBAny(this._get_value);
   @JSName('value')
@@ -229,7 +230,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX, '15')
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @Experimental
-class Database extends EventTarget native "*IDBDatabase" {
+class Database extends EventTarget native "IDBDatabase" {
   @DomName('IDBDatabase.createObjectStore')
   @DocsEditable
   ObjectStore createObjectStore(String name,
@@ -351,7 +352,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX, '15')
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @Experimental
-class IdbFactory native "*IDBFactory" {
+class IdbFactory native "IDBFactory" {
   /**
    * Checks to see if Indexed DB is supported on the current platform.
    */
@@ -480,7 +481,7 @@
 
 
 @DomName('IDBIndex')
-class Index native "*IDBIndex" {
+class Index native "IDBIndex" {
   @DomName('IDBIndex.count')
   Future<int> count([key_OR_range]) {
    try {
@@ -638,7 +639,7 @@
 
 
 @DomName('IDBKeyRange')
-class KeyRange native "*IDBKeyRange" {
+class KeyRange native "IDBKeyRange" {
   @DomName('IDBKeyRange.only')
   factory KeyRange.only(/*Key*/ value) =>
       _KeyRangeFactoryProvider.createKeyRange_only(value);
@@ -701,7 +702,7 @@
 
 
 @DomName('IDBObjectStore')
-class ObjectStore native "*IDBObjectStore" {
+class ObjectStore native "IDBObjectStore" {
 
   @DomName('IDBObjectStore.add')
   Future add(value, [key]) {
@@ -1029,7 +1030,7 @@
 
 @DocsEditable
 @DomName('IDBOpenDBRequest')
-class OpenDBRequest extends Request implements EventTarget native "*IDBOpenDBRequest" {
+class OpenDBRequest extends Request implements EventTarget native "IDBOpenDBRequest" {
 
   @DomName('IDBOpenDBRequest.blockedEvent')
   @DocsEditable
@@ -1054,7 +1055,7 @@
 
 @DocsEditable
 @DomName('IDBRequest')
-class Request extends EventTarget native "*IDBRequest" {
+class Request extends EventTarget native "IDBRequest" {
 
   @DomName('IDBRequest.errorEvent')
   @DocsEditable
@@ -1124,7 +1125,7 @@
 
 
 @DomName('IDBTransaction')
-class Transaction extends EventTarget native "*IDBTransaction" {
+class Transaction extends EventTarget native "IDBTransaction" {
 
   /**
    * Provides a Future which will be completed once the transaction has
@@ -1226,7 +1227,7 @@
 
 @DocsEditable
 @DomName('IDBVersionChangeEvent')
-class VersionChangeEvent extends Event native "*IDBVersionChangeEvent" {
+class VersionChangeEvent extends Event native "IDBVersionChangeEvent" {
 
   @DomName('IDBVersionChangeEvent.newVersion')
   @DocsEditable
@@ -1243,5 +1244,5 @@
 
 @DocsEditable
 @DomName('IDBAny')
-abstract class _IDBAny native "*IDBAny" {
+abstract class _IDBAny native "IDBAny" {
 }
diff --git a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
index 87c0ebe..1285ca5 100644
--- a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
+++ b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
@@ -84,22 +84,9 @@
   @DocsEditable
   Request $dom_delete() native "IDBCursor_delete_Callback";
 
-  void next([Object key]) {
-    if (?key) {
-      _continue_1(key);
-      return;
-    }
-    _continue_2();
-    return;
-  }
-
-  @DomName('IDBCursor._continue_1')
+  @DomName('IDBCursor.next')
   @DocsEditable
-  void _continue_1(key) native "IDBCursor__continue_1_Callback";
-
-  @DomName('IDBCursor._continue_2')
-  @DocsEditable
-  void _continue_2() native "IDBCursor__continue_2_Callback";
+  void next([Object key]) native "IDBCursor_next_Callback";
 
   @DomName('IDBCursor.update')
   @DocsEditable
@@ -491,30 +478,23 @@
   bool get unique native "IDBIndex_unique_Getter";
 
   Request $dom_count([key_OR_range]) {
-    if (!?key_OR_range) {
-      return _count_1();
-    }
     if ((key_OR_range is KeyRange || key_OR_range == null)) {
-      return _count_2(key_OR_range);
+      return _count_1(key_OR_range);
     }
     if (?key_OR_range) {
-      return _count_3(key_OR_range);
+      return _count_2(key_OR_range);
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
   @DomName('IDBIndex._count_1')
   @DocsEditable
-  Request _count_1() native "IDBIndex__count_1_Callback";
+  Request _count_1(key_OR_range) native "IDBIndex__count_1_Callback";
 
   @DomName('IDBIndex._count_2')
   @DocsEditable
   Request _count_2(key_OR_range) native "IDBIndex__count_2_Callback";
 
-  @DomName('IDBIndex._count_3')
-  @DocsEditable
-  Request _count_3(key_OR_range) native "IDBIndex__count_3_Callback";
-
   Request $dom_get(key) {
     if ((key is KeyRange || key == null)) {
       return _get_1(key);
@@ -552,82 +532,40 @@
   Request _getKey_2(key) native "IDBIndex__getKey_2_Callback";
 
   Request $dom_openCursor([key_OR_range, String direction]) {
-    if (!?key_OR_range && !?direction) {
-      return _openCursor_1();
-    }
-    if ((key_OR_range is KeyRange || key_OR_range == null) && !?direction) {
-      return _openCursor_2(key_OR_range);
-    }
     if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is String || direction == null)) {
-      return _openCursor_3(key_OR_range, direction);
-    }
-    if (?key_OR_range && !?direction) {
-      return _openCursor_4(key_OR_range);
+      return _openCursor_1(key_OR_range, direction);
     }
     if (?key_OR_range && (direction is String || direction == null)) {
-      return _openCursor_5(key_OR_range, direction);
+      return _openCursor_2(key_OR_range, direction);
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
   @DomName('IDBIndex._openCursor_1')
   @DocsEditable
-  Request _openCursor_1() native "IDBIndex__openCursor_1_Callback";
+  Request _openCursor_1(key_OR_range, direction) native "IDBIndex__openCursor_1_Callback";
 
   @DomName('IDBIndex._openCursor_2')
   @DocsEditable
-  Request _openCursor_2(key_OR_range) native "IDBIndex__openCursor_2_Callback";
-
-  @DomName('IDBIndex._openCursor_3')
-  @DocsEditable
-  Request _openCursor_3(key_OR_range, direction) native "IDBIndex__openCursor_3_Callback";
-
-  @DomName('IDBIndex._openCursor_4')
-  @DocsEditable
-  Request _openCursor_4(key_OR_range) native "IDBIndex__openCursor_4_Callback";
-
-  @DomName('IDBIndex._openCursor_5')
-  @DocsEditable
-  Request _openCursor_5(key_OR_range, direction) native "IDBIndex__openCursor_5_Callback";
+  Request _openCursor_2(key_OR_range, direction) native "IDBIndex__openCursor_2_Callback";
 
   Request $dom_openKeyCursor([key_OR_range, String direction]) {
-    if (!?key_OR_range && !?direction) {
-      return _openKeyCursor_1();
-    }
-    if ((key_OR_range is KeyRange || key_OR_range == null) && !?direction) {
-      return _openKeyCursor_2(key_OR_range);
-    }
     if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is String || direction == null)) {
-      return _openKeyCursor_3(key_OR_range, direction);
-    }
-    if (?key_OR_range && !?direction) {
-      return _openKeyCursor_4(key_OR_range);
+      return _openKeyCursor_1(key_OR_range, direction);
     }
     if (?key_OR_range && (direction is String || direction == null)) {
-      return _openKeyCursor_5(key_OR_range, direction);
+      return _openKeyCursor_2(key_OR_range, direction);
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
   @DomName('IDBIndex._openKeyCursor_1')
   @DocsEditable
-  Request _openKeyCursor_1() native "IDBIndex__openKeyCursor_1_Callback";
+  Request _openKeyCursor_1(key_OR_range, direction) native "IDBIndex__openKeyCursor_1_Callback";
 
   @DomName('IDBIndex._openKeyCursor_2')
   @DocsEditable
-  Request _openKeyCursor_2(key_OR_range) native "IDBIndex__openKeyCursor_2_Callback";
-
-  @DomName('IDBIndex._openKeyCursor_3')
-  @DocsEditable
-  Request _openKeyCursor_3(key_OR_range, direction) native "IDBIndex__openKeyCursor_3_Callback";
-
-  @DomName('IDBIndex._openKeyCursor_4')
-  @DocsEditable
-  Request _openKeyCursor_4(key_OR_range) native "IDBIndex__openKeyCursor_4_Callback";
-
-  @DomName('IDBIndex._openKeyCursor_5')
-  @DocsEditable
-  Request _openKeyCursor_5(key_OR_range, direction) native "IDBIndex__openKeyCursor_5_Callback";
+  Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCursor_2_Callback";
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -673,61 +611,21 @@
   @DocsEditable
   bool get upperOpen native "IDBKeyRange_upperOpen_Getter";
 
-  static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upperOpen]) {
-    if (?upperOpen) {
-      return _bound_1(lower, upper, lowerOpen, upperOpen);
-    }
-    if (?lowerOpen) {
-      return _bound_2(lower, upper, lowerOpen);
-    }
-    return _bound_3(lower, upper);
-  }
-
-  @DomName('IDBKeyRange._bound_1')
+  @DomName('IDBKeyRange.bound_')
   @DocsEditable
-  static KeyRange _bound_1(lower, upper, lowerOpen, upperOpen) native "IDBKeyRange__bound_1_Callback";
+  static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upperOpen]) native "IDBKeyRange_bound__Callback";
 
-  @DomName('IDBKeyRange._bound_2')
+  @DomName('IDBKeyRange.lowerBound_')
   @DocsEditable
-  static KeyRange _bound_2(lower, upper, lowerOpen) native "IDBKeyRange__bound_2_Callback";
-
-  @DomName('IDBKeyRange._bound_3')
-  @DocsEditable
-  static KeyRange _bound_3(lower, upper) native "IDBKeyRange__bound_3_Callback";
-
-  static KeyRange lowerBound_(Object bound, [bool open]) {
-    if (?open) {
-      return _lowerBound_1(bound, open);
-    }
-    return _lowerBound_2(bound);
-  }
-
-  @DomName('IDBKeyRange._lowerBound_1')
-  @DocsEditable
-  static KeyRange _lowerBound_1(bound, open) native "IDBKeyRange__lowerBound_1_Callback";
-
-  @DomName('IDBKeyRange._lowerBound_2')
-  @DocsEditable
-  static KeyRange _lowerBound_2(bound) native "IDBKeyRange__lowerBound_2_Callback";
+  static KeyRange lowerBound_(Object bound, [bool open]) native "IDBKeyRange_lowerBound__Callback";
 
   @DomName('IDBKeyRange.only_')
   @DocsEditable
   static KeyRange only_(Object value) native "IDBKeyRange_only__Callback";
 
-  static KeyRange upperBound_(Object bound, [bool open]) {
-    if (?open) {
-      return _upperBound_1(bound, open);
-    }
-    return _upperBound_2(bound);
-  }
-
-  @DomName('IDBKeyRange._upperBound_1')
+  @DomName('IDBKeyRange.upperBound_')
   @DocsEditable
-  static KeyRange _upperBound_1(bound, open) native "IDBKeyRange__upperBound_1_Callback";
-
-  @DomName('IDBKeyRange._upperBound_2')
-  @DocsEditable
-  static KeyRange _upperBound_2(bound) native "IDBKeyRange__upperBound_2_Callback";
+  static KeyRange upperBound_(Object bound, [bool open]) native "IDBKeyRange_upperBound__Callback";
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -891,50 +789,32 @@
   @DocsEditable
   Transaction get transaction native "IDBObjectStore_transaction_Getter";
 
-  Request $dom_add(Object value, [Object key]) {
-    if (?key) {
-      return _add_1(value, key);
-    }
-    return _add_2(value);
-  }
-
-  @DomName('IDBObjectStore._add_1')
+  @DomName('IDBObjectStore.add')
   @DocsEditable
-  Request _add_1(value, key) native "IDBObjectStore__add_1_Callback";
-
-  @DomName('IDBObjectStore._add_2')
-  @DocsEditable
-  Request _add_2(value) native "IDBObjectStore__add_2_Callback";
+  Request $dom_add(Object value, [Object key]) native "IDBObjectStore_add_Callback";
 
   @DomName('IDBObjectStore.clear')
   @DocsEditable
   Request $dom_clear() native "IDBObjectStore_clear_Callback";
 
   Request $dom_count([key_OR_range]) {
-    if (!?key_OR_range) {
-      return _count_1();
-    }
     if ((key_OR_range is KeyRange || key_OR_range == null)) {
-      return _count_2(key_OR_range);
+      return _count_1(key_OR_range);
     }
     if (?key_OR_range) {
-      return _count_3(key_OR_range);
+      return _count_2(key_OR_range);
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
   @DomName('IDBObjectStore._count_1')
   @DocsEditable
-  Request _count_1() native "IDBObjectStore__count_1_Callback";
+  Request _count_1(key_OR_range) native "IDBObjectStore__count_1_Callback";
 
   @DomName('IDBObjectStore._count_2')
   @DocsEditable
   Request _count_2(key_OR_range) native "IDBObjectStore__count_2_Callback";
 
-  @DomName('IDBObjectStore._count_3')
-  @DocsEditable
-  Request _count_3(key_OR_range) native "IDBObjectStore__count_3_Callback";
-
   Index $dom_createIndex(String name, keyPath, [Map options]) {
     if ((name is String || name == null) && (keyPath is List<String> || keyPath == null) && (options is Map || options == null)) {
       return _createIndex_1(name, keyPath, options);
@@ -998,58 +878,26 @@
   Index index(String name) native "IDBObjectStore_index_Callback";
 
   Request $dom_openCursor([key_OR_range, String direction]) {
-    if (!?key_OR_range && !?direction) {
-      return _openCursor_1();
-    }
-    if ((key_OR_range is KeyRange || key_OR_range == null) && !?direction) {
-      return _openCursor_2(key_OR_range);
-    }
     if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is String || direction == null)) {
-      return _openCursor_3(key_OR_range, direction);
-    }
-    if (?key_OR_range && !?direction) {
-      return _openCursor_4(key_OR_range);
+      return _openCursor_1(key_OR_range, direction);
     }
     if (?key_OR_range && (direction is String || direction == null)) {
-      return _openCursor_5(key_OR_range, direction);
+      return _openCursor_2(key_OR_range, direction);
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
   @DomName('IDBObjectStore._openCursor_1')
   @DocsEditable
-  Request _openCursor_1() native "IDBObjectStore__openCursor_1_Callback";
+  Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCursor_1_Callback";
 
   @DomName('IDBObjectStore._openCursor_2')
   @DocsEditable
-  Request _openCursor_2(key_OR_range) native "IDBObjectStore__openCursor_2_Callback";
+  Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCursor_2_Callback";
 
-  @DomName('IDBObjectStore._openCursor_3')
+  @DomName('IDBObjectStore.put')
   @DocsEditable
-  Request _openCursor_3(key_OR_range, direction) native "IDBObjectStore__openCursor_3_Callback";
-
-  @DomName('IDBObjectStore._openCursor_4')
-  @DocsEditable
-  Request _openCursor_4(key_OR_range) native "IDBObjectStore__openCursor_4_Callback";
-
-  @DomName('IDBObjectStore._openCursor_5')
-  @DocsEditable
-  Request _openCursor_5(key_OR_range, direction) native "IDBObjectStore__openCursor_5_Callback";
-
-  Request $dom_put(Object value, [Object key]) {
-    if (?key) {
-      return _put_1(value, key);
-    }
-    return _put_2(value);
-  }
-
-  @DomName('IDBObjectStore._put_1')
-  @DocsEditable
-  Request _put_1(value, key) native "IDBObjectStore__put_1_Callback";
-
-  @DomName('IDBObjectStore._put_2')
-  @DocsEditable
-  Request _put_2(value) native "IDBObjectStore__put_2_Callback";
+  Request $dom_put(Object value, [Object key]) native "IDBObjectStore_put_Callback";
 
 
   /**
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index bacd50e..853b858 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -393,6 +393,11 @@
    * Gets and sets the persistent connection header value.
    */
   bool persistentConnection;
+
+  /**
+   * Gets and sets the chunked transfer encoding header value.
+   */
+  bool chunkedTransferEncoding;
 }
 
 
diff --git a/sdk/lib/io/http_body.dart b/sdk/lib/io/http_body.dart
index 809075e..7a8a494 100644
--- a/sdk/lib/io/http_body.dart
+++ b/sdk/lib/io/http_body.dart
@@ -39,7 +39,9 @@
  */
 class HttpBodyHandler
     implements StreamTransformer<HttpRequest, HttpRequestBody> {
-  factory HttpBodyHandler() => new _HttpBodyHandler();
+  var _transformer;
+
+  HttpBodyHandler() : _transformer = new _HttpBodyHandlerTransformer();
 
   /**
    * Process and parse an incoming [HttpRequest]. The returned [HttpRequestBody]
@@ -56,6 +58,10 @@
       HttpClientResponse response) {
     return _HttpBodyHandler.processResponse(response);
   }
+
+  Stream<HttpRequestBody> bind(Stream<HttpRequest> stream) {
+    return _transformer.bind(stream);
+  }
 }
 
 
diff --git a/sdk/lib/io/http_body_impl.dart b/sdk/lib/io/http_body_impl.dart
index 214daa3..095b74e 100644
--- a/sdk/lib/io/http_body_impl.dart
+++ b/sdk/lib/io/http_body_impl.dart
@@ -12,11 +12,7 @@
   }
 }
 
-class _HttpBodyHandler implements HttpBodyHandler {
-  Stream<HttpRequestBody> bind(Stream<HttpRequest> stream) {
-    return new _HttpBodyHandlerTransformer().bind(stream);
-  }
-
+class _HttpBodyHandler {
   static Future<HttpRequestBody> processRequest(HttpRequest request) {
     return process(request, request.headers)
         .then((body) => new _HttpRequestBody(request, body),
@@ -110,13 +106,15 @@
 
 class _HttpClientResponseBody
     extends _HttpBody implements HttpClientResponseBody {
-  final int statusCode;
-  final String reasonPhrase;
-  final HttpHeaders headers;
+  final HttpClientResponse response;
 
   _HttpClientResponseBody(HttpClientResponse response, HttpBody body)
       : super(body.mimeType, body.type, body.body),
-        statusCode = response.statusCode,
-        reasonPhrase = response.reasonPhrase,
-        headers = response.headers;
+        this.response = response;
+
+  int get statusCode => response.statusCode;
+
+  String get reasonPhrase => response.reasonPhrase;
+
+  HttpHeaders get headers => response.headers;
 }
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index d9db3fd..fb9f009 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1838,7 +1838,7 @@
 
   int get port => _socket.port;
 
-  String get host => _socket.host;
+  InternetAddress get address => _socket.address;
 
   String get remoteHost => _socket.remoteHost;
 
diff --git a/sdk/lib/io/io.dart b/sdk/lib/io/io.dart
index ac08c0a..2d7000f 100644
--- a/sdk/lib/io/io.dart
+++ b/sdk/lib/io/io.dart
@@ -23,7 +23,7 @@
 import 'dart:math';
 import 'dart:uri';
 import 'dart:utf';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 part 'base64.dart';
 part 'buffer_list.dart';
@@ -36,6 +36,8 @@
 part 'file_impl.dart';
 part 'file_system_entity.dart';
 part 'http.dart';
+part 'http_body.dart';
+part 'http_body_impl.dart';
 part 'http_headers.dart';
 part 'http_impl.dart';
 part 'http_parser.dart';
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 26bbf12..db82ea4 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -35,7 +35,7 @@
    * to continue the [SecureSocket] connection.
    */
   static Future<SecureSocket> connect(
-      String host,
+      host,
       int port,
       {bool sendClientCertificate: false,
        String certificateName,
@@ -49,6 +49,85 @@
   }
 
   /**
+   * Takes an already connected [socket] and starts client side TLS
+   * handshake to make the communication secure. When the returned
+   * future completes the [SecureSocket] has completed the TLS
+   * handshake. Using this function requires that the other end of the
+   * connection is prepared for TLS handshake.
+   *
+   * If the [socket] already has a subscription, this subscription
+   * will no longer receive and events. In most cases calling
+   * [:pause:] on this subscription before starting TLS handshake is
+   * the right thing to do.
+   *
+   * See [connect] for more information on the arguments.
+   *
+   */
+  static Future<SecureSocket> secure(
+      Socket socket,
+      {bool sendClientCertificate: false,
+       String certificateName,
+       bool onBadCertificate(X509Certificate certificate)}) {
+    var completer = new Completer();
+    (socket as dynamic)._detachRaw()
+        .then((detachedRaw) {
+          return RawSecureSocket.secure(
+            detachedRaw[0],
+            subscription: detachedRaw[1],
+            sendClientCertificate: sendClientCertificate,
+            onBadCertificate: onBadCertificate);
+          })
+        .then((raw) {
+          completer.complete(new SecureSocket._(raw));
+        });
+    return completer.future;
+  }
+
+  /**
+   * Takes an already connected [socket] and starts server side TLS
+   * handshake to make the communication secure. When the returned
+   * future completes the [SecureSocket] has completed the TLS
+   * handshake. Using this function requires that the other end of the
+   * connection is going to start the TLS handshake.
+   *
+   * If the [socket] already has a subscription, this subscription
+   * will no longer receive and events. In most cases calling
+   * [:pause:] on this subscription before starting TLS handshake is
+   * the right thing to do.
+   *
+   * If some of the data of the TLS handshake has already been read
+   * from the socket this data can be passed in the [carryOverData]
+   * parameter. This data will be processed before any other data
+   * available on the socket.
+   *
+   * See [SecureServerSocket.bind] for more information on the
+   * arguments.
+   *
+   */
+  static Future<SecureSocket> secureServer(
+      Socket socket,
+      String certificateName,
+      {List<int> carryOverData,
+       bool requestClientCertificate: false,
+       bool requireClientCertificate: false}) {
+    var completer = new Completer();
+    (socket as dynamic)._detachRaw()
+        .then((detachedRaw) {
+          return RawSecureSocket.secureServer(
+            detachedRaw[0],
+            certificateName,
+            subscription: detachedRaw[1],
+            carryOverData: carryOverData,
+            requestClientCertificate: requestClientCertificate,
+            requireClientCertificate: requireClientCertificate);
+          })
+        .then((raw) {
+          completer.complete(new SecureSocket._(raw));
+        });
+    return completer.future;
+  }
+
+  /**
    * Get the peer certificate for a connected SecureSocket.  If this
    * SecureSocket is the server end of a secure socket connection,
    * [peerCertificate] will return the client certificate, or null, if no
@@ -129,7 +208,7 @@
    * to continue the [RawSecureSocket] connection.
    */
   static Future<RawSecureSocket> connect(
-      String host,
+      host,
       int port,
       {bool sendClientCertificate: false,
        String certificateName,
@@ -165,7 +244,7 @@
        String certificateName,
        bool onBadCertificate(X509Certificate certificate)}) {
     return  _RawSecureSocket.connect(
-        socket.host,
+        socket.address,
         socket.port,
         certificateName,
         is_server: false,
@@ -266,7 +345,7 @@
   StreamSubscription<RawSocketEvent> _socketSubscription;
   List<int> _carryOverData;
   int _carryOverDataIndex = 0;
-  final String host;
+  final InternetAddress address;
   final bool is_server;
   final String certificateName;
   final bool requestClientCertificate;
@@ -287,7 +366,7 @@
   _SecureFilter _secureFilter = new _SecureFilter();
 
   static Future<_RawSecureSocket> connect(
-      String host,
+      host,
       int requestedPort,
       String certificateName,
       {bool is_server,
@@ -297,8 +376,15 @@
        bool requestClientCertificate: false,
        bool requireClientCertificate: false,
        bool sendClientCertificate: false,
-       bool onBadCertificate(X509Certificate certificate)}){
-     return new _RawSecureSocket(host,
+       bool onBadCertificate(X509Certificate certificate)}) {
+    var future;
+    if (host is String) {
+      future = InternetAddress.lookup(host).then((addrs) => addrs.first);
+    } else {
+      future = new Future.value(host);
+    }
+    return future.then((addr) {
+     return new _RawSecureSocket(addr,
                                  requestedPort,
                                  certificateName,
                                  is_server,
@@ -310,10 +396,11 @@
                                  sendClientCertificate,
                                  onBadCertificate)
          ._handshakeComplete.future;
+    });
   }
 
   _RawSecureSocket(
-      String this.host,
+      InternetAddress this.address,
       int requestedPort,
       String this.certificateName,
       bool this.is_server,
@@ -342,7 +429,7 @@
     }
     var futureSocket;
     if (socket == null) {
-      futureSocket = RawSocket.connect(host, requestedPort);
+      futureSocket = RawSocket.connect(address, requestedPort);
     } else {
       futureSocket = new Future.value(socket);
     }
@@ -362,7 +449,7 @@
         _socketSubscription.onDone(_doneHandler);
       }
       _connectPending = true;
-      _secureFilter.connect(host,
+      _secureFilter.connect(rawSocket.address.host,
                             port,
                             is_server,
                             certificateName,
@@ -396,9 +483,9 @@
   void _verifyFields() {
     assert(is_server is bool);
     assert(_socket == null || _socket is RawSocket);
-    if (host is! String) {
+    if (address is! InternetAddress) {
       throw new ArgumentError(
-          "RawSecureSocket constructor: host is not a String");
+          "RawSecureSocket constructor: host is not an InternetAddress");
     }
     if (certificateName != null && certificateName is! String) {
       throw new ArgumentError("certificateName is not null or a String");
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index b8be4d6..344b0a9 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -4,6 +4,73 @@
 
 part of dart.io;
 
+
+/**
+ * [InternetAddressType] is the type an [InternetAddress]. Currently, IPv4 and
+ * IPv6 are supported.
+ */
+class InternetAddressType {
+  static const InternetAddressType IPv4 = const InternetAddressType._(0);
+  static const InternetAddressType IPv6 = const InternetAddressType._(1);
+  static const InternetAddressType ANY = const InternetAddressType._(-1);
+
+  final int _value;
+
+  const InternetAddressType._(int this._value);
+
+  factory InternetAddressType._from(int value) {
+    if (value == 0) return IPv4;
+    if (value == 1) return IPv6;
+    throw new ArgumentError("Invalid type: $value");
+  }
+
+  /**
+   * Get the name of the type, e.g. "IPv4" or "IPv6".
+   */
+  String get name {
+    switch (_value) {
+      case -1: return "ANY";
+      case 0: return "IPv4";
+      case 1: return "IPv6";
+      default: throw new ArgumentError("Invalid InternetAddress");
+    }
+  }
+
+  String toString() => "InternetAddressType($name)";
+}
+
+
+/**
+ * The [InternetAddress] is an object reflecting either a remote or a local
+ * address, for wich a socket can be connected to or bound on.
+ *
+ */
+abstract class InternetAddress {
+  /**
+   * The [type] of the [InternetAddress] specified what IP procotol.
+   */
+  InternetAddressType type;
+
+  /**
+   * The resolved address of the host.
+   */
+  String get address;
+
+  /**
+   * The host used to lookup the address.
+   */
+  String get host;
+
+  /**
+   * Lookup a host, returning a Future of a list of [InternetAddress]s. If
+   * [type] is [InternetAddressType.ANY], it will lookup both IPv4 and IPv6
+   * addresses. The order of the list depends on the local machine and the DNS
+   * lookup performed, and can as such change over time.
+   */
+  external static Future<List<InternetAddress>> lookup(
+      String host, {InternetAddressType type: InternetAddressType.IPv4});
+}
+
 /**
  * The RawServerSocket is a server socket, providing a stream of low-level
  * [RawSocket]s.
@@ -31,9 +98,9 @@
    * value of [:0:] (the default) a reasonable value will be chosen by
    * the system.
    */
-  external static Future<RawServerSocket> bind([String address = "127.0.0.1",
-                                               int port = 0,
-                                               int backlog = 0]);
+  external static Future<RawServerSocket> bind([address = "127.0.0.1",
+                                                int port = 0,
+                                                int backlog = 0]);
 
   /**
    * Returns the port used by this socket.
@@ -74,7 +141,7 @@
    * value of [:0:] (the default) a reasonable value will be chosen by
    * the system.
    */
-  external static Future<ServerSocket> bind([String address = "127.0.0.1",
+  external static Future<ServerSocket> bind([address = "127.0.0.1",
                                              int port = 0,
                                              int backlog = 0]);
 
@@ -144,8 +211,12 @@
    * Creates a new socket connection to the host and port and returns a [Future]
    * that will complete with either a [RawSocket] once connected or an error
    * if the host-lookup or connection failed.
+   *
+   * [host] can either be a [String] or an [InternetAddress]. If [host] is a
+   * [String], [connect] will perform a [InternetAddress.lookup] and use
+   * the first value in the list.
    */
-  external static Future<RawSocket> connect(String host, int port);
+  external static Future<RawSocket> connect(host, int port);
 
   /**
    * Returns the number of received and non-read bytes in the socket that
@@ -181,9 +252,9 @@
   int get remotePort;
 
   /**
-   * Returns the host used to connect this socket.
+   * Returns the [InternetAddress] used to connect this socket.
    */
-  String get host;
+  InternetAddress get address;
 
   /**
    * Returns the remote host connected to by this socket.
@@ -238,8 +309,12 @@
    * Creats 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.
+   *
+   * [host] can either be a [String] or an [InternetAddress]. If [host] is a
+   * [String], [connect] will perform a [InternetAddress.lookup] and use
+   * the first value in the list.
    */
-  external static Future<Socket> connect(String host, int port);
+  external static Future<Socket> connect(host, int port);
 
   /**
    * Destroy the socket in both directions. Calling [destroy] will make the
@@ -270,9 +345,9 @@
   int get remotePort;
 
   /**
-   * Returns the host used to connect this socket.
+   * Returns the [InternetAddress] used to connect this socket.
    */
-  String get host;
+  InternetAddress get address;
 
   /**
    * Returns the remote host connected to by this socket.
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index 12c06a2..86bbce1 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.dart
@@ -16,6 +16,7 @@
 
 import 'dart:async';
 import 'dart:isolate';
+import 'dart:uri';
 
 /**
  * A [MirrorSystem] is the main interface used to reflect on a set of
@@ -34,8 +35,16 @@
    * An immutable map from from library names to mirrors for all
    * libraries known to this mirror system.
    */
-  // TODO(ahe): [libraries] should be Map<Uri, LibraryMirror>.
-  Map<Symbol, LibraryMirror> get libraries;
+  Map<Uri, LibraryMirror> get libraries;
+
+  /**
+   * Returns an iterable of all libraries in the mirror system whose library
+   * name is [libraryName].
+   */
+  Iterable<LibraryMirror> findLibrary(Symbol libraryName) {
+    return libraries.values.where(
+        (library) => library.simpleName == libraryName);
+  }
 
   /**
    * A mirror on the isolate associated with this [MirrorSystem].
@@ -336,13 +345,9 @@
  */
 abstract class LibraryMirror implements DeclarationMirror, ObjectMirror {
   /**
-   * The url of the library.
-   *
-   * TODO(turnidge): Document where this url comes from.  Will this
-   * value be sensible?
+   * The absolute uri of the library.
    */
-  // TODO(ahe): Change type to [Uri], rename to "uri"?
-  String get url;
+  Uri get uri;
 
   /**
    * An immutable map from from names to mirrors for all members in
diff --git a/sdk/lib/svg/dart2js/svg_dart2js.dart b/sdk/lib/svg/dart2js/svg_dart2js.dart
index 999864a..c562e43 100644
--- a/sdk/lib/svg/dart2js/svg_dart2js.dart
+++ b/sdk/lib/svg/dart2js/svg_dart2js.dart
@@ -63,7 +63,7 @@
 
 @DocsEditable
 @DomName('SVGAElement')
-class AElement extends StyledElement implements UriReference, Tests, Transformable, ExternalResourcesRequired, LangSpace native "*SVGAElement" {
+class AElement extends StyledElement implements UriReference, Tests, Transformable, ExternalResourcesRequired, LangSpace native "SVGAElement" {
 
   @DomName('SVGAElement.SVGAElement')
   @DocsEditable
@@ -157,7 +157,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class AltGlyphElement extends TextPositioningElement implements UriReference native "*SVGAltGlyphElement" {
+class AltGlyphElement extends TextPositioningElement implements UriReference native "SVGAltGlyphElement" {
 
   @DomName('SVGAltGlyphElement.SVGAltGlyphElement')
   @DocsEditable
@@ -187,7 +187,7 @@
 
 @DocsEditable
 @DomName('SVGAngle')
-class Angle native "*SVGAngle" {
+class Angle native "SVGAngle" {
 
   static const int SVG_ANGLETYPE_DEG = 2;
 
@@ -233,7 +233,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class AnimateElement extends AnimationElement native "*SVGAnimateElement" {
+class AnimateElement extends AnimationElement native "SVGAnimateElement" {
 
   @DomName('SVGAnimateElement.SVGAnimateElement')
   @DocsEditable
@@ -252,7 +252,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class AnimateMotionElement extends AnimationElement native "*SVGAnimateMotionElement" {
+class AnimateMotionElement extends AnimationElement native "SVGAnimateMotionElement" {
 
   @DomName('SVGAnimateMotionElement.SVGAnimateMotionElement')
   @DocsEditable
@@ -271,7 +271,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class AnimateTransformElement extends AnimationElement native "*SVGAnimateTransformElement" {
+class AnimateTransformElement extends AnimationElement native "SVGAnimateTransformElement" {
 
   @DomName('SVGAnimateTransformElement.SVGAnimateTransformElement')
   @DocsEditable
@@ -287,7 +287,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedAngle')
-class AnimatedAngle native "*SVGAnimatedAngle" {
+class AnimatedAngle native "SVGAnimatedAngle" {
 
   @DomName('SVGAnimatedAngle.animVal')
   @DocsEditable
@@ -304,7 +304,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedBoolean')
-class AnimatedBoolean native "*SVGAnimatedBoolean" {
+class AnimatedBoolean native "SVGAnimatedBoolean" {
 
   @DomName('SVGAnimatedBoolean.animVal')
   @DocsEditable
@@ -321,7 +321,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedEnumeration')
-class AnimatedEnumeration native "*SVGAnimatedEnumeration" {
+class AnimatedEnumeration native "SVGAnimatedEnumeration" {
 
   @DomName('SVGAnimatedEnumeration.animVal')
   @DocsEditable
@@ -338,7 +338,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedInteger')
-class AnimatedInteger native "*SVGAnimatedInteger" {
+class AnimatedInteger native "SVGAnimatedInteger" {
 
   @DomName('SVGAnimatedInteger.animVal')
   @DocsEditable
@@ -355,7 +355,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedLength')
-class AnimatedLength native "*SVGAnimatedLength" {
+class AnimatedLength native "SVGAnimatedLength" {
 
   @DomName('SVGAnimatedLength.animVal')
   @DocsEditable
@@ -372,7 +372,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedLengthList')
-class AnimatedLengthList native "*SVGAnimatedLengthList" {
+class AnimatedLengthList native "SVGAnimatedLengthList" {
 
   @DomName('SVGAnimatedLengthList.animVal')
   @DocsEditable
@@ -389,7 +389,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedNumber')
-class AnimatedNumber native "*SVGAnimatedNumber" {
+class AnimatedNumber native "SVGAnimatedNumber" {
 
   @DomName('SVGAnimatedNumber.animVal')
   @DocsEditable
@@ -406,7 +406,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedNumberList')
-class AnimatedNumberList native "*SVGAnimatedNumberList" {
+class AnimatedNumberList native "SVGAnimatedNumberList" {
 
   @DomName('SVGAnimatedNumberList.animVal')
   @DocsEditable
@@ -423,7 +423,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedPreserveAspectRatio')
-class AnimatedPreserveAspectRatio native "*SVGAnimatedPreserveAspectRatio" {
+class AnimatedPreserveAspectRatio native "SVGAnimatedPreserveAspectRatio" {
 
   @DomName('SVGAnimatedPreserveAspectRatio.animVal')
   @DocsEditable
@@ -440,7 +440,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedRect')
-class AnimatedRect native "*SVGAnimatedRect" {
+class AnimatedRect native "SVGAnimatedRect" {
 
   @DomName('SVGAnimatedRect.animVal')
   @DocsEditable
@@ -457,7 +457,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedString')
-class AnimatedString native "*SVGAnimatedString" {
+class AnimatedString native "SVGAnimatedString" {
 
   @DomName('SVGAnimatedString.animVal')
   @DocsEditable
@@ -474,7 +474,7 @@
 
 @DocsEditable
 @DomName('SVGAnimatedTransformList')
-class AnimatedTransformList native "*SVGAnimatedTransformList" {
+class AnimatedTransformList native "SVGAnimatedTransformList" {
 
   @DomName('SVGAnimatedTransformList.animVal')
   @DocsEditable
@@ -491,7 +491,7 @@
 
 @DocsEditable
 @DomName('SVGAnimationElement')
-class AnimationElement extends SvgElement implements Tests, ElementTimeControl, ExternalResourcesRequired native "*SVGAnimationElement" {
+class AnimationElement extends SvgElement implements Tests, ElementTimeControl, ExternalResourcesRequired native "SVGAnimationElement" {
 
   @DomName('SVGAnimationElement.SVGAnimationElement')
   @DocsEditable
@@ -562,7 +562,7 @@
 
 @DocsEditable
 @DomName('SVGCircleElement')
-class CircleElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGCircleElement" {
+class CircleElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGCircleElement" {
 
   @DomName('SVGCircleElement.SVGCircleElement')
   @DocsEditable
@@ -655,7 +655,7 @@
 
 @DocsEditable
 @DomName('SVGClipPathElement')
-class ClipPathElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGClipPathElement" {
+class ClipPathElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGClipPathElement" {
 
   @DomName('SVGClipPathElement.SVGClipPathElement')
   @DocsEditable
@@ -740,7 +740,7 @@
 
 @DocsEditable
 @DomName('SVGDefsElement')
-class DefsElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGDefsElement" {
+class DefsElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGDefsElement" {
 
   @DomName('SVGDefsElement.SVGDefsElement')
   @DocsEditable
@@ -821,7 +821,7 @@
 
 @DocsEditable
 @DomName('SVGDescElement')
-class DescElement extends StyledElement implements LangSpace native "*SVGDescElement" {
+class DescElement extends StyledElement implements LangSpace native "SVGDescElement" {
 
   @DomName('SVGDescElement.SVGDescElement')
   @DocsEditable
@@ -844,7 +844,7 @@
 
 @DocsEditable
 @DomName('SVGElementInstance')
-class ElementInstance extends EventTarget native "*SVGElementInstance" {
+class ElementInstance extends EventTarget native "SVGElementInstance" {
 
   @DomName('SVGElementInstance.abortEvent')
   @DocsEditable
@@ -1223,7 +1223,7 @@
 
 @DocsEditable
 @DomName('SVGEllipseElement')
-class EllipseElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGEllipseElement" {
+class EllipseElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGEllipseElement" {
 
   @DomName('SVGEllipseElement.SVGEllipseElement')
   @DocsEditable
@@ -1337,7 +1337,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEBlendElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEBlendElement" {
+class FEBlendElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEBlendElement" {
 
   @DomName('SVGFEBlendElement.SVGFEBlendElement')
   @DocsEditable
@@ -1403,7 +1403,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEColorMatrixElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEColorMatrixElement" {
+class FEColorMatrixElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEColorMatrixElement" {
 
   @DomName('SVGFEColorMatrixElement.SVGFEColorMatrixElement')
   @DocsEditable
@@ -1467,7 +1467,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEComponentTransferElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEComponentTransferElement" {
+class FEComponentTransferElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEComponentTransferElement" {
 
   @DomName('SVGFEComponentTransferElement.SVGFEComponentTransferElement')
   @DocsEditable
@@ -1509,7 +1509,7 @@
 
 @DocsEditable
 @DomName('SVGFECompositeElement')
-class FECompositeElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFECompositeElement" {
+class FECompositeElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFECompositeElement" {
 
   static const int SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;
 
@@ -1586,7 +1586,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEConvolveMatrixElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEConvolveMatrixElement" {
+class FEConvolveMatrixElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEConvolveMatrixElement" {
 
   @DomName('SVGFEConvolveMatrixElement.SVGFEConvolveMatrixElement')
   @DocsEditable
@@ -1684,7 +1684,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEDiffuseLightingElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEDiffuseLightingElement" {
+class FEDiffuseLightingElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEDiffuseLightingElement" {
 
   @DomName('SVGFEDiffuseLightingElement.SVGFEDiffuseLightingElement')
   @DocsEditable
@@ -1746,7 +1746,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEDisplacementMapElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEDisplacementMapElement" {
+class FEDisplacementMapElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEDisplacementMapElement" {
 
   @DomName('SVGFEDisplacementMapElement.SVGFEDisplacementMapElement')
   @DocsEditable
@@ -1818,7 +1818,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEDistantLightElement extends SvgElement native "*SVGFEDistantLightElement" {
+class FEDistantLightElement extends SvgElement native "SVGFEDistantLightElement" {
 
   @DomName('SVGFEDistantLightElement.SVGFEDistantLightElement')
   @DocsEditable
@@ -1846,7 +1846,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEFloodElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEFloodElement" {
+class FEFloodElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEFloodElement" {
 
   @DomName('SVGFEFloodElement.SVGFEFloodElement')
   @DocsEditable
@@ -1888,7 +1888,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEFuncAElement extends _SVGComponentTransferFunctionElement native "*SVGFEFuncAElement" {
+class FEFuncAElement extends _SVGComponentTransferFunctionElement native "SVGFEFuncAElement" {
 
   @DomName('SVGFEFuncAElement.SVGFEFuncAElement')
   @DocsEditable
@@ -1908,7 +1908,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEFuncBElement extends _SVGComponentTransferFunctionElement native "*SVGFEFuncBElement" {
+class FEFuncBElement extends _SVGComponentTransferFunctionElement native "SVGFEFuncBElement" {
 
   @DomName('SVGFEFuncBElement.SVGFEFuncBElement')
   @DocsEditable
@@ -1928,7 +1928,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEFuncGElement extends _SVGComponentTransferFunctionElement native "*SVGFEFuncGElement" {
+class FEFuncGElement extends _SVGComponentTransferFunctionElement native "SVGFEFuncGElement" {
 
   @DomName('SVGFEFuncGElement.SVGFEFuncGElement')
   @DocsEditable
@@ -1948,7 +1948,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEFuncRElement extends _SVGComponentTransferFunctionElement native "*SVGFEFuncRElement" {
+class FEFuncRElement extends _SVGComponentTransferFunctionElement native "SVGFEFuncRElement" {
 
   @DomName('SVGFEFuncRElement.SVGFEFuncRElement')
   @DocsEditable
@@ -1968,7 +1968,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEGaussianBlurElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEGaussianBlurElement" {
+class FEGaussianBlurElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEGaussianBlurElement" {
 
   @DomName('SVGFEGaussianBlurElement.SVGFEGaussianBlurElement')
   @DocsEditable
@@ -2026,7 +2026,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEImageElement extends StyledElement implements FilterPrimitiveStandardAttributes, UriReference, ExternalResourcesRequired, LangSpace native "*SVGFEImageElement" {
+class FEImageElement extends StyledElement implements FilterPrimitiveStandardAttributes, UriReference, ExternalResourcesRequired, LangSpace native "SVGFEImageElement" {
 
   @DomName('SVGFEImageElement.SVGFEImageElement')
   @DocsEditable
@@ -2094,7 +2094,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEMergeElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEMergeElement" {
+class FEMergeElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEMergeElement" {
 
   @DomName('SVGFEMergeElement.SVGFEMergeElement')
   @DocsEditable
@@ -2136,7 +2136,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEMergeNodeElement extends SvgElement native "*SVGFEMergeNodeElement" {
+class FEMergeNodeElement extends SvgElement native "SVGFEMergeNodeElement" {
 
   @DomName('SVGFEMergeNodeElement.SVGFEMergeNodeElement')
   @DocsEditable
@@ -2160,7 +2160,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEMorphologyElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEMorphologyElement" {
+class FEMorphologyElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEMorphologyElement" {
 
   static const int SVG_MORPHOLOGY_OPERATOR_DILATE = 2;
 
@@ -2221,7 +2221,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEOffsetElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEOffsetElement" {
+class FEOffsetElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEOffsetElement" {
 
   @DomName('SVGFEOffsetElement.SVGFEOffsetElement')
   @DocsEditable
@@ -2275,7 +2275,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FEPointLightElement extends SvgElement native "*SVGFEPointLightElement" {
+class FEPointLightElement extends SvgElement native "SVGFEPointLightElement" {
 
   @DomName('SVGFEPointLightElement.SVGFEPointLightElement')
   @DocsEditable
@@ -2307,7 +2307,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FESpecularLightingElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFESpecularLightingElement" {
+class FESpecularLightingElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFESpecularLightingElement" {
 
   @DomName('SVGFESpecularLightingElement.SVGFESpecularLightingElement')
   @DocsEditable
@@ -2365,7 +2365,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FESpotLightElement extends SvgElement native "*SVGFESpotLightElement" {
+class FESpotLightElement extends SvgElement native "SVGFESpotLightElement" {
 
   @DomName('SVGFESpotLightElement.SVGFESpotLightElement')
   @DocsEditable
@@ -2417,7 +2417,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FETileElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFETileElement" {
+class FETileElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFETileElement" {
 
   @DomName('SVGFETileElement.SVGFETileElement')
   @DocsEditable
@@ -2463,7 +2463,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FETurbulenceElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFETurbulenceElement" {
+class FETurbulenceElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFETurbulenceElement" {
 
   @DomName('SVGFETurbulenceElement.SVGFETurbulenceElement')
   @DocsEditable
@@ -2541,7 +2541,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FilterElement extends StyledElement implements UriReference, ExternalResourcesRequired, LangSpace native "*SVGFilterElement" {
+class FilterElement extends StyledElement implements UriReference, ExternalResourcesRequired, LangSpace native "SVGFilterElement" {
 
   @DomName('SVGFilterElement.SVGFilterElement')
   @DocsEditable
@@ -2648,7 +2648,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class ForeignObjectElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGForeignObjectElement" {
+class ForeignObjectElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGForeignObjectElement" {
 
   @DomName('SVGForeignObjectElement.SVGForeignObjectElement')
   @DocsEditable
@@ -2748,7 +2748,7 @@
 
 @DocsEditable
 @DomName('SVGGElement')
-class GElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGGElement" {
+class GElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGGElement" {
 
   @DomName('SVGGElement.SVGGElement')
   @DocsEditable
@@ -2829,7 +2829,7 @@
 
 @DocsEditable
 @DomName('SVGImageElement')
-class ImageElement extends StyledElement implements UriReference, Tests, Transformable, ExternalResourcesRequired, LangSpace native "*SVGImageElement" {
+class ImageElement extends StyledElement implements UriReference, Tests, Transformable, ExternalResourcesRequired, LangSpace native "SVGImageElement" {
 
   @DomName('SVGImageElement.SVGImageElement')
   @DocsEditable
@@ -2951,7 +2951,7 @@
 
 @DocsEditable
 @DomName('SVGLength')
-class Length native "*SVGLength" {
+class Length native "SVGLength" {
 
   static const int SVG_LENGTHTYPE_CM = 6;
 
@@ -3006,7 +3006,7 @@
 
 @DocsEditable
 @DomName('SVGLengthList')
-class LengthList implements JavaScriptIndexingBehavior, List<Length> native "*SVGLengthList" {
+class LengthList implements JavaScriptIndexingBehavior, List<Length> native "SVGLengthList" {
 
   @DomName('SVGLengthList.numberOfItems')
   @DocsEditable
@@ -3164,7 +3164,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -3176,7 +3176,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Length> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Length> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -3247,7 +3247,7 @@
 
 @DocsEditable
 @DomName('SVGLineElement')
-class LineElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGLineElement" {
+class LineElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGLineElement" {
 
   @DomName('SVGLineElement.SVGLineElement')
   @DocsEditable
@@ -3344,7 +3344,7 @@
 
 @DocsEditable
 @DomName('SVGLinearGradientElement')
-class LinearGradientElement extends _GradientElement native "*SVGLinearGradientElement" {
+class LinearGradientElement extends _GradientElement native "SVGLinearGradientElement" {
 
   @DomName('SVGLinearGradientElement.SVGLinearGradientElement')
   @DocsEditable
@@ -3393,7 +3393,7 @@
 
 @DocsEditable
 @DomName('SVGMarkerElement')
-class MarkerElement extends StyledElement implements FitToViewBox, ExternalResourcesRequired, LangSpace native "*SVGMarkerElement" {
+class MarkerElement extends StyledElement implements FitToViewBox, ExternalResourcesRequired, LangSpace native "SVGMarkerElement" {
 
   @DomName('SVGMarkerElement.SVGMarkerElement')
   @DocsEditable
@@ -3480,7 +3480,7 @@
 
 @DocsEditable
 @DomName('SVGMaskElement')
-class MaskElement extends StyledElement implements Tests, ExternalResourcesRequired, LangSpace native "*SVGMaskElement" {
+class MaskElement extends StyledElement implements Tests, ExternalResourcesRequired, LangSpace native "SVGMaskElement" {
 
   @DomName('SVGMaskElement.SVGMaskElement')
   @DocsEditable
@@ -3551,7 +3551,7 @@
 
 @DocsEditable
 @DomName('SVGMatrix')
-class Matrix native "*SVGMatrix" {
+class Matrix native "SVGMatrix" {
 
   @DomName('SVGMatrix.a')
   @DocsEditable
@@ -3628,7 +3628,7 @@
 
 @DocsEditable
 @DomName('SVGMetadataElement')
-class MetadataElement extends SvgElement native "*SVGMetadataElement" {
+class MetadataElement extends SvgElement native "SVGMetadataElement" {
 }
 // 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
@@ -3637,7 +3637,7 @@
 
 @DocsEditable
 @DomName('SVGNumber')
-class Number native "*SVGNumber" {
+class Number native "SVGNumber" {
 
   @DomName('SVGNumber.value')
   @DocsEditable
@@ -3650,7 +3650,7 @@
 
 @DocsEditable
 @DomName('SVGNumberList')
-class NumberList implements JavaScriptIndexingBehavior, List<Number> native "*SVGNumberList" {
+class NumberList implements JavaScriptIndexingBehavior, List<Number> native "SVGNumberList" {
 
   @DomName('SVGNumberList.numberOfItems')
   @DocsEditable
@@ -3808,7 +3808,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -3820,7 +3820,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Number> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Number> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -3891,7 +3891,7 @@
 
 @DocsEditable
 @DomName('SVGPathElement')
-class PathElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGPathElement" {
+class PathElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGPathElement" {
 
   @DomName('SVGPathElement.SVGPathElement')
   @DocsEditable
@@ -4099,7 +4099,7 @@
 
 @DocsEditable
 @DomName('SVGPathSeg')
-class PathSeg native "*SVGPathSeg" {
+class PathSeg native "SVGPathSeg" {
 
   static const int PATHSEG_ARC_ABS = 10;
 
@@ -4156,7 +4156,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegArcAbs')
-class PathSegArcAbs extends PathSeg native "*SVGPathSegArcAbs" {
+class PathSegArcAbs extends PathSeg native "SVGPathSegArcAbs" {
 
   @DomName('SVGPathSegArcAbs.angle')
   @DocsEditable
@@ -4193,7 +4193,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegArcRel')
-class PathSegArcRel extends PathSeg native "*SVGPathSegArcRel" {
+class PathSegArcRel extends PathSeg native "SVGPathSegArcRel" {
 
   @DomName('SVGPathSegArcRel.angle')
   @DocsEditable
@@ -4230,7 +4230,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegClosePath')
-class PathSegClosePath extends PathSeg native "*SVGPathSegClosePath" {
+class PathSegClosePath extends PathSeg native "SVGPathSegClosePath" {
 }
 // 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
@@ -4239,7 +4239,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegCurvetoCubicAbs')
-class PathSegCurvetoCubicAbs extends PathSeg native "*SVGPathSegCurvetoCubicAbs" {
+class PathSegCurvetoCubicAbs extends PathSeg native "SVGPathSegCurvetoCubicAbs" {
 
   @DomName('SVGPathSegCurvetoCubicAbs.x')
   @DocsEditable
@@ -4272,7 +4272,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegCurvetoCubicRel')
-class PathSegCurvetoCubicRel extends PathSeg native "*SVGPathSegCurvetoCubicRel" {
+class PathSegCurvetoCubicRel extends PathSeg native "SVGPathSegCurvetoCubicRel" {
 
   @DomName('SVGPathSegCurvetoCubicRel.x')
   @DocsEditable
@@ -4305,7 +4305,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegCurvetoCubicSmoothAbs')
-class PathSegCurvetoCubicSmoothAbs extends PathSeg native "*SVGPathSegCurvetoCubicSmoothAbs" {
+class PathSegCurvetoCubicSmoothAbs extends PathSeg native "SVGPathSegCurvetoCubicSmoothAbs" {
 
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.x')
   @DocsEditable
@@ -4330,7 +4330,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegCurvetoCubicSmoothRel')
-class PathSegCurvetoCubicSmoothRel extends PathSeg native "*SVGPathSegCurvetoCubicSmoothRel" {
+class PathSegCurvetoCubicSmoothRel extends PathSeg native "SVGPathSegCurvetoCubicSmoothRel" {
 
   @DomName('SVGPathSegCurvetoCubicSmoothRel.x')
   @DocsEditable
@@ -4355,7 +4355,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegCurvetoQuadraticAbs')
-class PathSegCurvetoQuadraticAbs extends PathSeg native "*SVGPathSegCurvetoQuadraticAbs" {
+class PathSegCurvetoQuadraticAbs extends PathSeg native "SVGPathSegCurvetoQuadraticAbs" {
 
   @DomName('SVGPathSegCurvetoQuadraticAbs.x')
   @DocsEditable
@@ -4380,7 +4380,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegCurvetoQuadraticRel')
-class PathSegCurvetoQuadraticRel extends PathSeg native "*SVGPathSegCurvetoQuadraticRel" {
+class PathSegCurvetoQuadraticRel extends PathSeg native "SVGPathSegCurvetoQuadraticRel" {
 
   @DomName('SVGPathSegCurvetoQuadraticRel.x')
   @DocsEditable
@@ -4405,7 +4405,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegCurvetoQuadraticSmoothAbs')
-class PathSegCurvetoQuadraticSmoothAbs extends PathSeg native "*SVGPathSegCurvetoQuadraticSmoothAbs" {
+class PathSegCurvetoQuadraticSmoothAbs extends PathSeg native "SVGPathSegCurvetoQuadraticSmoothAbs" {
 
   @DomName('SVGPathSegCurvetoQuadraticSmoothAbs.x')
   @DocsEditable
@@ -4422,7 +4422,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegCurvetoQuadraticSmoothRel')
-class PathSegCurvetoQuadraticSmoothRel extends PathSeg native "*SVGPathSegCurvetoQuadraticSmoothRel" {
+class PathSegCurvetoQuadraticSmoothRel extends PathSeg native "SVGPathSegCurvetoQuadraticSmoothRel" {
 
   @DomName('SVGPathSegCurvetoQuadraticSmoothRel.x')
   @DocsEditable
@@ -4439,7 +4439,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegLinetoAbs')
-class PathSegLinetoAbs extends PathSeg native "*SVGPathSegLinetoAbs" {
+class PathSegLinetoAbs extends PathSeg native "SVGPathSegLinetoAbs" {
 
   @DomName('SVGPathSegLinetoAbs.x')
   @DocsEditable
@@ -4456,7 +4456,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegLinetoHorizontalAbs')
-class PathSegLinetoHorizontalAbs extends PathSeg native "*SVGPathSegLinetoHorizontalAbs" {
+class PathSegLinetoHorizontalAbs extends PathSeg native "SVGPathSegLinetoHorizontalAbs" {
 
   @DomName('SVGPathSegLinetoHorizontalAbs.x')
   @DocsEditable
@@ -4469,7 +4469,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegLinetoHorizontalRel')
-class PathSegLinetoHorizontalRel extends PathSeg native "*SVGPathSegLinetoHorizontalRel" {
+class PathSegLinetoHorizontalRel extends PathSeg native "SVGPathSegLinetoHorizontalRel" {
 
   @DomName('SVGPathSegLinetoHorizontalRel.x')
   @DocsEditable
@@ -4482,7 +4482,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegLinetoRel')
-class PathSegLinetoRel extends PathSeg native "*SVGPathSegLinetoRel" {
+class PathSegLinetoRel extends PathSeg native "SVGPathSegLinetoRel" {
 
   @DomName('SVGPathSegLinetoRel.x')
   @DocsEditable
@@ -4499,7 +4499,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegLinetoVerticalAbs')
-class PathSegLinetoVerticalAbs extends PathSeg native "*SVGPathSegLinetoVerticalAbs" {
+class PathSegLinetoVerticalAbs extends PathSeg native "SVGPathSegLinetoVerticalAbs" {
 
   @DomName('SVGPathSegLinetoVerticalAbs.y')
   @DocsEditable
@@ -4512,7 +4512,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegLinetoVerticalRel')
-class PathSegLinetoVerticalRel extends PathSeg native "*SVGPathSegLinetoVerticalRel" {
+class PathSegLinetoVerticalRel extends PathSeg native "SVGPathSegLinetoVerticalRel" {
 
   @DomName('SVGPathSegLinetoVerticalRel.y')
   @DocsEditable
@@ -4525,7 +4525,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegList')
-class PathSegList implements JavaScriptIndexingBehavior, List<PathSeg> native "*SVGPathSegList" {
+class PathSegList implements JavaScriptIndexingBehavior, List<PathSeg> native "SVGPathSegList" {
 
   @DomName('SVGPathSegList.numberOfItems')
   @DocsEditable
@@ -4683,7 +4683,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -4695,7 +4695,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<PathSeg> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<PathSeg> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -4766,7 +4766,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegMovetoAbs')
-class PathSegMovetoAbs extends PathSeg native "*SVGPathSegMovetoAbs" {
+class PathSegMovetoAbs extends PathSeg native "SVGPathSegMovetoAbs" {
 
   @DomName('SVGPathSegMovetoAbs.x')
   @DocsEditable
@@ -4783,7 +4783,7 @@
 
 @DocsEditable
 @DomName('SVGPathSegMovetoRel')
-class PathSegMovetoRel extends PathSeg native "*SVGPathSegMovetoRel" {
+class PathSegMovetoRel extends PathSeg native "SVGPathSegMovetoRel" {
 
   @DomName('SVGPathSegMovetoRel.x')
   @DocsEditable
@@ -4800,7 +4800,7 @@
 
 @DocsEditable
 @DomName('SVGPatternElement')
-class PatternElement extends StyledElement implements FitToViewBox, UriReference, Tests, ExternalResourcesRequired, LangSpace native "*SVGPatternElement" {
+class PatternElement extends StyledElement implements FitToViewBox, UriReference, Tests, ExternalResourcesRequired, LangSpace native "SVGPatternElement" {
 
   @DomName('SVGPatternElement.SVGPatternElement')
   @DocsEditable
@@ -4891,7 +4891,7 @@
 
 @DocsEditable
 @DomName('SVGPoint')
-class Point native "*SVGPoint" {
+class Point native "SVGPoint" {
 
   @DomName('SVGPoint.x')
   @DocsEditable
@@ -4912,7 +4912,7 @@
 
 @DocsEditable
 @DomName('SVGPointList')
-class PointList native "*SVGPointList" {
+class PointList native "SVGPointList" {
 
   @DomName('SVGPointList.numberOfItems')
   @DocsEditable
@@ -4953,7 +4953,7 @@
 
 @DocsEditable
 @DomName('SVGPolygonElement')
-class PolygonElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGPolygonElement" {
+class PolygonElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGPolygonElement" {
 
   @DomName('SVGPolygonElement.SVGPolygonElement')
   @DocsEditable
@@ -5042,7 +5042,7 @@
 
 @DocsEditable
 @DomName('SVGPolylineElement')
-class PolylineElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGPolylineElement" {
+class PolylineElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGPolylineElement" {
 
   @DomName('SVGPolylineElement.SVGPolylineElement')
   @DocsEditable
@@ -5131,7 +5131,7 @@
 
 @DocsEditable
 @DomName('SVGPreserveAspectRatio')
-class PreserveAspectRatio native "*SVGPreserveAspectRatio" {
+class PreserveAspectRatio native "SVGPreserveAspectRatio" {
 
   static const int SVG_MEETORSLICE_MEET = 1;
 
@@ -5176,7 +5176,7 @@
 
 @DocsEditable
 @DomName('SVGRadialGradientElement')
-class RadialGradientElement extends _GradientElement native "*SVGRadialGradientElement" {
+class RadialGradientElement extends _GradientElement native "SVGRadialGradientElement" {
 
   @DomName('SVGRadialGradientElement.SVGRadialGradientElement')
   @DocsEditable
@@ -5213,7 +5213,7 @@
 
 @DocsEditable
 @DomName('SVGRect')
-class Rect native "*SVGRect" {
+class Rect native "SVGRect" {
 
   @DomName('SVGRect.height')
   @DocsEditable
@@ -5238,7 +5238,7 @@
 
 @DocsEditable
 @DomName('SVGRectElement')
-class RectElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGRectElement" {
+class RectElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGRectElement" {
 
   @DomName('SVGRectElement.SVGRectElement')
   @DocsEditable
@@ -5343,7 +5343,7 @@
 
 @DocsEditable
 @DomName('SVGRenderingIntent')
-class RenderingIntent native "*SVGRenderingIntent" {
+class RenderingIntent native "SVGRenderingIntent" {
 
   static const int RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5;
 
@@ -5364,7 +5364,7 @@
 
 @DocsEditable
 @DomName('SVGScriptElement')
-class ScriptElement extends SvgElement implements UriReference, ExternalResourcesRequired native "*SVGScriptElement" {
+class ScriptElement extends SvgElement implements UriReference, ExternalResourcesRequired native "SVGScriptElement" {
 
   @DomName('SVGScriptElement.SVGScriptElement')
   @DocsEditable
@@ -5396,7 +5396,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class SetElement extends AnimationElement native "*SVGSetElement" {
+class SetElement extends AnimationElement native "SVGSetElement" {
 
   @DomName('SVGSetElement.SVGSetElement')
   @DocsEditable
@@ -5412,7 +5412,7 @@
 
 @DocsEditable
 @DomName('SVGStopElement')
-class StopElement extends StyledElement native "*SVGStopElement" {
+class StopElement extends StyledElement native "SVGStopElement" {
 
   @DomName('SVGStopElement.SVGStopElement')
   @DocsEditable
@@ -5430,7 +5430,7 @@
 
 @DocsEditable
 @DomName('SVGStringList')
-class StringList implements JavaScriptIndexingBehavior, List<String> native "*SVGStringList" {
+class StringList implements JavaScriptIndexingBehavior, List<String> native "SVGStringList" {
 
   @DomName('SVGStringList.numberOfItems')
   @DocsEditable
@@ -5588,7 +5588,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -5600,7 +5600,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<String> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<String> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -5671,7 +5671,7 @@
 
 @DocsEditable
 @DomName('SVGStyleElement')
-class StyleElement extends SvgElement implements LangSpace native "*SVGStyleElement" {
+class StyleElement extends SvgElement implements LangSpace native "SVGStyleElement" {
 
   @DomName('SVGStyleElement.SVGStyleElement')
   @DocsEditable
@@ -5713,7 +5713,7 @@
 
 @DocsEditable
 @DomName('SVGStyledElement')
-class StyledElement extends SvgElement native "*SVGStyledElement" {
+class StyledElement extends SvgElement native "SVGStyledElement" {
 
   // Shadowing definition.
   AnimatedString get $dom_svgClassName => JS("AnimatedString", "#.className", this);
@@ -5728,7 +5728,7 @@
 
 @DocsEditable
 @DomName('SVGDocument')
-class SvgDocument extends Document native "*SVGDocument" {
+class SvgDocument extends Document native "SVGDocument" {
 
   @DomName('SVGDocument.rootElement')
   @DocsEditable
@@ -5771,7 +5771,7 @@
 }
 
 @DomName('SVGElement')
-class SvgElement extends Element native "*SVGElement" {
+class SvgElement extends Element native "SVGElement" {
   factory SvgElement.tag(String tag) =>
       _SvgElementFactoryProvider.createSvgElement_tag(tag);
   factory SvgElement.svg(String svg) =>
@@ -5879,7 +5879,7 @@
 
 @DocsEditable
 @DomName('SVGException')
-class SvgException native "*SVGException" {
+class SvgException native "SVGException" {
 
   static const int SVG_INVALID_VALUE_ERR = 1;
 
@@ -5909,7 +5909,7 @@
 
 
 @DomName('SVGSVGElement')
-class SvgSvgElement extends StyledElement implements FitToViewBox, Transformable, Tests, ExternalResourcesRequired, ZoomAndPan, LangSpace native "*SVGSVGElement" {
+class SvgSvgElement extends StyledElement implements FitToViewBox, Transformable, Tests, ExternalResourcesRequired, ZoomAndPan, LangSpace native "SVGSVGElement" {
   factory SvgSvgElement() => _SvgSvgElementFactoryProvider.createSvgSvgElement();
 
 
@@ -6169,7 +6169,7 @@
 
 @DocsEditable
 @DomName('SVGSwitchElement')
-class SwitchElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "*SVGSwitchElement" {
+class SwitchElement extends StyledElement implements Transformable, Tests, ExternalResourcesRequired, LangSpace native "SVGSwitchElement" {
 
   @DomName('SVGSwitchElement.SVGSwitchElement')
   @DocsEditable
@@ -6250,7 +6250,7 @@
 
 @DocsEditable
 @DomName('SVGSymbolElement')
-class SymbolElement extends StyledElement implements FitToViewBox, ExternalResourcesRequired, LangSpace native "*SVGSymbolElement" {
+class SymbolElement extends StyledElement implements FitToViewBox, ExternalResourcesRequired, LangSpace native "SVGSymbolElement" {
 
   @DomName('SVGSymbolElement.SVGSymbolElement')
   @DocsEditable
@@ -6289,7 +6289,7 @@
 
 @DocsEditable
 @DomName('SVGTSpanElement')
-class TSpanElement extends TextPositioningElement native "*SVGTSpanElement" {
+class TSpanElement extends TextPositioningElement native "SVGTSpanElement" {
 
   @DomName('SVGTSpanElement.SVGTSpanElement')
   @DocsEditable
@@ -6318,7 +6318,7 @@
 
 @DocsEditable
 @DomName('SVGTextContentElement')
-class TextContentElement extends StyledElement implements Tests, ExternalResourcesRequired, LangSpace native "*SVGTextContentElement" {
+class TextContentElement extends StyledElement implements Tests, ExternalResourcesRequired, LangSpace native "SVGTextContentElement" {
 
   static const int LENGTHADJUST_SPACING = 1;
 
@@ -6411,7 +6411,7 @@
 
 @DocsEditable
 @DomName('SVGTextElement')
-class TextElement extends TextPositioningElement implements Transformable native "*SVGTextElement" {
+class TextElement extends TextPositioningElement implements Transformable native "SVGTextElement" {
 
   @DomName('SVGTextElement.SVGTextElement')
   @DocsEditable
@@ -6458,7 +6458,7 @@
 
 @DocsEditable
 @DomName('SVGTextPathElement')
-class TextPathElement extends TextContentElement implements UriReference native "*SVGTextPathElement" {
+class TextPathElement extends TextContentElement implements UriReference native "SVGTextPathElement" {
 
   static const int TEXTPATH_METHODTYPE_ALIGN = 1;
 
@@ -6497,7 +6497,7 @@
 
 @DocsEditable
 @DomName('SVGTextPositioningElement')
-class TextPositioningElement extends TextContentElement native "*SVGTextPositioningElement" {
+class TextPositioningElement extends TextContentElement native "SVGTextPositioningElement" {
 
   @DomName('SVGTextPositioningElement.dx')
   @DocsEditable
@@ -6526,7 +6526,7 @@
 
 @DocsEditable
 @DomName('SVGTitleElement')
-class TitleElement extends StyledElement implements LangSpace native "*SVGTitleElement" {
+class TitleElement extends StyledElement implements LangSpace native "SVGTitleElement" {
 
   @DomName('SVGTitleElement.SVGTitleElement')
   @DocsEditable
@@ -6549,7 +6549,7 @@
 
 @DocsEditable
 @DomName('SVGTransform')
-class Transform native "*SVGTransform" {
+class Transform native "SVGTransform" {
 
   static const int SVG_TRANSFORM_MATRIX = 1;
 
@@ -6608,7 +6608,7 @@
 
 @DocsEditable
 @DomName('SVGTransformList')
-class TransformList implements List<Transform>, JavaScriptIndexingBehavior native "*SVGTransformList" {
+class TransformList implements List<Transform>, JavaScriptIndexingBehavior native "SVGTransformList" {
 
   @DomName('SVGTransformList.numberOfItems')
   @DocsEditable
@@ -6766,7 +6766,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -6778,7 +6778,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Transform> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Transform> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -6882,7 +6882,7 @@
 
 @DocsEditable
 @DomName('SVGUnitTypes')
-class UnitTypes native "*SVGUnitTypes" {
+class UnitTypes native "SVGUnitTypes" {
 
   static const int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2;
 
@@ -6907,7 +6907,7 @@
 
 @DocsEditable
 @DomName('SVGUseElement')
-class UseElement extends StyledElement implements UriReference, Tests, Transformable, ExternalResourcesRequired, LangSpace native "*SVGUseElement" {
+class UseElement extends StyledElement implements UriReference, Tests, Transformable, ExternalResourcesRequired, LangSpace native "SVGUseElement" {
 
   @DomName('SVGUseElement.SVGUseElement')
   @DocsEditable
@@ -7018,7 +7018,7 @@
 
 @DocsEditable
 @DomName('SVGViewElement')
-class ViewElement extends SvgElement implements FitToViewBox, ExternalResourcesRequired, ZoomAndPan native "*SVGViewElement" {
+class ViewElement extends SvgElement implements FitToViewBox, ExternalResourcesRequired, ZoomAndPan native "SVGViewElement" {
 
   @DomName('SVGViewElement.SVGViewElement')
   @DocsEditable
@@ -7057,7 +7057,7 @@
 
 @DocsEditable
 @DomName('SVGViewSpec')
-class ViewSpec native "*SVGViewSpec" {
+class ViewSpec native "SVGViewSpec" {
 
   @DomName('SVGViewSpec.preserveAspectRatio')
   @DocsEditable
@@ -7118,7 +7118,7 @@
 
 @DocsEditable
 @DomName('SVGZoomEvent')
-class ZoomEvent extends UIEvent native "*SVGZoomEvent" {
+class ZoomEvent extends UIEvent native "SVGZoomEvent" {
 
   @DomName('SVGZoomEvent.newScale')
   @DocsEditable
@@ -7147,7 +7147,7 @@
 
 @DocsEditable
 @DomName('SVGElementInstanceList')
-class _ElementInstanceList implements JavaScriptIndexingBehavior, List<ElementInstance> native "*SVGElementInstanceList" {
+class _ElementInstanceList implements JavaScriptIndexingBehavior, List<ElementInstance> native "SVGElementInstanceList" {
 
   @DomName('SVGElementInstanceList.length')
   @DocsEditable
@@ -7305,7 +7305,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -7317,7 +7317,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<ElementInstance> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<ElementInstance> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -7364,7 +7364,7 @@
 
 @DocsEditable
 @DomName('SVGGradientElement')
-class _GradientElement extends StyledElement implements UriReference, ExternalResourcesRequired native "*SVGGradientElement" {
+class _GradientElement extends StyledElement implements UriReference, ExternalResourcesRequired native "SVGGradientElement" {
 
   static const int SVG_SPREADMETHOD_PAD = 1;
 
@@ -7405,7 +7405,7 @@
 
 @DocsEditable
 @DomName('SVGAltGlyphDefElement')
-abstract class _SVGAltGlyphDefElement extends SvgElement native "*SVGAltGlyphDefElement" {
+abstract class _SVGAltGlyphDefElement extends SvgElement native "SVGAltGlyphDefElement" {
 }
 // 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
@@ -7414,7 +7414,7 @@
 
 @DocsEditable
 @DomName('SVGAltGlyphItemElement')
-abstract class _SVGAltGlyphItemElement extends SvgElement native "*SVGAltGlyphItemElement" {
+abstract class _SVGAltGlyphItemElement extends SvgElement native "SVGAltGlyphItemElement" {
 }
 // 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
@@ -7423,7 +7423,7 @@
 
 @DocsEditable
 @DomName('SVGAnimateColorElement')
-abstract class _SVGAnimateColorElement extends AnimationElement native "*SVGAnimateColorElement" {
+abstract class _SVGAnimateColorElement extends AnimationElement native "SVGAnimateColorElement" {
 }
 // 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
@@ -7434,7 +7434,7 @@
 // type entirely but can't.
 @DocsEditable
 @DomName('SVGColor')
-class _SVGColor native "*SVGColor" {
+class _SVGColor native "SVGColor" {
   _SVGColor.internal();
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -7444,7 +7444,7 @@
 
 @DocsEditable
 @DomName('SVGComponentTransferFunctionElement')
-abstract class _SVGComponentTransferFunctionElement extends SvgElement native "*SVGComponentTransferFunctionElement" {
+abstract class _SVGComponentTransferFunctionElement extends SvgElement native "SVGComponentTransferFunctionElement" {
 }
 // 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
@@ -7453,7 +7453,7 @@
 
 @DocsEditable
 @DomName('SVGCursorElement')
-abstract class _SVGCursorElement extends SvgElement implements UriReference, Tests, ExternalResourcesRequired native "*SVGCursorElement" {
+abstract class _SVGCursorElement extends SvgElement implements UriReference, Tests, ExternalResourcesRequired native "SVGCursorElement" {
 
   @DomName('SVGCursorElement.SVGCursorElement')
   @DocsEditable
@@ -7475,7 +7475,7 @@
 
 @DocsEditable
 @DomName('SVGFEDropShadowElement')
-abstract class _SVGFEDropShadowElement extends StyledElement implements FilterPrimitiveStandardAttributes native "*SVGFEDropShadowElement" {
+abstract class _SVGFEDropShadowElement extends StyledElement implements FilterPrimitiveStandardAttributes native "SVGFEDropShadowElement" {
 
   // From SVGFilterPrimitiveStandardAttributes
 }
@@ -7486,7 +7486,7 @@
 
 @DocsEditable
 @DomName('SVGFontElement')
-abstract class _SVGFontElement extends SvgElement native "*SVGFontElement" {
+abstract class _SVGFontElement extends SvgElement native "SVGFontElement" {
 }
 // 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
@@ -7495,7 +7495,7 @@
 
 @DocsEditable
 @DomName('SVGFontFaceElement')
-abstract class _SVGFontFaceElement extends SvgElement native "*SVGFontFaceElement" {
+abstract class _SVGFontFaceElement extends SvgElement native "SVGFontFaceElement" {
 }
 // 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
@@ -7504,7 +7504,7 @@
 
 @DocsEditable
 @DomName('SVGFontFaceFormatElement')
-abstract class _SVGFontFaceFormatElement extends SvgElement native "*SVGFontFaceFormatElement" {
+abstract class _SVGFontFaceFormatElement extends SvgElement native "SVGFontFaceFormatElement" {
 }
 // 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
@@ -7513,7 +7513,7 @@
 
 @DocsEditable
 @DomName('SVGFontFaceNameElement')
-abstract class _SVGFontFaceNameElement extends SvgElement native "*SVGFontFaceNameElement" {
+abstract class _SVGFontFaceNameElement extends SvgElement native "SVGFontFaceNameElement" {
 }
 // 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
@@ -7522,7 +7522,7 @@
 
 @DocsEditable
 @DomName('SVGFontFaceSrcElement')
-abstract class _SVGFontFaceSrcElement extends SvgElement native "*SVGFontFaceSrcElement" {
+abstract class _SVGFontFaceSrcElement extends SvgElement native "SVGFontFaceSrcElement" {
 }
 // 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
@@ -7531,7 +7531,7 @@
 
 @DocsEditable
 @DomName('SVGFontFaceUriElement')
-abstract class _SVGFontFaceUriElement extends SvgElement native "*SVGFontFaceUriElement" {
+abstract class _SVGFontFaceUriElement extends SvgElement native "SVGFontFaceUriElement" {
 }
 // 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
@@ -7540,7 +7540,7 @@
 
 @DocsEditable
 @DomName('SVGGlyphElement')
-abstract class _SVGGlyphElement extends SvgElement native "*SVGGlyphElement" {
+abstract class _SVGGlyphElement extends SvgElement native "SVGGlyphElement" {
 
   @DomName('SVGGlyphElement.SVGGlyphElement')
   @DocsEditable
@@ -7553,7 +7553,7 @@
 
 @DocsEditable
 @DomName('SVGGlyphRefElement')
-abstract class _SVGGlyphRefElement extends StyledElement implements UriReference native "*SVGGlyphRefElement" {
+abstract class _SVGGlyphRefElement extends StyledElement implements UriReference native "SVGGlyphRefElement" {
 
   // From SVGURIReference
 }
@@ -7564,7 +7564,7 @@
 
 @DocsEditable
 @DomName('SVGHKernElement')
-abstract class _SVGHKernElement extends SvgElement native "*SVGHKernElement" {
+abstract class _SVGHKernElement extends SvgElement native "SVGHKernElement" {
 
   @DomName('SVGHKernElement.SVGHKernElement')
   @DocsEditable
@@ -7577,7 +7577,7 @@
 
 @DocsEditable
 @DomName('SVGMPathElement')
-abstract class _SVGMPathElement extends SvgElement implements UriReference, ExternalResourcesRequired native "*SVGMPathElement" {
+abstract class _SVGMPathElement extends SvgElement implements UriReference, ExternalResourcesRequired native "SVGMPathElement" {
 
   @DomName('SVGMPathElement.SVGMPathElement')
   @DocsEditable
@@ -7594,7 +7594,7 @@
 
 @DocsEditable
 @DomName('SVGMissingGlyphElement')
-abstract class _SVGMissingGlyphElement extends StyledElement native "*SVGMissingGlyphElement" {
+abstract class _SVGMissingGlyphElement extends StyledElement native "SVGMissingGlyphElement" {
 }
 // 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
@@ -7603,7 +7603,7 @@
 
 @DocsEditable
 @DomName('SVGPaint')
-abstract class _SVGPaint extends _SVGColor native "*SVGPaint" {
+abstract class _SVGPaint extends _SVGColor native "SVGPaint" {
 }
 // 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
@@ -7612,7 +7612,7 @@
 
 @DocsEditable
 @DomName('SVGTRefElement')
-abstract class _SVGTRefElement extends TextPositioningElement implements UriReference native "*SVGTRefElement" {
+abstract class _SVGTRefElement extends TextPositioningElement implements UriReference native "SVGTRefElement" {
 
   @DomName('SVGTRefElement.SVGTRefElement')
   @DocsEditable
@@ -7627,7 +7627,7 @@
 
 @DocsEditable
 @DomName('SVGVKernElement')
-abstract class _SVGVKernElement extends SvgElement native "*SVGVKernElement" {
+abstract class _SVGVKernElement extends SvgElement native "SVGVKernElement" {
 
   @DomName('SVGVKernElement.SVGVKernElement')
   @DocsEditable
diff --git a/sdk/lib/svg/dartium/svg_dartium.dart b/sdk/lib/svg/dartium/svg_dartium.dart
index 64d8154..3e42808 100644
--- a/sdk/lib/svg/dartium/svg_dartium.dart
+++ b/sdk/lib/svg/dartium/svg_dartium.dart
@@ -3425,7 +3425,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -3437,7 +3437,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Length> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Length> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -4146,7 +4146,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -4158,7 +4158,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Number> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Number> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -5294,7 +5294,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -5306,7 +5306,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<PathSeg> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<PathSeg> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -6296,7 +6296,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -6308,7 +6308,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<String> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<String> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -7563,7 +7563,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -7575,7 +7575,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Transform> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Transform> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -8156,7 +8156,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -8168,7 +8168,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<ElementInstance> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<ElementInstance> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
diff --git a/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
new file mode 100644
index 0000000..20d88d2
--- /dev/null
+++ b/sdk/lib/typed_data/dart2js/typed_data_dart2js.dart
@@ -0,0 +1,2409 @@
+// 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.
+
+/// The Dart TypedData library.
+library dart.typed_data;
+
+import 'dart:collection';
+import 'dart:_collection-dev';
+import 'dart:html';
+import 'dart:html_common';
+import 'dart:_js_helper' show convertDartClosureToJS, Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
+import 'dart:_foreign_helper' show JS;
+
+/**
+ * Describes endianness to be used when accessing a sequence of bytes.
+ */
+class Endianness {
+  const Endianness(this._littleEndian);
+
+  static const Endianness BIG_ENDIAN = const Endianness(false);
+  static const Endianness LITTLE_ENDIAN = const Endianness(true);
+  static final Endianness HOST_ENDIAN =
+    (new ByteData.view(new Int16List.fromList([1]).buffer)).getInt8(0) == 1 ?
+    LITTLE_ENDIAN : BIG_ENDIAN;
+
+  final bool _littleEndian;
+}
+
+@DocsEditable
+@DomName('ArrayBuffer')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class ByteBuffer native "ArrayBuffer" {
+  @JSName('byteLength')
+  @DomName('ArrayBuffer.byteLength')
+  @DocsEditable
+  final int lengthInBytes;
+}
+
+@DomName('ArrayBufferView')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class TypedData native "ArrayBufferView" {
+  @DomName('ArrayBufferView.buffer')
+  @DocsEditable
+  @Creates('ByteBuffer')
+  @Returns('ByteBuffer|Null')
+  final ByteBuffer buffer;
+
+  @JSName('byteLength')
+  @DomName('ArrayBufferView.byteLength')
+  @DocsEditable
+  final int lengthInBytes;
+
+  @JSName('byteOffset')
+  @DomName('ArrayBufferView.byteOffset')
+  @DocsEditable
+  final int offsetInBytes;
+
+  @JSName('BYTES_PER_ELEMENT')
+  final int elementSizeInBytes;
+}
+
+@DocsEditable
+@DomName('DataView')
+class ByteData extends TypedData native "DataView" {
+  @DomName('DataView.DataView')
+  @DocsEditable
+  factory ByteData(int length) => JS('ByteData', 'new DataView(#)', length);
+
+  @DomName('DataView.DataView')
+  @DocsEditable
+  factory ByteData.view(ByteBuffer buffer, [int byteOffset, int byteLength]) {
+    if (?byteLength) {
+      return ByteData._create_1(buffer, byteOffset, byteLength);
+    }
+    if (?byteOffset) {
+      return ByteData._create_2(buffer, byteOffset);
+    }
+    return ByteData._create_3(buffer);
+  }
+
+  static ByteData _create_1(buffer, byteOffset, byteLength) =>
+    JS('ByteData', 'new DataView(#,#,#)', buffer, byteOffset, byteLength);
+  static ByteData _create_2(buffer, byteOffset) => JS('ByteData', 'new DataView(#,#)', buffer, byteOffset);
+  static ByteData _create_3(buffer) => JS('ByteData', 'new DataView(#)', buffer);
+
+  @DomName('DataView.getFloat32')
+  @DocsEditable
+  num getFloat32(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _getFloat32(byteOffset, endian._littleEndian);
+
+  @JSName('getFloat32')
+  @Returns('num')
+  num _getFloat32(int byteOffset, [bool littleEndian]) native;
+
+  @DomName('DataView.getFloat64')
+  @DocsEditable
+  num getFloat64(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _getFloat64(byteOffset, endian._littleEndian);
+
+  @JSName('getFloat64')
+  @Returns('num')
+  num _getFloat64(int byteOffset, [bool littleEndian]) native;
+
+  @DomName('DataView.getInt16')
+  @DocsEditable
+  int getInt16(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _getInt16(byteOffset, endian._littleEndian);
+
+  @JSName('getInt16')
+  @Returns('int')
+  int _getInt16(int byteOffset, [bool littleEndian]) native;
+
+  @DomName('DataView.getInt32')
+  @DocsEditable
+  int getInt32(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _getInt32(byteOffset, endian._littleEndian);
+
+  @JSName('getInt32')
+  @Returns('int')
+  int _getInt32(int byteOffset, [bool littleEndian]) native;
+
+  @DomName('DataView.getInt8')
+  @DocsEditable
+  int getInt8(int byteOffset) native;
+
+  @DomName('DataView.getUint16')
+  @DocsEditable
+  int getUint16(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _getUint16(byteOffset, endian._littleEndian);
+
+  @JSName('getUint16')
+  @Returns('int')
+  int _getUint16(int byteOffset, [bool littleEndian]) native;
+
+  @DomName('DataView.getUint32')
+  @DocsEditable
+  int getUint32(int byteOffset, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _getUint32(byteOffset, endian._littleEndian);
+
+  @JSName('getUint32')
+  @Returns('int')
+  int _getUint32(int byteOffset, [bool littleEndian]) native;
+
+  @DomName('DataView.getUint8')
+  @DocsEditable
+  int getUint8(int byteOffset) native;
+
+  @DomName('DataView.setFloat32')
+  @DocsEditable
+  void setFloat32(int byteOffset, num value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _setFloat32(byteOffset, value, endian._littleEndian);
+
+  @JSName('setFloat32')
+  void _setFloat32(int byteOffset, num value, [bool littleEndian]) native;
+
+  @DomName('DataView.setFloat64')
+  @DocsEditable
+  void setFloat64(int byteOffset, num value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _setFloat64(byteOffset, value, endian._littleEndian);
+
+  @JSName('setFloat64')
+  void _setFloat64(int byteOffset, num value, [bool littleEndian]) native;
+
+  @DomName('DataView.setInt16')
+  @DocsEditable
+  void setInt16(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _setInt16(byteOffset, value, endian._littleEndian);
+
+  @JSName('setInt16')
+  void _setInt16(int byteOffset, int value, [bool littleEndian]) native;
+
+  @DomName('DataView.setInt32')
+  @DocsEditable
+  void setInt32(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _setInt32(byteOffset, value, endian._littleEndian);
+
+  @JSName('setInt32')
+  void _setInt32(int byteOffset, int value, [bool littleEndian]) native;
+
+  @DomName('DataView.setInt8')
+  @DocsEditable
+  void setInt8(int byteOffset, int value) native;
+
+  @DomName('DataView.setUint16')
+  @DocsEditable
+  void setUint16(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _setUint16(byteOffset, value, endian._littleEndian);
+
+  @JSName('setUint16')
+  void _setUint16(int byteOffset, int value, [bool littleEndian]) native;
+
+  @DomName('DataView.setUint32')
+  @DocsEditable
+  void setUint32(int byteOffset, int value, [Endianness endian=Endianness.BIG_ENDIAN]) =>
+      _setUint32(byteOffset, value, endian._littleEndian);
+
+  @JSName('setUint32')
+  void _setUint32(int byteOffset, int value, [bool littleEndian]) native;
+
+  @DomName('DataView.setUint8')
+  @DocsEditable
+  void setUint8(int byteOffset, int value) native;
+}
+
+@DocsEditable
+@DomName('Float32Array')
+class Float32List extends TypedData implements JavaScriptIndexingBehavior, List<double> native "Float32Array" {
+  @DomName('Float32Array.Float32Array')
+  @DocsEditable
+  factory Float32List(int length) =>
+    _TypedArrayFactoryProvider.createFloat32List(length);
+
+  @DomName('Float32Array.fromList')
+  @DocsEditable
+  factory Float32List.fromList(List<num> list) =>
+    _TypedArrayFactoryProvider.createFloat32List_fromList(list);
+
+  @DomName('Float32Array.fromBuffer')
+  @DocsEditable
+  factory Float32List.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createFloat32List_fromBuffer(buffer, byteOffset, length);
+
+  static const int BYTES_PER_ELEMENT = 4;
+
+  @DomName('Float32Array.length')
+  @DocsEditable
+  int get length => JS("int", "#.length", this);
+
+  num operator[](int index) => JS("num", "#[#]", this, index);
+
+  void operator[]=(int index, num value) { JS("void", "#[#] = #", this, index, value); }
+  // -- start List<num> mixins.
+  // num is the element type.
+
+  // From Iterable<num>:
+
+  Iterator<num> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<num>(this);
+  }
+
+  num reduce(num combine(num value, num element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, num element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(num element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(num element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<num> where(bool f(num element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(num element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
+
+  List<num> toList({ bool growable: true }) =>
+      new List<num>.from(this, growable: growable);
+
+  Set<num> toSet() => new Set<num>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<num> takeWhile(bool test(num value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<num> skipWhile(bool test(num value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  num firstWhere(bool test(num value), { num orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  num lastWhere(bool test(num value), {num orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  num singleWhere(bool test(num value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  num elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<num>:
+
+  void add(num value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<num> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<num>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<num> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(num a, num b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(num element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(num element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  num get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  num get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  num get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, num element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<num> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<num> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  num removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  num removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(num element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(num element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<num> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<num> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [num fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<num> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<num> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <num>[]);
+  }
+
+  Map<int, num> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<num> mixins.
+}
+
+@DocsEditable
+@DomName('Float64Array')
+class Float64List extends TypedData implements JavaScriptIndexingBehavior, List<double> native "Float64Array" {
+
+  @DomName('Float64Array.Float64Array')
+  @DocsEditable
+  factory Float64List(int length) =>
+    _TypedArrayFactoryProvider.createFloat64List(length);
+
+  @DomName('Float64Array.fromList')
+  @DocsEditable
+  factory Float64List.fromList(List<num> list) =>
+    _TypedArrayFactoryProvider.createFloat64List_fromList(list);
+
+  @DomName('Float64Array.fromBuffer')
+  @DocsEditable
+  factory Float64List.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createFloat64List_fromBuffer(buffer, byteOffset, length);
+
+  static const int BYTES_PER_ELEMENT = 8;
+
+  @DomName('Float64Array.length')
+  @DocsEditable
+  int get length => JS("int", "#.length", this);
+
+  num operator[](int index) => JS("num", "#[#]", this, index);
+
+  void operator[]=(int index, num value) { JS("void", "#[#] = #", this, index, value); }
+  // -- start List<num> mixins.
+  // num is the element type.
+
+  // From Iterable<num>:
+
+  Iterator<num> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<num>(this);
+  }
+
+  num reduce(num combine(num value, num element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, num element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(num element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(num element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<num> where(bool f(num element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(num element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
+
+  List<num> toList({ bool growable: true }) =>
+      new List<num>.from(this, growable: growable);
+
+  Set<num> toSet() => new Set<num>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<num> takeWhile(bool test(num value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<num> skipWhile(bool test(num value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  num firstWhere(bool test(num value), { num orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  num lastWhere(bool test(num value), {num orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  num singleWhere(bool test(num value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  num elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<num>:
+
+  void add(num value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<num> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<num>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<num> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(num a, num b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(num element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(num element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  num get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  num get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  num get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, num element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<num> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<num> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  num removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  num removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(num element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(num element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<num> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<num> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [num fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<num> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<num> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <num>[]);
+  }
+
+  Map<int, num> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<num> mixins.
+}
+
+@DocsEditable
+@DomName('Int16Array')
+class Int16List extends TypedData implements JavaScriptIndexingBehavior, List<int> native "Int16Array" {
+
+  @DomName('Int16Array.Int16Array')
+  @DocsEditable
+  factory Int16List(int length) =>
+    _TypedArrayFactoryProvider.createInt16List(length);
+
+  @DomName('Int16Array.fromList')
+  @DocsEditable
+  factory Int16List.fromList(List<int> list) =>
+    _TypedArrayFactoryProvider.createInt16List_fromList(list);
+
+  @DomName('Int16Array.fromBuffer')
+  @DocsEditable
+  factory Int16List.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createInt16List_fromBuffer(buffer, byteOffset, length);
+
+  static const int BYTES_PER_ELEMENT = 2;
+
+  @DomName('Int16Array.length')
+  @DocsEditable
+  int get length => JS("int", "#.length", this);
+
+  int operator[](int index) => JS("int", "#[#]", this, index);
+
+  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  // int is the element type.
+
+  // From Iterable<int>:
+
+  Iterator<int> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<int>(this);
+  }
+
+  int reduce(int combine(int value, int element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, int element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(int element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<int> where(bool f(int element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(int element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+
+  List<int> toList({ bool growable: true }) =>
+      new List<int>.from(this, growable: growable);
+
+  Set<int> toSet() => new Set<int>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<int> takeWhile(bool test(int value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<int> skipWhile(bool test(int value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  int firstWhere(bool test(int value), { int orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  int lastWhere(bool test(int value), {int orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  int singleWhere(bool test(int value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  int elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<int>:
+
+  void add(int value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<int>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<int> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(int a, int b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(int element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(int element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  int get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  int get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  int get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, int element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  int removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  int removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<int> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [int fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<int> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<int> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <int>[]);
+  }
+
+  Map<int, int> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<int> mixins.
+}
+
+@DocsEditable
+@DomName('Int32Array')
+class Int32List extends TypedData implements JavaScriptIndexingBehavior, List<int> native "Int32Array" {
+
+  @DomName('Int32Array.Int32Array')
+  @DocsEditable
+  factory Int32List(int length) =>
+    _TypedArrayFactoryProvider.createInt32List(length);
+
+  @DomName('Int32Array.fromList')
+  @DocsEditable
+  factory Int32List.fromList(List<int> list) =>
+    _TypedArrayFactoryProvider.createInt32List_fromList(list);
+
+  @DomName('Int32Array.fromBuffer')
+  @DocsEditable
+  factory Int32List.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createInt32List_fromBuffer(buffer, byteOffset, length);
+
+  static const int BYTES_PER_ELEMENT = 4;
+
+  @DomName('Int32Array.length')
+  @DocsEditable
+  int get length => JS("int", "#.length", this);
+
+  int operator[](int index) => JS("int", "#[#]", this, index);
+
+  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  // int is the element type.
+
+  // From Iterable<int>:
+
+  Iterator<int> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<int>(this);
+  }
+
+  int reduce(int combine(int value, int element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, int element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(int element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<int> where(bool f(int element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(int element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+
+  List<int> toList({ bool growable: true }) =>
+      new List<int>.from(this, growable: growable);
+
+  Set<int> toSet() => new Set<int>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<int> takeWhile(bool test(int value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<int> skipWhile(bool test(int value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  int firstWhere(bool test(int value), { int orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  int lastWhere(bool test(int value), {int orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  int singleWhere(bool test(int value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  int elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<int>:
+
+  void add(int value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<int>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<int> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(int a, int b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(int element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(int element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  int get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  int get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  int get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, int element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  int removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  int removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<int> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [int fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<int> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<int> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <int>[]);
+  }
+
+  Map<int, int> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<int> mixins.
+}
+
+@DocsEditable
+@DomName('Int8Array')
+class Int8List extends TypedData implements JavaScriptIndexingBehavior, List<int> native "Int8Array" {
+
+  @DomName('Int8Array.Int8Array')
+  @DocsEditable
+  factory Int8List(int length) =>
+    _TypedArrayFactoryProvider.createInt8List(length);
+
+  @DomName('Int8Array.fromList')
+  @DocsEditable
+  factory Int8List.fromList(List<int> list) =>
+    _TypedArrayFactoryProvider.createInt8List_fromList(list);
+
+  @DomName('Int8Array.fromBuffer')
+  @DocsEditable
+  factory Int8List.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createInt8List_fromBuffer(buffer, byteOffset, length);
+
+  static const int BYTES_PER_ELEMENT = 1;
+
+  @DomName('Int8Array.length')
+  @DocsEditable
+  int get length => JS("int", "#.length", this);
+
+  int operator[](int index) => JS("int", "#[#]", this, index);
+
+  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  // int is the element type.
+
+  // From Iterable<int>:
+
+  Iterator<int> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<int>(this);
+  }
+
+  int reduce(int combine(int value, int element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, int element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(int element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<int> where(bool f(int element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(int element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+
+  List<int> toList({ bool growable: true }) =>
+      new List<int>.from(this, growable: growable);
+
+  Set<int> toSet() => new Set<int>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<int> takeWhile(bool test(int value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<int> skipWhile(bool test(int value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  int firstWhere(bool test(int value), { int orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  int lastWhere(bool test(int value), {int orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  int singleWhere(bool test(int value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  int elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<int>:
+
+  void add(int value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<int>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<int> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(int a, int b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(int element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(int element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  int get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  int get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  int get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, int element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  int removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  int removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<int> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [int fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<int> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<int> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <int>[]);
+  }
+
+  Map<int, int> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<int> mixins.
+}
+
+@DocsEditable
+@DomName('Uint16Array')
+class Uint16List extends TypedData implements JavaScriptIndexingBehavior, List<int> native "Uint16Array" {
+
+  @DomName('Uint16Array.Uint16Array')
+  @DocsEditable
+  factory Uint16List(int length) =>
+    _TypedArrayFactoryProvider.createUint16List(length);
+
+  @DomName('Uint16Array.fromList')
+  @DocsEditable
+  factory Uint16List.fromList(List<int> list) =>
+    _TypedArrayFactoryProvider.createUint16List_fromList(list);
+
+  @DomName('Uint16Array.fromBuffer')
+  @DocsEditable
+  factory Uint16List.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createUint16List_fromBuffer(buffer, byteOffset, length);
+
+  static const int BYTES_PER_ELEMENT = 2;
+
+  @DomName('Uint16Array.length')
+  @DocsEditable
+  int get length => JS("int", "#.length", this);
+
+  int operator[](int index) => JS("int", "#[#]", this, index);
+
+  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  // int is the element type.
+
+  // From Iterable<int>:
+
+  Iterator<int> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<int>(this);
+  }
+
+  int reduce(int combine(int value, int element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, int element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(int element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<int> where(bool f(int element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(int element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+
+  List<int> toList({ bool growable: true }) =>
+      new List<int>.from(this, growable: growable);
+
+  Set<int> toSet() => new Set<int>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<int> takeWhile(bool test(int value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<int> skipWhile(bool test(int value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  int firstWhere(bool test(int value), { int orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  int lastWhere(bool test(int value), {int orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  int singleWhere(bool test(int value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  int elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<int>:
+
+  void add(int value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<int>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<int> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(int a, int b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(int element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(int element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  int get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  int get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  int get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, int element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  int removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  int removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<int> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [int fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<int> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<int> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <int>[]);
+  }
+
+  Map<int, int> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<int> mixins.
+}
+
+@DocsEditable
+@DomName('Uint32Array')
+class Uint32List extends TypedData implements JavaScriptIndexingBehavior, List<int> native "Uint32Array" {
+
+  @DomName('Uint32Array.Uint32Array')
+  @DocsEditable
+  factory Uint32List(int length) =>
+    _TypedArrayFactoryProvider.createUint32List(length);
+
+  @DomName('Uint32Array.fromList')
+  @DocsEditable
+  factory Uint32List.fromList(List<int> list) =>
+    _TypedArrayFactoryProvider.createUint32List_fromList(list);
+
+  @DomName('Uint32Array.fromBuffer')
+  @DocsEditable
+  factory Uint32List.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createUint32List_fromBuffer(buffer, byteOffset, length);
+
+  static const int BYTES_PER_ELEMENT = 4;
+
+  @DomName('Uint32Array.length')
+  @DocsEditable
+  int get length => JS("int", "#.length", this);
+
+  int operator[](int index) => JS("int", "#[#]", this, index);
+
+  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  // int is the element type.
+
+  // From Iterable<int>:
+
+  Iterator<int> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<int>(this);
+  }
+
+  int reduce(int combine(int value, int element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, int element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(int element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<int> where(bool f(int element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(int element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+
+  List<int> toList({ bool growable: true }) =>
+      new List<int>.from(this, growable: growable);
+
+  Set<int> toSet() => new Set<int>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<int> takeWhile(bool test(int value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<int> skipWhile(bool test(int value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  int firstWhere(bool test(int value), { int orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  int lastWhere(bool test(int value), {int orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  int singleWhere(bool test(int value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  int elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<int>:
+
+  void add(int value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<int>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<int> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(int a, int b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(int element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(int element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  int get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  int get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  int get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, int element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  int removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  int removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<int> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [int fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<int> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<int> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <int>[]);
+  }
+
+  Map<int, int> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<int> mixins.
+}
+
+@DocsEditable
+@DomName('Uint8ClampedArray')
+class Uint8ClampedList extends Uint8List implements JavaScriptIndexingBehavior, List<int> native "Uint8ClampedArray" {
+
+  @DomName('Uint8ClampedArray.Uint8ClampedArray')
+  @DocsEditable
+  factory Uint8ClampedList(int length) =>
+    _TypedArrayFactoryProvider.createUint8ClampedList(length);
+
+  @DomName('Uint8ClampedArray.fromList')
+  @DocsEditable
+  factory Uint8ClampedList.fromList(List<int> list) =>
+    _TypedArrayFactoryProvider.createUint8ClampedList_fromList(list);
+
+  @DomName('Uint8ClampedArray.fromBuffer')
+  @DocsEditable
+  factory Uint8ClampedList.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createUint8ClampedList_fromBuffer(buffer, byteOffset, length);
+
+  // Use implementation from Uint8Array.
+  // final int length;
+
+  int operator[](int index) => JS("int", "#[#]", this, index);
+
+  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  // int is the element type.
+
+  // From Iterable<int>:
+
+  Iterator<int> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<int>(this);
+  }
+
+  int reduce(int combine(int value, int element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, int element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(int element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<int> where(bool f(int element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(int element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+
+  List<int> toList({ bool growable: true }) =>
+      new List<int>.from(this, growable: growable);
+
+  Set<int> toSet() => new Set<int>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<int> takeWhile(bool test(int value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<int> skipWhile(bool test(int value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  int firstWhere(bool test(int value), { int orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  int lastWhere(bool test(int value), {int orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  int singleWhere(bool test(int value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  int elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<int>:
+
+  void add(int value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<int>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<int> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(int a, int b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(int element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(int element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  int get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  int get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  int get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, int element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  int removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  int removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<int> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [int fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<int> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<int> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <int>[]);
+  }
+
+  Map<int, int> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<int> mixins.
+}
+
+@DocsEditable
+@DomName('Uint8Array')
+class Uint8List extends TypedData implements JavaScriptIndexingBehavior, List<int> native "Uint8Array" {
+
+  @DomName('Uint8Array.Uint8Array')
+  @DocsEditable
+  factory Uint8List(int length) =>
+    _TypedArrayFactoryProvider.createUint8List(length);
+
+  @DomName('Uint8Array.fromList')
+  @DocsEditable
+  factory Uint8List.fromList(List<int> list) =>
+    _TypedArrayFactoryProvider.createUint8List_fromList(list);
+
+  @DomName('Uint8Array.fromBuffer')
+  @DocsEditable
+  factory Uint8List.view(ByteBuffer buffer, [int byteOffset, int length]) => 
+    _TypedArrayFactoryProvider.createUint8List_fromBuffer(buffer, byteOffset, length);
+
+  static const int BYTES_PER_ELEMENT = 1;
+
+  @DomName('Uint8Array.length')
+  @DocsEditable
+  int get length => JS("int", "#.length", this);
+
+  int operator[](int index) => JS("int", "#[#]", this, index);
+
+  void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); }  // -- start List<int> mixins.
+  // int is the element type.
+
+  // From Iterable<int>:
+
+  Iterator<int> get iterator {
+    // Note: NodeLists are not fixed size. And most probably length shouldn't
+    // be cached in both iterator _and_ forEach method. For now caching it
+    // for consistency.
+    return new FixedSizeListIterator<int>(this);
+  }
+
+  int reduce(int combine(int value, int element)) {
+    return IterableMixinWorkaround.reduce(this, combine);
+  }
+
+  dynamic fold(dynamic initialValue,
+               dynamic combine(dynamic previousValue, int element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+
+  void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+
+  String join([String separator = ""]) =>
+      IterableMixinWorkaround.joinList(this, separator);
+
+  Iterable map(f(int element)) =>
+      IterableMixinWorkaround.mapList(this, f);
+
+  Iterable<int> where(bool f(int element)) =>
+      IterableMixinWorkaround.where(this, f);
+
+  Iterable expand(Iterable f(int element)) =>
+      IterableMixinWorkaround.expand(this, f);
+
+  bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+
+  bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+
+  List<int> toList({ bool growable: true }) =>
+      new List<int>.from(this, growable: growable);
+
+  Set<int> toSet() => new Set<int>.from(this);
+
+  bool get isEmpty => this.length == 0;
+
+  Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+  Iterable<int> takeWhile(bool test(int value)) {
+    return IterableMixinWorkaround.takeWhile(this, test);
+  }
+
+  Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+
+  Iterable<int> skipWhile(bool test(int value)) {
+    return IterableMixinWorkaround.skipWhile(this, test);
+  }
+
+  int firstWhere(bool test(int value), { int orElse() }) {
+    return IterableMixinWorkaround.firstWhere(this, test, orElse);
+  }
+
+  int lastWhere(bool test(int value), {int orElse()}) {
+    return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+  }
+
+  int singleWhere(bool test(int value)) {
+    return IterableMixinWorkaround.singleWhere(this, test);
+  }
+
+  int elementAt(int index) {
+    return this[index];
+  }
+
+  // From Collection<int>:
+
+  void add(int value) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void addAll(Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  // From List<int>:
+  void set length(int value) {
+    throw new UnsupportedError("Cannot resize immutable List.");
+  }
+
+  void clear() {
+    throw new UnsupportedError("Cannot clear immutable List.");
+  }
+
+  Iterable<int> get reversed {
+    return IterableMixinWorkaround.reversedList(this);
+  }
+
+  void sort([int compare(int a, int b)]) {
+    throw new UnsupportedError("Cannot sort immutable List.");
+  }
+
+  int indexOf(int element, [int start = 0]) =>
+      Lists.indexOf(this, element, start, this.length);
+
+  int lastIndexOf(int element, [int start]) {
+    if (start == null) start = length - 1;
+    return Lists.lastIndexOf(this, element, start);
+  }
+
+  int get first {
+    if (this.length > 0) return this[0];
+    throw new StateError("No elements");
+  }
+
+  int get last {
+    if (this.length > 0) return this[this.length - 1];
+    throw new StateError("No elements");
+  }
+
+  int get single {
+    if (length == 1) return this[0];
+    if (length == 0) throw new StateError("No elements");
+    throw new StateError("More than one element");
+  }
+
+  void insert(int index, int element) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void insertAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot add to immutable List.");
+  }
+
+  void setAll(int index, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  int removeAt(int pos) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  int removeLast() {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void remove(Object object) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void removeWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void retainWhere(bool test(int element)) {
+    throw new UnsupportedError("Cannot remove from immutable List.");
+  }
+
+  void setRange(int start, int end, Iterable<int> iterable, [int skipCount=0]) {
+    IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
+  }
+
+  void removeRange(int start, int end) {
+    throw new UnsupportedError("Cannot removeRange on immutable List.");
+  }
+
+  void replaceRange(int start, int end, Iterable<int> iterable) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  void fillRange(int start, int end, [int fillValue]) {
+    throw new UnsupportedError("Cannot modify an immutable List.");
+  }
+
+  Iterable<int> getRange(int start, int end) =>
+    IterableMixinWorkaround.getRangeList(this, start, end);
+
+  List<int> sublist(int start, [int end]) {
+    if (end == null) end = length;
+    return Lists.getRange(this, start, end, <int>[]);
+  }
+
+  Map<int, int> asMap() =>
+    IterableMixinWorkaround.asMapList(this);
+
+  String toString() {
+    StringBuffer buffer = new StringBuffer('[');
+    buffer.writeAll(this, ', ');
+    buffer.write(']');
+    return buffer.toString();
+  }
+
+  // -- end List<int> mixins.
+}
+
+
+class Int64List extends TypedData implements JavaScriptIndexingBehavior, List<int> {
+  factory Int64List(int length) {
+    throw new UnsupportedError("Int64List not supported by dart2js.");
+  }
+
+  factory Int64List.fromList(List<int> list) {
+    throw new UnsupportedError("Int64List not supported by dart2js.");
+  }
+
+  factory Int64List.view(ByteBuffer buffer, [int byteOffset, int length]) {
+    throw new UnsupportedError("Int64List not supported by dart2js.");
+  }
+
+  static const int BYTES_PER_ELEMENT = 8;
+}
+
+
+class Uint64List extends TypedData implements JavaScriptIndexingBehavior, List<int> {
+  factory Int64List(int length) {
+    throw new UnsupportedError("Int64List not supported by dart2js.");
+  }
+
+  factory Int64List.fromList(List<int> list) {
+    throw new UnsupportedError("Int64List not supported by dart2js.");
+  }
+
+  factory Int64List.view(ByteBuffer buffer, [int byteOffset, int length]) {
+    throw new UnsupportedError("Int64List not supported by dart2js.");
+  }
+
+  static const int BYTES_PER_ELEMENT = 8;
+}
+
+
+// TODO(vsm): Eliminate this class and just inline into above.
+class _TypedArrayFactoryProvider {
+  static ByteData createByteData(int length) => _B8(length);
+  static ByteData createByteData_fromBuffer(ByteBuffer buffer,
+                                  [int byteOffset = 0, int length]) {
+    if (length == null) return _B8_2(buffer, byteOffset);
+    return _B8_3(buffer, byteOffset, length);
+  }
+
+  static Float32List createFloat32List(int length) => _F32(length);
+  static Float32List createFloat32List_fromList(List<num> list) =>
+      _F32(ensureNative(list));
+  static Float32List createFloat32List_fromBuffer(ByteBuffer buffer,
+                                  [int byteOffset = 0, int length]) {
+    if (length == null) return _F32_2(buffer, byteOffset);
+    return _F32_3(buffer, byteOffset, length);
+  }
+
+  static Float64List createFloat64List(int length) => _F64(length);
+  static Float64List createFloat64List_fromList(List<num> list) =>
+      _F64(ensureNative(list));
+  static Float64List createFloat64List_fromBuffer(ByteBuffer buffer,
+      [int byteOffset = 0, int length]) {
+    if (length == null) return _F64_2(buffer, byteOffset);
+    return _F64_3(buffer, byteOffset, length);
+  }
+
+  static Int8List createInt8List(int length) => _I8(length);
+  static Int8List createInt8List_fromList(List<num> list) =>
+      _I8(ensureNative(list));
+  static Int8List createInt8List_fromBuffer(ByteBuffer buffer,
+      [int byteOffset = 0, int length]) {
+    if (length == null) return _I8_2(buffer, byteOffset);
+    return _I8_3(buffer, byteOffset, length);
+  }
+
+  static Int16List createInt16List(int length) => _I16(length);
+  static Int16List createInt16List_fromList(List<num> list) =>
+      _I16(ensureNative(list));
+  static Int16List createInt16List_fromBuffer(ByteBuffer buffer,
+      [int byteOffset = 0, int length]) {
+    if (length == null) return _I16_2(buffer, byteOffset);
+    return _I16_3(buffer, byteOffset, length);
+  }
+
+  static Int32List createInt32List(int length) => _I32(length);
+  static Int32List createInt32List_fromList(List<num> list) =>
+      _I32(ensureNative(list));
+  static Int32List createInt32List_fromBuffer(ByteBuffer buffer,
+      [int byteOffset = 0, int length]) {
+    if (length == null) return _I32_2(buffer, byteOffset);
+    return _I32_3(buffer, byteOffset, length);
+  }
+
+  static Uint8List createUint8List(int length) => _U8(length);
+  static Uint8List createUint8List_fromList(List<num> list) =>
+      _U8(ensureNative(list));
+  static Uint8List createUint8List_fromBuffer(ByteBuffer buffer,
+      [int byteOffset = 0, int length]) {
+    if (length == null) return _U8_2(buffer, byteOffset);
+    return _U8_3(buffer, byteOffset, length);
+  }
+
+  static Uint16List createUint16List(int length) => _U16(length);
+  static Uint16List createUint16List_fromList(List<num> list) =>
+      _U16(ensureNative(list));
+  static Uint16List createUint16List_fromBuffer(ByteBuffer buffer,
+      [int byteOffset = 0, int length]) {
+    if (length == null) return _U16_2(buffer, byteOffset);
+    return _U16_3(buffer, byteOffset, length);
+  }
+
+  static Uint32List createUint32List(int length) => _U32(length);
+  static Uint32List createUint32List_fromList(List<num> list) =>
+      _U32(ensureNative(list));
+  static Uint32List createUint32List_fromBuffer(ByteBuffer buffer,
+      [int byteOffset = 0, int length]) {
+    if (length == null) return _U32_2(buffer, byteOffset);
+    return _U32_3(buffer, byteOffset, length);
+  }
+
+  static Uint8ClampedList createUint8ClampedList(int length) => _U8C(length);
+  static Uint8ClampedList createUint8ClampedList_fromList(List<num> list) =>
+      _U8C(ensureNative(list));
+  static Uint8ClampedList createUint8ClampedList_fromBuffer(
+        ByteBuffer buffer, [int byteOffset = 0, int length]) {
+    if (length == null) return _U8C_2(buffer, byteOffset);
+    return _U8C_3(buffer, byteOffset, length);
+  }
+
+  static ByteData _B8(arg) =>
+      JS('ByteData', 'new DataView(new ArrayBuffer(#))', arg);
+  static Float32List _F32(arg) =>
+      JS('Float32List', 'new Float32Array(#)', arg);
+  static Float64List _F64(arg) =>
+      JS('Float64List', 'new Float64Array(#)', arg);
+  static Int8List _I8(arg) =>
+      JS('Int8List', 'new Int8Array(#)', arg);
+  static Int16List _I16(arg) =>
+      JS('Int16List', 'new Int16Array(#)', arg);
+  static Int32List _I32(arg) =>
+      JS('Int32List', 'new Int32Array(#)', arg);
+  static Uint8List _U8(arg) =>
+      JS('Uint8List', 'new Uint8Array(#)', arg);
+  static Uint16List _U16(arg) =>
+      JS('Uint16List', 'new Uint16Array(#)', arg);
+  static Uint32List _U32(arg) =>
+      JS('Uint32List', 'new Uint32Array(#)', arg);
+  static Uint8ClampedList _U8C(arg) =>
+      JS('Uint8ClampedList', 'new Uint8ClampedArray(#)', arg);
+
+  static ByteData _B8_2(arg1, arg2) =>
+      JS('ByteData', 'new DataView(#, #)', arg1, arg2);
+  static Float32List _F32_2(arg1, arg2) =>
+      JS('Float32List', 'new Float32Array(#, #)', arg1, arg2);
+  static Float64List _F64_2(arg1, arg2) =>
+      JS('Float64List', 'new Float64Array(#, #)', arg1, arg2);
+  static Int8List _I8_2(arg1, arg2) =>
+      JS('Int8List', 'new Int8Array(#, #)', arg1, arg2);
+  static Int16List _I16_2(arg1, arg2) =>
+      JS('Int16List', 'new Int16Array(#, #)', arg1, arg2);
+  static Int32List _I32_2(arg1, arg2) =>
+      JS('Int32List', 'new Int32Array(#, #)', arg1, arg2);
+  static Uint8List _U8_2(arg1, arg2) =>
+      JS('Uint8List', 'new Uint8Array(#, #)', arg1, arg2);
+  static Uint16List _U16_2(arg1, arg2) =>
+      JS('Uint16List', 'new Uint16Array(#, #)', arg1, arg2);
+  static Uint32List _U32_2(arg1, arg2) =>
+      JS('Uint32List', 'new Uint32Array(#, #)', arg1, arg2);
+  static Uint8ClampedList _U8C_2(arg1, arg2) =>
+      JS('Uint8ClampedList', 'new Uint8ClampedArray(#, #)', arg1, arg2);
+
+  static ByteData _B8_3(arg1, arg2, arg3) =>
+      JS('ByteData', 'new DataView(#, #, #)', arg1, arg2, arg3);
+  static Float32List _F32_3(arg1, arg2, arg3) =>
+      JS('Float32List', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
+  static Float64List _F64_3(arg1, arg2, arg3) =>
+      JS('Float64List', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
+  static Int8List _I8_3(arg1, arg2, arg3) =>
+      JS('Int8List', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
+  static Int16List _I16_3(arg1, arg2, arg3) =>
+      JS('Int16List', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
+  static Int32List _I32_3(arg1, arg2, arg3) =>
+      JS('Int32List', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
+  static Uint8List _U8_3(arg1, arg2, arg3) =>
+      JS('Uint8List', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
+  static Uint16List _U16_3(arg1, arg2, arg3) =>
+      JS('Uint16List', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
+  static Uint32List _U32_3(arg1, arg2, arg3) =>
+      JS('Uint32List', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
+  static Uint8ClampedList _U8C_3(arg1, arg2, arg3) =>
+      JS('Uint8ClampedList', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3);
+
+
+  // Ensures that [list] is a JavaScript Array or a typed array.  If necessary,
+  // copies the list.
+  static ensureNative(List list) => list;  // TODO: make sure.
+}
diff --git a/sdk/lib/typeddata/typeddata.dart b/sdk/lib/typed_data/typed_data.dart
similarity index 99%
rename from sdk/lib/typeddata/typeddata.dart
rename to sdk/lib/typed_data/typed_data.dart
index e90f3ce..55274b2 100644
--- a/sdk/lib/typeddata/typeddata.dart
+++ b/sdk/lib/typed_data/typed_data.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.
 
-library dart.typeddata;
+library dart.typed_data;
 
 import 'dart:collection';
 import 'dart:_collection-dev';
@@ -826,6 +826,7 @@
  */
 abstract class Float32x4 {
   external factory Float32x4(double x, double y, double z, double w);
+  external factory Float32x4.splat(double v);
   external factory Float32x4.zero();
 
   /// Addition operator.
diff --git a/sdk/lib/typeddata/typeddata_sources.gypi b/sdk/lib/typed_data/typed_data_sources.gypi
similarity index 92%
rename from sdk/lib/typeddata/typeddata_sources.gypi
rename to sdk/lib/typed_data/typed_data_sources.gypi
index 92ce89d..3cad00d 100644
--- a/sdk/lib/typeddata/typeddata_sources.gypi
+++ b/sdk/lib/typed_data/typed_data_sources.gypi
@@ -4,7 +4,7 @@
 
 {
   'sources': [
-    'typeddata.dart',
+    'typed_data.dart',
     # The above file needs to be first if additional parts are added to the lib.
   ],
 }
diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
index 7dd2c2a..1dea2a1 100644
--- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
@@ -5,6 +5,7 @@
 import 'dart:_collection-dev';
 import 'dart:html';
 import 'dart:html_common';
+import 'dart:typed_data';
 import 'dart:_js_helper' show Creates, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 // DO NOT EDIT - unless you are editing documentation as per:
@@ -21,7 +22,7 @@
 
 @DocsEditable
 @DomName('AnalyserNode')
-class AnalyserNode extends AudioNode native "*AnalyserNode" {
+class AnalyserNode extends AudioNode native "AnalyserNode" {
 
   @DomName('AnalyserNode.fftSize')
   @DocsEditable
@@ -45,15 +46,15 @@
 
   @DomName('AnalyserNode.getByteFrequencyData')
   @DocsEditable
-  void getByteFrequencyData(Uint8Array array) native;
+  void getByteFrequencyData(Uint8List array) native;
 
   @DomName('AnalyserNode.getByteTimeDomainData')
   @DocsEditable
-  void getByteTimeDomainData(Uint8Array array) native;
+  void getByteTimeDomainData(Uint8List array) native;
 
   @DomName('AnalyserNode.getFloatFrequencyData')
   @DocsEditable
-  void getFloatFrequencyData(Float32Array array) native;
+  void getFloatFrequencyData(Float32List array) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -62,7 +63,7 @@
 
 @DocsEditable
 @DomName('AudioBuffer')
-class AudioBuffer native "*AudioBuffer" {
+class AudioBuffer native "AudioBuffer" {
 
   @DomName('AudioBuffer.duration')
   @DocsEditable
@@ -86,8 +87,8 @@
 
   @DomName('AudioBuffer.getChannelData')
   @DocsEditable
-  @Returns('Float32Array')
-  @Creates('Float32Array')
+  @Returns('Float32List')
+  @Creates('Float32List')
   List<double> getChannelData(int channelIndex) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -104,7 +105,7 @@
 
 
 @DomName('AudioBufferSourceNode')
-class AudioBufferSourceNode extends AudioSourceNode native "*AudioBufferSourceNode" {
+class AudioBufferSourceNode extends AudioSourceNode native "AudioBufferSourceNode" {
 
   // TODO(efortuna): Remove these methods when Chrome stable also uses start
   // instead of noteOn.
@@ -179,7 +180,7 @@
 
 
 @DomName('AudioContext')
-class AudioContext extends EventTarget native "*AudioContext" {
+class AudioContext extends EventTarget native "AudioContext" {
 
   @DomName('AudioContext.completeEvent')
   @DocsEditable
@@ -270,11 +271,11 @@
 
   @DomName('AudioContext.createWaveTable')
   @DocsEditable
-  WaveTable createWaveTable(Float32Array real, Float32Array imag) native;
+  WaveTable createWaveTable(Float32List real, Float32List imag) native;
 
   @DomName('AudioContext.decodeAudioData')
   @DocsEditable
-  void decodeAudioData(/*ArrayBuffer*/ audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) native;
+  void decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) native;
 
   @DomName('AudioContext.startRendering')
   @DocsEditable
@@ -318,7 +319,7 @@
 
 @DocsEditable
 @DomName('AudioDestinationNode')
-class AudioDestinationNode extends AudioNode native "*AudioDestinationNode" {
+class AudioDestinationNode extends AudioNode native "AudioDestinationNode" {
 
   @DomName('AudioDestinationNode.maxChannelCount')
   @DocsEditable
@@ -331,7 +332,7 @@
 
 @DocsEditable
 @DomName('AudioListener')
-class AudioListener native "*AudioListener" {
+class AudioListener native "AudioListener" {
 
   @DomName('AudioListener.dopplerFactor')
   @DocsEditable
@@ -360,7 +361,7 @@
 
 @DocsEditable
 @DomName('AudioNode')
-class AudioNode native "*AudioNode" {
+class AudioNode native "AudioNode" {
 
   @DomName('AudioNode.channelCount')
   @DocsEditable
@@ -401,7 +402,7 @@
 
 @DocsEditable
 @DomName('AudioParam')
-class AudioParam native "*AudioParam" {
+class AudioParam native "AudioParam" {
 
   @DomName('AudioParam.defaultValue')
   @DocsEditable
@@ -449,7 +450,7 @@
 
   @DomName('AudioParam.setValueCurveAtTime')
   @DocsEditable
-  void setValueCurveAtTime(Float32Array values, num time, num duration) native;
+  void setValueCurveAtTime(Float32List values, num time, num duration) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -458,7 +459,7 @@
 
 @DocsEditable
 @DomName('AudioProcessingEvent')
-class AudioProcessingEvent extends Event native "*AudioProcessingEvent" {
+class AudioProcessingEvent extends Event native "AudioProcessingEvent" {
 
   @DomName('AudioProcessingEvent.inputBuffer')
   @DocsEditable
@@ -475,7 +476,7 @@
 
 @DocsEditable
 @DomName('AudioSourceNode')
-class AudioSourceNode extends AudioNode native "*AudioSourceNode" {
+class AudioSourceNode extends AudioNode native "AudioSourceNode" {
 }
 // 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
@@ -484,7 +485,7 @@
 
 @DocsEditable
 @DomName('BiquadFilterNode')
-class BiquadFilterNode extends AudioNode native "*BiquadFilterNode" {
+class BiquadFilterNode extends AudioNode native "BiquadFilterNode" {
 
   static const int ALLPASS = 7;
 
@@ -524,7 +525,7 @@
 
   @DomName('BiquadFilterNode.getFrequencyResponse')
   @DocsEditable
-  void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse) native;
+  void getFrequencyResponse(Float32List frequencyHz, Float32List magResponse, Float32List phaseResponse) native;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -533,7 +534,7 @@
 
 @DocsEditable
 @DomName('ChannelMergerNode')
-class ChannelMergerNode extends AudioNode native "*ChannelMergerNode" {
+class ChannelMergerNode extends AudioNode native "ChannelMergerNode" {
 }
 // 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
@@ -542,7 +543,7 @@
 
 @DocsEditable
 @DomName('ChannelSplitterNode')
-class ChannelSplitterNode extends AudioNode native "*ChannelSplitterNode" {
+class ChannelSplitterNode extends AudioNode native "ChannelSplitterNode" {
 }
 // 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
@@ -551,7 +552,7 @@
 
 @DocsEditable
 @DomName('ConvolverNode')
-class ConvolverNode extends AudioNode native "*ConvolverNode" {
+class ConvolverNode extends AudioNode native "ConvolverNode" {
 
   @DomName('ConvolverNode.buffer')
   @DocsEditable
@@ -568,7 +569,7 @@
 
 @DocsEditable
 @DomName('DelayNode')
-class DelayNode extends AudioNode native "*DelayNode" {
+class DelayNode extends AudioNode native "DelayNode" {
 
   @DomName('DelayNode.delayTime')
   @DocsEditable
@@ -581,7 +582,7 @@
 
 @DocsEditable
 @DomName('DynamicsCompressorNode')
-class DynamicsCompressorNode extends AudioNode native "*DynamicsCompressorNode" {
+class DynamicsCompressorNode extends AudioNode native "DynamicsCompressorNode" {
 
   @DomName('DynamicsCompressorNode.attack')
   @DocsEditable
@@ -614,7 +615,7 @@
 
 @DocsEditable
 @DomName('GainNode')
-class GainNode extends AudioNode native "*GainNode" {
+class GainNode extends AudioNode native "GainNode" {
 
   @DomName('GainNode.gain')
   @DocsEditable
@@ -627,7 +628,7 @@
 
 @DocsEditable
 @DomName('MediaElementAudioSourceNode')
-class MediaElementAudioSourceNode extends AudioSourceNode native "*MediaElementAudioSourceNode" {
+class MediaElementAudioSourceNode extends AudioSourceNode native "MediaElementAudioSourceNode" {
 
   @DomName('MediaElementAudioSourceNode.mediaElement')
   @DocsEditable
@@ -640,7 +641,7 @@
 
 @DocsEditable
 @DomName('MediaStreamAudioDestinationNode')
-class MediaStreamAudioDestinationNode extends AudioSourceNode native "*MediaStreamAudioDestinationNode" {
+class MediaStreamAudioDestinationNode extends AudioSourceNode native "MediaStreamAudioDestinationNode" {
 
   @DomName('MediaStreamAudioDestinationNode.stream')
   @DocsEditable
@@ -653,7 +654,7 @@
 
 @DocsEditable
 @DomName('MediaStreamAudioSourceNode')
-class MediaStreamAudioSourceNode extends AudioSourceNode native "*MediaStreamAudioSourceNode" {
+class MediaStreamAudioSourceNode extends AudioSourceNode native "MediaStreamAudioSourceNode" {
 
   @DomName('MediaStreamAudioSourceNode.mediaStream')
   @DocsEditable
@@ -666,7 +667,7 @@
 
 @DocsEditable
 @DomName('OfflineAudioCompletionEvent')
-class OfflineAudioCompletionEvent extends Event native "*OfflineAudioCompletionEvent" {
+class OfflineAudioCompletionEvent extends Event native "OfflineAudioCompletionEvent" {
 
   @DomName('OfflineAudioCompletionEvent.renderedBuffer')
   @DocsEditable
@@ -679,7 +680,7 @@
 
 @DocsEditable
 @DomName('OfflineAudioContext')
-class OfflineAudioContext extends AudioContext implements EventTarget native "*OfflineAudioContext" {
+class OfflineAudioContext extends AudioContext implements EventTarget native "OfflineAudioContext" {
 
   @DomName('OfflineAudioContext.OfflineAudioContext')
   @DocsEditable
@@ -695,7 +696,7 @@
 
 @DocsEditable
 @DomName('OscillatorNode')
-class OscillatorNode extends AudioSourceNode native "*OscillatorNode" {
+class OscillatorNode extends AudioSourceNode native "OscillatorNode" {
 
   static const int CUSTOM = 4;
 
@@ -750,7 +751,7 @@
 
 @DocsEditable
 @DomName('PannerNode')
-class PannerNode extends AudioNode native "*PannerNode" {
+class PannerNode extends AudioNode native "PannerNode" {
 
   static const int EQUALPOWER = 0;
 
@@ -814,7 +815,7 @@
 
 
 @DomName('ScriptProcessorNode')
-class ScriptProcessorNode extends AudioNode native "*ScriptProcessorNode" {
+class ScriptProcessorNode extends AudioNode native "ScriptProcessorNode" {
   Stream<AudioProcessingEvent> _eventStream;
 
   /**
@@ -860,12 +861,12 @@
 
 @DocsEditable
 @DomName('WaveShaperNode')
-class WaveShaperNode extends AudioNode native "*WaveShaperNode" {
+class WaveShaperNode extends AudioNode native "WaveShaperNode" {
 
   @DomName('WaveShaperNode.curve')
   @DocsEditable
-  @Returns('Float32Array')
-  @Creates('Float32Array')
+  @Returns('Float32List')
+  @Creates('Float32List')
   List<double> curve;
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -875,5 +876,5 @@
 
 @DocsEditable
 @DomName('WaveTable')
-class WaveTable native "*WaveTable" {
+class WaveTable native "WaveTable" {
 }
diff --git a/sdk/lib/web_audio/dartium/web_audio_dartium.dart b/sdk/lib/web_audio/dartium/web_audio_dartium.dart
index 99294d2..0a06b2e 100644
--- a/sdk/lib/web_audio/dartium/web_audio_dartium.dart
+++ b/sdk/lib/web_audio/dartium/web_audio_dartium.dart
@@ -6,7 +6,7 @@
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
-import 'dart:typeddata' as _typeddata;
+import 'dart:typed_data';
 // DO NOT EDIT
 // Auto-generated dart:audio library.
 
@@ -272,7 +272,7 @@
     if ((buffer_OR_numberOfChannels is int || buffer_OR_numberOfChannels == null) && (mixToMono_OR_numberOfFrames is int || mixToMono_OR_numberOfFrames == null) && (sampleRate is num || sampleRate == null)) {
       return _createBuffer_1(buffer_OR_numberOfChannels, mixToMono_OR_numberOfFrames, sampleRate);
     }
-    if ((buffer_OR_numberOfChannels is ArrayBuffer || buffer_OR_numberOfChannels is _typeddata.ByteBuffer || buffer_OR_numberOfChannels == null) && (mixToMono_OR_numberOfFrames is bool || mixToMono_OR_numberOfFrames == null) && !?sampleRate) {
+    if ((buffer_OR_numberOfChannels is ByteBuffer || buffer_OR_numberOfChannels == null) && (mixToMono_OR_numberOfFrames is bool || mixToMono_OR_numberOfFrames == null) && !?sampleRate) {
       return _createBuffer_2(buffer_OR_numberOfChannels, mixToMono_OR_numberOfFrames);
     }
     throw new ArgumentError("Incorrect number or type of arguments");
@@ -399,7 +399,7 @@
 
   @DomName('AudioContext.decodeAudioData')
   @DocsEditable
-  void decodeAudioData(/*ArrayBuffer*/ audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) native "AudioContext_decodeAudioData_Callback";
+  void decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) native "AudioContext_decodeAudioData_Callback";
 
   @DomName('AudioContext.startRendering')
   @DocsEditable
diff --git a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
index b7eaa46..2c5f0ee 100644
--- a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
+++ b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
@@ -4,6 +4,7 @@
 import 'dart:_collection-dev';
 import 'dart:html';
 import 'dart:html_common';
+import 'dart:typed_data';
 import 'dart:_js_helper' show Creates, JSName, Null, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 // DO NOT EDIT - unless you are editing documentation as per:
@@ -322,7 +323,7 @@
 
 @DocsEditable
 @DomName('WebGLActiveInfo')
-class ActiveInfo native "*WebGLActiveInfo" {
+class ActiveInfo native "WebGLActiveInfo" {
 
   @DomName('WebGLActiveInfo.name')
   @DocsEditable
@@ -343,7 +344,7 @@
 
 @DocsEditable
 @DomName('WebGLBuffer')
-class Buffer native "*WebGLBuffer" {
+class Buffer native "WebGLBuffer" {
 }
 // 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
@@ -352,7 +353,7 @@
 
 @DocsEditable
 @DomName('WebGLCompressedTextureATC')
-class CompressedTextureAtc native "*WebGLCompressedTextureATC" {
+class CompressedTextureAtc native "WebGLCompressedTextureATC" {
 
   static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
 
@@ -367,7 +368,7 @@
 
 @DocsEditable
 @DomName('WebGLCompressedTexturePVRTC')
-class CompressedTexturePvrtc native "*WebGLCompressedTexturePVRTC" {
+class CompressedTexturePvrtc native "WebGLCompressedTexturePVRTC" {
 
   static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
 
@@ -384,7 +385,7 @@
 
 @DocsEditable
 @DomName('WebGLCompressedTextureS3TC')
-class CompressedTextureS3TC native "*WebGLCompressedTextureS3TC" {
+class CompressedTextureS3TC native "WebGLCompressedTextureS3TC" {
 
   static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
 
@@ -401,7 +402,7 @@
 
 @DocsEditable
 @DomName('WebGLContextAttributes')
-class ContextAttributes native "*WebGLContextAttributes" {
+class ContextAttributes native "WebGLContextAttributes" {
 
   @DomName('WebGLContextAttributes.alpha')
   @DocsEditable
@@ -434,7 +435,7 @@
 
 @DocsEditable
 @DomName('WebGLContextEvent')
-class ContextEvent extends Event native "*WebGLContextEvent" {
+class ContextEvent extends Event native "WebGLContextEvent" {
 
   @DomName('WebGLContextEvent.statusMessage')
   @DocsEditable
@@ -447,7 +448,7 @@
 
 @DocsEditable
 @DomName('WebGLDebugRendererInfo')
-class DebugRendererInfo native "*WebGLDebugRendererInfo" {
+class DebugRendererInfo native "WebGLDebugRendererInfo" {
 
   static const int UNMASKED_RENDERER_WEBGL = 0x9246;
 
@@ -460,7 +461,7 @@
 
 @DocsEditable
 @DomName('WebGLDebugShaders')
-class DebugShaders native "*WebGLDebugShaders" {
+class DebugShaders native "WebGLDebugShaders" {
 
   @DomName('WebGLDebugShaders.getTranslatedShaderSource')
   @DocsEditable
@@ -473,7 +474,7 @@
 
 @DocsEditable
 @DomName('WebGLDepthTexture')
-class DepthTexture native "*WebGLDepthTexture" {
+class DepthTexture native "WebGLDepthTexture" {
 
   static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
 }
@@ -484,7 +485,7 @@
 
 @DocsEditable
 @DomName('EXTDrawBuffers')
-class ExtDrawBuffers native "*EXTDrawBuffers" {
+class ExtDrawBuffers native "EXTDrawBuffers" {
 
   static const int COLOR_ATTACHMENT0_EXT = 0x8CE0;
 
@@ -561,7 +562,7 @@
 
 @DocsEditable
 @DomName('EXTTextureFilterAnisotropic')
-class ExtTextureFilterAnisotropic native "*EXTTextureFilterAnisotropic" {
+class ExtTextureFilterAnisotropic native "EXTTextureFilterAnisotropic" {
 
   static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
 
@@ -574,7 +575,7 @@
 
 @DocsEditable
 @DomName('WebGLFramebuffer')
-class Framebuffer native "*WebGLFramebuffer" {
+class Framebuffer native "WebGLFramebuffer" {
 }
 // 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
@@ -583,7 +584,7 @@
 
 @DocsEditable
 @DomName('WebGLLoseContext')
-class LoseContext native "*WebGLLoseContext" {
+class LoseContext native "WebGLLoseContext" {
 
   @DomName('WebGLLoseContext.loseContext')
   @DocsEditable
@@ -600,7 +601,7 @@
 
 @DocsEditable
 @DomName('OESElementIndexUint')
-class OesElementIndexUint native "*OESElementIndexUint" {
+class OesElementIndexUint native "OESElementIndexUint" {
 }
 // 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
@@ -609,7 +610,7 @@
 
 @DocsEditable
 @DomName('OESStandardDerivatives')
-class OesStandardDerivatives native "*OESStandardDerivatives" {
+class OesStandardDerivatives native "OESStandardDerivatives" {
 
   static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
 }
@@ -620,7 +621,7 @@
 
 @DocsEditable
 @DomName('OESTextureFloat')
-class OesTextureFloat native "*OESTextureFloat" {
+class OesTextureFloat native "OESTextureFloat" {
 }
 // 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
@@ -629,7 +630,7 @@
 
 @DocsEditable
 @DomName('OESTextureHalfFloat')
-class OesTextureHalfFloat native "*OESTextureHalfFloat" {
+class OesTextureHalfFloat native "OESTextureHalfFloat" {
 }
 // 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
@@ -638,7 +639,7 @@
 
 @DocsEditable
 @DomName('OESVertexArrayObject')
-class OesVertexArrayObject native "*OESVertexArrayObject" {
+class OesVertexArrayObject native "OESVertexArrayObject" {
 
   static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
 
@@ -669,7 +670,7 @@
 
 @DocsEditable
 @DomName('WebGLProgram')
-class Program native "*WebGLProgram" {
+class Program native "WebGLProgram" {
 }
 // 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
@@ -678,7 +679,7 @@
 
 @DocsEditable
 @DomName('WebGLRenderbuffer')
-class Renderbuffer native "*WebGLRenderbuffer" {
+class Renderbuffer native "WebGLRenderbuffer" {
 }
 // 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
@@ -690,7 +691,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @Experimental
-class RenderingContext extends CanvasRenderingContext native "*WebGLRenderingContext" {
+class RenderingContext extends CanvasRenderingContext native "WebGLRenderingContext" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(window.WebGLRenderingContext)');
@@ -1349,7 +1350,7 @@
 
   @DomName('WebGLRenderingContext.bufferSubData')
   @DocsEditable
-  void bufferSubData(int target, int offset, /*ArrayBuffer*/ data) native;
+  void bufferSubData(int target, int offset, data) native;
 
   @DomName('WebGLRenderingContext.checkFramebufferStatus')
   @DocsEditable
@@ -1381,11 +1382,11 @@
 
   @DomName('WebGLRenderingContext.compressedTexImage2D')
   @DocsEditable
-  void compressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, /*ArrayBufferView*/ data) native;
+  void compressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, TypedData data) native;
 
   @DomName('WebGLRenderingContext.compressedTexSubImage2D')
   @DocsEditable
-  void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, /*ArrayBufferView*/ data) native;
+  void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, TypedData data) native;
 
   @DomName('WebGLRenderingContext.copyTexImage2D')
   @DocsEditable
@@ -1549,8 +1550,8 @@
 
   @DomName('WebGLRenderingContext.getParameter')
   @DocsEditable
-  @Creates('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array|Framebuffer|Renderbuffer|Texture')
-  @Returns('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array|Framebuffer|Renderbuffer|Texture')
+  @Creates('Null|num|String|bool|=List|Float32List|Int32List|Uint32List|Framebuffer|Renderbuffer|Texture')
+  @Returns('Null|num|String|bool|=List|Float32List|Int32List|Uint32List|Framebuffer|Renderbuffer|Texture')
   Object getParameter(int pname) native;
 
   @DomName('WebGLRenderingContext.getProgramInfoLog')
@@ -1659,7 +1660,7 @@
 
   @DomName('WebGLRenderingContext.readPixels')
   @DocsEditable
-  void readPixels(int x, int y, int width, int height, int format, int type, /*ArrayBufferView*/ pixels) native;
+  void readPixels(int x, int y, int width, int height, int format, int type, TypedData pixels) native;
 
   @DomName('WebGLRenderingContext.releaseShaderCompiler')
   @DocsEditable
@@ -1707,8 +1708,8 @@
 
   @DomName('WebGLRenderingContext.texImage2D')
   @DocsEditable
-  void texImage2D(int target, int level, int internalformat, int format_OR_width, int height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, [int format, int type, /*ArrayBufferView*/ pixels]) {
-    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && ?pixels) {
+  void texImage2D(int target, int level, int internalformat, int format_OR_width, int height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, [int format, int type, TypedData pixels]) {
+    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_video == null)) {
       _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
       return;
     }
@@ -1734,7 +1735,7 @@
   @JSName('texImage2D')
   @DomName('WebGLRenderingContext.texImage2D')
   @DocsEditable
-  void _texImage2D_1(target, level, internalformat, width, height, int border, format, type, pixels) native;
+  void _texImage2D_1(target, level, internalformat, width, height, int border, format, type, TypedData pixels) native;
   @JSName('texImage2D')
   @DomName('WebGLRenderingContext.texImage2D')
   @DocsEditable
@@ -1762,8 +1763,8 @@
 
   @DomName('WebGLRenderingContext.texSubImage2D')
   @DocsEditable
-  void texSubImage2D(int target, int level, int xoffset, int yoffset, int format_OR_width, int height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, [int type, /*ArrayBufferView*/ pixels]) {
-    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && ?pixels) {
+  void texSubImage2D(int target, int level, int xoffset, int yoffset, int format_OR_width, int height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, [int type, TypedData pixels]) {
+    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format_OR_image_OR_pixels_OR_video == null)) {
       _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
       return;
     }
@@ -1789,7 +1790,7 @@
   @JSName('texSubImage2D')
   @DomName('WebGLRenderingContext.texSubImage2D')
   @DocsEditable
-  void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int format, type, pixels) native;
+  void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int format, type, TypedData pixels) native;
   @JSName('texSubImage2D')
   @DomName('WebGLRenderingContext.texSubImage2D')
   @DocsEditable
@@ -1813,7 +1814,7 @@
 
   @DomName('WebGLRenderingContext.uniform1fv')
   @DocsEditable
-  void uniform1fv(UniformLocation location, Float32Array v) native;
+  void uniform1fv(UniformLocation location, Float32List v) native;
 
   @DomName('WebGLRenderingContext.uniform1i')
   @DocsEditable
@@ -1821,7 +1822,7 @@
 
   @DomName('WebGLRenderingContext.uniform1iv')
   @DocsEditable
-  void uniform1iv(UniformLocation location, Int32Array v) native;
+  void uniform1iv(UniformLocation location, Int32List v) native;
 
   @DomName('WebGLRenderingContext.uniform2f')
   @DocsEditable
@@ -1829,7 +1830,7 @@
 
   @DomName('WebGLRenderingContext.uniform2fv')
   @DocsEditable
-  void uniform2fv(UniformLocation location, Float32Array v) native;
+  void uniform2fv(UniformLocation location, Float32List v) native;
 
   @DomName('WebGLRenderingContext.uniform2i')
   @DocsEditable
@@ -1837,7 +1838,7 @@
 
   @DomName('WebGLRenderingContext.uniform2iv')
   @DocsEditable
-  void uniform2iv(UniformLocation location, Int32Array v) native;
+  void uniform2iv(UniformLocation location, Int32List v) native;
 
   @DomName('WebGLRenderingContext.uniform3f')
   @DocsEditable
@@ -1845,7 +1846,7 @@
 
   @DomName('WebGLRenderingContext.uniform3fv')
   @DocsEditable
-  void uniform3fv(UniformLocation location, Float32Array v) native;
+  void uniform3fv(UniformLocation location, Float32List v) native;
 
   @DomName('WebGLRenderingContext.uniform3i')
   @DocsEditable
@@ -1853,7 +1854,7 @@
 
   @DomName('WebGLRenderingContext.uniform3iv')
   @DocsEditable
-  void uniform3iv(UniformLocation location, Int32Array v) native;
+  void uniform3iv(UniformLocation location, Int32List v) native;
 
   @DomName('WebGLRenderingContext.uniform4f')
   @DocsEditable
@@ -1861,7 +1862,7 @@
 
   @DomName('WebGLRenderingContext.uniform4fv')
   @DocsEditable
-  void uniform4fv(UniformLocation location, Float32Array v) native;
+  void uniform4fv(UniformLocation location, Float32List v) native;
 
   @DomName('WebGLRenderingContext.uniform4i')
   @DocsEditable
@@ -1869,19 +1870,19 @@
 
   @DomName('WebGLRenderingContext.uniform4iv')
   @DocsEditable
-  void uniform4iv(UniformLocation location, Int32Array v) native;
+  void uniform4iv(UniformLocation location, Int32List v) native;
 
   @DomName('WebGLRenderingContext.uniformMatrix2fv')
   @DocsEditable
-  void uniformMatrix2fv(UniformLocation location, bool transpose, Float32Array array) native;
+  void uniformMatrix2fv(UniformLocation location, bool transpose, Float32List array) native;
 
   @DomName('WebGLRenderingContext.uniformMatrix3fv')
   @DocsEditable
-  void uniformMatrix3fv(UniformLocation location, bool transpose, Float32Array array) native;
+  void uniformMatrix3fv(UniformLocation location, bool transpose, Float32List array) native;
 
   @DomName('WebGLRenderingContext.uniformMatrix4fv')
   @DocsEditable
-  void uniformMatrix4fv(UniformLocation location, bool transpose, Float32Array array) native;
+  void uniformMatrix4fv(UniformLocation location, bool transpose, Float32List array) native;
 
   @DomName('WebGLRenderingContext.useProgram')
   @DocsEditable
@@ -1897,7 +1898,7 @@
 
   @DomName('WebGLRenderingContext.vertexAttrib1fv')
   @DocsEditable
-  void vertexAttrib1fv(int indx, Float32Array values) native;
+  void vertexAttrib1fv(int indx, Float32List values) native;
 
   @DomName('WebGLRenderingContext.vertexAttrib2f')
   @DocsEditable
@@ -1905,7 +1906,7 @@
 
   @DomName('WebGLRenderingContext.vertexAttrib2fv')
   @DocsEditable
-  void vertexAttrib2fv(int indx, Float32Array values) native;
+  void vertexAttrib2fv(int indx, Float32List values) native;
 
   @DomName('WebGLRenderingContext.vertexAttrib3f')
   @DocsEditable
@@ -1913,7 +1914,7 @@
 
   @DomName('WebGLRenderingContext.vertexAttrib3fv')
   @DocsEditable
-  void vertexAttrib3fv(int indx, Float32Array values) native;
+  void vertexAttrib3fv(int indx, Float32List values) native;
 
   @DomName('WebGLRenderingContext.vertexAttrib4f')
   @DocsEditable
@@ -1921,7 +1922,7 @@
 
   @DomName('WebGLRenderingContext.vertexAttrib4fv')
   @DocsEditable
-  void vertexAttrib4fv(int indx, Float32Array values) native;
+  void vertexAttrib4fv(int indx, Float32List values) native;
 
   @DomName('WebGLRenderingContext.vertexAttribPointer')
   @DocsEditable
@@ -1938,7 +1939,7 @@
 
 @DocsEditable
 @DomName('WebGLShader')
-class Shader native "*WebGLShader" {
+class Shader native "WebGLShader" {
 }
 // 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
@@ -1947,7 +1948,7 @@
 
 @DocsEditable
 @DomName('WebGLShaderPrecisionFormat')
-class ShaderPrecisionFormat native "*WebGLShaderPrecisionFormat" {
+class ShaderPrecisionFormat native "WebGLShaderPrecisionFormat" {
 
   @DomName('WebGLShaderPrecisionFormat.precision')
   @DocsEditable
@@ -1968,7 +1969,7 @@
 
 @DocsEditable
 @DomName('WebGLTexture')
-class Texture native "*WebGLTexture" {
+class Texture native "WebGLTexture" {
 }
 // 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
@@ -1977,7 +1978,7 @@
 
 @DocsEditable
 @DomName('WebGLUniformLocation')
-class UniformLocation native "*WebGLUniformLocation" {
+class UniformLocation native "WebGLUniformLocation" {
 }
 // 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
@@ -1986,5 +1987,5 @@
 
 @DocsEditable
 @DomName('WebGLVertexArrayObjectOES')
-class VertexArrayObject native "*WebGLVertexArrayObjectOES" {
+class VertexArrayObject native "WebGLVertexArrayObjectOES" {
 }
diff --git a/sdk/lib/web_gl/dartium/web_gl_dartium.dart b/sdk/lib/web_gl/dartium/web_gl_dartium.dart
index b8c6d3c..e0a973c 100644
--- a/sdk/lib/web_gl/dartium/web_gl_dartium.dart
+++ b/sdk/lib/web_gl/dartium/web_gl_dartium.dart
@@ -6,7 +6,7 @@
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
-import 'dart:typeddata' as _typeddata;
+import 'dart:typed_data';
 // DO NOT EDIT
 // Auto-generated dart:web_gl library.
 
@@ -1451,11 +1451,11 @@
   void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) native "WebGLRenderingContext_blendFuncSeparate_Callback";
 
   void bufferData(int target, data_OR_size, int usage) {
-    if ((target is int || target == null) && (data_OR_size is ArrayBufferView || data_OR_size is _typeddata.TypedData || data_OR_size == null) && (usage is int || usage == null)) {
+    if ((target is int || target == null) && (data_OR_size is TypedData || data_OR_size == null) && (usage is int || usage == null)) {
       _bufferData_1(target, data_OR_size, usage);
       return;
     }
-    if ((target is int || target == null) && (data_OR_size is ArrayBuffer || data_OR_size is _typeddata.ByteBuffer || data_OR_size == null) && (usage is int || usage == null)) {
+    if ((target is int || target == null) && (data_OR_size is ByteBuffer || data_OR_size == null) && (usage is int || usage == null)) {
       _bufferData_2(target, data_OR_size, usage);
       return;
     }
@@ -1478,12 +1478,12 @@
   @DocsEditable
   void _bufferData_3(target, data_OR_size, usage) native "WebGLRenderingContext__bufferData_3_Callback";
 
-  void bufferSubData(int target, int offset, /*ArrayBuffer*/ data) {
-    if ((target is int || target == null) && (offset is int || offset == null) && (data is ArrayBufferView || data is _typeddata.TypedData || data == null)) {
+  void bufferSubData(int target, int offset, data) {
+    if ((target is int || target == null) && (offset is int || offset == null) && (data is TypedData || data == null)) {
       _bufferSubData_1(target, offset, data);
       return;
     }
-    if ((target is int || target == null) && (offset is int || offset == null) && (data is ArrayBuffer || data is _typeddata.ByteBuffer || data == null)) {
+    if ((target is int || target == null) && (offset is int || offset == null) && (data is ByteBuffer || data == null)) {
       _bufferSubData_2(target, offset, data);
       return;
     }
@@ -1528,11 +1528,11 @@
 
   @DomName('WebGLRenderingContext.compressedTexImage2D')
   @DocsEditable
-  void compressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, /*ArrayBufferView*/ data) native "WebGLRenderingContext_compressedTexImage2D_Callback";
+  void compressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, TypedData data) native "WebGLRenderingContext_compressedTexImage2D_Callback";
 
   @DomName('WebGLRenderingContext.compressedTexSubImage2D')
   @DocsEditable
-  void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, /*ArrayBufferView*/ data) native "WebGLRenderingContext_compressedTexSubImage2D_Callback";
+  void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, TypedData data) native "WebGLRenderingContext_compressedTexSubImage2D_Callback";
 
   @DomName('WebGLRenderingContext.copyTexImage2D')
   @DocsEditable
@@ -1804,7 +1804,7 @@
 
   @DomName('WebGLRenderingContext.readPixels')
   @DocsEditable
-  void readPixels(int x, int y, int width, int height, int format, int type, /*ArrayBufferView*/ pixels) native "WebGLRenderingContext_readPixels_Callback";
+  void readPixels(int x, int y, int width, int height, int format, int type, TypedData pixels) native "WebGLRenderingContext_readPixels_Callback";
 
   @DomName('WebGLRenderingContext.releaseShaderCompiler')
   @DocsEditable
@@ -1850,8 +1850,8 @@
   @DocsEditable
   void stencilOpSeparate(int face, int fail, int zfail, int zpass) native "WebGLRenderingContext_stencilOpSeparate_Callback";
 
-  void texImage2D(int target, int level, int internalformat, int format_OR_width, int height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, [int format, int type, /*ArrayBufferView*/ pixels]) {
-    if ((target is int || target == null) && (level is int || level == null) && (internalformat is int || internalformat == null) && (format_OR_width is int || format_OR_width == null) && (height_OR_type is int || height_OR_type == null) && (border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && (format is int || format == null) && (type is int || type == null) && (pixels is ArrayBufferView || pixels is _typeddata.TypedData || pixels == null)) {
+  void texImage2D(int target, int level, int internalformat, int format_OR_width, int height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, [int format, int type, TypedData pixels]) {
+    if ((target is int || target == null) && (level is int || level == null) && (internalformat is int || internalformat == null) && (format_OR_width is int || format_OR_width == null) && (height_OR_type is int || height_OR_type == null) && (border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && (format is int || format == null) && (type is int || type == null) && (pixels is TypedData || pixels == null)) {
       _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
       return;
     }
@@ -1902,8 +1902,8 @@
   @DocsEditable
   void texParameteri(int target, int pname, int param) native "WebGLRenderingContext_texParameteri_Callback";
 
-  void texSubImage2D(int target, int level, int xoffset, int yoffset, int format_OR_width, int height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, [int type, /*ArrayBufferView*/ pixels]) {
-    if ((target is int || target == null) && (level is int || level == null) && (xoffset is int || xoffset == null) && (yoffset is int || yoffset == null) && (format_OR_width is int || format_OR_width == null) && (height_OR_type is int || height_OR_type == null) && (canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && (type is int || type == null) && (pixels is ArrayBufferView || pixels is _typeddata.TypedData || pixels == null)) {
+  void texSubImage2D(int target, int level, int xoffset, int yoffset, int format_OR_width, int height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, [int type, TypedData pixels]) {
+    if ((target is int || target == null) && (level is int || level == null) && (xoffset is int || xoffset == null) && (yoffset is int || yoffset == null) && (format_OR_width is int || format_OR_width == null) && (height_OR_type is int || height_OR_type == null) && (canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && (type is int || type == null) && (pixels is TypedData || pixels == null)) {
       _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
       return;
     }
diff --git a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
index 1e0794b..cc7f88b 100644
--- a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
@@ -66,7 +66,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class SqlDatabase native "*Database" {
+class SqlDatabase native "Database" {
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => JS('bool', '!!(window.openDatabase)');
@@ -106,7 +106,7 @@
 
 @DocsEditable
 @DomName('SQLError')
-class SqlError native "*SQLError" {
+class SqlError native "SQLError" {
 
   static const int CONSTRAINT_ERR = 6;
 
@@ -139,7 +139,7 @@
 
 @DocsEditable
 @DomName('SQLException')
-class SqlException native "*SQLException" {
+class SqlException native "SQLException" {
 
   static const int CONSTRAINT_ERR = 6;
 
@@ -172,7 +172,7 @@
 
 @DocsEditable
 @DomName('SQLResultSet')
-class SqlResultSet native "*SQLResultSet" {
+class SqlResultSet native "SQLResultSet" {
 
   @DomName('SQLResultSet.insertId')
   @DocsEditable
@@ -193,7 +193,7 @@
 
 @DocsEditable
 @DomName('SQLResultSetRowList')
-class SqlResultSetRowList implements JavaScriptIndexingBehavior, List<Map> native "*SQLResultSetRowList" {
+class SqlResultSetRowList implements JavaScriptIndexingBehavior, List<Map> native "SQLResultSetRowList" {
 
   @DomName('SQLResultSetRowList.length')
   @DocsEditable
@@ -351,7 +351,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -363,7 +363,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Map> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Map> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
@@ -421,7 +421,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-class SqlTransaction native "*SQLTransaction" {
+class SqlTransaction native "SQLTransaction" {
 
   @DomName('SQLTransaction.executeSql')
   @DocsEditable
@@ -437,5 +437,5 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental
-abstract class _SQLTransactionSync native "*SQLTransactionSync" {
+abstract class _SQLTransactionSync native "SQLTransactionSync" {
 }
diff --git a/sdk/lib/web_sql/dartium/web_sql_dartium.dart b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
index 474d36b..656c3a1 100644
--- a/sdk/lib/web_sql/dartium/web_sql_dartium.dart
+++ b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
@@ -369,7 +369,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -381,7 +381,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<Map> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<Map> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index 2a65929..f6e4a79 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -99,7 +99,6 @@
 Language/05_Variables/05_Variables_A01_t13: Fail # http://dartbug.com/5519
 Language/05_Variables/05_Variables_A01_t14: Fail # http://dartbug.com/5519
 Language/05_Variables/05_Variables_A01_t15: Fail # http://dartbug.com/5519
-Language/05_Variables/05_Variables_A04_t01: Fail # http://dartbug.com/5519
 Language/05_Variables/05_Variables_A05_t04: Fail # Inherited from dart2js
 Language/05_Variables/05_Variables_A05_t05: Fail # Inherited from dart2js
 Language/05_Variables/05_Variables_A05_t06: Fail # Inherited from dart2js
@@ -120,7 +119,6 @@
 Language/05_Variables/05_Variables_A08_t02: Fail # Inherited from dart2js
 Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t02: Fail # Inherited from VM (circular initialization?).
 Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t05: Fail # Inherited from dart2js
-Language/06_Functions/06_Functions_A01_t22: Fail # inherited from VM
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t03: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t04: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t05: Fail # http://dartbug.com/5519
@@ -253,7 +251,6 @@
 Language/11_Expressions/07_Maps_A01_t01: Skip # co19 issue 91: map literals illegal at statement beginning.
 Language/11_Expressions/07_Maps_A02_t01: Fail # http://dartbug.com/5519
 Language/11_Expressions/07_Maps_A02_t02: Fail # http://dartbug.com/5519
-Language/11_Expressions/08_Throw_A01_t01: Fail # inherited from dart2js
 Language/11_Expressions/11_Instance_Creation/1_New_A01_t04: Fail, OK # co19 issue 241
 Language/11_Expressions/11_Instance_Creation/1_New_A02_t03: Fail # inherited from dart2js
 Language/11_Expressions/11_Instance_Creation/1_New_A02_t05: Fail # inherited from dart2js
@@ -310,10 +307,8 @@
 Language/11_Expressions/30_Identifier_Reference_A04_t09: Fail # Inherited from dart2js
 Language/11_Expressions/30_Identifier_Reference_A05_t01: Fail # Inherited from dart2js
 Language/11_Expressions/30_Identifier_Reference_A05_t12: Fail # Inherited from dart2js
-Language/11_Expressions/30_Identifier_Reference_A06_t02: Fail # Inherited from VM (error returning typedef).
 Language/11_Expressions/30_Identifier_Reference_A07_t01: Fail # http://dartbug.com/5519
 Language/11_Expressions/30_Identifier_Reference_A08_t02: Fail # Inhertited from VM.
-Language/11_Expressions/31_Type_Test_A01_t04: Fail # Inherited from dart2js
 Language/11_Expressions/31_Type_Test_A04_t01: Fail # Inherited from dart2js
 Language/11_Expressions/32_Type_Cast_A03_t01: Fail # Inherited from dart2js
 Language/11_Expressions/32_Type_Cast_A03_t02: Fail # Inherited from dart2js
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index e5020a4..b745700 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -24,7 +24,6 @@
 Language/05_Variables/05_Variables_A07_t08: Fail # TODO(ahe): Please triage this failure.
 Language/05_Variables/05_Variables_A08_t01: Fail # TODO(ahe): Please triage this failure.
 Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t05: Fail # TODO(ahe): Please triage this failure.
-Language/06_Functions/06_Functions_A01_t22: Fail # TODO(ahe): Please triage this failure.
 Language/07_Classes/07_Classes_A03_t07: Fail # TODO(ahe): Please triage this failure.
 Language/07_Classes/1_Instance_Methods_A06_t01: Fail # TODO(ahe): Please triage this failure.
 Language/07_Classes/1_Instance_Methods_A06_t02: Fail # TODO(ahe): Please triage this failure.
@@ -45,7 +44,6 @@
 Language/11_Expressions/01_Constants_A13_t06: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/01_Constants_A18_t07: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/01_Constants_A20_t03: Fail # TODO(ahe): Please triage this failure.
-Language/11_Expressions/08_Throw_A01_t01: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/08_Throw_A05_t02: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/08_Throw_A05_t03: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/11_Instance_Creation/1_New_A02_t03: Fail # TODO(ahe): Please triage this failure.
@@ -550,6 +548,9 @@
 Language/11_Expressions/18_Assignment_A05_t04: Fail, OK # co19 issue 409
 Language/11_Expressions/18_Assignment_A08_t04: Fail, OK # co19 issue 409
 
+Language/14_Types/5_Function_Types_A01_t10: Fail # co19 issue 410
+Language/14_Types/5_Function_Types_A02_t06: Fail # co19 issue 410
+
 
 [ $compiler == dart2js && $unchecked ]
 LibTest/core/List/setRange_A05_t01: Fail # setRange throws StateError if there aren't enough elements in the iterable. Issue 402
@@ -667,7 +668,6 @@
 Language/05_Variables/05_Variables_A01_t13: Fail # Checks that variable declaration cannot contain both 'const' and 'final'.
 Language/05_Variables/05_Variables_A01_t14: Fail # Checks that variable declaration cannot contain 'const', 'final' and 'var' simultaneously.
 Language/05_Variables/05_Variables_A01_t15: Fail # Checks that a variable declaration cannot contain the 'abstract' keyword.
-Language/05_Variables/05_Variables_A04_t01: Fail # Checks that a compile-time error occurs if a local constant variable is redefined.
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t03: Fail # Checks that a required parameter can be constant. Reassigning it should produce a compile-time error.
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t04: Fail # Checks that static variable declaration can't be a required formal parameter
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t06: Fail # Checks that a functionSignature parameter cannot be final.
diff --git a/tests/compiler/dart2js/analyze_api_test.dart b/tests/compiler/dart2js/analyze_api_test.dart
index 3c92012..a70de8b 100644
--- a/tests/compiler/dart2js/analyze_api_test.dart
+++ b/tests/compiler/dart2js/analyze_api_test.dart
@@ -107,8 +107,7 @@
 }
 
 void main() {
-  Uri currentWorkingDirectory = getCurrentDirectory();
-  var libraryRoot = currentWorkingDirectory.resolve('sdk/');
+  var libraryRoot = currentDirectory.resolve('sdk/');
   var uriList = new List<Uri>();
   LIBRARIES.forEach((String name, LibraryInfo info) {
     if (info.documented) {
diff --git a/tests/compiler/dart2js/bad_loop_test.dart b/tests/compiler/dart2js/bad_loop_test.dart
index aedbfc0..5705095 100644
--- a/tests/compiler/dart2js/bad_loop_test.dart
+++ b/tests/compiler/dart2js/bad_loop_test.dart
@@ -9,8 +9,7 @@
        show Diagnostic;
 
 main() {
-  Uri cwd = getCurrentDirectory();
-  Uri script = cwd.resolve(nativeToUriPath(new Options().script));
+  Uri script = currentDirectory.resolve(nativeToUriPath(new Options().script));
   Uri libraryRoot = script.resolve('../../../sdk/');
   Uri packageRoot = script.resolve('./packages/');
 
diff --git a/tests/compiler/dart2js/call_site_type_inferer_test.dart b/tests/compiler/dart2js/call_site_type_inferer_test.dart
index 5587405..4a04eff 100644
--- a/tests/compiler/dart2js/call_site_type_inferer_test.dart
+++ b/tests/compiler/dart2js/call_site_type_inferer_test.dart
@@ -211,14 +211,14 @@
 """;
 
 void doTest(String test,
-            bool enableInlining,
+            bool disableInlining,
             List expectedTypes,  // HTypes, or functions constructing HTypes.
             OptionalParameterTypes defaultTypes) {
   compileAndFind(
     test,
     'A',
     'x',
-    enableInlining,
+    disableInlining,
     (compiler, x) {
       HTypeList types =
           compiler.backend.optimisticParameterTypes(x, defaultTypes);
@@ -238,7 +238,6 @@
 void runTest(String test,
              [List<HType> expectedTypes,
               OptionalParameterTypes defaultTypes]) {
-  doTest(test, false, expectedTypes, defaultTypes);
   doTest(test, true, expectedTypes, defaultTypes);
 }
 
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart
index fff3a5b..237a6a9 100644
--- a/tests/compiler/dart2js/compiler_helper.dart
+++ b/tests/compiler/dart2js/compiler_helper.dart
@@ -160,7 +160,8 @@
 String anyIdentifier = "[a-zA-Z][a-zA-Z0-9]*";
 
 String getIntTypeCheck(String variable) {
-  return "\\($variable ?!== ?\\($variable ?\\| ?0\\)\\)";
+  return "\\($variable ?!== ?\\($variable ?\\| ?0\\)|"
+         "\\($variable ?>>> ?0 ?!== ?$variable";
 }
 
 String getNumberTypeCheck(String variable) {
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index 0cf252f..d67dd56 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -1185,6 +1185,60 @@
   result.checkNodeHasType('c', [result.num]);
 }
 
+testConcreteTypeToTypeMask() {
+  final String source = r"""
+      class A {}
+      class B extends A {}
+      class C extends A {}
+      class D implements A {}
+      main() {
+        new A();
+        new B();
+        new C();
+        new D();
+      }
+      """;
+  AnalysisResult result = analyze(source);
+
+  convert(ConcreteType type) {
+    return result.compiler.typesTask.concreteTypesInferrer
+        .concreteTypeToTypeMask(type);
+  }
+
+  final nullSingleton =
+      result.compiler.typesTask.concreteTypesInferrer.singletonConcreteType(
+          new NullBaseType());
+
+  singleton(ClassElement element) {
+    return result.compiler.typesTask.concreteTypesInferrer
+        .singletonConcreteType(new ClassBaseType(element));
+  }
+
+  ClassElement a = findElement(result.compiler, 'A');
+  ClassElement b = findElement(result.compiler, 'B');
+  ClassElement c = findElement(result.compiler, 'C');
+  ClassElement d = findElement(result.compiler, 'D');
+
+  for (ClassElement cls in [a, b, c, d]) {
+    Expect.equals(convert(singleton(cls)),
+                  new TypeMask.exact(cls.rawType).nonNullable());
+  }
+
+  for (ClassElement cls in [a, b, c, d]) {
+    Expect.equals(convert(singleton(cls).union(nullSingleton)),
+                  new TypeMask.exact(cls.rawType));
+  }
+
+  Expect.equals(convert(singleton(a).union(singleton(b))),
+                new TypeMask.subclass(a.rawType).nonNullable());
+
+  Expect.equals(convert(singleton(a).union(singleton(b)).union(nullSingleton)),
+                new TypeMask.subclass(a.rawType));
+
+  Expect.equals(convert(singleton(b).union(singleton(d))),
+                new TypeMask.subtype(a.rawType).nonNullable());
+}
+
 void main() {
   testDynamicBackDoor();
   testLiterals();
@@ -1232,4 +1286,5 @@
   testSeenClasses();
   testGoodGuys();
   testIntDoubleNum();
+  testConcreteTypeToTypeMask();
 }
diff --git a/tests/compiler/dart2js/dead_bailout_target_test.dart b/tests/compiler/dart2js/dead_bailout_target_test.dart
index d482467..b6fe836 100644
--- a/tests/compiler/dart2js/dead_bailout_target_test.dart
+++ b/tests/compiler/dart2js/dead_bailout_target_test.dart
@@ -14,7 +14,12 @@
   foo([]);
 }
 
+class A {
+  operator -() => this;
+}
+
 foo(a) {
+  new A(); // Force having another operator-
   // Make the method recursive to always enable bailouts
   // and force a list instantiation.
   foo([]);
diff --git a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
index 7c4c551..b05ead8 100644
--- a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
+++ b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
@@ -13,8 +13,7 @@
        as dart2js;
 
 void main() {
-  Uri cwd = getCurrentDirectory();
-  Uri script = cwd.resolve(nativeToUriPath(new Options().script));
+  Uri script = currentDirectory.resolve(nativeToUriPath(new Options().script));
   Uri libraryRoot = script.resolve('../../../sdk/');
   Uri packageRoot = script.resolve('./packages/');
 
diff --git a/tests/compiler/dart2js/field_type_simple_inferer_test.dart b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
index 6964206..5a2f27b 100644
--- a/tests/compiler/dart2js/field_type_simple_inferer_test.dart
+++ b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
@@ -486,7 +486,7 @@
 
   runTest(TEST_8, {'f': (inferrer) => inferrer.stringType.nullable()});
   runTest(TEST_9, {'f': (inferrer) => inferrer.stringType.nullable()});
-  runTest(TEST_10, {'f': subclassOfInterceptor});
+  runTest(TEST_10, {'f': (inferrer) => inferrer.intType});
   runTest(TEST_11, {'fs': (inferrer) => inferrer.intType});
 
   // TODO(ngeoffray): We should try to infer that the initialization
diff --git a/tests/compiler/dart2js/memory_source_file_helper.dart b/tests/compiler/dart2js/memory_source_file_helper.dart
index 26a33b0..db1c4f0 100644
--- a/tests/compiler/dart2js/memory_source_file_helper.dart
+++ b/tests/compiler/dart2js/memory_source_file_helper.dart
@@ -14,7 +14,7 @@
        show Compiler;
 
 export '../../../sdk/lib/_internal/compiler/implementation/filenames.dart'
-       show getCurrentDirectory, nativeToUriPath;
+       show currentDirectory, nativeToUriPath;
 
 import '../../../sdk/lib/_internal/compiler/implementation/source_file.dart'
        show SourceFile;
diff --git a/tests/compiler/dart2js/mirrors_metadata_test.dart b/tests/compiler/dart2js/mirrors_metadata_test.dart
index 5b42947..c52c744 100644
--- a/tests/compiler/dart2js/mirrors_metadata_test.dart
+++ b/tests/compiler/dart2js/mirrors_metadata_test.dart
@@ -13,15 +13,15 @@
 import 'mock_compiler.dart';
 
 const String SOURCE = 'source';
+const Uri SOURCE_URI = const Uri.fromComponents(scheme: SOURCE, path: SOURCE);
 
 MirrorSystem createMirrorSystem(String source) {
-  Uri sourceUri = new Uri.fromComponents(scheme: SOURCE, path: SOURCE);
   MockCompiler compiler = new MockCompiler(
       analyzeOnly: true,
       analyzeAll: true,
       preserveComments: true);
-  compiler.registerSource(sourceUri, source);
-  compiler.librariesToAnalyzeWhenRun = <Uri>[sourceUri];
+  compiler.registerSource(SOURCE_URI, source);
+  compiler.librariesToAnalyzeWhenRun = <Uri>[SOURCE_URI];
   compiler.runCompiler(null);
   return new Dart2JsMirrorSystem(compiler);
 }
@@ -32,7 +32,7 @@
                                 bool isDocComment,
                                 List<String> declarationNames) {
   MirrorSystem mirrors = createMirrorSystem(code);
-  LibraryMirror library = mirrors.libraries[SOURCE];
+  LibraryMirror library = mirrors.libraries[SOURCE_URI];
   Expect.isNotNull(library);
   for (String declarationName in declarationNames) {
     DeclarationMirror declaration = library.members[declarationName];
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 2c056ba..6f81d31 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -6,8 +6,15 @@
 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart';
 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart';
+import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart'
+       show currentDirectory, nativeToUriPath;
+import '../../../sdk/lib/_internal/compiler/implementation/source_file_provider.dart';
 
 import 'dart:io';
+import 'dart:uri';
+
+const Uri DART_MIRRORS_URI =
+  const Uri.fromComponents(scheme: 'dart', path: 'mirrors');
 
 int count(Iterable iterable) {
   var count = 0;
@@ -26,7 +33,7 @@
   return false;
 }
 
-DeclarationMirror findMirror(List<DeclarationMirror> list, String name) {
+DeclarationMirror findMirror(Iterable<DeclarationMirror> list, String name) {
   for (DeclarationMirror mirror in list) {
     if (mirror.simpleName == name) {
       return mirror;
@@ -36,12 +43,16 @@
 }
 
 main() {
-  var scriptPath = new Path(new Options().script);
-  var dirPath = scriptPath.directoryPath;
-  var libPath = dirPath.join(new Path('../../../sdk/'));
-  var inputPath = dirPath.join(new Path('mirrors_helper.dart'));
-  var result = analyze([inputPath], libPath,
-                       options: <String>['--preserve-comments']);
+  Uri scriptUri =
+      currentDirectory.resolve(nativeToUriPath(new Options().script));
+  Uri libUri = scriptUri.resolve('../../../sdk/');
+  Uri inputUri = scriptUri.resolve('mirrors_helper.dart');
+  var provider = new SourceFileProvider();
+  var diagnosticHandler =
+        new FormattingDiagnosticHandler(provider).diagnosticHandler;
+  var result = analyze([inputUri], libUri, null,
+                       provider.readStringFromUri, diagnosticHandler,
+                       <String>['--preserve-comments']);
   result.then((MirrorSystem mirrors) {
     test(mirrors);
   });
@@ -54,12 +65,13 @@
   Expect.isNotNull(libraries, "No libraries map returned");
   Expect.isFalse(libraries.isEmpty, "Empty libraries map returned");
 
-  var helperLibrary = libraries["mirrors_helper"];
+  var helperLibrary = findMirror(libraries.values, "mirrors_helper");
   Expect.isNotNull(helperLibrary, "Library 'mirrors_helper' not found");
   Expect.stringEquals("mirrors_helper", helperLibrary.simpleName,
     "Unexpected library simple name");
   Expect.stringEquals("mirrors_helper", helperLibrary.qualifiedName,
     "Unexpected library qualified name");
+  Expect.equals(helperLibrary, mirrors.findLibrary('mirrors_helper').single);
 
   var helperLibraryLocation = helperLibrary.location;
   Expect.isNotNull(helperLibraryLocation);
@@ -181,7 +193,7 @@
   var metadataListIndex = 0;
   var metadata;
 
-  var dartMirrorsLibrary = system.libraries['dart.mirrors'];
+  var dartMirrorsLibrary = system.libraries[DART_MIRRORS_URI];
   Expect.isNotNull(dartMirrorsLibrary);
   var commentType = dartMirrorsLibrary.classes['Comment'];
   Expect.isNotNull(commentType);
@@ -254,11 +266,10 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isNotNull(data);
-    Expect.isTrue(data.hasReflectee);
-    Expect.isNull(data.reflectee);
-  });
+  InstanceMirror data = metadata.getField('data');
+  Expect.isNotNull(data);
+  Expect.isTrue(data.hasReflectee);
+  Expect.isNull(data.reflectee);
 
   // @Metadata(true)
   metadata = metadataList[metadataListIndex++];
@@ -266,11 +277,10 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isNotNull(data);
-    Expect.isTrue(data.hasReflectee);
-    Expect.isTrue(data.reflectee);
-  });
+  data = metadata.getField('data');
+  Expect.isNotNull(data);
+  Expect.isTrue(data.hasReflectee);
+  Expect.isTrue(data.reflectee);
 
   // @Metadata(false)
   metadata = metadataList[metadataListIndex++];
@@ -278,11 +288,10 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isNotNull(data);
-    Expect.isTrue(data.hasReflectee);
-    Expect.isFalse(data.reflectee);
-  });
+  data = metadata.getField('data');
+  Expect.isNotNull(data);
+  Expect.isTrue(data.hasReflectee);
+  Expect.isFalse(data.reflectee);
 
   // @Metadata(0)
   metadata = metadataList[metadataListIndex++];
@@ -290,11 +299,10 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isNotNull(data);
-    Expect.isTrue(data.hasReflectee);
-    Expect.equals(0, data.reflectee);
-  });
+  data = metadata.getField('data');
+  Expect.isNotNull(data);
+  Expect.isTrue(data.hasReflectee);
+  Expect.equals(0, data.reflectee);
 
   // @Metadata(1.5)
   metadata = metadataList[metadataListIndex++];
@@ -302,11 +310,10 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isNotNull(data);
-    Expect.isTrue(data.hasReflectee);
-    Expect.equals(1.5, data.reflectee);
-  });
+  data = metadata.getField('data');
+  Expect.isNotNull(data);
+  Expect.isTrue(data.hasReflectee);
+  Expect.equals(1.5, data.reflectee);
 
   // @Metadata("Foo")
   metadata = metadataList[metadataListIndex++];
@@ -314,11 +321,10 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isNotNull(data);
-    Expect.isTrue(data.hasReflectee);
-    Expect.stringEquals("Foo", data.reflectee);
-  });
+  data = metadata.getField('data');
+  Expect.isNotNull(data);
+  Expect.isTrue(data.hasReflectee);
+  Expect.stringEquals("Foo", data.reflectee);
 
   // @Metadata(const ["Foo"])
   metadata = metadataList[metadataListIndex++];
@@ -326,18 +332,16 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isTrue(data is ListInstanceMirror);
-    Expect.isFalse(data.hasReflectee);
-    Expect.throws(() => data.reflectee, (_) => true);
-    ListInstanceMirror listData = data;
-    Expect.equals(1, listData.length);
-    listData[0].then((InstanceMirror element) {
-      Expect.isNotNull(element);
-      Expect.isTrue(element.hasReflectee);
-      Expect.stringEquals("Foo", element.reflectee);
-    });
-  });
+  data = metadata.getField('data');
+  Expect.isTrue(data is ListInstanceMirror);
+  Expect.isFalse(data.hasReflectee);
+  Expect.throws(() => data.reflectee, (_) => true);
+  ListInstanceMirror listData = data;
+  Expect.equals(1, listData.length);
+  InstanceMirror element = listData[0];
+  Expect.isNotNull(element);
+  Expect.isTrue(element.hasReflectee);
+  Expect.stringEquals("Foo", element.reflectee);
 
   // @Metadata(/* Inline comment */ const {'foo':"Foo"})
   metadata = metadataList[metadataListIndex++];
@@ -345,22 +349,20 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isTrue(data is MapInstanceMirror);
-    Expect.isFalse(data.hasReflectee);
-    Expect.throws(() => data.reflectee, (_) => true);
-    MapInstanceMirror mapData = data;
-    Expect.equals(1, mapData.length);
-    var it = mapData.keys.iterator;
-    Expect.isTrue(it.moveNext());
-    Expect.stringEquals('foo', it.current);
-    mapData['foo'].then((InstanceMirror element) {
-      Expect.isNotNull(element);
-      Expect.isTrue(element.hasReflectee);
-      Expect.stringEquals("Foo", element.reflectee);
-    });
-    Expect.isNull(mapData['bar']);
-  });
+  data = metadata.getField('data');
+  Expect.isTrue(data is MapInstanceMirror);
+  Expect.isFalse(data.hasReflectee);
+  Expect.throws(() => data.reflectee, (_) => true);
+  MapInstanceMirror mapData = data;
+  Expect.equals(1, mapData.length);
+  var it = mapData.keys.iterator;
+  Expect.isTrue(it.moveNext());
+  Expect.stringEquals('foo', it.current);
+  element = mapData['foo'];
+  Expect.isNotNull(element);
+  Expect.isTrue(element.hasReflectee);
+  Expect.stringEquals("Foo", element.reflectee);
+  Expect.isNull(mapData['bar']);
 
   // @metadata
   metadata = metadataList[metadataListIndex++];
@@ -368,11 +370,10 @@
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
   Expect.equals(metadataType.originalDeclaration, metadata.type);
-  metadata.getField('data').then((InstanceMirror data) {
-    Expect.isNotNull(data);
-    Expect.isTrue(data.hasReflectee);
-    Expect.isNull(data.reflectee);
-  });
+  data = metadata.getField('data');
+  Expect.isNotNull(data);
+  Expect.isTrue(data.hasReflectee);
+  Expect.isNull(data.reflectee);
 
   // /** Multiline doc comment. */
   metadata = metadataList[metadataListIndex++];
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index f7c8f7e..453bbf2 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -59,6 +59,7 @@
   class ConstantMap {}
   class TypeImpl {}
   S() {}
+  throwExpression(e) {}
   unwrapException(e) {}
   assertHelper(a){}
   createRuntimeType(a) {}
@@ -77,14 +78,17 @@
     bool operator==(other) => identical(this, other);
     noSuchMethod(im) { throw im; }
   }
-  class JSIndexable {}
+  abstract class JSIndexable {
+    get length;
+  }
+  abstract class JSMutableIndexable extends JSIndexable {}
   class JSArray extends Interceptor implements List, JSIndexable {
     var length;
     operator[](index) {}
     operator[]=(index, value) {}
     var add;
   }
-  class JSMutableArray extends JSArray {}
+  class JSMutableArray extends JSArray implements JSMutableIndexable {}
   class JSFixedArray extends JSMutableArray {}
   class JSExtendableArray extends JSMutableArray {}
   class JSString extends Interceptor implements String, JSIndexable {
@@ -112,6 +116,9 @@
     operator <(other) => true;
     operator <=(other) => true;
     operator ==(other) => true;
+
+    abs() => (this is JSInt) ? 42 : 42.0;
+    remainder(other) => (this is JSInt) ? 42 : 42.0;
   }
   class JSInt extends JSNumber implements int {
   }
diff --git a/tests/compiler/dart2js/simple_inferrer_relations_test.dart b/tests/compiler/dart2js/simple_inferrer_relations_test.dart
index 205b01a..1488c10 100644
--- a/tests/compiler/dart2js/simple_inferrer_relations_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_relations_test.dart
@@ -40,9 +40,11 @@
 }
 
 main() {
-  var both = [new A(inscrutable(0) == 0 ? 42 : "fish"),
-              new B(0, inscrutable(0) == 0 ? 2 : "horse")];
-  if (both[1] == both[0]) {
+  var a = new A(inscrutable(0) == 0 ? 42 : "fish");
+  var b = new B(0, inscrutable(0) == 0 ? 2 : "horse");
+  var c = inscrutable(0) == 0 ? a : "kurt";
+  var d = inscrutable(0) == 0 ? b : "gert";
+  if (c == d) {
     print("hestfisk");
   }
 }
@@ -50,7 +52,7 @@
 
 void main() {
   String generated = compileAll(TEST);
-  if (!generated.contains(r'if ($.$eq(both[1], both[0]))')) {
+  if (!generated.contains(r'if ($.$eq(c, d))')) {
     print(generated);
     Expect.fail("missing elision of '=== true'");
   }
diff --git a/tests/compiler/dart2js/simple_inferrer_test.dart b/tests/compiler/dart2js/simple_inferrer_test.dart
index 0b4c37b..db2572a 100644
--- a/tests/compiler/dart2js/simple_inferrer_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_test.dart
@@ -41,12 +41,12 @@
   return a++;
 }
 
-returnNum3() {
+returnInt5() {
   var a = 42;
   return ++a;
 }
 
-returnNum4() {
+returnInt6() {
   var a = 42;
   a++;
   return a;
@@ -65,6 +65,24 @@
   return (42);
 }
 
+returnInt7() {
+  return 42.abs();
+}
+
+returnInt8() {
+  return 42.remainder(54);
+}
+
+returnDynamic1() {
+  // Ensure that we don't intrisify a wrong call to [int.remainder].
+  return 42.remainder();
+}
+
+returnDynamic2() {
+  // Ensure that we don't intrisify a wrong call to [int.abs].
+  return 42.abs(42);
+}
+
 get topLevelGetter => 42;
 returnDynamic() => topLevelGetter(42);
 
@@ -75,26 +93,26 @@
 
   get myField => 42;
   set myField(a) {}
-  returnNum1() => ++myField;
-  returnNum2() => ++this.myField;
-  returnNum3() => this.myField += 42;
-  returnNum4() => myField += 42;
+  returnInt1() => ++myField;
+  returnInt2() => ++this.myField;
+  returnInt3() => this.myField += 42;
+  returnInt4() => myField += 42;
   operator[](index) => 42;
   operator[]= (index, value) {}
-  returnNum5() => ++this[0];
-  returnNum6() => this[0] += 1;
+  returnInt5() => ++this[0];
+  returnInt6() => this[0] += 1;
 }
 
 class B extends A {
   B() : super.generative();
-  returnNum1() => ++new A().myField;
-  returnNum2() => new A().myField += 4;
-  returnNum3() => ++new A()[0];
-  returnNum4() => new A()[0] += 42;
-  returnNum5() => ++super.myField;
-  returnNum6() => super.myField += 4;
-  returnNum7() => ++super[0];
-  returnNum8() => super[0] += 54;
+  returnInt1() => ++new A().myField;
+  returnInt2() => new A().myField += 4;
+  returnInt3() => ++new A()[0];
+  returnInt4() => new A()[0] += 42;
+  returnInt5() => ++super.myField;
+  returnInt6() => super.myField += 4;
+  returnInt7() => ++super[0];
+  returnInt8() => super[0] += 54;
 }
 
 main() {
@@ -106,26 +124,30 @@
   returnInt4();
   returnDouble(true);
   returnGiveUp(true);
-  returnNum3();
-  returnNum4();
+  returnInt5();
+  returnInt6();
+  returnInt7();
+  returnInt8();
   returnIntOrNull(true);
   returnDynamic();
+  returnDynamic1();
+  returnDynamic2();
   new A() == null;
-  new A()..returnNum1()
-         ..returnNum2()
-         ..returnNum3()
-         ..returnNum4()
-         ..returnNum5()
-         ..returnNum6();
+  new A()..returnInt1()
+         ..returnInt2()
+         ..returnInt3()
+         ..returnInt4()
+         ..returnInt5()
+         ..returnInt6();
 
-  new B()..returnNum1()
-         ..returnNum2()
-         ..returnNum3()
-         ..returnNum4()
-         ..returnNum5()
-         ..returnNum6()
-         ..returnNum7()
-         ..returnNum8();
+  new B()..returnInt1()
+         ..returnInt2()
+         ..returnInt3()
+         ..returnInt4()
+         ..returnInt5()
+         ..returnInt6()
+         ..returnInt7()
+         ..returnInt8();
 }
 """;
 
@@ -148,12 +170,16 @@
   checkReturn('returnInt2', typesInferrer.intType);
   checkReturn('returnDouble', typesInferrer.doubleType);
   checkReturn('returnGiveUp', interceptorType);
-  checkReturn('returnNum3', typesInferrer.numType);
-  checkReturn('returnNum4', typesInferrer.numType);
+  checkReturn('returnInt5', typesInferrer.intType);
+  checkReturn('returnInt6', typesInferrer.intType);
   checkReturn('returnIntOrNull', typesInferrer.intType.nullable());
   checkReturn('returnInt3', typesInferrer.intType);
   checkReturn('returnDynamic', typesInferrer.dynamicType);
   checkReturn('returnInt4', typesInferrer.intType);
+  checkReturn('returnInt7', typesInferrer.intType);
+  checkReturn('returnInt8', typesInferrer.intType);
+  checkReturn('returnDynamic1', typesInferrer.dynamicType);
+  checkReturn('returnDynamic2', typesInferrer.dynamicType);
 
   checkReturnInClass(String className, String methodName, type) {
     var cls = findElement(compiler, className);
@@ -161,22 +187,22 @@
     Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
   }
 
-  checkReturnInClass('A', 'returnNum1', typesInferrer.numType);
-  checkReturnInClass('A', 'returnNum2', typesInferrer.numType);
-  checkReturnInClass('A', 'returnNum3', typesInferrer.numType);
-  checkReturnInClass('A', 'returnNum4', typesInferrer.numType);
-  checkReturnInClass('A', 'returnNum5', typesInferrer.numType);
-  checkReturnInClass('A', 'returnNum6', typesInferrer.numType);
+  checkReturnInClass('A', 'returnInt1', typesInferrer.intType);
+  checkReturnInClass('A', 'returnInt2', typesInferrer.intType);
+  checkReturnInClass('A', 'returnInt3', typesInferrer.intType);
+  checkReturnInClass('A', 'returnInt4', typesInferrer.intType);
+  checkReturnInClass('A', 'returnInt5', typesInferrer.intType);
+  checkReturnInClass('A', 'returnInt6', typesInferrer.intType);
   checkReturnInClass('A', '==', interceptorType);
 
-  checkReturnInClass('B', 'returnNum1', typesInferrer.numType);
-  checkReturnInClass('B', 'returnNum2', typesInferrer.numType);
-  checkReturnInClass('B', 'returnNum3', typesInferrer.numType);
-  checkReturnInClass('B', 'returnNum4', typesInferrer.numType);
-  checkReturnInClass('B', 'returnNum5', typesInferrer.numType);
-  checkReturnInClass('B', 'returnNum6', typesInferrer.numType);
-  checkReturnInClass('B', 'returnNum7', typesInferrer.numType);
-  checkReturnInClass('B', 'returnNum8', typesInferrer.numType);
+  checkReturnInClass('B', 'returnInt1', typesInferrer.intType);
+  checkReturnInClass('B', 'returnInt2', typesInferrer.intType);
+  checkReturnInClass('B', 'returnInt3', typesInferrer.intType);
+  checkReturnInClass('B', 'returnInt4', typesInferrer.intType);
+  checkReturnInClass('B', 'returnInt5', typesInferrer.intType);
+  checkReturnInClass('B', 'returnInt6', typesInferrer.intType);
+  checkReturnInClass('B', 'returnInt7', typesInferrer.intType);
+  checkReturnInClass('B', 'returnInt8', typesInferrer.intType);
 
   checkFactoryConstructor(String className) {
     var cls = findElement(compiler, className);
diff --git a/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart b/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart
new file mode 100644
index 0000000..b277c2b
--- /dev/null
+++ b/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+
+import 'compiler_helper.dart';
+import 'parser_helper.dart';
+
+const String TEST = """
+var a = '';
+class A {
+  operator+(other) => other;
+}
+
+foo() {
+  // The following '+' call will first say that it may call A::+,
+  // String::+, or int::+. After all methods have been analyzed, we know
+  // that a is of type String, and therefore, this method cannot call
+  // A::+. Therefore, the type of the parameter of A::+ will be the
+  // one given by the other calls.
+  return a + 'foo';
+}
+
+main() {
+  new A() + 42;
+  foo();
+}
+""";
+
+
+void main() {
+  Uri uri = new Uri.fromComponents(scheme: 'source');
+  var compiler = compilerFor(TEST, uri);
+  compiler.runCompiler(uri);
+  var typesInferrer = compiler.typesTask.typesInferrer;
+
+  checkReturnInClass(String className, String methodName, type) {
+    var cls = findElement(compiler, className);
+    var element = cls.lookupLocalMember(buildSourceString(methodName));
+    Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
+  }
+
+  checkReturnInClass('A', '+', typesInferrer.intType);
+}
diff --git a/tests/compiler/dart2js/subtype_test.dart b/tests/compiler/dart2js/subtype_test.dart
index db53398..b4efe86 100644
--- a/tests/compiler/dart2js/subtype_test.dart
+++ b/tests/compiler/dart2js/subtype_test.dart
@@ -362,8 +362,10 @@
       void void___Object([Object o]) {}
       void void__int__int(int i1, [int i2]) {}
       void void__int__int2(int i1, [int i2]) {}
+      void void__int__int_int(int i1, [int i2, int i3]);
       void void___double(double d) {}
       void void___int_int([int i1, int i2]) {}
+      void void___int_int_int([int i1, int i2, int i3]);
       void void___Object_int([Object o, int i]) {}
       """);
   functionSubtypingOptionalHelper(env);
@@ -378,8 +380,10 @@
       typedef void void___Object([Object o]);
       typedef void void__int__int(int i1, [int i2]);
       typedef void void__int__int2(int i1, [int i2]);
+      typedef void void__int__int_int(int i1, [int i2, int i3]);
       typedef void void___double(double d);
       typedef void void___int_int([int i1, int i2]);
+      typedef void void___int_int_int([int i1, int i2, int i3]);
       typedef void void___Object_int([Object o, int i]);
       """);
   functionSubtypingOptionalHelper(env);
@@ -396,7 +400,7 @@
   // Test ([int])->void <: ()->void.
   expect(true, 'void___int', 'void_');
   // Test ([int])->void <: (int)->void.
-  expect(false, 'void___int', 'void__int');
+  expect(true, 'void___int', 'void__int');
   // Test (int)->void <: ([int])->void.
   expect(false, 'void__int', 'void___int');
   // Test ([int])->void <: ([int])->void.
@@ -405,8 +409,20 @@
   expect(true, 'void___Object', 'void___int');
   // Test ([int])->void <: ([Object])->void.
   expect(true, 'void___int', 'void___Object');
+  // Test (int,[int])->void <: (int)->void.
+  expect(true, 'void__int__int', 'void__int');
   // Test (int,[int])->void <: (int,[int])->void.
   expect(true, 'void__int__int', 'void__int__int2');
+  // Test (int)->void <: ([int])->void.
+  expect(false, 'void__int', 'void___int');
+  // Test ([int,int])->void <: (int)->void.
+  expect(true, 'void___int_int', 'void__int');
+  // Test ([int,int])->void <: (int,[int])->void.
+  expect(true, 'void___int_int', 'void__int__int');
+  // Test ([int,int])->void <: (int,[int,int])->void.
+  expect(false, 'void___int_int', 'void__int__int_int');
+  // Test ([int,int,int])->void <: (int,[int,int])->void.
+  expect(true, 'void___int_int_int', 'void__int__int_int');
   // Test ([int])->void <: ([double])->void.
   expect(false, 'void___int', 'void___double');
   // Test ([int])->void <: ([int,int])->void.
diff --git a/tests/compiler/dart2js/type_inference4_test.dart b/tests/compiler/dart2js/type_inference4_test.dart
index 92e51d1..ace9eee 100644
--- a/tests/compiler/dart2js/type_inference4_test.dart
+++ b/tests/compiler/dart2js/type_inference4_test.dart
@@ -23,6 +23,6 @@
   Expect.isFalse(generated.contains('iae'));
   // Also make sure that we are not just in bailout mode without speculative
   // types by grepping for the integer-bailout check on argument j.
-  RegExp regexp = new RegExp(getIntTypeCheck('[aj]'));
+  RegExp regexp = new RegExp(getIntTypeCheck('[aji]'));
   Expect.isTrue(regexp.hasMatch(generated));
 }
diff --git a/tests/compiler/dart2js/type_inference5_test.dart b/tests/compiler/dart2js/type_inference5_test.dart
index 647ea7d..ba46456 100644
--- a/tests/compiler/dart2js/type_inference5_test.dart
+++ b/tests/compiler/dart2js/type_inference5_test.dart
@@ -25,6 +25,6 @@
   var argname =
       new RegExp(r'function(?: [a-z]+)?\(([a-zA-Z0-9_]+)\)').firstMatch(generated)[1];
   print(argname);
-  RegExp regexp = new RegExp(getIntTypeCheck(argname));
+  RegExp regexp = new RegExp(getIntTypeCheck("(i|$argname)"));
   Expect.isTrue(regexp.hasMatch(generated));
 }
diff --git a/tests/compiler/dart2js/type_inference_test.dart b/tests/compiler/dart2js/type_inference_test.dart
index cf3f59f..8c3d91b 100644
--- a/tests/compiler/dart2js/type_inference_test.dart
+++ b/tests/compiler/dart2js/type_inference_test.dart
@@ -111,6 +111,7 @@
   generated = compile(TEST_SIX, entry: 'foo');
   regexp = new RegExp('a.constructor !== Array');
   Expect.isTrue(regexp.hasMatch(generated));
-  Expect.isTrue(!generated.contains('index'));
+  Expect.isTrue(!generated.contains('index(0)'));
+  Expect.isTrue(!generated.contains('index(1)'));
   Expect.isTrue(!generated.contains('indexSet'));
 }
diff --git a/tests/compiler/dart2js/value_range_test.dart b/tests/compiler/dart2js/value_range_test.dart
index 5913d94..32aee9f 100644
--- a/tests/compiler/dart2js/value_range_test.dart
+++ b/tests/compiler/dart2js/value_range_test.dart
@@ -222,13 +222,16 @@
   bool identical(Object a, Object b) {}''';
 
 const String INTERCEPTORSLIB_WITH_MEMBERS = r'''
-  class JSIndexable {}
+  abstract class JSIndexable {
+    get length;
+  }
+  abstract class JSMutableIndexable extends JSIndexable {}
   class JSArray implements JSIndexable {
     var length;
     var removeLast;
     operator[] (_) {}
   }
-  class JSMutableArray extends JSArray {}
+  class JSMutableArray extends JSArray implements JSMutableIndexable {}
   class JSFixedArray extends JSMutableArray {}
   class JSExtendableArray extends JSMutableArray {}
   class JSString implements JSIndexable {
@@ -297,7 +300,7 @@
       break;
 
     case ONE_ZERO_CHECK:
-      RegExp regexp = new RegExp('< 0');
+      RegExp regexp = new RegExp('< 0|>>> 0 !==');
       Iterator matches = regexp.allMatches(generated).iterator;
       checkNumberOfMatches(matches, 1);
       break;
diff --git a/tests/compiler/dart2js_extra/bailout8_test.dart b/tests/compiler/dart2js_extra/bailout8_test.dart
new file mode 100644
index 0000000..b2fd0a1
--- /dev/null
+++ b/tests/compiler/dart2js_extra/bailout8_test.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that the right exception for dart2js is thrown in the presence of
+// bailouts.
+
+import "package:expect/expect.dart";
+
+var a;
+var b;
+
+bar() {
+  a = a == null ? 42 : new Object();
+  a += b;
+}
+
+foo() {
+  a = a == null ? new Object() : 42;
+  a--;
+}
+
+main() {
+  for (int i = 0; i < 10; i++) {
+    a = null;
+    Expect.throws(foo, (e) => e is NoSuchMethodError);
+    a = null;
+    // dart2js throws [ArgumentError], VM throws [NoSuchMethodError].
+    Expect.throws(bar, (e) => e is ArgumentError);
+  }
+}
diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status
index d2c3205..73703bd 100644
--- a/tests/compiler/dart2js_extra/dart2js_extra.status
+++ b/tests/compiler/dart2js_extra/dart2js_extra.status
@@ -41,3 +41,4 @@
 
 [ $runtime == none ]
 timer_negative_test: Fail, OK # A negative runtime test.
+bailout8_test: Fail, OK # Mismatch in thrown exception.
diff --git a/tests/compiler/dart2js_native/core_type_check_native_test.dart b/tests/compiler/dart2js_native/core_type_check_native_test.dart
index de64aef..11890a1 100644
--- a/tests/compiler/dart2js_native/core_type_check_native_test.dart
+++ b/tests/compiler/dart2js_native/core_type_check_native_test.dart
@@ -6,16 +6,16 @@
 
 var inscrutable = (int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
 
-class A native "*A" {
+class A native "A" {
 }
 
-class B implements Comparable native "*B" {
+class B implements Comparable native "B" {
 }
 
-class C implements Pattern native "*C" {
+class C implements Pattern native "C" {
 }
 
-class D implements Pattern, Comparable native "*D" {
+class D implements Pattern, Comparable native "D" {
 }
 
 makeA() native;
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 1315cac..7257bf3 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -9,6 +9,7 @@
 native_null_closure_frog_test: Fail
 native_no_such_method_exception4_frog_test: Fail  # Issue 9631
 native_no_such_method_exception5_frog_test: Fail  # Issue 9631
+super_call_test: Fail  # Issue 10166
 
 [ $compiler == dart2js && $checked ]
 native_no_such_method_exception3_frog_test: Fail # TODO(ahe): investigate.
diff --git a/tests/compiler/dart2js_native/downcast_test.dart b/tests/compiler/dart2js_native/downcast_test.dart
index 31202055..079b5f7 100644
--- a/tests/compiler/dart2js_native/downcast_test.dart
+++ b/tests/compiler/dart2js_native/downcast_test.dart
@@ -16,13 +16,13 @@
 
 // Native implementation.
 
-class A implements I native "*A" {
+class A implements I native "A" {
   // The native class accepts only other native instances.
   A read() native;
   write(A x) native;
 }
 
-class B extends A native "*B" {
+class B extends A native "B" {
 }
 
 makeA() native;
diff --git a/tests/compiler/dart2js_native/field_type2_test.dart b/tests/compiler/dart2js_native/field_type2_test.dart
index b4c138c..15dbf61 100644
--- a/tests/compiler/dart2js_native/field_type2_test.dart
+++ b/tests/compiler/dart2js_native/field_type2_test.dart
@@ -5,7 +5,7 @@
 // Test that a closure call on a native field is recognized by the
 // type inferrer.
 
-class Node native "*Node" {
+class Node native "Node" {
   final parentNode;
 }
 
diff --git a/tests/compiler/dart2js_native/field_type_test.dart b/tests/compiler/dart2js_native/field_type_test.dart
index 0ea5711..bd2b1c1 100644
--- a/tests/compiler/dart2js_native/field_type_test.dart
+++ b/tests/compiler/dart2js_native/field_type_test.dart
@@ -8,7 +8,7 @@
 
 import "package:expect/expect.dart";
 
-class Node native "*Node" {
+class Node native "Node" {
 
   final Node parentNode;
 
diff --git a/tests/compiler/dart2js_native/hash_code_test.dart b/tests/compiler/dart2js_native/hash_code_test.dart
index 1cd9da7..c222de6 100644
--- a/tests/compiler/dart2js_native/hash_code_test.dart
+++ b/tests/compiler/dart2js_native/hash_code_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 
-class A native "*A" {}
+class A native "A" {}
 makeA() native;
 
 void setup() native """
diff --git a/tests/compiler/dart2js_native/is_check_test.dart b/tests/compiler/dart2js_native/is_check_test.dart
index 0f70722..db04502 100644
--- a/tests/compiler/dart2js_native/is_check_test.dart
+++ b/tests/compiler/dart2js_native/is_check_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 
-class A native "*A" {}
+class A native "A" {}
 
 main() {
   var a = [new Object()];
diff --git a/tests/compiler/dart2js_native/issue9182_test.dart b/tests/compiler/dart2js_native/issue9182_test.dart
index b8ae713..8d2734b 100644
--- a/tests/compiler/dart2js_native/issue9182_test.dart
+++ b/tests/compiler/dart2js_native/issue9182_test.dart
@@ -7,7 +7,7 @@
 
 import "package:expect/expect.dart";
 
-class Foo native "*A" {
+class Foo native "A" {
   factory Foo() => makeA();
   // Ensure the instance method 'Bar' uses interceptor convention.
   Bar() => 123;
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 6f398b4..285e349 100644
--- a/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
@@ -12,11 +12,11 @@
 // * Optional positional arguments are passed in the correct position, so
 // require preceding arguments to be passed.
 
-class A native "*A" {
+class A native "A" {
   int foo(int x) native;
 }
 
-class B native "*B" {
+class B native "B" {
   int foo([x, y, z]) native;
 }
 
diff --git a/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
index 0014b00..7941775 100644
--- a/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
@@ -7,11 +7,11 @@
 // This is a similar test to NativeCallArity1FrogTest, but makes sure
 // that subclasses also get the right number of arguments.
 
-class A native "*A" {
+class A native "A" {
   int foo([x, y]) native;
 }
 
-class B extends A native "*B" {
+class B extends A native "B" {
   int foo([x, y]) native;
 }
 
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 ff59e31..59c35af 100644
--- a/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
@@ -8,11 +8,11 @@
 // parameters set to null. These parameters should be treated as if they
 // do not have a default value for the native methods.
 
-class A native "*A" {
+class A native "A" {
   int foo(int x) native;
 }
 
-class B native "*B" {
+class B native "B" {
   int foo([x = null, y, z = null]) native;
 }
 
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 7874dcd..3edf17b 100644
--- a/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
@@ -6,12 +6,12 @@
 
 // Test that type checks occur on native methods.
 
-class A native "*A" {
+class A native "A" {
   int foo(int x) native;
   int cmp(A other) native;
 }
 
-class B native "*B" {
+class B native "B" {
   String foo(String x) native;
   int cmp(B other) native;
 }
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 a63674c..22b9c7a 100644
--- a/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
@@ -6,11 +6,11 @@
 
 // Test that type checks occur on assignment to fields of native methods.
 
-class A native "*A" {
+class A native "A" {
   int foo;
 }
 
-class B native "*B" {
+class B native "B" {
   String foo;
 }
 
diff --git a/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart b/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
index dc7877f..3090172 100644
--- a/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_avoids_hidden_name_frog_test.dart
@@ -6,12 +6,12 @@
 
 // Test that hidden native class names are not used by generated code.
 
-class A native "*B" {
+class A native "B" {
   get name => 'A';
   static A create() => makeA();
 }
 
-class B native "*C" {
+class B native "C" {
   get name => 'B';
   static B create() => makeB();
 }
diff --git a/tests/compiler/dart2js_native/native_class_fields_2_test.dart b/tests/compiler/dart2js_native/native_class_fields_2_test.dart
index 00ca28b..b7ddbf7 100644
--- a/tests/compiler/dart2js_native/native_class_fields_2_test.dart
+++ b/tests/compiler/dart2js_native/native_class_fields_2_test.dart
@@ -6,7 +6,7 @@
 
 // Verify that methods are not renamed to clash with native field names
 // that are known from the DOM (like x, y, z).
-class A native "*A" {
+class A native "A" {
   int x;
   int y;
   int z;
@@ -110,4 +110,3 @@
   Expect.equals(42, x.z);
   Expect.equals(1, x.gettersCalled);
 }
-
diff --git a/tests/compiler/dart2js_native/native_class_fields_3_test.dart b/tests/compiler/dart2js_native/native_class_fields_3_test.dart
index 1af5d67..cbd97a9 100644
--- a/tests/compiler/dart2js_native/native_class_fields_3_test.dart
+++ b/tests/compiler/dart2js_native/native_class_fields_3_test.dart
@@ -12,7 +12,7 @@
 // names for clashes because it's hard - subclasses can force superclasses
 // to rename getters, and that can force unrelated classes to change their
 // getters too if they have a property that has the same name.
-class A native "*A" {
+class A native "A" {
   int bar;
   int g;
   int s;
diff --git a/tests/compiler/dart2js_native/native_class_fields_test.dart b/tests/compiler/dart2js_native/native_class_fields_test.dart
index 4bd0aa6..309654a 100644
--- a/tests/compiler/dart2js_native/native_class_fields_test.dart
+++ b/tests/compiler/dart2js_native/native_class_fields_test.dart
@@ -5,7 +5,7 @@
 import "package:expect/expect.dart";
 
 // Verify that native fields on classes are not renamed by the minifier.
-class A native "*A" {
+class A native "A" {
   int myLongPropertyName;
   int getValue;
 
@@ -58,4 +58,3 @@
     Expect.equals(11, gotten);
   }
 }
-
diff --git a/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
index 9c37eba..75a1032 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
@@ -10,11 +10,11 @@
 // stored on Object.prototype.
 
 // Version 1: It might be possible to call foo directly.
-class A1 native "*A1" {
+class A1 native "A1" {
   foo() native;
 }
 
-class B1 extends A1 native "*B1" {
+class B1 extends A1 native "B1" {
   foo() native;
 }
 
@@ -23,11 +23,11 @@
 
 
 // Version 2: foo needs some kind of trampoline.
-class A2 native "*A2" {
+class A2 native "A2" {
   foo([a=99]) native;
 }
 
-class B2 extends A2 native "*B2" {
+class B2 extends A2 native "B2" {
   foo([z=1000]) native;
 }
 
diff --git a/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart
index 27819c4..7177573 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance2_frog_test.dart
@@ -9,18 +9,18 @@
 // superclass caches the method in the prototype, so shadowing the dispatcher
 // stored on Object.prototype.
 
-class A native "*A" {
+class A native "A" {
   foo([a=100]) native;
 }
 
-class B extends A native "*B" {
+class B extends A native "B" {
 }
 
-class C extends B native "*C" {
+class C extends B native "C" {
   foo([z=300]) native;
 }
 
-class D extends C native "*D" {
+class D extends C native "D" {
 }
 
 makeA() native;
diff --git a/tests/compiler/dart2js_native/native_class_inheritance3_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance3_frog_test.dart
index 2f93bd2..aff6345 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance3_frog_test.dart
@@ -8,21 +8,21 @@
 // interferes with subsequent resolving of the method.  This might happen if the
 // noSuchMethod is cached on Object.prototype.
 
-class A1 native "*A1" {
+class A1 native "A1" {
 }
 
-class B1 extends A1 native "*B1" {
+class B1 extends A1 native "B1" {
 }
 
 makeA1() native;
 makeB1() native;
 
 
-class A2 native "*A2" {
+class A2 native "A2" {
   foo([a=99]) native;
 }
 
-class B2 extends A2 native "*B2" {
+class B2 extends A2 native "B2" {
 }
 
 makeA2() native;
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 70f2282..b243c59 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
@@ -8,7 +8,7 @@
 // inheritance, the superclass method must not be reached by a call on the
 // subclass.
 
-class A native "*A" {
+class A native "A" {
   var _field;
 
   int get X => _field;
@@ -17,7 +17,7 @@
   int method(int z) => _field + z;
 }
 
-class B extends A native "*B" {
+class B extends A native "B" {
   var _field2;
 
   int get X => _field2;
diff --git a/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart b/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
index 49dde38..ece197b 100644
--- a/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
@@ -13,7 +13,7 @@
 
 // Native implementation.
 
-class A implements I native "*A" {
+class A implements I native "A" {
   // The native class accepts only other native instances.
   A read() native;
   write(A x) native;
diff --git a/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart b/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
index b1f5f64..0a36764 100644
--- a/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
@@ -16,13 +16,13 @@
 
 // Native implementation.
 
-class A implements I native "*A" {
+class A implements I native "A" {
   // The native class accepts only other native instances.
   A read() native;
   write(A x) native;
 }
 
-class B extends A native "*B" {
+class B extends A native "B" {
 }
 
 makeA() native;
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 e595936..c5519e9 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
@@ -6,7 +6,7 @@
 
 // Additional Dart code may be 'placed on' hidden native classes.
 
-class A native "*A" {
+class A native "A" {
 
   var _field;
 
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 0f699b8..84b379b 100644
--- a/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_closure_identity_frog_test.dart
@@ -6,7 +6,7 @@
 
 typedef void MyFunctionType();
 
-class A native "*A" {
+class A native "A" {
   setClosure(MyFunctionType f) native;
   check(MyFunctionType f) native;
   invoke() native;
diff --git a/tests/compiler/dart2js_native/native_constructor_name_test.dart b/tests/compiler/dart2js_native/native_constructor_name_test.dart
index 9ea1b2d..1a88b65 100644
--- a/tests/compiler/dart2js_native/native_constructor_name_test.dart
+++ b/tests/compiler/dart2js_native/native_constructor_name_test.dart
@@ -13,7 +13,7 @@
 class A {
 }
 
-class Z native "*A" {
+class Z native "A" {
   foo() => 100;
 }
 
diff --git a/tests/compiler/dart2js_native/native_equals_frog_test.dart b/tests/compiler/dart2js_native/native_equals_frog_test.dart
index 58829c8..9d04fc4 100644
--- a/tests/compiler/dart2js_native/native_equals_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_equals_frog_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 
-class A native "*A" {}
+class A native "A" {}
 makeA() native;
 
 void setup() native """
diff --git a/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart b/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
index 2d17069..a72911d 100644
--- a/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_exceptions1_frog_test.dart
@@ -17,14 +17,14 @@
 
 
 // The exception type.
-class E native "*E" {
+class E native "E" {
   E._used() native;  // Bogus native constructor, called only from fake body.
 
   final int code;
 }
 
 // Type with exception-throwing methods.
-class A native "*A" {
+class A native "A" {
   op(int x) native {
     // Fake body calls constructor to mark the exception class (E) as used.
     throw new E._used();
diff --git a/tests/compiler/dart2js_native/native_field_name_test.dart b/tests/compiler/dart2js_native/native_field_name_test.dart
index e73df5c..8eab52b 100644
--- a/tests/compiler/dart2js_native/native_field_name_test.dart
+++ b/tests/compiler/dart2js_native/native_field_name_test.dart
@@ -6,7 +6,7 @@
 
 // Check that native fields are not incorrectly renamed.
 
-class A native "*A" {
+class A native "A" {
   int myLongPropertyName;
   int getValue;
 
@@ -62,4 +62,3 @@
     Expect.equals(11, gotten);
   }
 }
-
diff --git a/tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart b/tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart
index 6bd1fc0..8b2a1d6 100644
--- a/tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart
@@ -9,7 +9,7 @@
 import "package:expect/expect.dart";
 import 'dart:_js_helper' show JSName;
 
-class A native "*A" {
+class A native "A" {
   int key;                    //  jsname is 'key'
   int getKey() => key;
 }
@@ -20,7 +20,7 @@
   int getKey() => key;
 }
 
-class X native "*X" {
+class X native "X" {
   @JSName('key')
   int native_key_method() native;
   // This should cause B.key to be renamed, but not A.key.
diff --git a/tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart b/tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart
index a26dd1c..75efb3c 100644
--- a/tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart
@@ -13,7 +13,7 @@
   int key;
 }
 
-class A implements I native "*A" {
+class A implements I native "A" {
   int key;                    //  jsname is 'key'
   int getKey() => key;
 }
@@ -24,7 +24,7 @@
   int getKey() => key;
 }
 
-class X native "*X" {
+class X native "X" {
   @JSName('key')
   int native_key_method() native;
   // This should cause B.key to be renamed, but not A.key.
diff --git a/tests/compiler/dart2js_native/native_library_same_name_used_lib2.dart b/tests/compiler/dart2js_native/native_library_same_name_used_lib2.dart
index 9f1cfe6..4a2e514 100644
--- a/tests/compiler/dart2js_native/native_library_same_name_used_lib2.dart
+++ b/tests/compiler/dart2js_native/native_library_same_name_used_lib2.dart
@@ -8,7 +8,7 @@
 import 'native_library_same_name_used_lib1.dart';  // To get interface I.
 
 // Native impl has same name as interface.
-class Impl implements I native "*I" {
+class Impl implements I native "I" {
   Impl read() native;
   write(Impl x) native;
 }
diff --git a/tests/compiler/dart2js_native/native_method_inlining_test.dart b/tests/compiler/dart2js_native/native_method_inlining_test.dart
index c22f3a7..23257e9 100644
--- a/tests/compiler/dart2js_native/native_method_inlining_test.dart
+++ b/tests/compiler/dart2js_native/native_method_inlining_test.dart
@@ -9,7 +9,7 @@
 
 typedef int Int2Int(int x);
 
-class A native "*A" {
+class A native "A" {
   int foo([x, y, z]) native;
 
   // Calls can be inlined provided they don't pass an argument.
diff --git a/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart b/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
index 08df659..286e588 100644
--- a/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_method_rename1_frog_test.dart
@@ -7,7 +7,7 @@
 import "package:expect/expect.dart";
 import 'dart:_js_helper' show JSName;
 
-class A native "*A" {
+class A native "A" {
   @JSName('fooA')
   int foo() native;
 
diff --git a/tests/compiler/dart2js_native/native_method_rename2_frog_test.dart b/tests/compiler/dart2js_native/native_method_rename2_frog_test.dart
index b79f91b..31fb465 100644
--- a/tests/compiler/dart2js_native/native_method_rename2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_method_rename2_frog_test.dart
@@ -7,12 +7,12 @@
 import "package:expect/expect.dart";
 import 'dart:_js_helper' show JSName;
 
-class A native "*A" {
+class A native "A" {
   @JSName('fooA')
   int foo() native;
 }
 
-class B extends A native "*B" {
+class B extends A native "B" {
   @JSName('fooB')
   int foo() native;
 }
diff --git a/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart b/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
index 28329c4..f7455b3 100644
--- a/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_method_rename3_frog_test.dart
@@ -8,12 +8,12 @@
 import "package:expect/expect.dart";
 import 'dart:_js_helper' show JSName;
 
-class A native "*A" {
+class A native "A" {
   @JSName('fooA')
   int foo() native;
 }
 
-class B extends A native "*B" {
+class B extends A native "B" {
   @JSName('fooB')
   int foo() native;
   int fooA() => 333;
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 b9a8975..989312d 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
@@ -6,7 +6,7 @@
 
 // Make sure we can have a native with a name that is a JavaScript keyword.
 
-class A native "*A" {
+class A native "A" {
   int delete() native;
 }
 
diff --git a/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart b/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
index 6f58acd..b630d23 100644
--- a/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 
-class A native "*A" {
+class A native "A" {
 }
 
 makeA() native;
diff --git a/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart b/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
index fa28fce..7d473ab 100644
--- a/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 
-class A native "*A" {
+class A native "A" {
 }
 
 makeA() native;
diff --git a/tests/compiler/dart2js_native/native_mixin_field_test.dart b/tests/compiler/dart2js_native/native_mixin_field_test.dart
index d17ff62..322381f 100644
--- a/tests/compiler/dart2js_native/native_mixin_field_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_field_test.dart
@@ -7,11 +7,11 @@
 // Test that native classes can use ordinary Dart classes with fields
 // as mixins.
 
-class A native "*A" {
+class A native "A" {
   var foo;
 }
 
-class B extends A with M1, M2 native "*B" {
+class B extends A with M1, M2 native "B" {
   var bar;
 }
 
diff --git a/tests/compiler/dart2js_native/native_mixin_multiple_test.dart b/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
index fa38c52..4e930c7 100644
--- a/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
@@ -6,12 +6,12 @@
 
 // Test that native classes can use ordinary Dart classes as mixins.
 
-class A native "*A" {
+class A native "A" {
   foo() => "A-foo";
   baz() => "A-baz";
 }
 
-class B extends A with M1, M2 native "*B" {
+class B extends A with M1, M2 native "B" {
   bar() => baz();
 }
 
diff --git a/tests/compiler/dart2js_native/native_mixin_test.dart b/tests/compiler/dart2js_native/native_mixin_test.dart
index ba36b32..d63f306 100644
--- a/tests/compiler/dart2js_native/native_mixin_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_test.dart
@@ -6,12 +6,12 @@
 
 // Test that native classes can use ordinary Dart classes as mixins.
 
-class A native "*A" {
+class A native "A" {
   foo() => "A-foo";
   baz() => "A-baz";
 }
 
-class B extends A with M native "*B" {
+class B extends A with M native "B" {
   bar() => baz();
 }
 
diff --git a/tests/compiler/dart2js_native/native_mixin_with_plain_test.dart b/tests/compiler/dart2js_native/native_mixin_with_plain_test.dart
index da38cb4..c21e0b3 100644
--- a/tests/compiler/dart2js_native/native_mixin_with_plain_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_with_plain_test.dart
@@ -7,13 +7,13 @@
 // Test that native classes and ordinary Dart classes can both use the same
 // ordinary Dart classes as a mixin.
 
-class A native "*A" {
+class A native "A" {
   final String aa;
   foo() => "A-foo $aa";
   baz() => "A-baz $aa";
 }
 
-class B extends A with M native "*B" {
+class B extends A with M native "B" {
   bar() => 'B-bar -> ${baz()}';
   get mm => 'B.mm($aa)';
 }
diff --git a/tests/compiler/dart2js_native/native_named_constructors2_frog_test.dart b/tests/compiler/dart2js_native/native_named_constructors2_frog_test.dart
index f3926d5..2620f96 100644
--- a/tests/compiler/dart2js_native/native_named_constructors2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_named_constructors2_frog_test.dart
@@ -8,7 +8,7 @@
 
 
 
-class A native "*A" {
+class A native "A" {
 
   factory A(int len) => _construct(len);
 
diff --git a/tests/compiler/dart2js_native/native_named_constructors3_frog_test.dart b/tests/compiler/dart2js_native/native_named_constructors3_frog_test.dart
index 1312f60..001c4ae 100644
--- a/tests/compiler/dart2js_native/native_named_constructors3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_named_constructors3_frog_test.dart
@@ -8,7 +8,7 @@
 // Regression test.
 
 
-class A native "*A" {
+class A native "A" {
 
   // No static methods in this class.
 
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
index 9b980fd..1c2f5a9 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception2_frog_test.dart
@@ -4,10 +4,10 @@
 
 import "package:expect/expect.dart";
 
-class A native "*A" {
+class A native "A" {
 }
 
-class B extends A native "*B" {
+class B extends A native "B" {
   foo() native;
 }
 
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
index d052f43..886e33f 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
@@ -11,11 +11,11 @@
 
 String getName(im) => reflect(new GetName()).delegate(im);
 
-class A native "*A" {
+class A native "A" {
   bar() => 42;
 }
 
-class B native "*B" {
+class B native "B" {
   foo() => 42;
 }
 
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
index 1cad00c..fed9ce8 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
@@ -12,12 +12,12 @@
 
 String getName(im) => reflect(new GetName()).delegate(im);;
 
-class A native "*A" {
+class A native "A" {
   bar() => 42;
   noSuchMethod(x) => "native(${getName(x)}:${x.positionalArguments})";
 }
 
-class B native "*B" {
+class B native "B" {
   baz() => 42;
 }
 
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
index 117e156..87b3a37 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
@@ -12,12 +12,12 @@
 
 String getName(im) => reflect(new GetName()).delegate(im);
 
-class A native "*A" {
+class A native "A" {
   bar() => 42;
   noSuchMethod(x) => "native(${getName(x)}:${x.positionalArguments})";
 }
 
-class B native "*B" {
+class B native "B" {
   baz() => 42;
 }
 
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception_frog_test.dart
index 952a4ac..007de7f 100644
--- a/tests/compiler/dart2js_native/native_no_such_method_exception_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_no_such_method_exception_frog_test.dart
@@ -4,11 +4,11 @@
 
 import "package:expect/expect.dart";
 
-class A native "*A" {
+class A native "A" {
   bar() => 42;
 }
 
-class B native "*B" {
+class B native "B" {
   foo() => 42;
 }
 
diff --git a/tests/compiler/dart2js_native/native_novel_html_test.dart b/tests/compiler/dart2js_native/native_novel_html_test.dart
index 5a29c8f..660685a 100644
--- a/tests/compiler/dart2js_native/native_novel_html_test.dart
+++ b/tests/compiler/dart2js_native/native_novel_html_test.dart
@@ -6,7 +6,7 @@
 
 // Test to see if novel HTML tags are interpreted as HTMLElement.
 
-class Element native "*HTMLElement" {
+class Element native "HTMLElement" {
   String dartMethod(int x) => 'dartMethod(${nativeMethod(x+1)})';
   String nativeMethod(int x) native;
 }
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 fbd5d0d..adba407 100644
--- a/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_null_closure_frog_test.dart
@@ -6,7 +6,7 @@
 
 typedef void MyFunctionType();
 
-class A native "*A" {
+class A native "A" {
   setClosure(MyFunctionType f) native;
   check(MyFunctionType f) native;
   invoke() native;
diff --git a/tests/compiler/dart2js_native/native_null_frog_test.dart b/tests/compiler/dart2js_native/native_null_frog_test.dart
index 8dde95e..846c9b4 100644
--- a/tests/compiler/dart2js_native/native_null_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_null_frog_test.dart
@@ -7,7 +7,7 @@
 // Test for values of some basic types.
 
 
-class A native "*A" {
+class A native "A" {
   returnNull() native;
   returnUndefined() native;
   returnEmptyString() native;
diff --git a/tests/compiler/dart2js_native/native_property_frog_test.dart b/tests/compiler/dart2js_native/native_property_frog_test.dart
index e3a647a..5814994 100644
--- a/tests/compiler/dart2js_native/native_property_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_property_frog_test.dart
@@ -7,7 +7,7 @@
 import "package:expect/expect.dart";
 import 'dart:_foreign_helper' show JS;
 
-class A native "*A" {
+class A native "A" {
 
   // Setters and getters should be similar to these methods:
   int getX() => JS('int', '#._x', this);
diff --git a/tests/compiler/dart2js_native/native_to_string_frog_test.dart b/tests/compiler/dart2js_native/native_to_string_frog_test.dart
index 1931ed6..c15dc55 100644
--- a/tests/compiler/dart2js_native/native_to_string_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_to_string_frog_test.dart
@@ -4,7 +4,7 @@
 
 import "package:expect/expect.dart";
 
-class A native "*A" {}
+class A native "A" {}
 makeA() native;
 
 void setup() native """
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 e24cef3..8c89d38 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
@@ -7,11 +7,11 @@
 // Test that we put native names and not Dart names into the dynamic
 // dispatch table.
 
-class A native "*NativeA" {
+class A native "NativeA" {
   foo() native;
 }
 
-class B extends A native "*NativeB" {
+class B extends A native "NativeB" {
 }
 
 A makeA() native { return new A(); }
diff --git a/tests/compiler/dart2js_native/native_wrapping_function3_frog_test.dart b/tests/compiler/dart2js_native/native_wrapping_function3_frog_test.dart
index 5350048..22f2f3e 100644
--- a/tests/compiler/dart2js_native/native_wrapping_function3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_wrapping_function3_frog_test.dart
@@ -8,7 +8,7 @@
 typedef void Callback1(arg1);
 typedef void Callback2(arg1, arg2);
 
-class A native "*A" {
+class A native "A" {
   foo1(Callback1 closure, [arg1 = 0]) native;
   foo2(Callback2 closure, [arg1 = 0, arg2 = 1]) native;
 }
diff --git a/tests/compiler/dart2js_native/native_wrapping_function_frog_test.dart b/tests/compiler/dart2js_native/native_wrapping_function_frog_test.dart
index b89d515..eca6639 100644
--- a/tests/compiler/dart2js_native/native_wrapping_function_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_wrapping_function_frog_test.dart
@@ -8,7 +8,7 @@
 typedef void Callback1(arg1);
 typedef void Callback2(arg1, arg2);
 
-class A native "*A" {
+class A native "A" {
   foo0(Callback0 closure) native;
   foo1(Callback1 closure, arg1) native;
   foo2(Callback2 closure, arg1, arg2) native;
diff --git a/tests/compiler/dart2js_native/runtimetype_test.dart b/tests/compiler/dart2js_native/runtimetype_test.dart
new file mode 100644
index 0000000..dc8d7a4
--- /dev/null
+++ b/tests/compiler/dart2js_native/runtimetype_test.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import 'dart:_foreign_helper' show JS;
+
+// Test to see runtimeType works on native classes and does not use the native
+// constructor name.
+
+class A native "TAGX" {
+}
+
+class B extends A native "TAGY" {
+}
+
+makeA() native;
+makeB() native;
+
+void setup() native """
+// This code is all inside 'setup' and so not accesible from the global scope.
+function inherits(child, parent) {
+  function tmp() {};
+  tmp.prototype = parent.prototype;
+  child.prototype = new tmp();
+  child.prototype.constructor = child;
+}
+
+function TAGX(){}
+function TAGY(){}
+inherits(TAGY, TAGX);
+
+makeA = function(){return new TAGX};
+makeB = function(){return new TAGY};
+""";
+
+
+testDynamicContext() {
+  var a = makeA();
+  var b = makeB();
+
+  var aT = a.runtimeType;
+  var bT = b.runtimeType;
+
+  Expect.notEquals('TAGX', '$aT');
+  Expect.notEquals('TAGY', '$bT');
+}
+
+testStaticContext() {
+  var a = JS('A', '#', makeA());  // Force compiler to know type.
+  var b = JS('B', '#', makeB());
+
+  var aT = a.runtimeType;
+  var bT = b.runtimeType;
+
+  Expect.notEquals('TAGX', '$aT');
+  Expect.notEquals('TAGY', '$bT');
+}
+
+main() {
+  setup();
+
+  testDynamicContext();
+  testStaticContext();
+}
diff --git a/tests/compiler/dart2js_native/super_call_test.dart b/tests/compiler/dart2js_native/super_call_test.dart
new file mode 100644
index 0000000..68cccb7
--- /dev/null
+++ b/tests/compiler/dart2js_native/super_call_test.dart
@@ -0,0 +1,75 @@
+// 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.
+
+import "package:expect/expect.dart";
+
+// Test to see if resolving a hidden native class's method interferes with
+// subsequent resolving the subclass's method.  This might happen if the
+// superclass caches the method in the prototype, so shadowing the dispatcher
+// stored on Object.prototype.
+
+class A native "A" {
+  foo() => 'A.foo ${bar()}';
+  bar() => 'A.bar';
+}
+
+class B extends A native "B" {
+  bar() => 'B.bar';
+}
+
+class C extends B native "C" {
+  foo() => 'C.foo; super.foo = ${super.foo()}';
+  bar() => 'C.bar';
+}
+
+class D extends C native "D" {
+  bar() => 'D.bar';
+}
+
+makeA() native;
+makeB() native;
+makeC() native;
+makeD() native;
+
+void setup() native """
+// This code is all inside 'setup' and so not accesible from the global scope.
+function inherits(child, parent) {
+  if (child.prototype.__proto__) {
+    child.prototype.__proto__ = parent.prototype;
+  } else {
+    function tmp() {};
+    tmp.prototype = parent.prototype;
+    child.prototype = new tmp();
+    child.prototype.constructor = child;
+  }
+}
+
+function A(){}
+function B(){}
+inherits(B, A);
+function C(){}
+inherits(C, B);
+function D(){}
+inherits(D, C);
+
+makeA = function(){return new A};
+makeB = function(){return new B};
+makeC = function(){return new C};
+makeD = function(){return new D};
+""";
+
+
+main() {
+  setup();
+
+  var a = makeA();
+  var b = makeB();
+  var c = makeC();
+  var d = makeD();
+
+  Expect.equals('A.foo A.bar', a.foo());
+  Expect.equals('A.foo B.bar', b.foo());
+  Expect.equals('C.foo; super.foo = A.foo C.bar', c.foo());
+  Expect.equals('C.foo; super.foo = A.foo D.bar', d.foo());
+}
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index 38e940d..cd29121c 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -62,6 +62,9 @@
 date_time7_test: Fail # BUG(3304): Maybe this doesn't time out?
 json_strict_test: Fail # IE parses slightly harmless no-standard JSON.
 string_base_vm_test: Fail # BUG(3304): Maybe this doesn't time out?
+list_test: Fail # IE doesn't support typed data.
+
+[ $compiler == dart2js && ($runtime == firefox || $runtime == safari || $runtime == chrome || $runtime == drt) ]
 
 [ $compiler == dart2dart ]
 compare_to2_test: Fail # inherited from VM
diff --git a/tests/corelib/list_test.dart b/tests/corelib/list_test.dart
index 932d4ca..28629a9 100644
--- a/tests/corelib/list_test.dart
+++ b/tests/corelib/list_test.dart
@@ -3,77 +3,163 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "dart:collection";
+import "dart:typed_data";
 import "package:expect/expect.dart";
 
 void main() {
+  // Typed lists - fixed length and can only contain integers.
+  testTypedList(new Uint8List(4));
+  testTypedList(new Int8List(4));
+  testTypedList(new Uint16List(4));
+  testTypedList(new Int16List(4));
+  testTypedList(new Uint32List(4));
+  testTypedList(new Int32List(4));
+
+  // Fixed length lists, length 4.
   testFixedLengthList(new List(4));
+  testFixedLengthList(new List(4).toList(growable: false));
+  testFixedLengthList((new List()..length = 4).toList(growable: false));
   // ListBase implementation of List.
   testFixedLengthList(new MyFixedList(new List(4)));
+  testFixedLengthList(new MyFixedList(new List(4)).toList(growable: false));
 
+  testFixedLengthList(new Uint8List(4).toList(growable: false));
+  testFixedLengthList(new Int8List(4).toList(growable: false));
+  testFixedLengthList(new Uint16List(4).toList(growable: false));
+  testFixedLengthList(new Int16List(4).toList(growable: false));
+  testFixedLengthList(new Uint32List(4).toList(growable: false));
+  testFixedLengthList(new Int32List(4).toList(growable: false));
+
+  // Growable lists. Initial length 0.
   testGrowableList(new List());
+  testGrowableList(new List().toList());
+  testGrowableList(new List(0).toList());
   testGrowableList([]);
+  testGrowableList((const []).toList());
   testGrowableList(new MyList([]));
+  testGrowableList(new MyList([]).toList());
+  testGrowableList(new Uint8List(0).toList());
+  testGrowableList(new Int8List(0).toList());
+  testGrowableList(new Uint16List(0).toList());
+  testGrowableList(new Int16List(0).toList());
+  testGrowableList(new Uint32List(0).toList());
+  testGrowableList(new Int32List(0).toList());
 }
 
-void expectValues(list, val1, val2, val3, val4) {
-  Expect.isFalse(list.isEmpty);
-  Expect.equals(4, list.length);
-  Expect.equals(list[0], val1);
-  Expect.equals(list[1], val2);
-  Expect.equals(list[2], val3);
-  Expect.equals(list[3], val4);
+void testLength(int length, List list) {
+  Expect.equals(length, list.length);
+  (length == 0 ? Expect.isTrue : Expect.isFalse)(list.isEmpty);
 }
 
-void testClosures(List list) {
-  testMap(val) {return val * 2 + 10; }
-  List mapped = list.map(testMap).toList();
-  Expect.equals(mapped.length, list.length);
-  for (var i = 0; i < list.length; i++) {
-    Expect.equals(mapped[i], list[i]*2 + 10);
-  }
-
-  testFilter(val) { return val == 3; }
-  Iterable filtered = list.where(testFilter);
-  Expect.equals(filtered.length, 1);
-
-  testEvery(val) { return val != 11; }
-  bool test = list.every(testEvery);
-  Expect.isTrue(test);
-
-  testSome(val) { return val == 1; }
-  test = list.any(testSome);
-  Expect.isTrue(test);
-
-  testSomeFirst(val) { return val == 0; }
-  test = list.any(testSomeFirst);
-  Expect.isTrue(test);
-
-  testSomeLast(val) { return val == (list.length - 1); }
-  test = list.any(testSomeLast);
-  Expect.isTrue(test);
-}
-
-void testFixedLengthList(List list) {
+void testTypedLengthInvariantOperations(List list) {
+  // length
   Expect.equals(list.length, 4);
+  // operators [], []=.
+  for (int i = 0; i < 4; i++) list[i] = 0;
   list[0] = 4;
-  expectValues(list, 4, null, null, null);
-  String val = "fisk";
-  list[1] = val;
-  expectValues(list, 4, val, null, null);
-  double d = 2.0;
-  list[3] = d;
-  expectValues(list, 4, val, null, d);
+  Expect.listEquals([4, 0, 0, 0], list);
+  list[1] = 7;
+  Expect.listEquals([4, 7, 0, 0], list);
+  list[3] = 2;
+  Expect.listEquals([4, 7, 0, 2], list);
 
   for (int i = 0; i < list.length; i++) {
     list[i] = i;
   }
 
+  // indexOf, lastIndexOf
   for (int i = 0; i < 4; i++) {
     Expect.equals(i, list[i]);
     Expect.equals(i, list.indexOf(i));
     Expect.equals(i, list.lastIndexOf(i));
   }
 
+  // setRange.
+  list.setRange(0, 4, [3, 2, 1, 0]);
+  Expect.listEquals([3, 2, 1, 0], list);
+
+  list.setRange(1, 4, list);
+  Expect.listEquals([3, 3, 2, 1], list);
+
+  list.setRange(0, 3, list, 1);
+  Expect.listEquals([3, 2, 1, 1], list);
+  list.setRange(0, 3, list, 1);
+  Expect.listEquals([2, 1, 1, 1], list);
+
+  list.setRange(2, 4, list, 0);
+  Expect.listEquals([2, 1, 2, 1], list);
+
+  // setAll.
+  list.setAll(0, [3, 2, 0, 1]);
+  Expect.listEquals([3, 2, 0, 1], list);
+  list.setAll(1, [0, 1]);
+  Expect.listEquals([3, 0, 1, 1], list);
+
+  // fillRange.
+  list.fillRange(1, 3, 7);
+  Expect.listEquals([3, 7, 7, 1], list);
+  list.fillRange(0, 0, 9);
+  Expect.listEquals([3, 7, 7, 1], list);
+  list.fillRange(4, 4, 9);
+  Expect.listEquals([3, 7, 7, 1], list);
+  list.fillRange(0, 4, 9);
+  Expect.listEquals([9, 9, 9, 9], list);
+
+  // sort.
+  list.setRange(0, 4, [3, 2, 1, 0]);
+  list.sort();
+  Expect.listEquals([0, 1, 2, 3], list);
+  list.setRange(0, 4, [1, 2, 3, 0]);
+  list.sort();
+  Expect.listEquals([0, 1, 2, 3], list);
+  list.setRange(0, 4, [1, 3, 0, 2]);
+  list.sort((a, b) => b - a);  // reverse compare.
+  Expect.listEquals([3, 2, 1, 0], list);
+  list.setRange(0, 4, [1, 2, 3, 0]);
+  list.sort((a, b) => b - a);
+  Expect.listEquals([3, 2, 1, 0], list);
+
+  // Some Iterable methods.
+
+  list.setRange(0, 4, [0, 1, 2, 3]);
+  // map.
+  testMap(val) {return val * 2 + 10; }
+  List mapped = list.map(testMap).toList();
+  Expect.equals(mapped.length, list.length);
+  for (var i = 0; i < list.length; i++) {
+    Expect.equals(mapped[i], list[i] * 2 + 10);
+  }
+
+  matchAll(val) => true;
+  matchSome(val) { return (val == 1 || val == 2); }
+  matchSomeFirst(val) { return val == 0; }
+  matchSomeLast(val) { return val == 3; }
+  matchNone(val) => false;
+
+  // where.
+  Iterable filtered = list.where(matchSome);
+  Expect.equals(filtered.length, 2);
+
+  // every
+  Expect.isTrue(list.every(matchAll));
+  Expect.isFalse(list.every(matchSome));
+  Expect.isFalse(list.every(matchNone));
+
+  // any
+  Expect.isTrue(list.any(matchAll));
+  Expect.isTrue(list.any(matchSome));
+  Expect.isTrue(list.any(matchSomeFirst));
+  Expect.isTrue(list.any(matchSomeLast));
+  Expect.isFalse(list.any(matchNone));
+
+  // Argument checking isn't implemented for typed arrays in browsers,
+  // so it's moved to the method below for now.
+}
+
+void testLengthInvariantOperations(List list) {
+  testTypedLengthInvariantOperations(list);
+  // Tests that need untyped lists.
+  list.setAll(0, [0, 1, 2, 3]);
   Expect.equals(-1, list.indexOf(100));
   Expect.equals(-1, list.lastIndexOf(100));
   list[2] = new Yes();
@@ -89,53 +175,284 @@
   Expect.equals(-1, list.indexOf(100));
   Expect.equals(-1, list.lastIndexOf(100));
 
-  testClosures(list);
+  // Argument errors on bad indices. List is still [0, 1, 2, 3].
+  testArgumentError(action()) {
+    Expect.throws(action, (e) => e is ArgumentError);
+  }
 
-  Expect.throws(list.clear, (e) => e is UnsupportedError);
+  // Direct indices (0 <= index < length).
+  testArgumentError(() => list[-1]);
+  testArgumentError(() => list[4]);
+  testArgumentError(() => list[-1] = 99);
+  testArgumentError(() => list[4] = 99);
+  testArgumentError(() => list.elementAt(-1));
+  testArgumentError(() => list.elementAt(4));
+  // Ranges (0 <= start <= end <= length).
+  testArgumentError(() => list.sublist(-1, 2));
+  testArgumentError(() => list.sublist(-1, 5));
+  testArgumentError(() => list.sublist(2, 5));
+  testArgumentError(() => list.sublist(4, 2));
+  testArgumentError(() => list.getRange(-1, 2));
+  testArgumentError(() => list.getRange(-1, 5));
+  testArgumentError(() => list.getRange(2, 5));
+  testArgumentError(() => list.getRange(4, 2));
+  testArgumentError(() => list.setRange(-1, 2, [1, 2, 3]));
+  testArgumentError(() => list.setRange(-1, 5, [1, 2, 3, 4, 5, 6]));
+  testArgumentError(() => list.setRange(2, 5, [1, 2, 3]));
+  testArgumentError(() => list.setRange(4, 2, [1, 2]));
+  // for setAll, end is implictly start + values.length.
+  testArgumentError(() => list.setAll(-1, []));
+  testArgumentError(() => list.setAll(5, []));
+  testArgumentError(() => list.setAll(2, [1, 2, 3]));
+  testArgumentError(() => list.fillRange(-1, 2));
+  testArgumentError(() => list.fillRange(-1, 5));
+  testArgumentError(() => list.fillRange(2, 5));
+  testArgumentError(() => list.fillRange(4, 2));
+}
+
+void testTypedList(List list) {
+  testTypedLengthInvariantOperations(list);
+  testCannotChangeLength(list);
+}
+
+void testFixedLengthList(List list) {
+  testLengthInvariantOperations(list);
+  testCannotChangeLength(list);
+}
+
+void testCannotChangeLength(List list) {
+  isUnsupported(action()) {
+    Expect.throws(action, (e) => e is UnsupportedError);
+  }
+  isUnsupported(() => list.add(0));
+  isUnsupported(() => list.addAll([0]));
+  isUnsupported(() => list.removeLast());
+  isUnsupported(() => list.insert(0, 1));
+  isUnsupported(() => list.insertAll(0, [1]));
+  isUnsupported(() => list.clear());
+  isUnsupported(() => list.remove(1));
+  isUnsupported(() => list.removeAt(1));
+  isUnsupported(() => list.removeRange(0, 1));
+  isUnsupported(() => list.replaceRange(0, 1, []));
 }
 
 void testGrowableList(List list) {
-  Expect.isTrue(list.isEmpty);
-  Expect.equals(list.length, 0);
-  list.add(4);
-  Expect.equals(1, list.length);
-  Expect.isTrue(!list.isEmpty);
-  Expect.equals(list.length, 1);
-  Expect.equals(list.length, 1);
-  Expect.equals(list.removeLast(), 4);
+  testLength(0, list);
+  // set length.
+  list.length = 4;
+  testLength(4, list);
 
-  for (int i = 0; i < 10; i++) {
+  testLengthInvariantOperations(list);
+
+  // add, removeLast.
+  list.clear();
+  testLength(0, list);
+  list.add(4);
+  testLength(1, list);
+  Expect.equals(4, list.removeLast());
+  testLength(0, list);
+
+  for (int i = 0; i < 100; i++) {
     list.add(i);
   }
 
-  Expect.equals(list.length, 10);
-  for (int i = 0; i < 10; i++) {
+  Expect.equals(list.length, 100);
+  for (int i = 0; i < 100; i++) {
     Expect.equals(i, list[i]);
-    Expect.equals(i, list.indexOf(i));
-    Expect.equals(i, list.lastIndexOf(i));
   }
 
-  Expect.equals(-1, list.indexOf(100));
-  Expect.equals(-1, list.lastIndexOf(100));
-  list[2] = new Yes();
-  Expect.equals(2, list.indexOf(100));
-  Expect.equals(2, list.lastIndexOf(100));
-  list[3] = new Yes();
-  Expect.equals(2, list.indexOf(100));
-  Expect.equals(3, list.lastIndexOf(100));
-  list[2] = 2;
-  Expect.equals(3, list.indexOf(100));
-  Expect.equals(3, list.lastIndexOf(100));
-  list[3] = 3;
-  Expect.equals(-1, list.indexOf(100));
-  Expect.equals(-1, list.lastIndexOf(100));
+  Expect.equals(17, list.indexOf(17));
+  Expect.equals(17, list.lastIndexOf(17));
+  Expect.equals(-1, list.indexOf(999));
+  Expect.equals(-1, list.lastIndexOf(999));
 
-  testClosures(list);
+  Expect.equals(99, list.removeLast());
+  testLength(99, list);
 
-  Expect.equals(9, list.removeLast());
+  // remove.
+  Expect.isTrue(list.remove(4));
+  testLength(98, list);
+  Expect.isFalse(list.remove(4));
+  testLength(98, list);
   list.clear();
-  Expect.equals(0, list.length);
-  Expect.isTrue(list.isEmpty);
+  testLength(0, list);
+
+  list.add(4);
+  list.add(4);
+  testLength(2, list);
+  Expect.isTrue(list.remove(4));
+  testLength(1, list);
+  Expect.isTrue(list.remove(4));
+  testLength(0, list);
+  Expect.isFalse(list.remove(4));
+  testLength(0, list);
+
+  // removeWhere, retainWhere
+  for (int i = 0; i < 100; i++) {
+    list.add(i);
+  }
+  testLength(100, list);
+  list.removeWhere((int x) => x.isOdd);
+  testLength(50, list);
+  for (int i = 0; i < list.length; i++) {
+    Expect.isTrue(list[i].isEven);
+  }
+  list.retainWhere((int x) => (x % 3) == 0);
+  testLength(17, list);
+  for (int i = 0; i < list.length; i++) {
+    Expect.isTrue((list[i] % 6) == 0);
+  }
+
+  // insert, remove, removeAt
+  list.clear();
+  testLength(0, list);
+
+  list.insert(0, 0);
+  Expect.listEquals([0], list);
+
+  list.insert(0, 1);
+  Expect.listEquals([1, 0], list);
+
+  list.insert(0, 2);
+  Expect.listEquals([2, 1, 0], list);
+
+  Expect.isTrue(list.remove(1));
+  Expect.listEquals([2, 0], list);
+
+  list.insert(1, 1);
+  Expect.listEquals([2, 1, 0], list);
+
+  list.removeAt(1);
+  Expect.listEquals([2, 0], list);
+
+  list.removeAt(1);
+  Expect.listEquals([2], list);
+
+  // insertAll
+  list.insertAll(0, [1, 2, 3]);
+  Expect.listEquals([1, 2, 3, 2], list);
+
+  list.insertAll(2, []);
+  Expect.listEquals([1, 2, 3, 2], list);
+
+  list.insertAll(4, [7, 9]);
+  Expect.listEquals([1, 2, 3, 2, 7, 9], list);
+
+  // addAll
+  list.addAll(list.reversed.toList());
+  Expect.listEquals([1, 2, 3, 2, 7, 9, 9, 7, 2, 3, 2, 1], list);
+
+  list.addAll([]);
+  Expect.listEquals([1, 2, 3, 2, 7, 9, 9, 7, 2, 3, 2, 1], list);
+
+  // replaceRange
+  list.replaceRange(3, 7, [0, 0]);
+  Expect.listEquals([1, 2, 3, 0, 0, 7, 2, 3, 2, 1], list);
+
+  list.replaceRange(2, 3, [5, 5, 5]);
+  Expect.listEquals([1, 2, 5, 5, 5, 0, 0, 7, 2, 3, 2, 1], list);
+
+  list.replaceRange(2, 4, [6, 6]);
+  Expect.listEquals([1, 2, 6, 6, 5, 0, 0, 7, 2, 3, 2, 1], list);
+
+  list.replaceRange(6, 8, []);
+  Expect.listEquals([1, 2, 6, 6, 5, 0, 2, 3, 2, 1], list);
+
+  // Operations that change the length cause ConcurrentModificationError.
+  void testConcurrentModification(action()) {
+    testIterator(int when) {
+      list.length = 4;
+      list.setAll(0, [0, 1, 2, 3]);
+      Expect.throws(() {
+        for (var element in list) {
+          if (element == when) action();
+        }
+      }, (e) => e is ConcurrentModificationError);
+    }
+    testForEach(int when) {
+      list.length = 4;
+      list.setAll(0, [0, 1, 2, 3]);
+      Expect.throws(() {
+        list.forEach((var element) {
+          if (element == when) action();
+        });
+      }, (e) => e is ConcurrentModificationError);
+    }
+    // Test the change at different points of the iteration.
+    testIterator(0);
+    testIterator(1);
+    testIterator(3);
+    testForEach(0);
+    testForEach(1);
+    testForEach(3);
+  }
+
+  testConcurrentModification(() => list.add(5));
+  testConcurrentModification(() => list.addAll([5, 6]));
+  testConcurrentModification(() => list.removeLast());
+  for (int i = 0; i < 4; i++) {
+    testConcurrentModification(() => list.remove(i));
+    testConcurrentModification(() => list.removeAt(i));
+    testConcurrentModification(() => list.removeWhere((x) => x == i));
+    testConcurrentModification(() => list.retainWhere((x) => x != i));
+    testConcurrentModification(() => list.insert(i, 5));
+    testConcurrentModification(() => list.insertAll(i, [5, 6]));
+    testConcurrentModification(() => list.removeRange(i, i + 1));
+    testConcurrentModification(() => list.replaceRange(i, i + 1, [5, 6]));
+  }
+
+  // Any operation that doesn't change the length should be safe for iteration.
+  testSafeConcurrentModification(action()) {
+    list.length = 4;
+    list.setAll(0, [0, 1, 2, 3]);
+    for (var i in list) {
+      action();
+    }
+    list.forEach((e) => action());
+  }
+
+  testSafeConcurrentModification(() {
+    list.add(5);
+    list.removeLast();
+  });
+  testSafeConcurrentModification(() {
+    list.add(list[0]);
+    list.removeAt(0);
+  });
+  testSafeConcurrentModification(() {
+    list.insert(0, list.removeLast());
+  });
+  testSafeConcurrentModification(() {
+    list.replaceRange(1, 3, list.sublist(1, 3).reversed);
+  });
+
+  // Argument errors on bad indices for methods that are only allowed
+  // on growable lists.
+  list.length = 4;
+  list.setAll(0, [0, 1, 2, 3]);
+  testArgumentError(action()) {
+    Expect.throws(action, (e) => e is ArgumentError);
+  }
+
+  // Direct indices (0 <= index < length).
+  testArgumentError(() => list.removeAt(-1));
+  testArgumentError(() => list.removeAt(4));
+  // Direct indices including end (0 <= index <= length).
+  testArgumentError(() => list.insert(-1, 0));
+  testArgumentError(() => list.insert(5, 0));
+  testArgumentError(() => list.insertAll(-1, [0]));
+  testArgumentError(() => list.insertAll(5, [0]));
+  testArgumentError(() => list.insertAll(-1, [0]));
+  testArgumentError(() => list.insertAll(5, [0]));
+  // Ranges (0 <= start <= end <= length).
+  testArgumentError(() => list.removeRange(-1, 2));
+  testArgumentError(() => list.removeRange(2, 5));
+  testArgumentError(() => list.removeRange(-1, 5));
+  testArgumentError(() => list.removeRange(4, 2));
+  testArgumentError(() => list.replaceRange(-1, 2, [9]));
+  testArgumentError(() => list.replaceRange(2, 5, [9]));
+  testArgumentError(() => list.replaceRange(-1, 5, [9]));
+  testArgumentError(() => list.replaceRange(4, 2, [9]));
 }
 
 class Yes {
diff --git a/tests/corelib/queue_test.dart b/tests/corelib/queue_test.dart
index e36ab42..6e5a0d77 100644
--- a/tests/corelib/queue_test.dart
+++ b/tests/corelib/queue_test.dart
@@ -222,7 +222,9 @@
       testLength(35 - i, queue);
     }
 
-    queue.remove(10);
+    Expect.isTrue(queue.remove(10));
+    testLength(29, queue);
+    Expect.isFalse(queue.remove(999));
     testLength(29, queue);
 
     queue.removeWhere((x) => x == 7);
@@ -267,7 +269,7 @@
     }
     Expect.equals(N - 1000, queue.length);
 
-    queue.remove(N >> 1);
+    Expect.isTrue(queue.remove(N >> 1));
     Expect.equals(N - 1001, queue.length);
 
     queue.clear();
diff --git a/tests/html/audiocontext_test.dart b/tests/html/audiocontext_test.dart
index bcf60a3..de151dc 100644
--- a/tests/html/audiocontext_test.dart
+++ b/tests/html/audiocontext_test.dart
@@ -2,6 +2,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_individual_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 import 'dart:web_audio';
 import 'dart:async';
 
@@ -30,12 +31,12 @@
     test('createBuffer', () {
       if(AudioContext.supported) {
         var ctx = new AudioContext();
-        ArrayBufferView arrayBufferView = new Float32Array.fromList([]);
+        Float32List view = new Float32List.fromList([]);
         try {
           // Test that native overload is chosen correctly. Native
           // implementation should throw 'SyntaxError' DomException because the
           // buffer is empty.
-          AudioBuffer buffer = ctx.createBuffer(arrayBufferView.buffer, false);
+          AudioBuffer buffer = ctx.createBuffer(view.buffer, false);
         } catch (e) {
           expect(e.name, DomException.SYNTAX);
         }
diff --git a/tests/html/blob_constructor_test.dart b/tests/html/blob_constructor_test.dart
index 93336f7..ea3ec66 100644
--- a/tests/html/blob_constructor_test.dart
+++ b/tests/html/blob_constructor_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -55,7 +56,7 @@
     });
 
   test('fromArrayBuffer', () {
-      var a = new Uint8Array(100).buffer; // i.e. new ArrayBuffer(100);
+      var a = new Uint8List(100).buffer; // i.e. new ArrayBuffer(100);
       var b = new Blob([a, a]);
       expect(b.size, 200);
     });
diff --git a/tests/html/crypto_test.dart b/tests/html/crypto_test.dart
index 57a2930..b4992a3 100644
--- a/tests/html/crypto_test.dart
+++ b/tests/html/crypto_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_individual_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlIndividualConfiguration();
@@ -27,7 +28,7 @@
 
       test('successful call', () {
         var crypto = window.crypto;
-        var data = new Uint8Array(100);
+        var data = new Uint8List(100);
         expect(data.every((e) => e == 0), isTrue);
         crypto.getRandomValues(data);
         // In theory this is flaky. However, in practice you will get 100 zeroes
@@ -38,7 +39,7 @@
 
       test('type mismatch', () {
         var crypto = window.crypto;
-        var data = new Float32Array(100);
+        var data = new Float32List(100);
         expect(() {
           crypto.getRandomValues(data);
         }, throws, reason: 'Only typed array views with integer types allowed');
diff --git a/tests/html/html.status b/tests/html/html.status
index 8ad255a..6282522 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -9,10 +9,14 @@
 custom_elements_test: Skip # Not yet implemented.
 interactive_test: Skip # Must be run manually.
 
+[ $compiler == none && ($runtime == drt || $runtime == dartium) ]
+# postMessage in dartium always transfers the typed array buffer, never a view
+postmessage_structured_test/typed_arrays: Fail
+
 [ $compiler == none && $runtime == drt && $system == windows ]
 worker_test/functional: Pass, Crash # Issue 9929.
 
-[ $compiler == dart2js]
+[ $compiler == dart2js && ($runtime == ie9 || $runtime == ie10 || $runtime == safari || $runtime == ff || $runtime == chrome || $runtime == opera || $runtime == drt || $runtime == dartium)]
 dom_isolates_test: Skip # Need to migrate to new spawnDomFunction.
 
 [ $compiler == dart2js && $runtime == ie10 ]
@@ -20,9 +24,12 @@
 indexeddb_4_test: Pass, Timeout, Slow # Issue: http://dartbug.com/9437
 async_test: Pass, Fail # timers test fails on ie10.
 
-[ $compiler == dart2js && $csp && $runtime == drt && $unchecked ]
-indexeddb_2_test: Fail, Crash, Pass # Bug in v8, http://dartbug.com/9407
-async_test: Fail, Crash, Pass # Bug in v8, http://dartbug.com/9407
+[ $compiler == dart2js && $runtime == safari ]
+url_test: Fail # Issue 10096
+
+[ $compiler == dart2js && $runtime == drt && $checked ]
+postmessage_structured_test/typed_arrays: Fail # Issue 10097
+postmessage_structured_test/primitives: Fail # Issue 10097
 
 # Layout tests are only supported on DRT.
 [ $runtime == ie9 || $runtime == ie10 || $runtime == safari || $runtime == ff || $runtime == chrome || $runtime == opera ]
@@ -127,6 +134,7 @@
 window_open_test: Skip      # BUG(4016)
 canvasrenderingcontext2d_test/drawImage_video_element: Fail # IE does not support drawImage w/ video element
 canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Fail # IE does not support drawImage w/ video element
+input_element_test/attributes: Fail # IE returns null while others ''
 
 # IE9 Feature support statuses-
 # All changes should be accompanied by platform support annotation changes.
@@ -294,7 +302,6 @@
 dart_object_local_storage_test: Skip  # sessionStorage NS_ERROR_DOM_NOT_SUPPORTED_ERR
 dromaeo_smoke_test: Pass, Fail # Issue: 8257
 webgl_1_test: Pass, Fail   # Issue 8219
-postmessage_structured_test/typed_arrays: Fail # FF incorrectly clones arrays.
 canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Fail # Firefox does not like dataUrl videos for drawImage
 
 # FireFox Feature support statuses-
diff --git a/tests/html/input_element_test.dart b/tests/html/input_element_test.dart
index fe90511..43f245c 100644
--- a/tests/html/input_element_test.dart
+++ b/tests/html/input_element_test.dart
@@ -177,4 +177,12 @@
       check(new ButtonInputElement(), 'button');
     });
   });
+
+  group('attributes', () {
+    test('valueSetNull', () {
+      final e = new TextInputElement();
+      e.value = null;
+      expect(e.value, '');
+    });
+  });
 }
diff --git a/tests/html/postmessage_structured_test.dart b/tests/html/postmessage_structured_test.dart
index ba35420..e56e3b1 100644
--- a/tests/html/postmessage_structured_test.dart
+++ b/tests/html/postmessage_structured_test.dart
@@ -7,6 +7,7 @@
 import '../../pkg/unittest/lib/html_individual_config.dart';
 import 'dart:html';
 import 'dart:collection';  // SplayTreeMap
+import 'dart:typed_data';
 import 'utils.dart';
 
 injectSource(code) {
@@ -136,9 +137,9 @@
   });
 
   group('typed_arrays', () {
-    var array_buffer = new ArrayBuffer(16);
-    var view_a = new Float32Array.fromBuffer(array_buffer, 0, 4);
-    var view_b = new Uint8Array.fromBuffer(array_buffer, 1, 13);
+    var array_buffer = new Uint8List(16);
+    var view_a = new Float32List.view(array_buffer, 0, 4);
+    var view_b = new Uint8List.view(array_buffer, 1, 13);
     var typed_arrays_list = [view_a, array_buffer, view_b];
 
     // Note that FF is failing this test because in the sent message:
diff --git a/tests/html/transferables_test.dart b/tests/html/transferables_test.dart
index 7162fab..d2ad13f 100644
--- a/tests/html/transferables_test.dart
+++ b/tests/html/transferables_test.dart
@@ -6,19 +6,20 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
 
-  var isArrayBuffer =
-      predicate((x) => x is ArrayBuffer, 'is an ArrayBuffer');
+  var isByteBuffer =
+      predicate((x) => x is ByteBuffer, 'is an ByteBuffer');
 
   test('TransferableTest', () {
     if (!Platform.supportsTypedData) {
       return;
     }
 
-    final buffer = (new Float32Array(3)).buffer;
+    final buffer = (new Float32List(3)).buffer;
     window.postMessage({
         'id': 'transferable data',
         'buffer': buffer
@@ -28,7 +29,7 @@
       (e) {
         return e.data is Map && e.data['id'] == 'transferable data';
       }).then((messageEvent) {
-        expect(messageEvent.data['buffer'], isArrayBuffer);
+        expect(messageEvent.data['buffer'], isByteBuffer);
       });
   });
 }
diff --git a/tests/html/typed_arrays_1_test.dart b/tests/html/typed_arrays_1_test.dart
index 52cd41b..a2de291 100644
--- a/tests/html/typed_arrays_1_test.dart
+++ b/tests/html/typed_arrays_1_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_individual_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlIndividualConfiguration();
@@ -23,16 +24,19 @@
   group('arrays', () {
     test('createByLengthTest', () {
       expect(() {
-        var a = new Float32Array(10);
+        var a = new Float32List(10);
         expect(a.length, 10);
+        expect(a.lengthInBytes, 40);
         expect(a[4], 0);
       }, expectation);
     });
 
     test('aliasTest', () {
       expect(() {
-        var a1 = new Uint8Array.fromList([0,0,1,0x45]);
-        var a2 = new Float32Array.fromBuffer(a1.buffer);
+        var a1 = new Uint8List.fromList([0,0,1,0x45]);
+        var a2 = new Float32List.view(a1.buffer);
+
+        expect(a1.lengthInBytes, a2.lengthInBytes);
 
         expect(a2.length, 1);
 
@@ -57,7 +61,7 @@
     if (supportsTypeTest) {
       test('typeTests', () {
         expect(() {
-          var a = new Float32Array(10);
+          var a = new Float32List(10);
           expect(a, isList);
           expect(a, isnumList);
           expect(a, isNot(isStringList));
diff --git a/tests/html/typed_arrays_2_test.dart b/tests/html/typed_arrays_2_test.dart
index b0a82eb..e223ea7 100644
--- a/tests/html/typed_arrays_2_test.dart
+++ b/tests/html/typed_arrays_2_test.dart
@@ -6,7 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
-
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -16,13 +16,13 @@
     return;
   }
 
-  test('fromBufferTest_dynamic', () {
-      var a1 = new Uint8Array(1024);
+  test('viewTest_dynamic', () {
+      var a1 = new Uint8List(1024);
       for (int i = 0; i < a1.length; i++) {
         a1[i] = i; // 0,1,2,...,254,255,0,1,2,...
       }
 
-      var a2 = new Uint32Array.fromBuffer(a1.buffer);
+      var a2 = new Uint32List.view(a1.buffer);
       expect(1024 ~/ 4, a2.length);
       expect(a2[0], 0x03020100);
       expect(a2[1], 0x07060504);
@@ -31,53 +31,53 @@
       expect(a2[51], 0xCFCECDCC);
       expect(a2[64], 0x03020100);
 
-      a2 = new Uint32Array.fromBuffer(a1.buffer, 200);
+      a2 = new Uint32List.view(a1.buffer, 200);
       expect(a2.length, (1024 - 200) ~/ 4);
       expect(a2[0], 0xCBCAC9C8);
       expect(a2[1], 0xCFCECDCC);
       expect(a2[14], 0x03020100);
 
-      a2 = new Uint32Array.fromBuffer(a1.buffer, 456, 20);
+      a2 = new Uint32List.view(a1.buffer, 456, 20);
       expect(a2.length, 20);
       expect(a2[0], 0xCBCAC9C8);
       expect(a2[1], 0xCFCECDCC);
       expect(a2[14], 0x03020100);
 
-      // OPTIONALS a2 = new Uint32Array.fromBuffer(a1.buffer, length: 30, byteOffset: 456);
-      a2 = new Uint32Array.fromBuffer(a1.buffer, 456, 30);
+      // OPTIONALS a2 = new Uint32List.view(a1.buffer, length: 30, byteOffset: 456);
+      a2 = new Uint32List.view(a1.buffer, 456, 30);
       expect(a2.length, 30);
       expect(a2[0], 0xCBCAC9C8);
       expect(a2[1], 0xCFCECDCC);
       expect(a2[14], 0x03020100);
   });
 
-  test('fromBufferTest_typed', () {
-      Uint8Array a1 = new Uint8Array(1024);
+  test('viewTest_typed', () {
+      Uint8List a1 = new Uint8List(1024);
       for (int i = 0; i < a1.length; i++) {
         a1[i] = i;
       }
 
-      Uint32Array a2 = new Uint32Array.fromBuffer(a1.buffer);
+      Uint32List a2 = new Uint32List.view(a1.buffer);
       expect(a2.length, 1024 ~/ 4);
       expect(a2[0], 0x03020100);
       expect(a2[50], 0xCBCAC9C8);
       expect(a2[51], 0xCFCECDCC);
       expect(a2[64], 0x03020100);
 
-      a2 = new Uint32Array.fromBuffer(a1.buffer, 200);
+      a2 = new Uint32List.view(a1.buffer, 200);
       expect(a2.length, (1024 - 200) ~/ 4);
       expect(a2[0], 0xCBCAC9C8);
       expect(a2[1], 0xCFCECDCC);
       expect(a2[14], 0x03020100);
 
-      a2 = new Uint32Array.fromBuffer(a1.buffer, 456, 20);
+      a2 = new Uint32List.view(a1.buffer, 456, 20);
       expect(20, a2.length);
       expect(a2[0], 0xCBCAC9C8);
       expect(a2[1], 0xCFCECDCC);
       expect(a2[14], 0x03020100);
 
-      // OPTIONALS a2 = new Uint32Array.fromBuffer(a1.buffer, length: 30, byteOffset: 456);
-      a2 = new Uint32Array.fromBuffer(a1.buffer, 456, 30);
+      // OPTIONALS a2 = new Uint32List.view(a1.buffer, length: 30, byteOffset: 456);
+      a2 = new Uint32List.view(a1.buffer, 456, 30);
       expect(a2.length, 30);
       expect(a2[0], 0xCBCAC9C8);
       expect(a2[1], 0xCFCECDCC);
diff --git a/tests/html/typed_arrays_3_test.dart b/tests/html/typed_arrays_3_test.dart
index a11287a..53f0b8d 100644
--- a/tests/html/typed_arrays_3_test.dart
+++ b/tests/html/typed_arrays_3_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -16,29 +17,29 @@
   }
 
   test('setElementsTest_dynamic', () {
-      var a1 = new Int8Array(1024);
+      var a1 = new Int8List(1024);
 
-      a1.setElements([0x50,0x60,0x70], 4);
+      a1.setRange(4, 7, [0x50,0x60,0x70]);
 
-      var a2 = new Uint32Array.fromBuffer(a1.buffer);
+      var a2 = new Uint32List.view(a1.buffer);
       expect(a2[0], 0x00000000);
       expect(a2[1], 0x00706050);
 
-      a2.setElements([0x01020304], 2);
+      a2.setRange(2, 3, [0x01020304]);
       expect(a1[8], 0x04);
       expect(a1[11], 0x01);
   });
 
   test('setElementsTest_typed', () {
-      Int8Array a1 = new Int8Array(1024);
+      Int8List a1 = new Int8List(1024);
 
-      a1.setElements([0x50,0x60,0x70], 4);
+      a1.setRange(4, 7, [0x50,0x60,0x70]);
 
-      Uint32Array a2 = new Uint32Array.fromBuffer(a1.buffer);
+      Uint32List a2 = new Uint32List.view(a1.buffer);
       expect(a2[0], 0x00000000);
       expect(a2[1], 0x00706050);
 
-      a2.setElements([0x01020304], 2);
+      a2.setRange(2, 3, [0x01020304]);
       expect(a1[8], 0x04);
       expect(a1[11], 0x01);
   });
diff --git a/tests/html/typed_arrays_4_test.dart b/tests/html/typed_arrays_4_test.dart
index 7a7fcdf..11a39e8 100644
--- a/tests/html/typed_arrays_4_test.dart
+++ b/tests/html/typed_arrays_4_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -16,7 +17,7 @@
   }
 
   test('indexOf_dynamic', () {
-      var a1 = new Uint8Array(1024);
+      var a1 = new Uint8List(1024);
       for (int i = 0; i < a1.length; i++) {
         a1[i] = i;
       }
@@ -31,7 +32,7 @@
   });
 
   test('indexOf_typed', () {
-      Uint8Array a1 = new Uint8Array(1024);
+      Uint8List a1 = new Uint8List(1024);
       for (int i = 0; i < a1.length; i++) {
         a1[i] = i;
       }
diff --git a/tests/html/typed_arrays_5_test.dart b/tests/html/typed_arrays_5_test.dart
index 4f7372a..3c6948d 100644
--- a/tests/html/typed_arrays_5_test.dart
+++ b/tests/html/typed_arrays_5_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -16,25 +17,25 @@
   }
 
   test('filter_dynamic', () {
-      var a = new Float32Array(1024);
+      var a = new Float32List(1024);
       for (int i = 0; i < a.length; i++) {
-        a[i] = i;
+        a[i] = i.toDouble();
       }
 
       expect(a.where((x) => x >= 1000).length, equals(24));
   });
 
   test('filter_typed', () {
-      Float32Array a = new Float32Array(1024);
+      Float32List a = new Float32List(1024);
       for (int i = 0; i < a.length; i++) {
-        a[i] = i;
+        a[i] = i.toDouble();
       }
 
       expect(a.where((x) => x >= 1000).length, equals(24));
   });
 
   test('contains', () {
-      var a = new Int16Array(1024);
+      var a = new Int16List(1024);
       for (int i = 0; i < a.length; i++) {
         a[i] = i;
       }
diff --git a/tests/html/typed_arrays_arraybuffer_test.dart b/tests/html/typed_arrays_arraybuffer_test.dart
index 1a2bd21..af75ab9 100644
--- a/tests/html/typed_arrays_arraybuffer_test.dart
+++ b/tests/html/typed_arrays_arraybuffer_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -16,31 +17,28 @@
   }
 
   test('constructor', () {
-      var a = new ArrayBuffer(100);
-      expect(a.byteLength, 100);
+      var a = new Int8List(100);
+      expect(a.lengthInBytes, 100);
   });
 
-  test('slice1', () {
-      var a = new ArrayBuffer(100);
-      var s = a.slice(10, 40);
-      expect(s.byteLength, 30);
+  test('sublist1', () {
+      var a = new Int8List(100);
+      var s = a.sublist(10, 40);
+      expect(s.length, 30);
   });
 
-  test('slice2', () {
-      var a = new ArrayBuffer(100);
-      var s = a.slice(10, 400);
-      expect(s.byteLength, 90);  // indexes clamped to valid range.
+  test('sublist2', () {
+      var a = new Int8List(100);
+      expect(() => a.sublist(10, 400), throwsRangeError);
   });
 
-  test('slice3', () {
-      var a = new ArrayBuffer(100);
-      var s = a.slice(50, 10);
-      expect(s.byteLength, 0);   // end before start becomes empty range.
+  test('sublist3', () {
+      var a = new Int8List(100);
+      expect(() => a.sublist(50, 10), throwsRangeError);
   });
 
-  test('slice4', () {
-      var a = new ArrayBuffer(100);
-      var s = a.slice(-90, -30);
-      expect(s.byteLength, 60);  // negative indexes measure from end.
+  test('sublist4', () {
+      var a = new Int8List(100);
+      expect(() => a.sublist(-90, -30), throwsRangeError);
   });
 }
diff --git a/tests/html/typed_arrays_dataview_test.dart b/tests/html/typed_arrays_dataview_test.dart
index 798b732..d1823da 100644
--- a/tests/html/typed_arrays_dataview_test.dart
+++ b/tests/html/typed_arrays_dataview_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -16,9 +17,9 @@
   }
 
   test('access8', () {
-      var a1 = new Uint8Array.fromList([0,0,3,255,0,0,0,0,0,0]);
+      var a1 = new Uint8List.fromList([0,0,3,255,0,0,0,0,0,0]);
 
-      var dv = new DataView(a1.buffer, 2, 6);
+      var dv = new ByteData.view(a1.buffer, 2, 6);
 
       expect(dv.getInt8(0), equals(3));
       expect(dv.getInt8(1), equals(-1));
@@ -35,19 +36,19 @@
   });
 
   test('access16', () {
-      var a1 = new Uint8Array.fromList([0,0,3,255,0,0,0,0,0,0]);
+      var a1 = new Uint8List.fromList([0,0,3,255,0,0,0,0,0,0]);
 
-      var dv = new DataView(a1.buffer, 2);
+      var dv = new ByteData.view(a1.buffer, 2);
 
-      expect(dv.byteLength, equals(10 - 2));
+      expect(dv.lengthInBytes, equals(10 - 2));
 
       expect(dv.getInt16(0), equals(1023));
-      expect(dv.getInt16(0, littleEndian: false), equals(1023));
-      expect(dv.getInt16(0, littleEndian: true), equals(-253));
+      expect(dv.getInt16(0, Endianness.BIG_ENDIAN), equals(1023));
+      expect(dv.getInt16(0, Endianness.LITTLE_ENDIAN), equals(-253));
 
       expect(dv.getUint16(0), equals(1023));
-      expect(dv.getUint16(0, littleEndian: false), equals(1023));
-      expect(dv.getUint16(0, littleEndian: true), equals(0xFF03));
+      expect(dv.getUint16(0, Endianness.BIG_ENDIAN), equals(1023));
+      expect(dv.getUint16(0, Endianness.LITTLE_ENDIAN), equals(0xFF03));
 
       dv.setInt16(2, -1);
       expect(dv.getInt16(2), equals(-1));
@@ -55,17 +56,17 @@
   });
 
   test('access32', () {
-      var a1 = new Uint8Array.fromList([0,0,3,255,0,0,0,0,0,0]);
+      var a1 = new Uint8List.fromList([0,0,3,255,0,0,0,0,0,0]);
 
-      var dv = new DataView(a1.buffer);
+      var dv = new ByteData.view(a1.buffer);
 
       expect(dv.getInt32(0), equals(1023));
-      expect(dv.getInt32(0, littleEndian: false), equals(1023));
-      expect(dv.getInt32(0, littleEndian: true), equals(-0xFD0000));
+      expect(dv.getInt32(0, Endianness.BIG_ENDIAN), equals(1023));
+      expect(dv.getInt32(0, Endianness.LITTLE_ENDIAN), equals(-0xFD0000));
 
       expect(dv.getUint32(0), equals(1023));
-      expect(dv.getUint32(0, littleEndian: false), equals(1023));
-      expect(dv.getUint32(0, littleEndian: true), equals(0xFF030000));
+      expect(dv.getUint32(0, Endianness.BIG_ENDIAN), equals(1023));
+      expect(dv.getUint32(0, Endianness.LITTLE_ENDIAN), equals(0xFF030000));
   });
 
 }
diff --git a/tests/html/typed_arrays_range_checks_test.dart b/tests/html/typed_arrays_range_checks_test.dart
index 5707dce..b7b7350 100644
--- a/tests/html/typed_arrays_range_checks_test.dart
+++ b/tests/html/typed_arrays_range_checks_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -16,20 +17,20 @@
   }
 
   test('outOfRangeAccess_dynamic', () {
-      var a = new Uint8Array(1024);
+      var a = new Uint8List(1024);
 
-      expect(a[a.length], isNull);
-      expect(a[a.length + 1], isNull);
-      expect(a[a.length + 1024], isNull);
+      expect(() => a[a.length], throws);
+      expect(() => a[a.length + 1], throws);
+      expect(() => a[a.length + 1024], throws);
 
       // expect(a[-1], isNull);
       // expect(a[-2], isNull);
       // expect(a[-1024], isNull);
 
       // It's harder to test out of range setters, but let's do some minimum.
-      a[a.length] = 0xdeadbeaf;
-      a[a.length + 1] = 0xdeadbeaf;
-      a[a.length + 1024] = 0xdeadbeaf;
+      expect(() => a[a.length] = 0xdeadbeaf, throws);
+      expect(() => a[a.length + 1] = 0xdeadbeaf, throws);
+      expect(() => a[a.length + 1024] = 0xdeadbeaf, throws);
 
       // a[-1] = 0xdeadbeaf;
       // a[-2] = 0xdeadbeaf;
@@ -37,20 +38,20 @@
   });
 
   test('outOfRange_typed', () {
-      Uint8Array a = new Uint8Array(1024);
+      Uint8List a = new Uint8List(1024);
 
-      expect(a[a.length], isNull);
-      expect(a[a.length + 1], isNull);
-      expect(a[a.length + 1024], isNull);
+      expect(() => a[a.length], throws);
+      expect(() => a[a.length + 1], throws);
+      expect(() => a[a.length + 1024], throws);
 
       // expect(a[-1], isNull);
       // expect(a[-2], isNull);
       // expect(a[-1024], isNull);
 
       // It's harder to test out of range setters, but let's do some minimum.
-      a[a.length] = 0xdeadbeaf;
-      a[a.length + 1] = 0xdeadbeaf;
-      a[a.length + 1024] = 0xdeadbeaf;
+      expect(() => a[a.length] = 0xdeadbeaf, throws);
+      expect(() => a[a.length + 1] = 0xdeadbeaf, throws);
+      expect(() => a[a.length + 1024] = 0xdeadbeaf, throws);
 
       // a[-1] = 0xdeadbeaf;
       // a[-2] = 0xdeadbeaf;
diff --git a/tests/html/url_test.dart b/tests/html/url_test.dart
index a4d8e4d..2b3260b 100644
--- a/tests/html/url_test.dart
+++ b/tests/html/url_test.dart
@@ -6,6 +6,7 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_config.dart';
 import 'dart:html';
+import 'dart:typed_data';
 
 main() {
   useHtmlConfiguration();
@@ -23,8 +24,8 @@
     var byteString = window.atob(dataUri.split(',')[1]);
     var mimeString = dataUri.split(',')[0].split(':')[1].split(';')[0];
 
-    var arrayBuffer = new ArrayBuffer(byteString.length);
-    var dataArray = new Uint8Array.fromBuffer(arrayBuffer);
+    var arrayBuffer = new Uint8List(byteString.length);
+    var dataArray = new Uint8List.view(arrayBuffer.buffer);
     for (var i = 0; i < byteString.length; i++) {
       dataArray[i] = byteString.codeUnitAt(i);
     }
diff --git a/tests/html/utils.dart b/tests/html/utils.dart
index 3257661..24e7711 100644
--- a/tests/html/utils.dart
+++ b/tests/html/utils.dart
@@ -2,6 +2,7 @@
 
 import 'dart:async';
 import 'dart:html';
+import 'dart:typed_data';
 import '../../pkg/unittest/lib/unittest.dart';
 
 /**
@@ -40,24 +41,24 @@
     eItems.add(expected);
     aItems.add(actual);
 
-    if (expected is ArrayBuffer) {
-      expect(actual is ArrayBuffer, isTrue,
-          reason: '$actual is ArrayBuffer');
-      expect(expected.byteLength, equals(actual.byteLength),
-          reason: message(path, '.byteLength'));
+    if (expected is ByteBuffer) {
+      expect(actual is ByteBuffer, isTrue,
+          reason: '$actual is ByteBuffer');
+      expect(expected.lengthInBytes, equals(actual.lengthInBytes),
+          reason: message(path, '.lengthInBytes'));
       // TODO(antonm): one can create a view on top of those
       // and check if contents identical.  Let's do it later.
       return;
     }
 
-    if (expected is ArrayBufferView) {
-      expect(actual is ArrayBufferView, isTrue,
-          reason: '$actual is ArrayBufferView');
+    if (expected is TypedData) {
+      expect(actual is TypedData, isTrue,
+          reason: '$actual is TypedData');
       walk('$path/.buffer', expected.buffer, actual.buffer);
-      expect(expected.byteOffset, equals(actual.byteOffset),
-          reason: message(path, '.byteOffset'));
-      expect(expected.byteLength, equals(actual.byteLength),
-          reason: message(path, '.byteLength'));
+      expect(expected.offsetInBytes, equals(actual.offsetInBytes),
+          reason: message(path, '.offsetInBytes'));
+      expect(expected.lengthInBytes, equals(actual.lengthInBytes),
+          reason: message(path, '.lengthInBytes'));
       // And also fallback to elements check below.
     }
 
diff --git a/tests/html/xhr_test.dart b/tests/html/xhr_test.dart
index 4758a8a..9d44746 100644
--- a/tests/html/xhr_test.dart
+++ b/tests/html/xhr_test.dart
@@ -8,6 +8,7 @@
 import 'dart:async';
 import 'dart:html';
 import 'dart:json' as json;
+import 'dart:typed_data';
 
 void fail(message) {
   guardAsync(() {
@@ -147,9 +148,9 @@
         HttpRequest.request(url, responseType: 'arraybuffer').then(
           expectAsync1((xhr) {
             expect(xhr.status, equals(200));
-            var arrayBuffer = xhr.response;
-            expect(arrayBuffer, new isInstanceOf<ArrayBuffer>());
-            expect(arrayBuffer, isNotNull);
+            var byteBuffer = xhr.response;
+            expect(byteBuffer, new isInstanceOf<ByteBuffer>());
+            expect(byteBuffer, isNotNull);
           }));
       }
     });
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index 10337b4..89c72e7 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -2,17 +2,6 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-[ $compiler == dart2js && $csp && $runtime == drt && $unchecked ]
-mandel_isolate_stream_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-nested_spawn_stream2_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-count_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-count_stream_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-mandel_isolate_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-message_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-mint_maker_test: Pass, Fail, Crash # Bug in v8, http://dartbug.com/9407
-unresolved_ports_negative_test: Fail, Pass, Crash # Bug in v8, http://dartbug.com/9407
-unresolved_ports_test: Fail, Pass, Crash # Bug in v8, http://dartbug.com/9407
-
 [ $runtime == vm ]
 isolate2_negative_test: Skip  # Need to resolve correct behaviour.
 isolate3_negative_test: Skip  # test depends on isolate error exiting process.
@@ -63,7 +52,9 @@
 global_error_handler_stream_test: Pass, Fail # http://dartbug.com/9012 and http://dartbug.com/9024
 global_error_handler2_test: Pass, Fail # http://dartbug.com/9012 and http://dartbug.com/9024
 global_error_handler_stream2_test: Pass, Fail # http://dartbug.com/9012 and http://dartbug.com/9024
-typed_data_message_test: Fail # dart:typeddata not supported in dart2js yet.
+
+[ $compiler == dart2js && ($runtime == drt || $runtime == ff || $runtime == chrome || $runtime == ie9 || $runtime == ie10 || $runtime == safari) ]
+typed_data_message_test: Fail
 
 [ $runtime == safari ]
 cross_isolate_message_test: Skip      # Depends on 32/64 bit Safari. See Issue 1120
diff --git a/tests/isolate/typed_data_message_test.dart b/tests/isolate/typed_data_message_test.dart
index 3631ded..b725b1c 100644
--- a/tests/isolate/typed_data_message_test.dart
+++ b/tests/isolate/typed_data_message_test.dart
@@ -7,7 +7,7 @@
 
 library TypedDataMessageTest;
 import 'dart:isolate';
-import 'dart:typeddata';
+import 'dart:typed_data';
 import '../../pkg/unittest/lib/unittest.dart';
 
 // ---------------------------------------------------------------------------
diff --git a/tests/language/language.status b/tests/language/language.status
index f732024..aaf1c24 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -386,8 +386,6 @@
 bad_override_test/01: Fail
 bad_override_test/02: Fail
 
-first_class_types_constants_test: Fail # Issue 6282
-
 # Missing compile-time error when modifying final local variables
 final_variable_assignment_test/01: Fail
 final_variable_assignment_test/02: Fail
@@ -425,7 +423,6 @@
 named_parameters_aggregated_test/03: Fail # http://dartbug.com/5519
 not_enough_positional_arguments_test/01: Fail # http://dartbug.com/5519
 
-throw_expr_test: Fail
 metadata_test: Fail
 # Fails in conservative mode, issue 4935, passes in minifinying mode.
 bad_constructor_test/04: Fail
@@ -555,8 +552,6 @@
 
 [ $compiler == dart2dart && $minified ]
 
-rethrow_test: Fail
-
 # TODO(tball): Assign proper bug numbers.
 class_literal_test/none: Fail
 
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 946cec3..362ff2b 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -135,8 +135,6 @@
 
 constructor_negative_test: Pass # Wrong reason: the expression 'C()' is valid with class literals.
 
-throw_expr_test: Fail
-rethrow_test: Fail
 metadata_test: Fail # Metadata on type parameters not supported.
 infinity_test: Fail # Issue 4984
 positive_bit_operations_test: Fail # (floitsch): This will be fixed when dart2js uses unsigned input for >>.
@@ -145,7 +143,6 @@
 canonical_const_test: Fail # We don't take the generic type into account yet.
 
 # Support for optional parameters not conform to latest spec.
-typedef_is_test: Fail # http://dartbug.com/9058
 function_type_alias_test: Fail # http://dartbug.com/9058
 function_type_alias2_test: Fail
 named_parameters_type_test: Fail
diff --git a/tests/language/type_propagation_assert_assignable_test.dart b/tests/language/type_propagation_assert_assignable_test.dart
new file mode 100644
index 0000000..56089e6
--- /dev/null
+++ b/tests/language/type_propagation_assert_assignable_test.dart
@@ -0,0 +1,44 @@
+// 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.
+// Check that type of the AssertAssignable is recomputed correctly.
+
+import "package:expect/expect.dart";
+
+class A {
+  final p;
+  final _b;
+
+  b() {
+    try { return _b; } catch (e) { }
+  }
+
+  A(this.p, this._b);
+}
+
+class B extends A {
+  B(p, b) : super(p, b);
+}
+
+bar(v) {
+  for (var x = v; x != null; x = x.p) {
+    if (x.b()) {
+      return x;
+    }
+  }
+  return null;
+}
+
+foo(v) {
+  A x = bar(v);
+  return x != null;
+}
+
+main() {
+  final a = new A(new B(new A("haha", true), false), false);
+
+  for (var i = 0; i < 10000; i++) {
+    Expect.isTrue(foo(a));
+  }
+  Expect.isTrue(foo(a));
+}
diff --git a/tests/lib/analyzer/analyze_tests.status b/tests/lib/analyzer/analyze_tests.status
new file mode 100644
index 0000000..e963348
--- /dev/null
+++ b/tests/lib/analyzer/analyze_tests.status
@@ -0,0 +1,38 @@
+# 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.
+
+[ $compiler == dartc ]
+
+# VM adds fields failedAssertion, url, line and column to AssertionError.
+# Issue 10144.
+standalone/assert_test: Fail
+
+# Uses mirrors which is are not fully implemented.
+standalone/package/package_isolate_test: Fail
+
+# Static type errors by design.
+standalone/io/directory_invalid_arguments_test: Fail
+standalone/io/file_fuzz_test: Fail
+standalone/io/file_constructor_test: Fail
+standalone/io/process_invalid_arguments_test: Fail
+standalone/io/secure_socket_argument_test: Fail
+standalone/io/stdout_bad_argument_test: Fail
+standalone/io/raw_secure_server_socket_argument_test: Fail
+
+# Test runner does not use the latest VM.
+standalone/io/test_runner_test: Fail
+standalone/io/skipping_dart2js_compilations_test: Fail
+
+# Implicit downcast.
+standalone/typed_data_view_test: Fail
+
+# Tests using fake "part" and/or "part of" directive.
+standalone/crypto/base64_test: Fail
+standalone/typed_data_test: Fail
+standalone/io/http_date_test: Fail
+standalone/io/http_headers_test: Fail
+standalone/io/http_parser_test: Fail
+standalone/io/mime_multipart_parser_test: Fail
+standalone/io/web_socket_protocol_processor_test: Fail
+standalone/io/url_encoding_test: Fail
diff --git a/tests/lib/analyzer/test_config.dart b/tests/lib/analyzer/test_config.dart
index c944979..d2dcd52 100644
--- a/tests/lib/analyzer/test_config.dart
+++ b/tests/lib/analyzer/test_config.dart
@@ -9,7 +9,7 @@
 
 class AnalyzeLibraryTestSuite extends DartcCompilationTestSuite {
   final libraries = [ 'async', 'core', 'crypto', 'io', 'isolate', 'json',
-                      'math', 'mirrors', 'typeddata', 'uri',
+                      'math', 'mirrors', 'typed_data', 'uri',
                       'utf' ];
 
   AnalyzeLibraryTestSuite(Map configuration)
@@ -29,3 +29,20 @@
 
   bool get listRecursively => true;
 }
+
+
+class AnalyzeTestsTestSuite extends DartcCompilationTestSuite {
+  AnalyzeTestsTestSuite(Map configuration)
+      : super(configuration,
+              'analyze_tests',
+              'tests',
+              [ 'standalone' ],
+              ['tests/lib/analyzer/analyze_tests.status'],
+              allStaticClean: true);
+
+  bool isTestFile(String filename) {
+    return filename.endsWith('_test.dart');
+  }
+
+  bool get listRecursively => true;
+}
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index dafb4d9..053f62a 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -4,19 +4,21 @@
 
 async/stream_periodic4_test: Fail, Pass # floitsch: Marking as flaky while collection debug information. http://dartbug.com/9619
 
-# The typeddata library is not supported by dart2js or dart2dart yet.
+# The typed_data library is not supported by dart2js or dart2dart yet.
 [ $compiler == dart2js  || $compiler == dart2dart ]
-typeddata/*: Fail
+typed_data/*: Fail
 
 
-# The typeddata library is not supported by dart2js or dart2dart yet.
+# The typed_data library is not supported by dart2js or dart2dart yet.
 [ $compiler == dart2js  || $compiler == dart2dart ]
-typeddata/*: Skip
+typed_data/*: Skip
 
 
 [ $compiler == dart2js ]
 math/*: Skip
 mirrors/mirrors_test: Fail # TODO(ahe): I'm working on fixing this.
+mirrors/library_uri_io_test: Skip # Not intended for dart2js as it uses dart:io.
+mirrors/library_uri_package_test: Fail # dart:mirrors not fully implemented.
 async/run_async3_test: Fail # _enqueueImmediate runs after Timer. http://dartbug.com/9002
 async/run_async4_test: Pass, Fail # no global exception handler in isolates. http://dartbug.com/9012
 
@@ -90,6 +92,7 @@
 async/timer_isolate_test: Skip # See Issue 4997
 async/timer_not_available_test: Skip # only meant to test when there is no way to
                                      # implement timer (currently only in d8)
+mirrors/library_uri_io_test: Skip # Not intended for drt as it uses dart:io.
 
 [ $arch == arm ]
 *: Skip
diff --git a/tests/lib/mirrors/library_uri_io_test.dart b/tests/lib/mirrors/library_uri_io_test.dart
new file mode 100644
index 0000000..beddc40
--- /dev/null
+++ b/tests/lib/mirrors/library_uri_io_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test library uri for a library read as a file.
+
+library MirrorsTest;
+
+import 'dart:mirrors';
+import 'dart:io';
+import 'dart:uri';
+import '../../../pkg/unittest/lib/unittest.dart';
+
+class Class {
+}
+
+testLibraryUri(var value, Uri expectedUri) {
+  var valueMirror = reflect(value);
+  ClassMirror valueClass = valueMirror.type;
+  LibraryMirror valueLibrary = valueClass.owner;
+  expect(valueLibrary.uri, equals(expectedUri));
+}
+
+main() {
+  var mirrors = currentMirrorSystem();
+  test("Test current library uri", () {
+    String appendSlash(String path) => path.endsWith('/') ? path : '$path/';
+    Uri cwd = new Uri.fromComponents(
+        scheme: 'file',
+        path: appendSlash(new Path(new File('.').fullPathSync()).toString()));
+    Uri uri = cwd.resolve(new Path(new Options().script).toString());
+    testLibraryUri(new Class(), uri);
+  });
+}
diff --git a/tests/lib/mirrors/library_uri_package_test.dart b/tests/lib/mirrors/library_uri_package_test.dart
new file mode 100644
index 0000000..bcd1085
--- /dev/null
+++ b/tests/lib/mirrors/library_uri_package_test.dart
@@ -0,0 +1,26 @@
+// 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.
+
+// Test library uri for a library read as a package .
+
+library MirrorsTest;
+
+import 'dart:mirrors';
+import 'dart:uri';
+import 'package:args/args.dart';
+import '../../../pkg/unittest/lib/unittest.dart';
+
+testLibraryUri(var value, Uri expectedUri) {
+  var valueMirror = reflect(value);
+  ClassMirror valueClass = valueMirror.type;
+  LibraryMirror valueLibrary = valueClass.owner;
+  expect(valueLibrary.uri, equals(expectedUri));
+}
+
+main() {
+  var mirrors = currentMirrorSystem();
+  test("Test package library uri", () {
+    testLibraryUri(new ArgParser(), Uri.parse('package:args/args.dart'));
+  });
+}
diff --git a/tests/lib/mirrors/mirrors_test.dart b/tests/lib/mirrors/mirrors_test.dart
index a1bcf20..fd7b0c8 100644
--- a/tests/lib/mirrors/mirrors_test.dart
+++ b/tests/lib/mirrors/mirrors_test.dart
@@ -8,6 +8,7 @@
 library MirrorsTest;
 import "dart:mirrors";
 import "../../../pkg/unittest/lib/unittest.dart";
+import 'dart:uri';
 
 var topLevelField;
 
@@ -32,9 +33,13 @@
 testFieldAccess(mirrors) {
   var instance = new Class();
 
-  var libMirror = mirrors.libraries[const Symbol("MirrorsTest")];
+  var libMirror = mirrors.findLibrary(const Symbol("MirrorsTest")).single;
   var classMirror = libMirror.classes[const Symbol("Class")];
   var instMirror = reflect(instance);
+  var fieldMirror = classMirror.members[new Symbol('field')];
+
+  expect(fieldMirror is VariableMirror, isTrue);
+  expect(fieldMirror.type, equals(mirrors.dynamicType));
 
   libMirror.setField(const Symbol('topLevelField'), [91]);
   expect(libMirror.getField(const Symbol('topLevelField')).reflectee,
@@ -82,7 +87,7 @@
 }
 
 testInvokeConstructor(mirrors) {
-  var libMirror = mirrors.libraries[const Symbol("MirrorsTest")];
+  var libMirror = mirrors.findLibrary(const Symbol("MirrorsTest")).single;
   var classMirror = libMirror.classes[const Symbol("Class")];
 
   var instanceMirror = classMirror.newInstance(const Symbol(''),[]);
@@ -121,7 +126,7 @@
 }
 
 testNames(mirrors) {
-  var libMirror = mirrors.libraries[const Symbol('MirrorsTest')];
+  var libMirror = mirrors.findLibrary(const Symbol("MirrorsTest")).single;
   var classMirror = libMirror.classes[const Symbol('Class')];
   var typedefMirror = libMirror.members[const Symbol('Typedef')];
   var methodMirror = libMirror.functions[const Symbol('testNames')];
@@ -151,6 +156,13 @@
          equals(const Symbol('MirrorsTest.Class.field')));
 }
 
+testLibraryUri(var value, bool check(Uri)) {
+  var valueMirror = reflect(value);
+  ClassMirror valueClass = valueMirror.type;
+  LibraryMirror valueLibrary = valueClass.owner;
+  expect(check(valueLibrary.uri), isTrue);
+}
+
 main() {
   var mirrors = currentMirrorSystem();
   test("Test reflective method invocation", () { testInvoke(mirrors); });
@@ -159,4 +171,11 @@
   test("Test invoke constructor", () { testInvokeConstructor(mirrors); });
   test("Test reflect type", () { testReflectClass(mirrors); });
   test("Test simple and qualifiedName", () { testNames(mirrors); });
+  test("Test current library uri", () {
+    testLibraryUri(new Class(),
+      (Uri uri) => uri.path.endsWith('/mirrors_test.dart'));
+  });
+  test("Test dart library uri", () {
+    testLibraryUri("test", (Uri uri) => uri == Uri.parse('dart:core'));
+  });
 }
diff --git a/tests/lib/typeddata/float32x4_list_test.dart b/tests/lib/typed_data/float32x4_list_test.dart
similarity index 99%
rename from tests/lib/typeddata/float32x4_list_test.dart
rename to tests/lib/typed_data/float32x4_list_test.dart
index 4885033..79ffdbc 100644
--- a/tests/lib/typeddata/float32x4_list_test.dart
+++ b/tests/lib/typed_data/float32x4_list_test.dart
@@ -7,7 +7,7 @@
 library float32x4_list_test;
 
 import 'package:expect/expect.dart';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 testLoadStore(array) {
   Expect.equals(8, array.length);
diff --git a/tests/lib/typeddata/float32x4_test.dart b/tests/lib/typed_data/float32x4_test.dart
similarity index 93%
rename from tests/lib/typeddata/float32x4_test.dart
rename to tests/lib/typed_data/float32x4_test.dart
index 490009a..7f6aa2f 100644
--- a/tests/lib/typeddata/float32x4_test.dart
+++ b/tests/lib/typed_data/float32x4_test.dart
@@ -6,7 +6,7 @@
 library float32x4_test;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 testAdd() {
   var m = new Float32x4(-1.0, -2.0, -3.0, -4.0);
@@ -350,8 +350,36 @@
   Expect.equals(false, m.flagW);
 }
 
+void testSplat() {
+  var f = new Float32x4.splat(2.0);
+  Expect.equals(2.0, f.x);
+  Expect.equals(2.0, f.y);
+  Expect.equals(2.0, f.z);
+  Expect.equals(2.0, f.w);
+}
+
+void testZero() {
+  var f = new Float32x4.zero();
+  Expect.equals(0.0, f.x);
+  Expect.equals(0.0, f.y);
+  Expect.equals(0.0, f.z);
+  Expect.equals(0.0, f.w);
+}
+
+void testConstructor() {
+  var f = new Float32x4(1.0, 2.0, 3.0, 4.0);
+  Expect.equals(1.0, f.x);
+  Expect.equals(2.0, f.y);
+  Expect.equals(3.0, f.z);
+  Expect.equals(4.0, f.w);
+}
+
+
 main() {
-  for (int i = 0; i < 3000; i++) {
+  for (int i = 0; i < 4000; i++) {
+    testConstructor();
+    testSplat();
+    testZero();
     testAdd();
     testGetters();
     testSetters();
diff --git a/tests/lib/typeddata/float32x4_unbox_regress_test.dart b/tests/lib/typed_data/float32x4_unbox_regress_test.dart
similarity index 77%
rename from tests/lib/typeddata/float32x4_unbox_regress_test.dart
rename to tests/lib/typed_data/float32x4_unbox_regress_test.dart
index dd84dfc..e166c3f 100644
--- a/tests/lib/typeddata/float32x4_unbox_regress_test.dart
+++ b/tests/lib/typed_data/float32x4_unbox_regress_test.dart
@@ -7,7 +7,7 @@
 library float32x4_unbox_regress_test;
 
 import 'package:expect/expect.dart';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 testListStore(array, index, value) {
   array[index] = value;
@@ -50,7 +50,31 @@
   } catch (_) {}
 }
 
+
+testGet(a) {
+  var c = a.x + a.y + a.z + a.w;
+  Expect.equals(10.0, c);
+}
+
+void testGetDeopt() {
+  var a = new Float32x4(1.0, 2.0, 3.0, 4.0);
+  var smi = 12;
+  for (int i = 0; i < 3000; i++) {
+    testGet(a);
+  }
+
+  try {
+    testGet(12);
+  } catch (_) {
+  }
+
+  for (int i = 0; i < 3000; i++) {
+    testGet(a);
+  }
+}
+
 main() {
   testListStoreDeopt();
   testAddDeopt();
+  testGetDeopt();
 }
diff --git a/tests/standalone/byte_array_view_optimized_test.dart b/tests/standalone/byte_array_view_optimized_test.dart
index b50e387..94ccf7b 100644
--- a/tests/standalone/byte_array_view_optimized_test.dart
+++ b/tests/standalone/byte_array_view_optimized_test.dart
@@ -8,7 +8,7 @@
 library ByteArrayViewOptimizedTest;
 
 import "package:expect/expect.dart";
-import "dart:typeddata";
+import "dart:typed_data";
 
 li16(v) => v[0];
 
diff --git a/tests/standalone/bytedata_test.dart b/tests/standalone/bytedata_test.dart
index 9a69bb8..068a984 100644
--- a/tests/standalone/bytedata_test.dart
+++ b/tests/standalone/bytedata_test.dart
@@ -8,7 +8,7 @@
 library ByteDataTest;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 testGetters() {
   bool host_is_little_endian = 
diff --git a/tests/standalone/float_array_test.dart b/tests/standalone/float_array_test.dart
index 562b91e..2fe83a2 100644
--- a/tests/standalone/float_array_test.dart
+++ b/tests/standalone/float_array_test.dart
@@ -8,7 +8,7 @@
 library FloatArrayTest;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 void testCreateFloat32Array() {
   Float32List floatArray;
@@ -26,7 +26,7 @@
 void testSetRange32() {
   Float32List floatArray = new Float32List(3);
 
-  List<num> list = [10.0, 11.0, 12.0];
+  List<double> list = [10.0, 11.0, 12.0];
   floatArray.setRange(0, 3, list);
   for (int i = 0; i < 3; i++) {
     Expect.equals(10 + i, floatArray[i]);
@@ -49,7 +49,7 @@
 
 void testIndexOutOfRange32() {
   Float32List floatArray = new Float32List(3);
-  List<num> list = const [0.0, 1.0, 2.0, 3.0];
+  List<double> list = const [0.0, 1.0, 2.0, 3.0];
 
   Expect.throws(() {
     floatArray[5] = 2.0;
@@ -110,7 +110,7 @@
 void testSetRange64() {
   Float64List floatArray = new Float64List(3);
 
-  List<num> list = [10.0, 11.0, 12.0];
+  List<double> list = [10.0, 11.0, 12.0];
   floatArray.setRange(0, 3, list);
   for (int i = 0; i < 3; i++) {
     Expect.equals(10 + i, floatArray[i]);
@@ -133,7 +133,7 @@
 
 void testIndexOutOfRange64() {
   Float64List floatArray = new Float64List(3);
-  List<num> list = const [0.0, 1.0, 2.0, 3.0];
+  List<double> list = const [0.0, 1.0, 2.0, 3.0];
 
   Expect.throws(() {
     floatArray[5] = 2.0;
diff --git a/tests/standalone/int_array_deopt.dart b/tests/standalone/int_array_deopt.dart
index 8897f1e..6049a30 100644
--- a/tests/standalone/int_array_deopt.dart
+++ b/tests/standalone/int_array_deopt.dart
@@ -4,7 +4,7 @@
 //
 // Dart deoptimization of Uint32Array and Int32Array loads.
 
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 loadI32(a) => a[0] + 1;
 loadUi32(a) => a[0] + 1;
diff --git a/tests/standalone/int_array_load_elimination_test.dart b/tests/standalone/int_array_load_elimination_test.dart
index c3792b0..4e8dea6 100644
--- a/tests/standalone/int_array_load_elimination_test.dart
+++ b/tests/standalone/int_array_load_elimination_test.dart
@@ -8,7 +8,7 @@
 library int_array_load_elimination;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 void testUint16() {
   Uint16List intArray = new Uint16List(1);
diff --git a/tests/standalone/int_array_test.dart b/tests/standalone/int_array_test.dart
index 3712a42..1f3d0cd 100644
--- a/tests/standalone/int_array_test.dart
+++ b/tests/standalone/int_array_test.dart
@@ -8,7 +8,7 @@
 library IntArrayTest;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 void testInt16() {
   Int16List intArray = new Int16List(4);
diff --git a/tests/standalone/io/echo_server_stream_test.dart b/tests/standalone/io/echo_server_stream_test.dart
index 4c00422..daf2c23 100644
--- a/tests/standalone/io/echo_server_stream_test.dart
+++ b/tests/standalone/io/echo_server_stream_test.dart
@@ -12,6 +12,7 @@
 library ServerTest;
 
 import "package:expect/expect.dart";
+import "dart:async";
 import "dart:io";
 import "dart:isolate";
 part "testing_server.dart";
diff --git a/tests/standalone/io/file_test.dart b/tests/standalone/io/file_test.dart
index 9ca0fe4..a94185c 100644
--- a/tests/standalone/io/file_test.dart
+++ b/tests/standalone/io/file_test.dart
@@ -6,14 +6,24 @@
 
 import "package:expect/expect.dart";
 import 'dart:async';
+import 'dart:collection';
 import 'dart:io';
 import 'dart:isolate';
 
-class MyListOfOneElement implements List {
+class MyListOfOneElement
+    extends Object with ListMixin<int> implements List<int> {
   int _value;
   MyListOfOneElement(this._value);
   int get length => 1;
   operator [](int index) => _value;
+  void set length(int index) { throw "Unsupported"; }
+  operator []=(int index, value) {
+    if (index != 0) {
+      throw "Unsupported";
+    } else {
+      _value = value;
+    }
+  }
 }
 
 class FileTest {
diff --git a/tests/standalone/io/file_typed_data_test.dart b/tests/standalone/io/file_typed_data_test.dart
index 2c00cef..9e02bcd 100644
--- a/tests/standalone/io/file_typed_data_test.dart
+++ b/tests/standalone/io/file_typed_data_test.dart
@@ -8,7 +8,7 @@
 import 'dart:async';
 import 'dart:io';
 import 'dart:isolate';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 void testWriteInt8ListAndView() {
   ReceivePort port = new ReceivePort();
diff --git a/tests/standalone/io/http_auth_test.dart b/tests/standalone/io/http_auth_test.dart
index ef400f4..8871d40 100644
--- a/tests/standalone/io/http_auth_test.dart
+++ b/tests/standalone/io/http_auth_test.dart
@@ -223,15 +223,15 @@
     return new Future.value(true);
   };
 
-  HttpClientConnection conn =
-      client.getUrl(Uri.parse("http://127.0.0.1/basic/test"));
-  conn.onResponse = (HttpClientResponse response) {
-    Expect.equals(HttpStatus.OK, response.statusCode);
-    response.inputStream.onData = () => response.inputStream.read();
-    response.inputStream.onClosed = () {
-      client.shutdown();
-    };
-  };
+  client.getUrl(Uri.parse("http://127.0.0.1/basic/test"))
+      .then((HttpClientRequest request) => request.close())
+      .then((HttpClientResponse response) {
+        Expect.equals(HttpStatus.OK, response.statusCode);
+        response.fold(null, (x, y) {})
+            .then((_) {
+              client.close();
+            });
+      });
 }
 
 void testLocalServerDigest() {
@@ -246,15 +246,15 @@
     return new Future.value(true);
   };
 
-  HttpClientConnection conn =
-      client.getUrl(Uri.parse("http://127.0.0.1/digest/test"));
-  conn.onResponse = (HttpClientResponse response) {
-    Expect.equals(HttpStatus.OK, response.statusCode);
-    response.inputStream.onData = () => response.inputStream.read();
-    response.inputStream.onClosed = () {
-      client.shutdown();
-    };
-  };
+  client.getUrl(Uri.parse("http://127.0.0.1/digest/test"))
+      .then((HttpClientRequest request) => request.close())
+      .then((HttpClientResponse response) {
+        Expect.equals(HttpStatus.OK, response.statusCode);
+        response.fold(null, (x, y) {})
+            .then((_) {
+              client.close();
+            });
+      });
 }
 
 main() {
diff --git a/tests/standalone/io/http_body_test.dart b/tests/standalone/io/http_body_test.dart
index ae0d128..b0f5f73 100644
--- a/tests/standalone/io/http_body_test.dart
+++ b/tests/standalone/io/http_body_test.dart
@@ -8,7 +8,6 @@
 import 'package:expect/expect.dart';
 
 void testHttpClientResponseBody() {
-  new HttpBodyHandler();
   void test(String mimeType,
             List<int> content,
             dynamic expectedBody,
@@ -33,6 +32,7 @@
           .then((body) {
             if (shouldFail) Expect.fail("Error expected");
             Expect.equals(type, body.type);
+            Expect.isNotNull(body.response);
             switch (type) {
               case "text":
                 Expect.equals(expectedBody, body.body);
@@ -165,7 +165,6 @@
   test(null, "body".codeUnits, "body".codeUnits, "binary");
 }
 
-
 void main() {
   testHttpClientResponseBody();
   testHttpServerRequestBody();
diff --git a/tests/standalone/io/http_client_request_test.dart b/tests/standalone/io/http_client_request_test.dart
index a9434d3..b72551f 100644
--- a/tests/standalone/io/http_client_request_test.dart
+++ b/tests/standalone/io/http_client_request_test.dart
@@ -5,7 +5,7 @@
 import "package:expect/expect.dart";
 import "dart:io";
 import "dart:isolate";
-import "dart:typeddata";
+import "dart:typed_data";
 
 void testClientRequest(void handler(request)) {
   HttpServer.bind().then((server) {
diff --git a/tests/standalone/io/http_close_test.dart b/tests/standalone/io/http_close_test.dart
index cc9fd62..d88f5f5 100644
--- a/tests/standalone/io/http_close_test.dart
+++ b/tests/standalone/io/http_close_test.dart
@@ -10,7 +10,7 @@
 import "package:expect/expect.dart";
 import "dart:async";
 import "dart:io";
-import "dart:typeddata";
+import "dart:typed_data";
 
 
 void testClientAndServerCloseNoListen(int connections) {
@@ -30,7 +30,7 @@
     });
     var client = new HttpClient();
     for (int i = 0; i < connections; i++) {
-      client.get("localhost", server.port, "/")
+      client.get("127.0.0.1", server.port, "/")
           .then((request) => request.close())
           .then((response) {
           });
@@ -61,7 +61,7 @@
     });
     var client = new HttpClient();
     for (int i = 0; i < connections; i++) {
-      client.get("localhost", server.port, "/")
+      client.get("127.0.0.1", server.port, "/")
           .then((request) => request.close())
           .then((response) => check());
     }
@@ -95,7 +95,7 @@
     });
     var client = new HttpClient();
     for (int i = 0; i < connections; i++) {
-      client.get("localhost", server.port, "/")
+      client.get("127.0.0.1", server.port, "/")
           .then((request) => request.close())
           .then((response) {
             // Ensure we don't accept the response until we have send the entire
diff --git a/tests/standalone/io/http_compression_test.dart b/tests/standalone/io/http_compression_test.dart
index 8bec0a2..47c2906 100644
--- a/tests/standalone/io/http_compression_test.dart
+++ b/tests/standalone/io/http_compression_test.dart
@@ -9,7 +9,7 @@
 
 import 'package:expect/expect.dart';
 import 'dart:io';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 void testServerCompress() {
   void test(List<int> data) {
@@ -19,7 +19,7 @@
         request.response.close();
       });
       var client = new HttpClient();
-      client.get("localhost", server.port, "/")
+      client.get("127.0.0.1", server.port, "/")
           .then((request) {
             request.headers.set(HttpHeaders.ACCEPT_ENCODING, "gzip,deflate");
             return request.close();
@@ -55,7 +55,7 @@
         request.response.close();
       });
       var client = new HttpClient();
-      client.get("localhost", server.port, "/")
+      client.get("127.0.0.1", server.port, "/")
           .then((request) {
             request.headers.set(HttpHeaders.ACCEPT_ENCODING, encoding);
             return request.close();
diff --git a/tests/standalone/io/http_keep_alive_test.dart b/tests/standalone/io/http_keep_alive_test.dart
index c2160d3..b2d821a 100644
--- a/tests/standalone/io/http_keep_alive_test.dart
+++ b/tests/standalone/io/http_keep_alive_test.dart
@@ -12,7 +12,7 @@
 import "dart:io";
 
 Future getData(HttpClient client, int port, bool chunked, int length) {
-  return client.get("localhost", port, "/?chunked=$chunked&length=$length")
+  return client.get("127.0.0.1", port, "/?chunked=$chunked&length=$length")
       .then((request) => request.close())
       .then((response) {
         return response.fold(0, (bytes, data) => bytes + data.length)
diff --git a/tests/standalone/io/http_parser_test.dart b/tests/standalone/io/http_parser_test.dart
index 00d5b8e..5742510 100644
--- a/tests/standalone/io/http_parser_test.dart
+++ b/tests/standalone/io/http_parser_test.dart
@@ -5,7 +5,7 @@
 import "package:expect/expect.dart";
 import 'dart:async';
 import 'dart:math';
-import 'dart:typeddata';
+import 'dart:typed_data';
 import 'dart:isolate';
 import 'dart:uri';
 
diff --git a/tests/standalone/io/http_proxy_test.dart b/tests/standalone/io/http_proxy_test.dart
index e3dc5ba..36abf04 100644
--- a/tests/standalone/io/http_proxy_test.dart
+++ b/tests/standalone/io/http_proxy_test.dart
@@ -22,8 +22,8 @@
     var x = new Completer();
     Future f = secure
         ? HttpServer.bindSecure(
-            "127.0.0.1", 0, certificateName: 'localhost_cert')
-        : HttpServer.bind();
+            "localhost", 0, certificateName: 'localhost_cert')
+        : HttpServer.bind("localhost");
     return f.then((s) {
       server = s;
       x.complete(this);
@@ -97,7 +97,7 @@
 
   Future<ProxyServer> start() {
     var x = new Completer();
-    HttpServer.bind().then((s) {
+    HttpServer.bind("localhost").then((s) {
       server = s;
       x.complete(this);
       server.listen((HttpRequest request) {
@@ -196,7 +196,7 @@
     };
 
     for (int i = 0; i < proxy.length; i++) {
-      client.getUrl(Uri.parse("http://127.0.0.1:${server.port}/$i"))
+      client.getUrl(Uri.parse("http://localhost:${server.port}/$i"))
         .then((HttpClientRequest clientRequest) {
           String content = "$i$i$i";
           clientRequest.contentLength = content.length;
@@ -254,7 +254,7 @@
       test(bool secure) {
         String url = secure
             ? "https://localhost:${secureServer.port}/$i"
-            : "http://127.0.0.1:${server.port}/$i";
+            : "http://localhost:${server.port}/$i";
 
         client.postUrl(Uri.parse(url))
           .then((HttpClientRequest clientRequest) {
@@ -290,7 +290,7 @@
   // Setup two proxy servers having the first using the second as its proxy.
   setupProxyServer().then((proxyServer1) {
   setupProxyServer().then((proxyServer2) {
-  proxyServer1.client.findProxy = (_) => "PROXY 127.0.0.1:${proxyServer2.port}";
+  proxyServer1.client.findProxy = (_) => "PROXY localhost:${proxyServer2.port}";
 
   setupServer(2, directRequestPaths: ["/4"]).then((server) {
     HttpClient client = new HttpClient();
@@ -322,7 +322,7 @@
     };
 
     for (int i = 0; i < proxy.length; i++) {
-      client.getUrl(Uri.parse("http://127.0.0.1:${server.port}/$i"))
+      client.getUrl(Uri.parse("http://localhost:${server.port}/$i"))
         .then((HttpClientRequest clientRequest) {
           String content = "$i$i$i";
           clientRequest.contentLength = content.length;
@@ -366,7 +366,7 @@
       test(bool secure) {
         String url = secure
             ? "https://localhost:${secureServer.port}/$i"
-            : "http://127.0.0.1:${server.port}/$i";
+            : "http://localhost:${server.port}/$i";
 
         client.postUrl(Uri.parse(url))
           .then((HttpClientRequest clientRequest) {
@@ -420,7 +420,7 @@
       test(bool secure) {
         String url = secure
             ? "https://localhost:${secureServer.port}/$i"
-            : "http://127.0.0.1:${server.port}/$i";
+            : "http://localhost:${server.port}/$i";
 
         client.postUrl(Uri.parse(url))
           .then((HttpClientRequest clientRequest) {
@@ -456,7 +456,7 @@
         test(bool secure) {
           String url = secure
               ? "https://localhost:${secureServer.port}/$i"
-              : "http://127.0.0.1:${server.port}/$i";
+              : "http://localhost:${server.port}/$i";
 
           client.postUrl(Uri.parse(url))
             .then((HttpClientRequest clientRequest) {
@@ -501,7 +501,7 @@
         test(bool secure) {
           String url = secure
               ? "https://localhost:${secureServer.port}/A"
-              : "http://127.0.0.1:${server.port}/A";
+              : "http://localhost:${server.port}/A";
 
           client.postUrl(Uri.parse(url))
             .then((HttpClientRequest clientRequest) {
@@ -556,7 +556,7 @@
     };
 
     for (int i = 0; i < proxy.length; i++) {
-      client.getUrl(Uri.parse("http://127.0.0.1:${server.port}/$i"))
+      client.getUrl(Uri.parse("http://localhost:${server.port}/$i"))
         .then((HttpClientRequest clientRequest) {
           String content = "$i$i$i";
           clientRequest.contentLength = content.length;
@@ -594,7 +594,7 @@
     };
 
     for (int i = 0; i < proxy.length; i++) {
-      client.getUrl(Uri.parse("http://127.0.0.1:${server.port}/$i"))
+      client.getUrl(Uri.parse("http://localhost:${server.port}/$i"))
         .then((HttpClientRequest clientRequest) {
           String content = "$i$i$i";
           clientRequest.contentLength = content.length;
diff --git a/tests/standalone/io/http_server_early_client_close_test.dart b/tests/standalone/io/http_server_early_client_close_test.dart
index aade9d2..d9c0113 100644
--- a/tests/standalone/io/http_server_early_client_close_test.dart
+++ b/tests/standalone/io/http_server_early_client_close_test.dart
@@ -146,7 +146,7 @@
             server.close();
           });
     });
-    Socket.connect("localhost", server.port)
+    Socket.connect("127.0.0.1", server.port)
         .then((socket) {
           socket.write("GET / HTTP/1.1\r\n");
           socket.write("Content-Length: 10\r\n");
diff --git a/tests/standalone/io/http_server_response_test.dart b/tests/standalone/io/http_server_response_test.dart
index ac019c8..2df33cd 100644
--- a/tests/standalone/io/http_server_response_test.dart
+++ b/tests/standalone/io/http_server_response_test.dart
@@ -10,7 +10,7 @@
 import "package:expect/expect.dart";
 import "dart:async";
 import "dart:io";
-import "dart:typeddata";
+import "dart:typed_data";
 
 void testServerRequest(void handler(server, request), {int bytes}) {
   HttpServer.bind().then((server) {
diff --git a/tests/standalone/io/https_client_certificate_test.dart b/tests/standalone/io/https_client_certificate_test.dart
index 720f0c6..fea97ef 100644
--- a/tests/standalone/io/https_client_certificate_test.dart
+++ b/tests/standalone/io/https_client_certificate_test.dart
@@ -8,13 +8,12 @@
 import "dart:uri";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 
 
 Function test() {
   var keepAlive = new ReceivePort();
-  HttpServer.bindSecure(SERVER_ADDRESS,
+  HttpServer.bindSecure(HOST_NAME,
                         0,
                         backlog: 5,
                         certificateName: 'localhost_cert',
diff --git a/tests/standalone/io/https_client_exception_test.dart b/tests/standalone/io/https_client_exception_test.dart
index a49c51a..8acac41 100644
--- a/tests/standalone/io/https_client_exception_test.dart
+++ b/tests/standalone/io/https_client_exception_test.dart
@@ -19,11 +19,6 @@
       });
 }
 
-void InitializeSSL() {
-  SecureSocket.initialize();
-}
-
 void main() {
   testBadHostName();
-  Expect.throws(InitializeSSL);
 }
diff --git a/tests/standalone/io/https_server_test.dart b/tests/standalone/io/https_server_test.dart
index fbefbeb..08fec0c 100644
--- a/tests/standalone/io/https_server_test.dart
+++ b/tests/standalone/io/https_server_test.dart
@@ -8,12 +8,11 @@
 import "dart:uri";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 
 void testListenOn() {
   void test(void onDone()) {
-    HttpServer.bindSecure(SERVER_ADDRESS,
+    HttpServer.bindSecure(HOST_NAME,
                           0,
                           backlog: 5,
                           certificateName: 'localhost_cert').then((server) {
diff --git a/tests/standalone/io/raw_secure_server_closing_test.dart b/tests/standalone/io/raw_secure_server_closing_test.dart
index 51e1ab2..11e641b 100644
--- a/tests/standalone/io/raw_secure_server_closing_test.dart
+++ b/tests/standalone/io/raw_secure_server_closing_test.dart
@@ -12,7 +12,6 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 
@@ -25,7 +24,7 @@
       .then((_) {
         port.close();
       });
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) {
+  RawSecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) {
     server.listen((serverConnection) {
       serverConnection.listen((event) {
         if (toClose == "server" || event == RawSocketEvent.READ_CLOSED) {
@@ -55,7 +54,7 @@
 
 void testCloseBothEnds() {
   ReceivePort port = new ReceivePort();
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) {
+  RawSecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) {
     var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port);
     server.listen((serverEnd) {
       clientEndFuture.then((clientEnd) {
@@ -75,7 +74,7 @@
 
   ReceivePort port = new ReceivePort();
 
-  RawSecureServerSocket.bind(SERVER_ADDRESS,
+  RawSecureServerSocket.bind(HOST_NAME,
                              0,
                              2 * socketCount,
                              CERTIFICATE).then((server) {
@@ -117,7 +116,7 @@
   ReceivePort port = new ReceivePort();
   List ends = [];
 
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 15, CERTIFICATE).then((server) {
+  RawSecureServerSocket.bind(HOST_NAME, 0, 15, CERTIFICATE).then((server) {
     Expect.isTrue(server.port > 0);
     void checkDone() {
       if (ends.length < 2 * socketCount) return;
diff --git a/tests/standalone/io/raw_secure_server_socket_argument_test.dart b/tests/standalone/io/raw_secure_server_socket_argument_test.dart
new file mode 100644
index 0000000..6c78cbc
--- /dev/null
+++ b/tests/standalone/io/raw_secure_server_socket_argument_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+
+import "package:expect/expect.dart";
+import "dart:async";
+import "dart:io";
+import "dart:isolate";
+
+const SERVER_ADDRESS = "127.0.0.1";
+const CERTIFICATE = "localhost_cert";
+
+
+void testArguments() {
+  Expect.throws(() =>
+      RawSecureServerSocket.bind(SERVER_ADDRESS, 65536, 5, CERTIFICATE));
+  Expect.throws(() =>
+      RawSecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE));
+  Expect.throws(() =>
+      RawSecureServerSocket.bind(SERVER_ADDRESS, 0, -1, CERTIFICATE));
+}
+
+
+main() {
+  Path scriptDir = new Path(new Options().script).directoryPath;
+  Path certificateDatabase = scriptDir.append('pkcert');
+  SecureSocket.initialize(database: certificateDatabase.toNativePath(),
+                          password: 'dartdart',
+                          useBuiltinRoots: false);
+  testArguments();
+}
diff --git a/tests/standalone/io/raw_secure_server_socket_test.dart b/tests/standalone/io/raw_secure_server_socket_test.dart
index 873cfba..40d8d04 100644
--- a/tests/standalone/io/raw_secure_server_socket_test.dart
+++ b/tests/standalone/io/raw_secure_server_socket_test.dart
@@ -12,22 +12,12 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 
-void testArguments() {
-  Expect.throws(() =>
-      RawSecureServerSocket.bind(SERVER_ADDRESS, 65536, 5, CERTIFICATE));
-  Expect.throws(() =>
-      RawSecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE));
-  Expect.throws(() =>
-      RawSecureServerSocket.bind(SERVER_ADDRESS, 0, -1, CERTIFICATE));
-}
-
 void testSimpleBind() {
   ReceivePort port = new ReceivePort();
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((s) {
+  RawSecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((s) {
     Expect.isTrue(s.port > 0);
     s.close();
     port.close();
@@ -59,8 +49,8 @@
   // Either an error or a successful bind is allowed.
   // Windows platforms allow multiple binding to the same socket, with
   // unpredictable results.
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((s) {
-    RawSecureServerSocket.bind(SERVER_ADDRESS,
+  RawSecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((s) {
+    RawSecureServerSocket.bind(HOST_NAME,
                                s.port,
                                5,
                                CERTIFICATE).then((t) {
@@ -81,7 +71,7 @@
 
 void testSimpleConnect(String certificate) {
   ReceivePort port = new ReceivePort();
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) {
+  RawSecureServerSocket.bind(HOST_NAME, 0, 5, certificate).then((server) {
     var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port);
     server.listen((serverEnd) {
       clientEndFuture.then((clientEnd) {
@@ -96,7 +86,7 @@
 
 void testSimpleConnectFail(String certificate) {
   ReceivePort port = new ReceivePort();
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) {
+  RawSecureServerSocket.bind(HOST_NAME, 0, 5, certificate).then((server) {
     var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port)
       .then((clientEnd) {
         Expect.fail("No client connection expected.");
@@ -116,7 +106,7 @@
 
 void testServerListenAfterConnect() {
   ReceivePort port = new ReceivePort();
-  RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) {
+  RawSecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) {
     Expect.isTrue(server.port > 0);
     var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port);
     new Timer(const Duration(milliseconds: 500), () {
@@ -168,7 +158,7 @@
                          [bool postponeSecure = false]) {
   if (handshakeBeforeSecure == true &&
       (listenSecure == true || connectSecure == true)) {
-    Expect.fails("Invalid arguments to testSimpleReadWrite");
+    Expect.fail("Invalid arguments to testSimpleReadWrite");
   }
 
   ReceivePort port = new ReceivePort();
@@ -328,7 +318,6 @@
             verifyHandshakeTestData(data);
             client.writeEventsEnabled = true;
           }
-        if (bytesRead > data.length) print("XXX");
           break;
         case RawSocketEvent.WRITE:
           Expect.isFalse(client.writeEventsEnabled);
@@ -344,6 +333,7 @@
           }
           if (bytesWritten == data.length) {
             if (!postponeSecure) {
+              client.readEventsEnabled = true;
               completer.complete([subscription, null]);
             }
           }
@@ -441,9 +431,9 @@
 
   if (listenSecure) {
     RawSecureServerSocket.bind(
-        SERVER_ADDRESS, 0, 5, CERTIFICATE).then(serverReady);
+        HOST_NAME, 0, 5, CERTIFICATE).then(serverReady);
   } else {
-    RawServerSocket.bind(SERVER_ADDRESS, 0, 5).then(serverReady);
+    RawServerSocket.bind(HOST_NAME, 0, 5).then(serverReady);
   }
 }
 
@@ -453,7 +443,6 @@
   SecureSocket.initialize(database: certificateDatabase.toNativePath(),
                           password: 'dartdart',
                           useBuiltinRoots: false);
-  testArguments();
   testSimpleBind();
   testInvalidBind();
   testSimpleConnect(CERTIFICATE);
diff --git a/tests/standalone/io/raw_secure_socket_pause_test.dart b/tests/standalone/io/raw_secure_socket_pause_test.dart
index cfd93cb..a8d01de 100644
--- a/tests/standalone/io/raw_secure_socket_pause_test.dart
+++ b/tests/standalone/io/raw_secure_socket_pause_test.dart
@@ -14,7 +14,7 @@
 
 Future<HttpServer> startServer() {
   return HttpServer.bindSecure(
-      "127.0.0.1",
+      "localhost",
       0,
       backlog: 5,
       certificateName: 'localhost_cert').then((server) {
diff --git a/tests/standalone/io/raw_secure_socket_test.dart b/tests/standalone/io/raw_secure_socket_test.dart
index 33b092f..06d6b83 100644
--- a/tests/standalone/io/raw_secure_socket_test.dart
+++ b/tests/standalone/io/raw_secure_socket_test.dart
@@ -14,7 +14,7 @@
 
 Future<HttpServer> startServer() {
   return HttpServer.bindSecure(
-      "127.0.0.1",
+      "localhost",
       0,
       backlog: 5,
       certificateName: 'localhost_cert').then((server) {
diff --git a/tests/standalone/io/raw_server_socket_cancel_test.dart b/tests/standalone/io/raw_server_socket_cancel_test.dart
index 5f0186e..1b9fe0d 100644
--- a/tests/standalone/io/raw_server_socket_cancel_test.dart
+++ b/tests/standalone/io/raw_server_socket_cancel_test.dart
@@ -7,6 +7,7 @@
 // VMOptions=--short_socket_write
 // VMOptions=--short_socket_read --short_socket_write
 
+import "package:expect/expect.dart";
 import "dart:async";
 import "dart:io";
 import "dart:isolate";
diff --git a/tests/standalone/io/secure_client_raw_server_test.dart b/tests/standalone/io/secure_client_raw_server_test.dart
index a00e27b..e72036a 100644
--- a/tests/standalone/io/secure_client_raw_server_test.dart
+++ b/tests/standalone/io/secure_client_raw_server_test.dart
@@ -12,11 +12,10 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 Future<RawSecureServerSocket> startEchoServer() {
-  return RawSecureServerSocket.bind(SERVER_ADDRESS,
+  return RawSecureServerSocket.bind(HOST_NAME,
                                     0,
                                     5,
                                     CERTIFICATE).then((server) {
diff --git a/tests/standalone/io/secure_client_server_test.dart b/tests/standalone/io/secure_client_server_test.dart
index 6681c11..494d54c 100644
--- a/tests/standalone/io/secure_client_server_test.dart
+++ b/tests/standalone/io/secure_client_server_test.dart
@@ -12,11 +12,10 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 Future<SecureServerSocket> startEchoServer() {
-  return SecureServerSocket.bind(SERVER_ADDRESS,
+  return SecureServerSocket.bind(HOST_NAME,
                                  0,
                                  5,
                                  CERTIFICATE).then((server) {
diff --git a/tests/standalone/io/secure_multiple_client_server_test.dart b/tests/standalone/io/secure_multiple_client_server_test.dart
index dc6720f..69dfb92 100644
--- a/tests/standalone/io/secure_multiple_client_server_test.dart
+++ b/tests/standalone/io/secure_multiple_client_server_test.dart
@@ -12,11 +12,10 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 Future<SecureServerSocket> startServer() {
-  return SecureServerSocket.bind(SERVER_ADDRESS,
+  return SecureServerSocket.bind(HOST_NAME,
                                  0,
                                  5,
                                  CERTIFICATE).then((server) {
diff --git a/tests/standalone/io/secure_server_client_certificate_test.dart b/tests/standalone/io/secure_server_client_certificate_test.dart
index 4d24783..4edabef 100644
--- a/tests/standalone/io/secure_server_client_certificate_test.dart
+++ b/tests/standalone/io/secure_server_client_certificate_test.dart
@@ -7,13 +7,12 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 
 void testClientCertificate() {
   ReceivePort port = new ReceivePort();
-  SecureServerSocket.bind(SERVER_ADDRESS,
+  SecureServerSocket.bind(HOST_NAME,
                           0,
                           5,
                           CERTIFICATE,
@@ -42,7 +41,7 @@
 
 void testRequiredClientCertificate() {
   ReceivePort port = new ReceivePort();
-  SecureServerSocket.bind(SERVER_ADDRESS,
+  SecureServerSocket.bind(HOST_NAME,
                           0,
                           5,
                           CERTIFICATE,
@@ -71,7 +70,7 @@
 
 void testNoClientCertificate() {
   ReceivePort port = new ReceivePort();
-  SecureServerSocket.bind(SERVER_ADDRESS,
+  SecureServerSocket.bind(HOST_NAME,
                           0,
                           5,
                           CERTIFICATE,
@@ -94,7 +93,7 @@
 void testNoRequiredClientCertificate() {
   ReceivePort port = new ReceivePort();
   bool clientError = false;
-  SecureServerSocket.bind(SERVER_ADDRESS,
+  SecureServerSocket.bind(HOST_NAME,
                           0,
                           5,
                           CERTIFICATE,
diff --git a/tests/standalone/io/secure_server_closing_test.dart b/tests/standalone/io/secure_server_closing_test.dart
index 29f3a1b..2e0bd4b 100644
--- a/tests/standalone/io/secure_server_closing_test.dart
+++ b/tests/standalone/io/secure_server_closing_test.dart
@@ -12,7 +12,6 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 
@@ -25,7 +24,7 @@
       .then((_) {
         port.close();
       });
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) {
     server.listen((serverConnection) {
       serverConnection.listen(
         (data) {
@@ -61,7 +60,7 @@
 
 void testCloseBothEnds() {
   ReceivePort port = new ReceivePort();
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) {
     var clientEndFuture = SecureSocket.connect(HOST_NAME, server.port);
     server.listen((serverEnd) {
       clientEndFuture.then((clientEnd) {
@@ -81,7 +80,7 @@
 
   ReceivePort port = new ReceivePort();
 
-  SecureServerSocket.bind(SERVER_ADDRESS,
+  SecureServerSocket.bind(HOST_NAME,
                           0,
                           2 * socketCount,
                           CERTIFICATE).then((server) {
@@ -125,7 +124,7 @@
   ReceivePort port = new ReceivePort();
   List ends = [];
 
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 15, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST_NAME, 0, 15, CERTIFICATE).then((server) {
     Expect.isTrue(server.port > 0);
     void checkDone() {
       if (ends.length < 2 * socketCount) return;
diff --git a/tests/standalone/io/secure_server_socket_test.dart b/tests/standalone/io/secure_server_socket_test.dart
index dbe0355..bf1bc05 100644
--- a/tests/standalone/io/secure_server_socket_test.dart
+++ b/tests/standalone/io/secure_server_socket_test.dart
@@ -12,22 +12,12 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 
-void testArguments() {
-  Expect.throws(() =>
-      SecureServerSocket.bind(SERVER_ADDRESS, 65536, 5, CERTIFICATE));
-  Expect.throws(() =>
-      SecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE));
-  Expect.throws(() =>
-      SecureServerSocket.bind(SERVER_ADDRESS, 0, -1, CERTIFICATE));
-}
-
 void testSimpleBind() {
   ReceivePort port = new ReceivePort();
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((s) {
+  SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((s) {
     Expect.isTrue(s.port > 0);
     s.close();
     port.close();
@@ -59,8 +49,8 @@
   // Either an error or a successful bind is allowed.
   // Windows platforms allow multiple binding to the same socket, with
   // unpredictable results.
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((s) {
-    SecureServerSocket.bind(SERVER_ADDRESS,
+  SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((s) {
+    SecureServerSocket.bind(HOST_NAME,
                             s.port,
                             5,
                             CERTIFICATE).then((t) {
@@ -80,7 +70,7 @@
 
 void testSimpleConnect(String certificate) {
   ReceivePort port = new ReceivePort();
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) {
+  SecureServerSocket.bind(HOST_NAME, 0, 5, certificate).then((server) {
     var clientEndFuture = SecureSocket.connect(HOST_NAME, server.port);
     server.listen((serverEnd) {
       clientEndFuture.then((clientEnd) {
@@ -95,7 +85,7 @@
 
 void testSimpleConnectFail(String certificate) {
   ReceivePort port = new ReceivePort();
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) {
+  SecureServerSocket.bind(HOST_NAME, 0, 5, certificate).then((server) {
     var clientEndFuture = SecureSocket.connect(HOST_NAME, server.port)
       .then((clientEnd) {
         Expect.fail("No client connection expected.");
@@ -115,7 +105,7 @@
 
 void testServerListenAfterConnect() {
   ReceivePort port = new ReceivePort();
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) {
     Expect.isTrue(server.port > 0);
     var clientEndFuture = SecureSocket.connect(HOST_NAME, server.port);
     new Timer(const Duration(milliseconds: 500), () {
@@ -156,7 +146,7 @@
     }
   }
 
-  SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) {
     server.listen((client) {
       int bytesRead = 0;
       int bytesWritten = 0;
@@ -205,7 +195,6 @@
   SecureSocket.initialize(database: certificateDatabase.toNativePath(),
                           password: 'dartdart',
                           useBuiltinRoots: false);
-  testArguments();
   testSimpleBind();
   testInvalidBind();
   testSimpleConnect(CERTIFICATE);
diff --git a/tests/standalone/io/secure_session_resume_test.dart b/tests/standalone/io/secure_session_resume_test.dart
index 6e5f48b..532dcec 100644
--- a/tests/standalone/io/secure_session_resume_test.dart
+++ b/tests/standalone/io/secure_session_resume_test.dart
@@ -21,11 +21,10 @@
 import "dart:io";
 import "dart:isolate";
 
-const SERVER_ADDRESS = "127.0.0.1";
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 Future<SecureServerSocket> startServer() {
-  return SecureServerSocket.bind(SERVER_ADDRESS,
+  return SecureServerSocket.bind(HOST_NAME,
                                  0,
                                  5,
                                  CERTIFICATE).then((server) {
diff --git a/tests/standalone/io/secure_socket_argument_test.dart b/tests/standalone/io/secure_socket_argument_test.dart
index 5e59c06..6caf84e 100644
--- a/tests/standalone/io/secure_socket_argument_test.dart
+++ b/tests/standalone/io/secure_socket_argument_test.dart
@@ -5,9 +5,23 @@
 import "package:expect/expect.dart";
 import "dart:io";
 
-void main() {
+void testInitialzeArguments() {
   Expect.throws(() => SecureSocket.initialize(database: "foo.txt"));
   Expect.throws(() => SecureSocket.initialize(password: false));
   Expect.throws(() => SecureSocket.initialize(useBuiltinRoots: 7));
+}
+
+void testServerSocketArguments() {
+  Expect.throws(() =>
+      SecureServerSocket.bind(SERVER_ADDRESS, 65536, 5, CERTIFICATE));
+  Expect.throws(() =>
+      SecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE));
+  Expect.throws(() =>
+      SecureServerSocket.bind(SERVER_ADDRESS, 0, -1, CERTIFICATE));
+}
+
+void main() {
+  testInitialzeArguments();
   SecureSocket.initialize();
+  testServerSocketArguments();
 }
diff --git a/tests/standalone/io/secure_socket_bad_certificate_test.dart b/tests/standalone/io/secure_socket_bad_certificate_test.dart
index 658d560..85b1cd3 100644
--- a/tests/standalone/io/secure_socket_bad_certificate_test.dart
+++ b/tests/standalone/io/secure_socket_bad_certificate_test.dart
@@ -31,12 +31,12 @@
 }
 
 Future testCertificateCallback({String host, bool acceptCertificate}) {
-  Expect.throws(
-      () {
-        var x = 7;
-        SecureSocket.connect(host, 443, onBadCertificate: x);
-      },
-      (e) => e is ArgumentError || e is TypeError);
+  try {
+    var x = 7;
+    SecureSocket.connect(host, 443, onBadCertificate: x)
+        .catchError((e) {}, test: (e) => e is ArgumentError);
+  } on TypeError catch (e) {
+  }
 
   bool badCertificateCallback(X509Certificate certificate) {
     Expect.isTrue(certificate.subject.contains("O=Google Inc"));
diff --git a/tests/standalone/io/secure_socket_test.dart b/tests/standalone/io/secure_socket_test.dart
index 61e5af8..84a9fb8 100644
--- a/tests/standalone/io/secure_socket_test.dart
+++ b/tests/standalone/io/secure_socket_test.dart
@@ -13,7 +13,7 @@
 
 Future<HttpServer> startServer() {
   return HttpServer.bindSecure(
-      "127.0.0.1",
+      "localhost",
       0,
       backlog: 5,
       certificateName: 'localhost_cert').then((server) {
diff --git a/tests/standalone/io/socket_close_test.dart b/tests/standalone/io/socket_close_test.dart
index 8022fcd..791c679 100644
--- a/tests/standalone/io/socket_close_test.dart
+++ b/tests/standalone/io/socket_close_test.dart
@@ -90,7 +90,7 @@
       }
     }
 
-    void errorHandler(Exception e) {
+    void errorHandler(Socket socket) {
       _errorEvents++;
       socket.close();
     }
diff --git a/tests/standalone/io/socket_exception_test.dart b/tests/standalone/io/socket_exception_test.dart
index 81c1b14..4713c74c 100644
--- a/tests/standalone/io/socket_exception_test.dart
+++ b/tests/standalone/io/socket_exception_test.dart
@@ -53,7 +53,7 @@
       Socket.connect("127.0.0.1", server.port).then((socket) {
         server.listen(
           (incoming) => server.close(),
-          onDone: port.close());
+          onDone: port.close);
       });
     });
   }
diff --git a/tests/standalone/io/socket_ipv6_test.dart b/tests/standalone/io/socket_ipv6_test.dart
new file mode 100644
index 0000000..4fe25fc
--- /dev/null
+++ b/tests/standalone/io/socket_ipv6_test.dart
@@ -0,0 +1,98 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:isolate';
+
+const ANY = InternetAddressType.ANY;
+
+void testIPv6toIPv6() {
+  InternetAddress.lookup("::0", type: ANY).then((serverAddr) {
+    InternetAddress.lookup("::1", type: ANY).then((clientAddr) {
+      ServerSocket.bind(serverAddr.first).then((server) {
+        server.listen((socket) {
+          socket.destroy();
+          server.close();
+        });
+        Socket.connect(clientAddr.first, server.port).then((socket) {
+          socket.destroy();
+        });
+      });
+    });
+  });
+}
+
+void testIPv4toIPv6() {
+  InternetAddress.lookup("::0", type: ANY).then((serverAddr) {
+    ServerSocket.bind(serverAddr.first).then((server) {
+      server.listen((socket) {
+        socket.destroy();
+        server.close();
+      });
+      Socket.connect("127.0.0.1", server.port).then((socket) {
+        socket.destroy();
+      });
+    });
+  });
+}
+
+void testIPv6toIPv4() {
+  InternetAddress.lookup("::1", type: ANY).then((clientAddr) {
+    ServerSocket.bind("127.0.0.1").then((server) {
+      server.listen((socket) {
+        throw "Unexpected socket";
+      });
+      Socket.connect(clientAddr.first, server.port).catchError((e) {
+        server.close();
+      });
+    });
+  });
+}
+
+void testIPv4toIPv4() {
+  ServerSocket.bind("127.0.0.1").then((server) {
+    server.listen((socket) {
+      socket.destroy();
+      server.close();
+    });
+    Socket.connect("127.0.0.1", server.port).then((socket) {
+      socket.destroy();
+    });
+  });
+}
+
+void testIPv6Lookup() {
+  var port = new ReceivePort();
+  InternetAddress.lookup("::0", type: ANY).then((list) {
+    if (list.length < 0) throw "no address";
+    for (var entry in list) {
+      if (entry.type != InternetAddressType.IPv6) {
+        throw "Wrong IP type";
+      }
+    }
+    port.close();
+  });
+}
+
+void testIPv4Lookup() {
+  var port = new ReceivePort();
+  InternetAddress.lookup("127.0.0.1").then((list) {
+    if (list.length < 0) throw "no addresse";
+    for (var entry in list) {
+      if (entry.type != InternetAddressType.IPv4) {
+        throw "Wrong IP type";
+      }
+    }
+    port.close();
+  });
+}
+
+void main() {
+  testIPv6toIPv6();
+  testIPv4toIPv6();
+  testIPv6toIPv4();
+  testIPv4toIPv4();
+  testIPv6Lookup();
+  testIPv4Lookup();
+}
diff --git a/tests/standalone/io/socket_many_connections_test.dart b/tests/standalone/io/socket_many_connections_test.dart
index c6c557e..bda8031 100644
--- a/tests/standalone/io/socket_many_connections_test.dart
+++ b/tests/standalone/io/socket_many_connections_test.dart
@@ -6,6 +6,7 @@
 library ServerTest;
 
 import "package:expect/expect.dart";
+import "dart:async";
 import "dart:io";
 import "dart:isolate";
 part "testing_server.dart";
diff --git a/tests/standalone/io/socket_upgrade_to_secure_test.dart b/tests/standalone/io/socket_upgrade_to_secure_test.dart
new file mode 100644
index 0000000..33b2059
--- /dev/null
+++ b/tests/standalone/io/socket_upgrade_to_secure_test.dart
@@ -0,0 +1,209 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+
+import "package:expect/expect.dart";
+import "dart:async";
+import "dart:io";
+import "dart:isolate";
+
+const HOST_NAME = "localhost";
+const CERTIFICATE = "localhost_cert";
+
+// This test creates a server and a client connects. After connecting
+// and an optional initial handshake the connection is secured by
+// upgrading to a secure connection The client then writes and the
+// server echos. When the server has finished its echo it
+// half-closes. When the client gets the close event is closes fully.
+//
+// The test can be run in different configurations based on
+// the boolean arguments:
+//
+// handshakeBeforeSecure
+// When this argument is true some initial clear text handshake is done
+// between client and server before the connection is secured. This argument
+// only makes sense when both listenSecure and connectSecure are false.
+//
+// postponeSecure
+// When this argument is false the securing of the server end will
+// happen as soon as the last byte of the handshake before securing
+// has been written. When this argument is true the securing of the
+// server will not happen until the first TLS handshake data has been
+// received from the client. This argument only takes effect when
+// handshakeBeforeSecure is true.
+void test(bool handshakeBeforeSecure,
+          [bool postponeSecure = false]) {
+  ReceivePort port = new ReceivePort();
+
+  const messageSize = 1000;
+  const handshakeMessageSize = 100;
+
+  List<int> createTestData() {
+    List<int> data = new List<int>(messageSize);
+    for (int i = 0; i < messageSize; i++) {
+      data[i] = i & 0xff;
+    }
+    return data;
+  }
+
+  List<int> createHandshakeTestData() {
+    List<int> data = new List<int>(handshakeMessageSize);
+    for (int i = 0; i < handshakeMessageSize; i++) {
+      data[i] = i & 0xff;
+    }
+    return data;
+  }
+
+  void verifyTestData(List<int> data) {
+    Expect.equals(messageSize, data.length);
+    List<int> expected = createTestData();
+    for (int i = 0; i < messageSize; i++) {
+      Expect.equals(expected[i], data[i]);
+    }
+  }
+
+  void verifyHandshakeTestData(List<int> data) {
+    Expect.equals(handshakeMessageSize, data.length);
+    List<int> expected = createHandshakeTestData();
+    for (int i = 0; i < handshakeMessageSize; i++) {
+      Expect.equals(expected[i], data[i]);
+    }
+  }
+
+  Future runServer(Socket client) {
+    var completer = new Completer();
+    var dataReceived = [];
+    client.listen(
+        (data) {
+          dataReceived.addAll(data);
+          if (dataReceived.length == messageSize) {
+            verifyTestData(dataReceived);
+            client.add(dataReceived);
+            client.close();
+          }
+        },
+        onDone: () => completer.complete(null));
+    return completer.future;
+  }
+
+  Future<RawSocket> runClient(Socket socket) {
+    var completer = new Completer();
+    var dataReceived = [];
+    socket.listen(
+        (data) {
+          dataReceived.addAll(data);
+        },
+        onDone: () {
+          Expect.equals(messageSize, dataReceived.length);
+          verifyTestData(dataReceived);
+          socket.close();
+          completer.complete(null);
+        });
+    socket.add(createTestData());
+    return completer.future;
+  }
+
+  Future runServerHandshake(Socket client) {
+    var completer = new Completer();
+    var dataReceived = [];
+    var subscription;
+    subscription = client.listen(
+        (data) {
+          if (dataReceived.length == handshakeMessageSize) {
+            Expect.isTrue(postponeSecure);
+            subscription.pause();
+            completer.complete(data);
+          }
+          dataReceived.addAll(data);
+          if (dataReceived.length == handshakeMessageSize) {
+            verifyHandshakeTestData(dataReceived);
+            client.add(dataReceived);
+            if (!postponeSecure) {
+              completer.complete(null);
+            }
+          }
+        },
+        onDone: () => completer.complete(null));
+    return completer.future;
+  }
+
+  Future<Socket> runClientHandshake(Socket socket) {
+    var completer = new Completer();
+    var dataReceived = [];
+    socket.listen(
+        (data) {
+          dataReceived.addAll(data);
+          if (dataReceived.length == handshakeMessageSize) {
+            verifyHandshakeTestData(dataReceived);
+            completer.complete(null);
+          }
+        },
+        onDone: () => Expect.fail("Should not be called")
+    );
+    socket.add(createHandshakeTestData());
+    return completer.future;
+  }
+
+  Future<SecureSocket> connectClient(int port) {
+    if (!handshakeBeforeSecure) {
+      return Socket.connect(HOST_NAME, port).then((socket) {
+        return SecureSocket.secure(socket).then((secureSocket) {
+          Expect.throws(() => socket.add([0]));
+          return secureSocket;
+        });
+      });
+    } else {
+      return Socket.connect(HOST_NAME, port).then((socket) {
+        return runClientHandshake(socket).then((_) {
+            return SecureSocket.secure(socket).then((secureSocket) {
+              Expect.throws(() => socket.add([0]));
+              return secureSocket;
+            });
+        });
+      });
+    }
+  }
+
+  serverReady(server) {
+    server.listen((client) {
+      if (!handshakeBeforeSecure) {
+        SecureSocket.secureServer(client, CERTIFICATE).then((secureClient) {
+          Expect.throws(() => client.add([0]));
+          runServer(secureClient).then((_) => server.close());
+        });
+      } else {
+        runServerHandshake(client).then((carryOverData) {
+          SecureSocket.secureServer(
+              client,
+              CERTIFICATE,
+              carryOverData: carryOverData).then((secureClient) {
+            Expect.throws(() => client.add([0]));
+            runServer(secureClient).then((_) => server.close());
+          });
+        });
+      }
+    });
+
+    connectClient(server.port).then(runClient).then((socket) {
+      port.close();
+    });
+  }
+
+  ServerSocket.bind(HOST_NAME, 0, 5).then(serverReady);
+}
+
+main() {
+  Path scriptDir = new Path(new Options().script).directoryPath;
+  Path certificateDatabase = scriptDir.append('pkcert');
+  SecureSocket.initialize(database: certificateDatabase.toNativePath(),
+                          password: 'dartdart',
+                          useBuiltinRoots: false);
+  test(false);
+  test(true);
+  test(true, true);
+}
diff --git a/tests/standalone/io/web_socket_protocol_processor_test.dart b/tests/standalone/io/web_socket_protocol_processor_test.dart
index eb15db0..39f9d91 100644
--- a/tests/standalone/io/web_socket_protocol_processor_test.dart
+++ b/tests/standalone/io/web_socket_protocol_processor_test.dart
@@ -7,7 +7,7 @@
 import "dart:math";
 import "dart:async";
 import "dart:collection";
-import "dart:typeddata";
+import "dart:typed_data";
 import "dart:isolate";
 
 part "../../../sdk/lib/io/http.dart";
diff --git a/tests/standalone/io/web_socket_test.dart b/tests/standalone/io/web_socket_test.dart
index 2bee0d8..5579e8f 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -11,11 +11,10 @@
 import "dart:async";
 import "dart:io";
 import "dart:isolate";
-import "dart:typeddata";
+import "dart:typed_data";
 import "dart:uri";
 
 const String CERT_NAME = 'localhost_cert';
-const String SERVER_ADDRESS = '127.0.0.1';
 const String HOST_NAME = 'localhost';
 
 /**
@@ -27,11 +26,11 @@
   SecurityConfiguration({bool this.secure});
 
   Future<HttpServer> createServer({int backlog: 0}) =>
-      secure ? HttpServer.bindSecure(SERVER_ADDRESS,
+      secure ? HttpServer.bindSecure(HOST_NAME,
                                      0,
                                      backlog: backlog,
                                      certificateName: CERT_NAME)
-             : HttpServer.bind(SERVER_ADDRESS,
+             : HttpServer.bind(HOST_NAME,
                                0,
                                backlog);
 
@@ -193,12 +192,16 @@
         WebSocketTransformer.upgrade(request)
             .then((webSocket) {
               webSocket.close();
-              webSocket.listen((_) { Expect.fail(); }, onDone: server.close);
+              webSocket.listen(
+                  (_) { Expect.fail("Unexpected message"); },
+                  onDone: server.close);
             });
       });
 
       createClient(server.port).then((webSocket) {
-          webSocket.listen((_) { Expect.fail(); }, onDone: webSocket.close);
+          webSocket.listen(
+              (_) { Expect.fail("Unexpected message"); },
+              onDone: webSocket.close);
         });
     });
   }
@@ -209,7 +212,9 @@
       server.listen((request) {
         WebSocketTransformer.upgrade(request)
             .then((webSocket) {
-              webSocket.listen((_) { Expect.fail(); }, onDone: () {
+              webSocket.listen(
+                  (_) { Expect.fail("Unexpected message"); },
+                  onDone: () {
                 server.close();
                 webSocket.close();
               });
@@ -218,7 +223,9 @@
 
       createClient(server.port).then((webSocket) {
           webSocket.close();
-          webSocket.listen((_) { Expect.fail(); }, onDone: webSocket.close);
+          webSocket.listen(
+              (_) { Expect.fail("Unexpected message"); },
+              onDone: webSocket.close);
         });
     });
   }
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index d4b3002..37ef277 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -14,6 +14,8 @@
 [ $runtime == vm ]
 package/package_isolate_test: Fail # http://dartbug.com/7520.
 io/raw_server_socket_cancel_test: Pass, Fail, Timeout # Issue 8675
+io/raw_secure_server_socket_test: Pass, Fail # Issue 10177
+io/socket_upgrade_to_secure_test: Pass, Fail # Issue 10177
 
 [ $runtime == vm && $checked ]
 # These tests have type errors on purpose.
@@ -78,14 +80,14 @@
 
 [ $compiler == dart2js ]
 number_identity_test: Skip # Bigints and int/double diff. not supported.
-typed_data_test: Skip # dart:typeddata support needed.
-bytedata_test: Skip # dart:typeddata support needed.
-typed_data_view_test: Skip # dart:typeddata support needed.
-typed_data_isolate_test: Skip # dart:typeddata support needed.
-typed_array_test: Skip # dart:typeddata support needed.
-float_array_test: Skip # dart:typeddata support needed.
-int_array_test: Skip  # dart:typeddata support needed.
-byte_array_view_optimized_test: Skip # dart:typeddata support needed.
+typed_data_test: Skip # dart:typed_data support needed.
+bytedata_test: Skip # dart:typed_data support needed.
+typed_data_view_test: Skip # dart:typed_data support needed.
+typed_data_isolate_test: Skip # dart:typed_data support needed.
+typed_array_test: Skip # dart:typed_data support needed.
+float_array_test: Skip # dart:typed_data support needed.
+int_array_test: Skip  # dart:typed_data support needed.
+byte_array_view_optimized_test: Skip # dart:typed_data support needed.
 io/web_socket_protocol_processor_test: Skip  # Importing code with external keyword
 int_array_load_elimination_test: Skip  # This is a VM test
 medium_integer_test: Fail, OK # Test fails with JS number semantics: issue 1533.
@@ -99,7 +101,6 @@
 byte_array_test: Fail, OK # ByteArray
 deoptimization_test: Fail, OK # Requires bigint.
 out_of_memory_test: Fail, OK # d8 handles much larger arrays than Dart VM.
-io/http_parser_test: Fail, OK # ByteArray
 io/options_test: Fail, OK # Cannot pass options to d8.
 
 [ $compiler == dart2js && $runtime == none ]
diff --git a/tests/standalone/typed_array_test.dart b/tests/standalone/typed_array_test.dart
index 007f9ec..b7d5b87 100644
--- a/tests/standalone/typed_array_test.dart
+++ b/tests/standalone/typed_array_test.dart
@@ -8,7 +8,7 @@
 library TypedArray;
 import "package:expect/expect.dart";
 import 'dart:isolate';
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 void main() {
   int8_receiver();
diff --git a/tests/standalone/typed_data_test.dart b/tests/standalone/typed_data_test.dart
index 141a082..21f17a5b 100644
--- a/tests/standalone/typed_data_test.dart
+++ b/tests/standalone/typed_data_test.dart
@@ -8,7 +8,7 @@
 library TypedDataTest;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 void testCreateUint8TypedData() {
   Uint8List typed_data;
diff --git a/tests/standalone/typed_data_view_test.dart b/tests/standalone/typed_data_view_test.dart
index dbdab31..1a71282 100644
--- a/tests/standalone/typed_data_view_test.dart
+++ b/tests/standalone/typed_data_view_test.dart
@@ -8,7 +8,7 @@
 library TypedDataTest;
 
 import "package:expect/expect.dart";
-import 'dart:typeddata';
+import 'dart:typed_data';
 
 validate(TypedData list, num expected) {
   for (int i = 0; i < list.length; i++) {
diff --git a/tests/utils/dummy_compiler_test.dart b/tests/utils/dummy_compiler_test.dart
index 7f145cb..470d79a 100644
--- a/tests/utils/dummy_compiler_test.dart
+++ b/tests/utils/dummy_compiler_test.dart
@@ -42,16 +42,20 @@
     } else if (uri.path.endsWith('_patch.dart')) {
       source = '';
     } else if (uri.path.endsWith('interceptors.dart')) {
-      source = """class ObjectInterceptor {}
+      source = """class Interceptor {
+                    operator==(other) {}
+                  }
+                  class JSIndexable {
+                    get length;
+                  }
+                  class JSMutableIndexable {}
                   class JSArray {
-                    var length;
                     var removeLast;
                     var add;
                   }
                   class JSFixedArray {}
                   class JSExtendableArray {}
                   class JSString {
-                    var length;
                     var split;
                     var concat;
                     var toString;
diff --git a/tests/utils/recursive_import_test.dart b/tests/utils/recursive_import_test.dart
index b6e95f3..15a09be 100644
--- a/tests/utils/recursive_import_test.dart
+++ b/tests/utils/recursive_import_test.dart
@@ -36,13 +36,15 @@
 
 const INTERCEPTORS_LIB = """
 library interceptors;
+class JSIndexable {
+  get length;
+}
+class JSMutableIndexable {}
 class JSArray {
-  get length => null;
   removeLast() => null;
   add(x) { }
 }
 class JSString {
-  get length => null;
   split(x) => null;
   concat(x) => null;
   toString() => null;
diff --git a/tools/VERSION b/tools/VERSION
index 065d490..5fac88f 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
 MAJOR 0
 MINOR 5
-BUILD 0
-PATCH 1
+BUILD 1
+PATCH 0
diff --git a/tools/build.py b/tools/build.py
index 2ee32d6..2426699 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -15,11 +15,23 @@
 
 HOST_OS = utils.GuessOS()
 HOST_CPUS = utils.GuessCpus()
-armcompilerlocation = '/opt/codesourcery/arm-2009q1'
 SCRIPT_DIR = os.path.dirname(sys.argv[0])
 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
 THIRD_PARTY_ROOT = os.path.join(DART_ROOT, 'third_party')
 
+arm_cc_error = """
+Couldn't find the arm cross compiler.
+To make sure that you have the arm cross compilation tools installed, run:
+
+$ wget http://src.chromium.org/chrome/trunk/src/build/install-build-deps.sh
+OR
+$ svn co http://src.chromium.org/chrome/trunk/src/build; cd build
+Then,
+$ chmod u+x install-build-deps.sh
+$ ./install-build-deps.sh --arm --no-chromeos-fonts
+"""
+DEFAULT_ARM_CROSS_COMPILER_PATH = '/usr'
+
 def BuildOptions():
   result = optparse.OptionParser()
   result.add_option("-m", "--mode",
@@ -107,14 +119,14 @@
 def SetTools(arch, toolchainprefix):
   toolsOverride = None
   if arch == 'arm' and toolchainprefix == None:
-    toolchainprefix = armcompilerlocation + "/bin/arm-none-linux-gnueabi"
+    toolchainprefix = DEFAULT_ARM_CROSS_COMPILER_PATH + "/bin/arm-linux-gnueabi"
   if toolchainprefix:
     toolsOverride = {
-      "CC"  :  toolchainprefix + "-gcc",
-      "CXX" :  toolchainprefix + "-g++",
-      "AR"  :  toolchainprefix + "-ar",
-      "LINK":  toolchainprefix + "-g++",
-      "NM"  :  toolchainprefix + "-nm",
+      "CC.target"  :  toolchainprefix + "-gcc",
+      "CXX.target" :  toolchainprefix + "-g++",
+      "AR.target"  :  toolchainprefix + "-ar",
+      "LINK.target":  toolchainprefix + "-g++",
+      "NM.target"  :  toolchainprefix + "-nm",
     }
   return toolsOverride
 
@@ -413,6 +425,13 @@
             args.append(  k + "=" + v)
             if printToolOverrides:
               print k + " = " + v
+          if not os.path.isfile(toolsOverride['CC.target']):
+            if arch == 'arm':
+              print arm_cc_error
+            else:
+              print "Couldn't find compiler: %s" % toolsOverride['CC.target']
+            return 1
+
 
         print ' '.join(args)
         process = None
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index be09394..56d903e 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -20,6 +20,7 @@
 # ......pub
 # ......snapshots/
 # ........utils_wrapper.dart.snapshot
+# ........pub.dart.snapshot
 # ....include/
 # ......dart_api.h
 # ......dart_debugger_api.h
@@ -38,7 +39,7 @@
 # ......mirrors/
 # ......uri/
 # ......utf/
-# ......typeddata/
+# ......typed_data/
 # ....packages/
 # ......args/
 # ......intl/
@@ -53,7 +54,6 @@
 # ......dartanalyzer/
 # ........dartanalyzer.jar
 # ........(third-party libraries for dart_analyzer)
-# ......pub/
 # ......(more will come here)
 
 
@@ -79,8 +79,8 @@
   options = optparse.OptionParser(usage='usage: %prog [options]')
   options.add_option("--sdk_output_dir",
       help='Where to output the sdk')
-  options.add_option("--utils_snapshot_location",
-      help='Location of the utils snapshot.')
+  options.add_option("--snapshot_location",
+      help='Location of the snapshots.')
   return options.parse_args()
 
 
@@ -115,14 +115,16 @@
 
 
 def CopyDartScripts(home, sdk_root):
-  # TODO(dgrove) - add pub once issue 6619 is fixed
-  for executable in ['dart2js', 'dartanalyzer', 'dartdoc']:
+  for executable in ['dart2js', 'dartanalyzer', 'dartdoc', 'pub']:
     CopyShellScript(os.path.join(home, 'sdk', 'bin', executable),
                     os.path.join(sdk_root, 'bin'))
 
 
-def CopySnapshots(snapshot, sdk_root):
-  copyfile(snapshot, join(sdk_root, 'bin', 'snapshots', basename(snapshot)))
+def CopySnapshots(snapshots, sdk_root):
+  for snapshot in ['utils_wrapper', 'pub']:
+    snapshot += '.dart.snapshot'
+    copyfile(join(snapshots, snapshot),
+             join(sdk_root, 'bin', 'snapshots', snapshot))
 
 
 def Main(argv):
@@ -134,7 +136,7 @@
   SDK = options.sdk_output_dir
   SDK_tmp = '%s.tmp' % SDK
 
-  SNAPSHOT = options.utils_snapshot_location
+  SNAPSHOT = options.snapshot_location
 
   # TODO(dgrove) - deal with architectures that are not ia32.
 
@@ -184,11 +186,6 @@
   copyfile(dart_analyzer_src_binary, dart_analyzer_dest_binary)
   copymode(dart_analyzer_src_binary, dart_analyzer_dest_binary)
 
-  # Create pub shell script.
-  # TODO(dgrove) - delete this once issue 6619 is fixed
-  pub_src_script = join(HOME, 'utils', 'pub', 'sdk', 'pub')
-  CopyShellScript(pub_src_script, BIN)
-
   #
   # Create and populate sdk/include.
   #
@@ -212,21 +209,28 @@
 
   os.makedirs(join(LIB, 'html'))
 
-  for library in ['_internal',
+  for library in [join('_internal', 'compiler'),
+                  join('_internal', 'dartdoc'),
+                  join('_internal', 'pub', 'resource'),
                   'async', 'collection', '_collection_dev', 'core',
                   'crypto', 'io', 'isolate',
                   join('chrome', 'dart2js'), join('chrome', 'dartium'),
                   join('html', 'dart2js'), join('html', 'dartium'),
                   join('html', 'html_common'),
                   join('indexed_db', 'dart2js'), join('indexed_db', 'dartium'),
-                  'json', 'math', 'mirrors', 'typeddata',
+                  'json', 'math', 'mirrors', 'typed_data',
                   join('svg', 'dart2js'), join('svg', 'dartium'),
                   'uri', 'utf',
                   join('web_audio', 'dart2js'), join('web_audio', 'dartium'),
                   join('web_gl', 'dart2js'), join('web_gl', 'dartium'),
                   join('web_sql', 'dart2js'), join('web_sql', 'dartium')]:
     copytree(join(HOME, 'sdk', 'lib', library), join(LIB, library),
-             ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh'))
+             ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh',
+                                    '.gitignore'))
+
+  # Copy lib/_internal/libraries.dart.
+  copyfile(join(HOME, 'sdk', 'lib', '_internal', 'libraries.dart'),
+           join(LIB, '_internal', 'libraries.dart'))
 
   # Create and copy packages.
   PACKAGES = join(SDK_tmp, 'packages')
@@ -275,23 +279,12 @@
   for jarFile in jarFiles:
     copyfile(jarFile, join(DARTANALYZER_DEST, os.path.basename(jarFile)))
   
-  # Create and populate util/pub.
-  copytree(join(HOME, 'utils', 'pub'), join(UTIL, 'pub'),
-           ignore=ignore_patterns('.svn', 'sdk'))
-
   # Copy in 7zip for Windows.
   if HOST_OS == 'win32':
     copytree(join(HOME, 'third_party', '7zip'),
-             join(join(UTIL, 'pub'), '7zip'),
+             join(SDK_tmp, 'lib', '_internal', 'pub', 'resource', '7zip'),
              ignore=ignore_patterns('.svn'))
 
-  ReplaceInFiles([
-      join(UTIL, 'pub', 'io.dart'),
-    ], [
-      ("../../third_party/7zip/7za.exe",
-       "7zip/7za.exe"),
-    ])
-
   # Copy dart2js/dartdoc/pub.
   CopyDartScripts(HOME, SDK_tmp)
   CopySnapshots(SNAPSHOT, SDK_tmp)
diff --git a/tools/ddbg.dart b/tools/ddbg.dart
index 4174700..c81dd28 100644
--- a/tools/ddbg.dart
+++ b/tools/ddbg.dart
@@ -48,6 +48,7 @@
   gs <lib_id> <script_url> Get source text of script in library
   tok <lib_id> <script_url> Get line and token table of script in library
   epi <none|all|unhandled>  Set exception pause info
+  li List ids of all isolates in the VM
   i <id> Interrupt execution of given isolate id
   h   Print help
 """);
@@ -193,6 +194,9 @@
                 "params": { "isolateId" : isolate_id,
                             "exceptions": args[1] } };
     sendCmd(cmd).then((result) => handleGenericResponse(result));
+  } else if (command == "li") {
+    var cmd = { "id": seqNum, "command": "getIsolateIds" };
+    sendCmd(cmd).then((result) => handleGetIsolatesResponse(result));
   } else if (command == "i" && args.length == 2) {
     var cmd = { "id": seqNum,
                 "command": "interrupt",
@@ -337,6 +341,12 @@
 }
 
 
+handleGetIsolatesResponse(response) {
+  Map result = response["result"];
+  print("Isolates: ${result["isolateIds"]}");
+}
+
+
 void handleGetLibraryResponse(response) {
   Map result = response["result"];
   List libs = result["libraries"];
diff --git a/tools/dom/docs/docs.json b/tools/dom/docs/docs.json
index 4b67a76..dae8eca 100644
--- a/tools/dom/docs/docs.json
+++ b/tools/dom/docs/docs.json
@@ -536,7 +536,8 @@
           "   * Send the request with any given `data`.",
           "   *",
           "   * See also:",
-          "   * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send())",
+          "   *",
+          "   *   * [send](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send%28%29)",
           "   * from MDN.",
           "   */"
         ],
diff --git a/tools/dom/docs/lib/docs.dart b/tools/dom/docs/lib/docs.dart
index 8856b73..bdd9809 100644
--- a/tools/dom/docs/lib/docs.dart
+++ b/tools/dom/docs/lib/docs.dart
@@ -10,7 +10,7 @@
 
 library docs;
 
-import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart';
+import '../../../../sdk/lib/_internal/dartdoc/lib/src/dart2js_mirrors.dart';
 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart';
 import '../../../../sdk/lib/_internal/dartdoc/lib/dartdoc.dart';
 import '../../../../sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart';
@@ -180,7 +180,7 @@
 
   if (domNameMetadata != null) {
     var domNames = <String>[];
-    var tags = deprecatedFutureValue(domNameMetadata.getField('name'));
+    var tags = domNameMetadata.getField('name');
     for (var s in tags.reflectee.split(',')) {
       domNames.add(s.trim());
     }
diff --git a/tools/dom/idl/dart/dart.idl b/tools/dom/idl/dart/dart.idl
index def76c9c..39034c3 100644
--- a/tools/dom/idl/dart/dart.idl
+++ b/tools/dom/idl/dart/dart.idl
@@ -2,12 +2,30 @@
 
 [Supplemental,
  Constructor]
-interface AudioContext {};
+interface AudioContext {
+  // TODO(ager): Auto-generate this custom method when the info about retaining
+  // typed arrays is in the IDL.
+  [Custom] void decodeAudioData(ArrayBuffer audioData, AudioBufferCallback successCallback, AudioBufferCallback errorCallback);
+};
+
+[Supplemental]
+interface WaveShaperNode {
+  // TODO(ager): Auto-generate this custom method when the info about retaining
+  // typed arrays is in the IDL.
+  [CustomSetter] attribute Float32Array curve;
+};
+
+[Supplemental]
+interface AudioParam {
+  // TODO(ager): Auto-generate this custom method when the info about retaining
+  // typed arrays is in the IDL.
+  [Custom] void setValueCurveAtTime(Float32Array values, float time, float duration);
+};
 
 [Supplemental]
 interface Document {
-  [Suppressed] DOMObject getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height);
-  CanvasRenderingContext getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height);
+  [Suppressed] DOMObject getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
+  CanvasRenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
 };
 
 [Supplemental]
@@ -33,31 +51,31 @@
 
 [Supplemental]
 interface CanvasRenderingContext2D {
-  [DartName=createImageDataFromImageData] ImageData createImageData(in ImageData imagedata);
+  [DartName=createImageDataFromImageData] ImageData createImageData(ImageData imagedata);
 };
 
 [Supplemental]
 interface Console {
-  [Suppressed] void assert(in boolean condition);
+  [Suppressed] void assert(boolean condition);
   [CallWith=ScriptArguments|ScriptState] void assertCondition(boolean condition);
 };
 
 interface HTMLCanvasElement {
-  [Suppressed] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] in DOMString type);
-  [Custom] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] in DOMString type, [Optional] in float quality);
+  [Suppressed] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] DOMString type);
+  [Custom] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] DOMString type, optional float quality);
 
-  [Suppressed] any getContext(in DOMString contextId);
-  [Custom] CanvasRenderingContext getContext(in DOMString contextId, [Optional] in Dictionary attrs);
+  [Suppressed] any getContext(DOMString contextId);
+  [Custom] CanvasRenderingContext getContext(DOMString contextId, optional Dictionary attrs);
 };
 
 [Supplemental]
 interface HTMLOptionsCollection {
-  [Suppressed] void add([Optional] in HTMLOptionElement element, [Optional] in long before);
+  [Suppressed] void add(optional HTMLOptionElement element, optional long before);
 };
 
 [Supplemental]
 interface HTMLSelectElement {
-  [Suppressed] void add([Optional=DefaultIsUndefined] in HTMLElement element, [Optional=DefaultIsUndefined] in HTMLElement before);
+  [Suppressed] void add([Default=Undefined] HTMLElement element, [Default=Undefined] HTMLElement before);
   [Suppressed, Custom] void remove();
 };
 
@@ -94,34 +112,34 @@
 
 [Supplemental]
 interface WebGLContextEvent {
-  [Suppressed] void initEvent([Optional] in DOMString eventTypeArg,
-                              [Optional] in boolean canBubbleArg,
-                              [Optional] in boolean cancelableArg,
-                              [Optional] in DOMString statusMessageArg);
+  [Suppressed] void initEvent(optional DOMString eventTypeArg,
+                              optional boolean canBubbleArg,
+                              optional boolean cancelableArg,
+                              optional DOMString statusMessageArg);
 };
 
 [Supplemental]
 interface WebGLRenderingContext {
 
-  //void         compressedTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in unsigned long width, in unsigned long height, in long border, in unsigned long imageSize, const void* data);
-  //void         compressedTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in unsigned long width, in unsigned long height, in unsigned long format, in unsigned long imageSize, const void* data);
+  //void         compressedTexImage2D(unsigned long target, long level, unsigned long internalformat, unsigned long width, unsigned long height, long border, unsigned long imageSize, const void* data);
+  //void         compressedTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, unsigned long width, unsigned long height, unsigned long format, unsigned long imageSize, const void* data);
 
-  [Custom] any getBufferParameter(in unsigned long target, in unsigned long pname);
+  [Custom] any getBufferParameter(unsigned long target, unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getBufferParameter();
 
-  [Custom] any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname);
+  [Custom] any getFramebufferAttachmentParameter(unsigned long target, unsigned long attachment, unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getFramebufferAttachmentParameter();
 
-  [Custom] any getParameter(in unsigned long pname);
+  [Custom] any getParameter(unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getParameter();
 
-  [Custom] any getProgramParameter(in WebGLProgram program, in unsigned long pname);
+  [Custom] any getProgramParameter(WebGLProgram program, unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getProgramParameter();
 
-  [Custom] any getRenderbufferParameter(in unsigned long target, in unsigned long pname);
+  [Custom] any getRenderbufferParameter(unsigned long target, unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getRenderbufferParameter();
 
-  [Custom] any getShaderParameter(in WebGLShader shader, in unsigned long pname);
+  [Custom] any getShaderParameter(WebGLShader shader, unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getShaderParameter();
 
   // TBD
@@ -132,119 +150,61 @@
   [Custom] DOMString[] getSupportedExtensions();
   [Suppressed, StrictTypeChecking, Custom] void getSupportedExtensions();
 
-  [Custom] any getTexParameter(in unsigned long target, in unsigned long pname);
+  [Custom] any getTexParameter(unsigned long target, unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getTexParameter();
 
-  [Custom] any getUniform(in WebGLProgram program, in WebGLUniformLocation location);
+  [Custom] any getUniform(WebGLProgram program, WebGLUniformLocation location);
   [Suppressed, StrictTypeChecking, Custom] void getUniform();
 
-  [Custom] any getVertexAttrib(in unsigned long index, in unsigned long pname);
+  [Custom] any getVertexAttrib(unsigned long index, unsigned long pname);
   [Suppressed, StrictTypeChecking, Custom] void getVertexAttrib();
 };
 [Supplemental]
 interface CSSStyleDeclaration {
-  void setProperty(in DOMString propertyName, in DOMString value, [Optional] in DOMString priority);
-  [DartName=_getPropertyValue] DOMString getPropertyValue(in DOMString propertyName);
-};
-
-[Supplemental,
-  Constructor(in long length)]  // Add constructor signature.
-interface ArrayBuffer {
-};
-[Supplemental]
-interface Float32Array {
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-[Supplemental]
-interface Float64Array {
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-[Supplemental]
-interface Int16Array {
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-[Supplemental]
-interface Int32Array {
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-[Supplemental]
-interface Int8Array {
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-[Supplemental]
-interface Uint16Array {
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-[Supplemental]
-interface Uint32Array {
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-[Supplemental]
-interface Uint8Array {
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-
-[Supplemental]
-interface Uint8ClampedArray {
-  // Avoid 'overriding static member BYTES_PER_ELEMENT'.
-  [Suppressed] const long BYTES_PER_ELEMENT = 1;
-
-  [Suppressed] void set();
-  [DartName=setElements, Custom] void set(in any array, [Optional] in unsigned long offset);
-};
-
-[Supplemental,
-  Constructor(in ArrayBuffer buffer,
-              [Optional] in unsigned long byteOffset,
-              [Optional] in unsigned long byteLength)
-  ]
-interface DataView {
-  // Undo this:
-  // We have to use custom code because our code generator does not support int8_t type.
-  // int8_t getInt8(in unsigned long byteOffset);
-  // uint8_t getUint8(in unsigned long byteOffset);
-  [Suppressed] any getInt8();
-  [Suppressed] any getUint8();
-  [RaisesException] byte getInt8(in unsigned long byteOffset);
-  [RaisesException] octet getUint8(in unsigned long byteOffset);
-
-  // We have to use custom code because our code generator does not support uint8_t type.
-  // void setInt8(in unsigned long byteOffset, in int8_t value);
-  // void setUint8(in unsigned long byteOffset, in uint8_t value);
-  [Suppressed] void setInt8();
-  [Suppressed] void setUint8();
-  [RaisesException] void setInt8(in unsigned long byteOffset, in byte value);
-  [RaisesException] void setUint8(in unsigned long byteOffset, in octet value);
+  void setProperty(DOMString propertyName, DOMString value, [ForceOptional] optional DOMString priority);
+  [DartName=_getPropertyValue] DOMString getPropertyValue(DOMString propertyName);
 };
 
 // TODO(vsm): Define new names for these (see b/4436830).
 [Supplemental]
 interface IDBCursor {
-  [DartName=next] void continue([Optional] in any key);
+  [DartName=next, CallWith=ScriptExecutionContext, ImplementedAs=continueFunction, RaisesException] void continue([ForceOptional] optional any key);
+};
+[Supplemental]
+interface IDBIndex {
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest openCursor([ForceOptional] optional IDBKeyRange? range, [ForceOptional] optional DOMString direction);
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest openCursor(any key, [ForceOptional] optional DOMString direction);
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest openKeyCursor([ForceOptional] optional IDBKeyRange? range, [ForceOptional] optional DOMString  direction);
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest openKeyCursor(any key,
+    [ForceOptional] optional DOMString direction);
+
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest count([ForceOptional] optional IDBKeyRange? range);
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest count(any key);
 };
 [Supplemental]
 interface IDBDatabase {
   // These variants are slated for removal from WebKit.  Suppress to bring our
   // API in line with the most recent spec.
-  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in unsigned short mode);
-  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in unsigned short mode);
-  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in unsigned short mode);
+  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(DOMStringList storeNames, unsigned short mode);
+  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(DOMString[] storeNames, unsigned short mode);
+  [Suppressed, CallWith=ScriptExecutionContext] IDBTransaction transaction(DOMString storeName, unsigned short mode);
 };
 
 [Supplemental]
 interface IDBKeyRange {
-  [DartName=only_] static IDBKeyRange only(in any value);
-  [DartName=lowerBound_] static IDBKeyRange lowerBound(in any bound, [Optional] in boolean open);
-  [DartName=upperBound_] static IDBKeyRange upperBound(in any bound, [Optional] in boolean open);
-  [DartName=bound_] static IDBKeyRange bound(in any lower, in any upper, [Optional] in boolean lowerOpen, [Optional] in boolean upperOpen);
+  [DartName=only_] static IDBKeyRange only(any value);
+  [DartName=lowerBound_] static IDBKeyRange lowerBound(any bound, [ForceOptional] optional boolean open);
+  [DartName=upperBound_] static IDBKeyRange upperBound(any bound, [ForceOptional] optional boolean open);
+  [DartName=bound_] static IDBKeyRange bound(any lower, any upper, [ForceOptional] optional boolean lowerOpen, [ForceOptional] optional boolean upperOpen);
+};
+[Supplemental]
+interface IDBObjectStore {
+    [CallWith=ScriptState, RaisesException] IDBRequest put(any value, [ForceOptional] optional any key);
+    [CallWith=ScriptState, RaisesException] IDBRequest add(any value, [ForceOptional] optional any key);
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest openCursor([ForceOptional] optional IDBKeyRange? range, [ForceOptional] optional DOMString direction);
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest openCursor(any key, [ForceOptional] optional DOMString direction);
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest count([ForceOptional] optional IDBKeyRange? range);
+    [CallWith=ScriptExecutionContext, RaisesException] IDBRequest count(any key);
 };
 
 interface EntrySync {
@@ -256,8 +216,7 @@
 
 [Supplemental,
   CustomConstructor,
-  Constructor(in Array blobParts,
-              [Optional] in DOMString type, [Optional] in DOMString endings)
+  Constructor(Array blobParts, optional DOMString type, optional DOMString endings)
   ]
 interface Blob {
 };
@@ -280,7 +239,7 @@
 [
   Callback
 ] interface MutationCallback {
-  [Custom] boolean handleEvent(in MutationRecordArray mutations, in MutationObserver observer);
+  [Custom] boolean handleEvent(MutationRecordArray mutations, MutationObserver observer);
 };
 
 [Supplemental,
@@ -290,35 +249,35 @@
 interface MutationObserver {
   // Rename 'observe' so we can define a new 'observe' API that calls the
   // original.
-  [DartName=_observe] void observe(in Node target, in Dictionary options);
+  [DartName=_observe] void observe(Node target, Dictionary options);
 };
 
   [Supplemental,
     CustomConstructor,
     // Provide missing constructor signature.
-    Constructor([Optional] in HTMLFormElement form)]
+    Constructor(optional HTMLFormElement form)]
   interface DOMFormData {
-    [Suppressed] void append(in DOMString name, in DOMString value, in DOMString filename);
-    [Custom] void append(in DOMString name, in DOMString value);
-    [Custom] void append(in DOMString name, in Blob value, [Optional] in DOMString filename);
+    [Suppressed] void append(DOMString name, DOMString value, DOMString filename);
+    [Custom] void append(DOMString name, DOMString value);
+    [Custom] void append(DOMString name, Blob value, optional DOMString filename);
   };
 
 [Supplemental]
 interface SQLResultSetRowList {
   // Change the return type to Dictionary so that rows are exposed in the Dart
   // API as a Maps, with the appropriate conversion in JavaScript.
-  [Suppressed] any item(in unsigned long index);
-  [Custom] Dictionary item(in unsigned long index);
+  [Suppressed] any item(unsigned long index);
+  [Custom] Dictionary item(unsigned long index);
 };
 
 [Supplemental]
 interface WebSocket {
   // Suppress the default since it has non-standard return type and add
   // overrides.
-  [Suppressed] boolean send(in ArrayBuffer data);
-  [Suppressed] boolean send(in ArrayBufferView data);
-  [Suppressed] boolean send(in Blob data);
-  [Suppressed] boolean send(in DOMString data);
+  [Suppressed] boolean send(ArrayBuffer data);
+  [Suppressed] boolean send(ArrayBufferView data);
+  [Suppressed] boolean send(Blob data);
+  [Suppressed] boolean send(DOMString data);
 
   [Custom] void send(DOMString data);
   [Custom] void send(Blob data);
@@ -329,12 +288,12 @@
 [Supplemental]
 interface XMLHttpRequest {
    [Custom] void send();
-   [Custom] void send(in ArrayBuffer data); // FIXME: this should be eventually deprecated.
-   [Custom] void send(in ArrayBufferView data);
-   [Custom] void send(in Blob data);
-   [Custom] void send(in Document data);
-   [Custom] void send([StrictTypeChecking] in DOMString data);
-   [Custom] void send(in DOMFormData data);
+   [Custom] void send(ArrayBuffer data); // FIXME: this should be eventually deprecated.
+   [Custom] void send(ArrayBufferView data);
+   [Custom] void send(Blob data);
+   [Custom] void send(Document data);
+   [Custom] void send([StrictTypeChecking] DOMString data);
+   [Custom] void send(DOMFormData data);
 };
 
 
diff --git a/tools/dom/scripts/fremontcutbuilder.py b/tools/dom/scripts/fremontcutbuilder.py
index 27865fb..8f440da 100755
--- a/tools/dom/scripts/fremontcutbuilder.py
+++ b/tools/dom/scripts/fremontcutbuilder.py
@@ -17,9 +17,7 @@
     'ENABLE_CUSTOM_SCHEME_HANDLER',
     'ENABLE_ENCRYPTED_MEDIA_V2',
     'ENABLE_MEDIA_CAPTURE', # Only enabled on Android.
-    'ENABLE_MICRODATA',
     'ENABLE_ORIENTATION_EVENTS', # Only enabled on Android.
-    'ENABLE_PROXIMITY_EVENTS',
     'ENABLE_SPEECH_SYNTHESIS',
     'ENABLE_WEBVTT_REGIONS',
     'ENABLE_XHR_TIMEOUT',
@@ -28,13 +26,10 @@
 FEATURE_DEFINES = [
     'ENABLE_CALENDAR_PICKER',
     'ENABLE_CANVAS_PROXY',
-    'ENABLE_CSS_FILTERS',
     'ENABLE_CSS_REGIONS',
     'ENABLE_CUSTOM_ELEMENTS',
     'ENABLE_DATALIST_ELEMENT',
-    'ENABLE_DETAILS_ELEMENT',
     'ENABLE_DIALOG_ELEMENT',
-    'ENABLE_DIRECTORY_UPLOAD',
     'ENABLE_ENCRYPTED_MEDIA',
     'ENABLE_FONT_LOAD_EVENTS',
     'ENABLE_GAMEPAD',
@@ -44,19 +39,15 @@
     'ENABLE_NAVIGATOR_CONTENT_UTILS',
     'ENABLE_NOTIFICATIONS',
     'ENABLE_PAGE_POPUP',
-    'ENABLE_SCRIPTED_SPEECH',
     'ENABLE_SHARED_WORKERS',
     'ENABLE_SVG',
     'ENABLE_SVG_FONTS',
-    'ENABLE_TOUCH_EVENTS',
     'ENABLE_VIDEO',
-    'ENABLE_VIDEO_TRACK',
     'ENABLE_WEB_AUDIO',
     'ENABLE_WEBGL',
-    'ENABLE_XSLT',
 ]
 
-def build_database(idl_files, database_dir, parallel=False):
+def build_database(idl_files, database_dir, feature_defines=None, parallel=False):
   """This code reconstructs the FremontCut IDL database from W3C,
   WebKit and Dart IDL files."""
   current_dir = os.path.dirname(__file__)
@@ -77,10 +68,13 @@
   # generation.  We need to recheck this periodically for now.
   webkit_defines = [ 'LANGUAGE_DART', 'LANGUAGE_JAVASCRIPT' ]
 
+  if feature_defines is None:
+    feature_defines = FEATURE_DEFINES
+
   webkit_options = databasebuilder.DatabaseBuilderOptions(
       idl_syntax=idlparser.WEBKIT_SYNTAX,
       # TODO(vsm): What else should we define as on when processing IDL?
-      idl_defines=webkit_defines + FEATURE_DEFINES,
+      idl_defines=webkit_defines + feature_defines,
       source='WebKit',
       source_attributes={'revision': webkit_revision})
 
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index 74da08d9..4ace8f6 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -11,7 +11,8 @@
 import monitored
 import os
 import re
-from htmlrenamer import html_interface_renames, renamed_html_members
+from htmlrenamer import html_interface_renames, renamed_html_members, \
+     typed_array_renames
 
 # Set up json file for retrieving comments.
 _current_dir = os.path.dirname(__file__)
@@ -35,30 +36,20 @@
     'SVGTransformable',
     'SVGURIReference',
     'SVGZoomAndPan',
-    'TimeoutHandler'])
+    'TimeoutHandler',
+    ])
 
 def IsPureInterface(interface_name):
   return interface_name in _pure_interfaces
 
+_custom_types = monitored.Set('generator._custom_types',
+                              typed_array_renames.keys())
+
+def IsCustomType(interface_name):
+  return interface_name in _custom_types
 
 _methods_with_named_formals = monitored.Set(
     'generator._methods_with_named_formals', [
-  'DataView.getFloat32',
-  'DataView.getFloat64',
-  'DataView.getInt16',
-  'DataView.getInt32',
-  'DataView.getInt8',
-  'DataView.getUint16',
-  'DataView.getUint32',
-  'DataView.getUint8',
-  'DataView.setFloat32',
-  'DataView.setFloat64',
-  'DataView.setInt16',
-  'DataView.setInt32',
-  'DataView.setInt8',
-  'DataView.setUint16',
-  'DataView.setUint32',
-  'DataView.setUint8',
   'DirectoryEntry.getDirectory',
   'DirectoryEntry.getFile',
   'Entry.copyTo',
@@ -79,15 +70,6 @@
 # factory provider.
 #
 interface_factories = monitored.Dict('generator.interface_factories', {
-    'Float32Array': '_TypedArrayFactoryProvider',
-    'Float64Array': '_TypedArrayFactoryProvider',
-    'Int8Array': '_TypedArrayFactoryProvider',
-    'Int16Array': '_TypedArrayFactoryProvider',
-    'Int32Array': '_TypedArrayFactoryProvider',
-    'Uint8Array': '_TypedArrayFactoryProvider',
-    'Uint8ClampedArray': '_TypedArrayFactoryProvider',
-    'Uint16Array': '_TypedArrayFactoryProvider',
-    'Uint32Array': '_TypedArrayFactoryProvider',
 })
 
 #
@@ -95,12 +77,22 @@
 #
 _dart2js_dom_custom_native_specs = monitored.Dict(
       'generator._dart2js_dom_custom_native_specs', {
-    # Decorate the singleton Console object, if present (workers do not have a
-    # console).
-    'Console': "=(typeof console == 'undefined' ? {} : console)",
 
-    # DOMWindow aliased with global scope.
-    'Window': '@*DOMWindow',
+    # Nodes with different tags in different browsers can be listed as multiple
+    # tags here provided there is not conflict in usage (e.g. browser X has tag
+    # T and no other browser has tag T).
+
+    'DOMApplicationCache':
+        'ApplicationCache,DOMApplicationCache,OfflineResourceList',
+
+    'MutationObserver': 'MutationObserver,WebKitMutationObserver',
+
+    'NodeList': 'NodeList,RadioNodeList',
+
+    'TransitionEvent': 'TransitionEvent,WebKitTransitionEvent',
+
+    'WheelEvent': 'WheelEvent,MouseWheelEvent,MouseScrollEvent',
+
 }, dart2jsOnly=True)
 
 def IsRegisteredType(type_name):
@@ -112,7 +104,7 @@
   else:
     # Make the class 'hidden' so it is dynamically patched at runtime.  This
     # is useful for browser compat.
-    return '*' + javascript_binding_name
+    return javascript_binding_name
 
 
 def MatchSourceFilter(thing):
@@ -151,12 +143,14 @@
 def _BuildArguments(args, interface, constructor=False):
   def IsOptional(argument):
     if 'Callback' in argument.ext_attrs:
-      # Callbacks with 'Optional=XXX' are treated as optional arguments.
-      return 'Optional' in argument.ext_attrs
+      # Optional callbacks arguments are treated as optional arguments.
+      return argument.optional
     if constructor:
-      # FIXME: Constructors with 'Optional=XXX' shouldn't be treated as
+      # FIXME: Optional constructors arguments should not be treated as
       # optional arguments.
-      return 'Optional' in argument.ext_attrs
+      return argument.optional
+    if 'ForceOptional' in argument.ext_attrs:
+      return True
     return False
 
   # Given a list of overloaded arguments, choose a suitable name.
@@ -190,8 +184,8 @@
   return result
 
 def IsOptional(argument):
-  return ('Optional' in argument.ext_attrs and
-          argument.ext_attrs['Optional'] == None)
+  return argument.optional and ('Default' not in argument.ext_attrs)\
+      or 'ForceOptional' in argument.ext_attrs
 
 def AnalyzeOperation(interface, operations):
   """Makes operation calling convention decision for a set of overloads.
@@ -393,11 +387,11 @@
     else:
       # TODO(antonm): temporary ugly hack.
       # While in transition phase we allow both DOM's ArrayBuffer
-      # and dart:typeddata's ByteBuffer for IDLs' ArrayBuffers,
+      # and dart:typed_data's ByteBuffer for IDLs' ArrayBuffers,
       # hence ArrayBuffer is mapped to dynamic in arguments and return
       # values.  To compensate for that when generating ArrayBuffer itself,
       # we need to lie a bit:
-      if self.type_name == 'ArrayBuffer': return 'ArrayBuffer'
+      if self.type_name == 'ArrayBuffer': return 'ByteBuffer'
       return rename_type(self.type_name)
 
 def ConstantOutputOrder(a, b):
@@ -551,14 +545,9 @@
 
 dart2js_annotations = monitored.Dict('generator.dart2js_annotations', {
 
-    'ArrayBuffer': [
-      "@Creates('ArrayBuffer')",
-      "@Returns('ArrayBuffer|Null')",
-    ],
-
     'ArrayBufferView': [
-      "@Creates('ArrayBufferView')",
-      "@Returns('ArrayBufferView|Null')",
+      "@Creates('TypedData')",
+      "@Returns('TypedData|Null')",
     ],
 
     'CanvasRenderingContext2D.createImageData': [
@@ -618,7 +607,7 @@
       "@Returns('Element|Document')",
     ],
 
-    'FileReader.result': ["@Creates('String|ArrayBuffer|Null')"],
+    'FileReader.result': ["@Creates('String|ByteBuffer|Null')"],
 
     # Rather than have the result of an IDBRequest as a union over all possible
     # results, we mark the result as instantiating any classes, and mark
@@ -687,14 +676,14 @@
     'WebGLRenderingContext.getParameter': [
       # Taken from http://www.khronos.org/registry/webgl/specs/latest/
       # Section 5.14.3 Setting and getting state
-      "@Creates('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array"
+      "@Creates('Null|num|String|bool|=List|Float32List|Int32List|Uint32List"
                 "|Framebuffer|Renderbuffer|Texture')",
-      "@Returns('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array"
+      "@Returns('Null|num|String|bool|=List|Float32List|Int32List|Uint32List"
                 "|Framebuffer|Renderbuffer|Texture')",
     ],
 
     'XMLHttpRequest.response': [
-      "@Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')",
+      "@Creates('ByteBuffer|Blob|Document|=Object|=List|String|num')",
     ],
 }, dart2jsOnly=True)
 
@@ -771,8 +760,6 @@
 #   INTERFACE:     annotations to be added to the interface declaration
 #   INTERFACE.MEMBER: annotation to be added to the member declaration
 dart_annotations = monitored.Dict('generator.dart_annotations', {
-  'ArrayBuffer': _all_but_ie9_annotations,
-  'ArrayBufferView': _all_but_ie9_annotations,
   'CSSHostRule': _shadow_dom_annotations,
   'Crypto': _webkit_experimental_annotations,
   'Database': _web_sql_annotations,
@@ -1035,9 +1022,6 @@
   def list_item_type(self):
     raise NotImplementedError()
 
-  def is_typed_array(self):
-    raise NotImplementedError()
-
   def merged_interface(self):
     return None
 
@@ -1164,9 +1148,6 @@
   def list_item_type(self):
     return self._data.item_type
 
-  def is_typed_array(self):
-    return self._data.is_typed_array
-
   def merged_interface(self):
     # All constants, attributes, and operations of merged interface should be
     # added to this interface. Merged idl interface does not have corresponding
@@ -1329,6 +1310,38 @@
     return name if interface_name.endswith('List') else '%s->propertyReference()' % name
 
 
+class TypedListIDLTypeInfo(InterfaceIDLTypeInfo):
+  def __init__(self, idl_type, data, interface_name, type_registry):
+    super(TypedListIDLTypeInfo, self).__init__(
+        idl_type, data, interface_name, type_registry)
+
+  def conversion_includes(self):
+    return [ '"wtf/%s.h"' % self._idl_type ]
+
+  def to_dart_conversion(self, value, interface_name, attributes):
+    return 'DartUtilities::arrayBufferViewToDart(%s)' % value
+
+  def to_native_info(self, idl_node, interface_name):
+    return '%s.get()', 'RefPtr<%s>' % self._idl_type, 'DartUtilities', 'dartTo%s' % self._idl_type
+
+
+class BasicTypedListIDLTypeInfo(InterfaceIDLTypeInfo):
+  def __init__(self, idl_type, data, interface_name, type_registry):
+    super(BasicTypedListIDLTypeInfo, self).__init__(
+        idl_type, data, interface_name, type_registry)
+
+  def conversion_includes(self):
+    return []
+
+  def to_dart_conversion(self, value, interface_name, attributes):
+    function_name = 'DartUtilities::%sToDart' % self._idl_type
+    function_name = function_name[0].lower() + function_name[1:]
+    return '%s(%s)' % (function_name, value)
+
+  def to_native_info(self, idl_node, interface_name):
+    return '%s.get()', 'RefPtr<%s>' % self._idl_type, 'DartUtilities', 'dartTo%s' % self._idl_type
+
+
 class TypeData(object):
   def __init__(self, clazz, dart_type=None, native_type=None,
                merged_interface=None, merged_into=None,
@@ -1336,7 +1349,7 @@
                conversion_includes=None,
                webcore_getter_name='getAttribute',
                webcore_setter_name='setAttribute',
-               item_type=None, suppress_interface=False, is_typed_array=False):
+               item_type=None, suppress_interface=False):
     self.clazz = clazz
     self.dart_type = dart_type
     self.native_type = native_type
@@ -1349,25 +1362,19 @@
     self.webcore_setter_name = webcore_setter_name
     self.item_type = item_type
     self.suppress_interface = suppress_interface
-    self.is_typed_array = is_typed_array
 
 
-def TypedArrayTypeData(item_type):
+def TypedListTypeData(item_type):
   return TypeData(
-      clazz='Interface',
-      dart_type='List<%s>' % item_type, # TODO(antonm): proper typeddata interfaces.
-      item_type=item_type,
-      # TODO(antonm): should be autogenerated. Let the dust settle down.
-      custom_to_dart=True, custom_to_native=True,
-      is_typed_array=True)
+      clazz='TypedList',
+      dart_type='List<%s>' % item_type, # TODO(antonm): proper typed_data interfaces.
+      item_type=item_type)
 
 
 _idl_type_registry = monitored.Dict('generator._idl_type_registry', {
     'boolean': TypeData(clazz='Primitive', dart_type='bool', native_type='bool',
                         webcore_getter_name='hasAttribute',
                         webcore_setter_name='setBooleanAttribute'),
-    'byte': TypeData(clazz='Primitive', dart_type='int', native_type='int'),
-    'octet': TypeData(clazz='Primitive', dart_type='int', native_type='int'),
     'short': TypeData(clazz='Primitive', dart_type='int', native_type='int'),
     'unsigned short': TypeData(clazz='Primitive', dart_type='int',
         native_type='int'),
@@ -1462,24 +1469,18 @@
     'TextTrackList': TypeData(clazz='Interface', item_type='TextTrack'),
     'TouchList': TypeData(clazz='Interface', item_type='Touch'),
 
-    'Float32Array': TypedArrayTypeData('double'),
-    'Float64Array': TypedArrayTypeData('double'),
-    'Int8Array': TypedArrayTypeData('int'),
-    'Int16Array': TypedArrayTypeData('int'),
-    'Int32Array': TypedArrayTypeData('int'),
-    'Uint8Array': TypedArrayTypeData('int'),
-    'Uint8ClampedArray': TypedArrayTypeData('int'),
-    'Uint16Array': TypedArrayTypeData('int'),
-    'Uint32Array': TypedArrayTypeData('int'),
-    # TODO(antonm): temporary ugly hack.
-    # While in transition phase we allow both DOM's ArrayBuffer
-    # and dart:typeddata's ByteBuffer for IDLs' ArrayBuffers,
-    # hence ArrayBuffer is mapped to dynamic in arguments and return
-    # values.
-    'ArrayBufferView': TypeData(clazz='Interface', dart_type='dynamic',
-        custom_to_native=True, custom_to_dart=True),
-    'ArrayBuffer': TypeData(clazz='Interface', dart_type='dynamic',
-        custom_to_native=True, custom_to_dart=True),
+    'Float32Array': TypedListTypeData('double'),
+    'Float64Array': TypedListTypeData('double'),
+    'Int8Array': TypedListTypeData('int'),
+    'Int16Array': TypedListTypeData('int'),
+    'Int32Array': TypedListTypeData('int'),
+    'Uint8Array': TypedListTypeData('int'),
+    'Uint8ClampedArray': TypedListTypeData('int'),
+    'Uint16Array': TypedListTypeData('int'),
+    'Uint32Array': TypedListTypeData('int'),
+
+    'ArrayBufferView': TypeData(clazz='BasicTypedList'),
+    'ArrayBuffer': TypeData(clazz='BasicTypedList'),
 
     'SVGAngle': TypeData(clazz='SVGTearOff'),
     'SVGLength': TypeData(clazz='SVGTearOff'),
@@ -1564,5 +1565,17 @@
       return SVGTearOffIDLTypeInfo(
           type_name, type_data, dart_interface_name, self)
 
+    if type_data.clazz == 'TypedList':
+      dart_interface_name = self._renamer.RenameInterface(
+          self._database.GetInterface(type_name))
+      return TypedListIDLTypeInfo(
+          type_name, type_data, dart_interface_name, self)
+
+    if type_data.clazz == 'BasicTypedList':
+      dart_interface_name = self._renamer.RenameInterface(
+          self._database.GetInterface(type_name))
+      return BasicTypedListIDLTypeInfo(
+          type_name, type_data, dart_interface_name, self)
+
     class_name = '%sIDLTypeInfo' % type_data.clazz
     return globals()[class_name](type_name, type_data)
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index 393d7b4..8c26992 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -234,25 +234,6 @@
         argument = signatures[signature_index][i]
         parameter_name = parameter_names[i]
         test_type = self._DartType(argument.type.id)
-        # TODO(antonm): temporary ugly hack to be able to work with existing
-        # typed array types as well as dart:typeddata types until
-        # the transition to dart:typeddata is complete for both dart2js
-        # and dartium.
-        from systemnative import DartiumBackend
-        if isinstance(self, DartiumBackend):
-          if argument.type.id == 'ArrayBufferView':
-            checks.append(
-                '(%(name)s is ArrayBufferView '
-                '|| %(name)s is _typeddata.TypedData '
-                '|| %(name)s == null)' % {'name': parameter_name})
-            continue
-          if argument.type.id == 'ArrayBuffer':
-            checks.append(
-                '(%(name)s is ArrayBuffer '
-                '|| %(name)s is _typeddata.ByteBuffer '
-                '|| %(name)s == null)' % {'name': parameter_name})
-            continue
-        # end of ugly hack.
         if test_type in ['dynamic', 'Object']:
           checks.append('?%s' % parameter_name)
         elif not can_omit_type_check(test_type, i):
@@ -301,7 +282,7 @@
           check = '?%s' % parameter_names[argument_position]
           # argument_count instead of argument_position + 1 is used here to cover one
           # complicated case with the effectively optional argument in the middle.
-          # Consider foo(x, [Optional] y, [Optional=DefaultIsNullString] z)
+          # Consider foo(x, optional y, [Default=NullString] optional z)
           # (as of now it's modelled after HTMLMediaElement.webkitAddKey).
           # y is optional in WebCore, while z is not.
           # In this case, if y was actually passed, we'd like to emit foo(x, y, z) invocation,
@@ -339,10 +320,7 @@
   def AdditionalImplementedInterfaces(self):
     # TODO: Include all implemented interfaces, including other Lists.
     implements = []
-    if self._interface_type_info.is_typed_array():
-      element_type = self._interface_type_info.list_item_type()
-      implements.append('List<%s>' % element_type)
-    elif self._interface_type_info.list_item_type():
+    if self._interface_type_info.list_item_type():
       item_type_info = self._type_registry.TypeInfo(
           self._interface_type_info.list_item_type())
       implements.append('List<%s>' % item_type_info.dart_type())
@@ -362,41 +340,6 @@
       self._AddConstructor(
           constructor_info, factory_name, factory_constructor_name)
 
-    typed_array_type = None
-    for interface in self._database.Hierarchy(self._interface):
-      type_info = self._type_registry.TypeInfo(interface.id)
-      if type_info.is_typed_array():
-        typed_array_type = type_info.list_item_type()
-        break
-
-    annotations = FormatAnnotationsAndComments(
-        GetAnnotationsAndComments(self._library_name, self._interface.id,
-                                  self._interface.id), '  ')
-
-    fromListAnnotations = FormatAnnotationsAndComments(
-        GetAnnotationsAndComments(self._library_name, self._interface.id,
-                                  'fromList'), '  ')
-
-    fromBufferAnnotations = FormatAnnotationsAndComments(
-        GetAnnotationsAndComments(self._library_name, self._interface.id,
-                                  'fromBuffer'), '  ')
-
-    if typed_array_type:
-      self._members_emitter.Emit(
-          '\n  $(ANNOTATIONS)factory $CTOR(int length) =>\n'
-          '    $FACTORY.create$(CTOR)(length);\n'
-          '\n  $(LIST_ANNOTATIONS)factory $CTOR.fromList(List<$TYPE> list) =>\n'
-          '    $FACTORY.create$(CTOR)_fromList(list);\n'
-          '\n  $(BUFFER_ANNOTATIONS)factory $CTOR.fromBuffer(ArrayBuffer buffer, '
-              '[int byteOffset, int length]) => \n'
-          '    $FACTORY.create$(CTOR)_fromBuffer(buffer, byteOffset, length);\n',
-        CTOR=self._interface.id,
-        ANNOTATIONS=annotations,
-        LIST_ANNOTATIONS=fromListAnnotations,
-        BUFFER_ANNOTATIONS=fromBufferAnnotations,
-        TYPE=self._DartType(typed_array_type),
-        FACTORY=factory_name)
-
   def _AddConstructor(self,
       constructor_info, factory_name, factory_constructor_name):
     if self.GenerateCustomFactory(constructor_info):
@@ -586,6 +529,7 @@
     has_clear = any(op.id == 'clear' for op in self._interface.operations)
     has_length = False
     has_length_setter = False
+
     for attr in self._interface.attributes:
       if attr.id == 'length':
         has_length = True
diff --git a/tools/dom/scripts/htmlrenamer.py b/tools/dom/scripts/htmlrenamer.py
index 998cbed..86b20b6 100644
--- a/tools/dom/scripts/htmlrenamer.py
+++ b/tools/dom/scripts/htmlrenamer.py
@@ -6,7 +6,23 @@
 import monitored
 import re
 
-html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames', {
+typed_array_renames = {
+    'ArrayBuffer': 'ByteBuffer',
+    'ArrayBufferView': 'TypedData',
+    'DataView': 'ByteData',
+    'Float32Array': 'Float32List',
+    'Float64Array': 'Float64List',
+    'Int8Array': 'Int8List',
+    'Int16Array': 'Int16List',
+    'Int32Array': 'Int32List',
+    'Uint8Array': 'Uint8List',
+    'Uint8ClampedArray': 'Uint8ClampedList',
+    'Uint16Array': 'Uint16List',
+    'Uint32Array': 'Uint32List',
+}
+
+html_interface_renames = monitored.Dict('htmlrenamer.html_interface_renames',
+                                        dict({
     'CDATASection': 'CDataSection',
     'Clipboard': 'DataTransfer',
     'Database': 'SqlDatabase', # Avoid conflict with Index DB's Database.
@@ -50,7 +66,7 @@
     'XMLHttpRequestException': 'HttpRequestException',
     'XMLHttpRequestProgressEvent': 'HttpRequestProgressEvent',
     'XMLHttpRequestUpload': 'HttpRequestUpload',
-})
+}, **typed_array_renames))
 
 # Interfaces that are suppressed, but need to still exist for Dartium and to
 # properly wrap DOM objects if/when encountered.
@@ -60,6 +76,7 @@
   'Counter',
   'DOMFileSystemSync', # Workers
   'DatabaseSync', # Workers
+  'DataView', # Typed arrays
   'DedicatedWorkerContext', # Workers
   'DirectoryEntrySync', # Workers
   'DirectoryReaderSync', # Workers
@@ -76,6 +93,7 @@
   'HTMLMarqueeElement',
   'IDBAny',
   'RGBColor',
+  'RadioNodeList',  # Folded onto NodeList in dart2js.
   'Rect',
   'SQLTransactionSync', # Workers
   'SQLTransactionSyncCallback', # Workers
@@ -326,8 +344,8 @@
     'StorageInfo.queryUsageAndQuota': '_queryUsageAndQuota',
     'SVGElement.className': '$dom_svgClassName',
     'SVGStopElement.offset': 'gradientOffset',
-    #'WorkerContext.webkitRequestFileSystem': '_requestFileSystem', # Workers
-    #'WorkerContext.webkitRequestFileSystemSync': '_requestFileSystemSync', # Workers
+    #'WorkerContext.webkitRequestFileSystem': '_requestFileSystem',
+    #'WorkerContext.webkitRequestFileSystemSync': '_requestFileSystemSync',
 })
 
 for member in convert_to_future_members:
@@ -574,24 +592,12 @@
     'MouseEvent.x',
     'MouseEvent.y',
     'Node.compareDocumentPosition',
-    'Node.get:ATTRIBUTE_NODE',
-    'Node.get:CDATA_SECTION_NODE',
-    'Node.get:COMMENT_NODE',
-    'Node.get:DOCUMENT_FRAGMENT_NODE',
-    'Node.get:DOCUMENT_NODE',
     'Node.get:DOCUMENT_POSITION_CONTAINED_BY',
     'Node.get:DOCUMENT_POSITION_CONTAINS',
     'Node.get:DOCUMENT_POSITION_DISCONNECTED',
     'Node.get:DOCUMENT_POSITION_FOLLOWING',
     'Node.get:DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
     'Node.get:DOCUMENT_POSITION_PRECEDING',
-    'Node.get:DOCUMENT_TYPE_NODE',
-    'Node.get:ELEMENT_NODE',
-    'Node.get:ENTITY_NODE',
-    'Node.get:ENTITY_REFERENCE_NODE',
-    'Node.get:NOTATION_NODE',
-    'Node.get:PROCESSING_INSTRUCTION_NODE',
-    'Node.get:TEXT_NODE',
     'Node.get:baseURI',
     'Node.get:nodeName',
     'Node.get:prefix',
@@ -720,6 +726,9 @@
       if 'WEBGL' in interface.ext_attrs['Conditional']:
         return 'web_gl'
 
+    if interface.id in typed_array_renames:
+      return 'typed_data'
+
     return 'html'
 
   def DartifyTypeName(self, type_name):
diff --git a/tools/dom/scripts/idlnode.py b/tools/dom/scripts/idlnode.py
index 953d274..60a6ef7 100755
--- a/tools/dom/scripts/idlnode.py
+++ b/tools/dom/scripts/idlnode.py
@@ -308,7 +308,7 @@
 
       func_value = self._find_first(value, 'ExtAttrFunctionValue')
       if func_value:
-        # E.g. NamedConstructor=Audio(in [Optional] DOMString src)
+        # E.g. NamedConstructor=Audio(optional DOMString src)
         self[name] = IDLExtAttrFunctionValue(
             func_value,
             self._find_first(func_value, 'ExtAttrArgList'))
@@ -497,6 +497,7 @@
   def __init__(self, ast):
     IDLNode.__init__(self, ast)
     self.type = self._convert_first(ast, 'Type', IDLType)
+    self.optional = self._has(ast, 'Optional')
     self._convert_ext_attrs(ast)
 
   def __repr__(self):
diff --git a/tools/dom/scripts/idlparser.py b/tools/dom/scripts/idlparser.py
index 637d7d4..194bf4a 100755
--- a/tools/dom/scripts/idlparser.py
+++ b/tools/dom/scripts/idlparser.py
@@ -234,8 +234,7 @@
         [MAYBE(ExtAttrs), MAYBE(Optional), MAYBE('in'),
          MAYBE(Optional), Type, MAYBE(AnEllipsis), Id],
         # WebKit:
-        [MAYBE(Optional), MAYBE('in'), MAYBE(Optional),
-         MAYBE(ExtAttrs), Type, Id])
+        [MAYBE(ExtAttrs), MAYBE(Optional), Type, Id])
 
     def Optional():
       return 'optional'
diff --git a/tools/dom/scripts/idlrenderer.py b/tools/dom/scripts/idlrenderer.py
index 3eda1d9..7c5d634 100755
--- a/tools/dom/scripts/idlrenderer.py
+++ b/tools/dom/scripts/idlrenderer.py
@@ -177,7 +177,8 @@
       wln(';')
     elif isinstance(node, IDLArgument):
       wsp(node.ext_attrs)
-      w('in ')
+      if (node.optional):
+        w('optional ')
       w('%s %s' % (node.type.id, node.id))
     else:
       raise TypeError("Expected str or IDLNode but %s found" %
diff --git a/tools/dom/scripts/idlsync.py b/tools/dom/scripts/idlsync.py
index 50af305..e2a7753 100755
--- a/tools/dom/scripts/idlsync.py
+++ b/tools/dom/scripts/idlsync.py
@@ -30,7 +30,7 @@
 # WebKit / WebCore info.
 WEBKIT_URL_PATTERN = r'"dartium_webkit_trunk": "(\S+)",'
 WEBKIT_REV_PATTERN = r'"dartium_webkit_revision": "(\d+)",'
-WEBCORE_SUBPATH = 'Source/WebCore'
+WEBCORE_SUBPATH = 'Source/core'
 MODULES_SUBPATH = 'Source/modules'
 LOCAL_WEBKIT_IDL_PATH = os.path.join(DART_PATH, 'third_party', 'WebCore')
 LOCAL_WEBKIT_README = """\
@@ -88,7 +88,8 @@
     # (component, remote subpath, local path, local readme file, depth)
 
     # WebKit IDL.
-    ('webkit', WEBCORE_SUBPATH, LOCAL_WEBKIT_IDL_PATH, LOCAL_WEBKIT_README,
+    ('webkit', WEBCORE_SUBPATH, os.path.join(LOCAL_WEBKIT_IDL_PATH, 'core'), LOCAL_WEBKIT_README,
+
      DEPTH_INFINITY),
     ('webkit', MODULES_SUBPATH, os.path.join(LOCAL_WEBKIT_IDL_PATH, 'modules'), LOCAL_WEBKIT_README,
      DEPTH_INFINITY),
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index b36ddcb..d6fa18a 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -12,11 +12,10 @@
 from generator import *
 from htmldartgenerator import *
 
-HTML_LIBRARY_NAMES = ['chrome', 'html', 'indexed_db', 'svg', 'web_audio',
-                      'web_gl', 'web_sql']
+HTML_LIBRARY_NAMES = ['chrome', 'html', 'indexed_db', 'svg',
+                      'web_audio', 'web_gl', 'web_sql']
 
 _js_custom_members = monitored.Set('systemhtml._js_custom_members', [
-    'ArrayBuffer.slice',
     'AudioBufferSourceNode.start',
     'AudioBufferSourceNode.stop',
     'AudioContext.createGain',
@@ -264,6 +263,7 @@
   'html': _html_element_constructors,
   'indexed_db': {},
   'svg': _svg_element_constructors,
+  'typed_data': {},
   'web_audio': {},
   'web_gl': {},
   'web_sql': {},
@@ -282,6 +282,10 @@
     'provider_name': '_SvgElementFactoryProvider',
     'constructor_name': 'createSvgElement_tag',
   },
+  'typed_data': {
+      'provider_name': 'document',
+      'constructor_name': '$dom_createElement'
+  },
   'web_audio': {
     'provider_name': 'document',
     'constructor_name': '$dom_createElement'
@@ -424,7 +428,9 @@
     self._library_name = self._renamer.GetLibraryName(self._interface)
 
   def Generate(self):
-    if 'Callback' in self._interface.ext_attrs:
+    if IsCustomType(self._interface.id):
+      pass
+    elif 'Callback' in self._interface.ext_attrs:
       self.GenerateCallback()
     else:
       self.GenerateInterface()
@@ -645,7 +651,7 @@
     return self._interface.doc_js_name in _js_custom_constructors
 
   def IsConstructorArgumentOptional(self, argument):
-    return 'Optional' in argument.ext_attrs
+    return argument.optional
 
   def EmitStaticFactoryOverload(self, constructor_info, name, arguments):
     index = len(arguments)
@@ -988,7 +994,7 @@
         parameter_names,
         declaration,
         GenerateCall,
-        self._IsOptional,
+        lambda _, argument: IsOptional(argument),
         can_omit_type_check=lambda type, pos: type == parameter_types[pos])
 
   def _AddInterfaceOperation(self, info, html_name):
@@ -999,9 +1005,6 @@
         NAME=info.name,
         PARAMS=info.ParametersDeclaration(self._NarrowInputType))
 
-  def _IsOptional(self, operation, argument):
-    return IsOptional(argument)
-
 
   def _OperationRequiresConversions(self, operation):
     return (self._OperationRequiresOutputConversion(operation) or
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py
index a8672db..fc27037 100644
--- a/tools/dom/scripts/systemnative.py
+++ b/tools/dom/scripts/systemnative.py
@@ -10,6 +10,7 @@
 import os
 from generator import *
 from htmldartgenerator import *
+from idlnode import IDLArgument
 from systemhtml import js_support_checks, GetCallbackInfo, HTML_LIBRARY_NAMES
 
 class DartiumBackend(HtmlDartGenerator):
@@ -35,7 +36,7 @@
     return {}
 
   def GenerateCallback(self, info):
-    if IsPureInterface(self._interface.id):
+    if IsPureInterface(self._interface.id) or IsCustomType(self._interface.id):
       return
 
     cpp_impl_includes = set()
@@ -115,7 +116,7 @@
 
   def StartInterface(self, members_emitter):
     # Create emitters for c++ implementation.
-    if not IsPureInterface(self._interface.id):
+    if not IsPureInterface(self._interface.id) and not IsCustomType(self._interface.id):
       self._cpp_header_emitter = self._cpp_library_emitter.CreateHeaderEmitter(
           self._interface.id,
           self._renamer.GetLibraryName(self._interface))
@@ -260,16 +261,28 @@
   def _GenerateCPPHeader(self):
     to_native_emitter = emitter.Emitter()
     if self._interface_type_info.custom_to_native():
-      to_native_emitter.Emit(
-          '    static PassRefPtr<NativeType> toNative(Dart_Handle handle, Dart_Handle& exception);\n')
+      return_type = 'PassRefPtr<NativeType>'
+      to_native_body = ';'
     else:
-      to_native_emitter.Emit(
-          '    static NativeType* toNative(Dart_Handle handle, Dart_Handle& exception)\n'
+      return_type = 'NativeType*'
+      to_native_body = emitter.Format(
+          '\n'
           '    {\n'
           '        return DartDOMWrapper::unwrapDartWrapper<Dart$INTERFACE>(handle, exception);\n'
-          '    }\n',
+          '    }',
           INTERFACE=self._interface.id)
 
+    to_native_emitter.Emit(
+        '    static $RETURN_TYPE toNative(Dart_Handle handle, Dart_Handle& exception)$TO_NATIVE_BODY\n'
+        '\n'
+        '    static $RETURN_TYPE toNativeWithNullCheck(Dart_Handle handle, Dart_Handle& exception)\n'
+        '    {\n'
+        '        return Dart_IsNull(handle) ? 0 : toNative(handle, exception);\n'
+        '    }\n',
+        RETURN_TYPE=return_type,
+        TO_NATIVE_BODY=to_native_body,
+        INTERFACE=self._interface.id)
+
     to_dart_emitter = emitter.Emitter()
 
     ext_attrs = self._interface.ext_attrs
@@ -680,6 +693,7 @@
 
     if requires_stack_info:
       self._cpp_impl_includes.add('"ScriptArguments.h"')
+      self._cpp_impl_includes.add('"ScriptCallStack.h"')
       body_emitter.Emit(
           '\n'
           '        ScriptState* currentState = ScriptState::current();\n'
@@ -718,9 +732,22 @@
       argument_expression_template, type, cls, function = \
           type_info.to_native_info(argument, self._interface.id)
 
-      if ((IsOptional(argument) and not self._IsArgumentOptionalInWebCore(node, argument)) or
-          (argument.ext_attrs.get('Optional') == 'DefaultIsNullString') or
-          _IsOptionalStringArgumentInInitEventMethod(self._interface, node, argument)):
+      def AllowsNull():
+        assert argument.ext_attrs.get('TreatNullAs', 'NullString') == 'NullString'
+        if argument.ext_attrs.get('TreatNullAs') == 'NullString':
+          return True
+
+        if isinstance(argument, IDLArgument):
+          if IsOptional(argument) and not self._IsArgumentOptionalInWebCore(node, argument):
+            return True
+          if argument.ext_attrs.get('Default') == 'NullString':
+            return True
+          if _IsOptionalStringArgumentInInitEventMethod(self._interface, node, argument):
+            return True
+
+        return False
+
+      if AllowsNull():
         function += 'WithNullCheck'
 
       argument_name = DartDomNameOfAttribute(argument)
@@ -848,9 +875,7 @@
       return False
     if operation.id in ['addEventListener', 'removeEventListener'] and argument.id == 'useCapture':
       return False
-    # Another option would be to adjust in IDLs, but let's keep it here for now
-    # as it's a single instance.
-    if self._interface.id == 'CSSStyleDeclaration' and operation.id == 'setProperty' and argument.id == 'priority':
+    if 'ForceOptional' in argument.ext_attrs:
       return False
     if argument.type.id == 'Dictionary':
       return False
@@ -922,5 +947,5 @@
   return (
       interface.id.endswith('Event') and
       operation.id.startswith('init') and
-      argument.ext_attrs.get('Optional') == 'DefaultIsUndefined' and
+      argument.ext_attrs.get('Default') == 'Undefined' and
       argument.type.id == 'DOMString')
diff --git a/tools/dom/src/dart2js_Conversions.dart b/tools/dom/src/dart2js_Conversions.dart
index 8ced5ef..9f30f09 100644
--- a/tools/dom/src/dart2js_Conversions.dart
+++ b/tools/dom/src/dart2js_Conversions.dart
@@ -50,7 +50,7 @@
 // On Firefox, the returned ImageData is a plain object.
 
 class _TypedImageData implements ImageData {
-  final Uint8ClampedArray data;
+  final Uint8ClampedList data;
   final int height;
   final int width;
 
diff --git a/tools/dom/src/dart2js_TypedArrayFactoryProvider.dart b/tools/dom/src/dart2js_TypedArrayFactoryProvider.dart
index af103a1..25e4413 100644
--- a/tools/dom/src/dart2js_TypedArrayFactoryProvider.dart
+++ b/tools/dom/src/dart2js_TypedArrayFactoryProvider.dart
@@ -5,144 +5,156 @@
 part of html;
 
 class _TypedArrayFactoryProvider {
+  static ByteData createByteData(int length) => _B8(length);
+  static ByteData createByteData_fromBuffer(ByteBuffer buffer,
+                                  [int byteOffset = 0, int length]) {
+    if (length == null) return _B8_2(buffer, byteOffset);
+    return _B8_3(buffer, byteOffset, length);
+  }
 
-  static Float32Array createFloat32Array(int length) => _F32(length);
-  static Float32Array createFloat32Array_fromList(List<num> list) =>
+  static Float32List createFloat32List(int length) => _F32(length);
+  static Float32List createFloat32List_fromList(List<num> list) =>
       _F32(ensureNative(list));
-  static Float32Array createFloat32Array_fromBuffer(ArrayBuffer buffer,
+  static Float32List createFloat32List_fromBuffer(ByteBuffer buffer,
                                   [int byteOffset = 0, int length]) {
     if (length == null) return _F32_2(buffer, byteOffset);
     return _F32_3(buffer, byteOffset, length);
   }
 
-  static Float64Array createFloat64Array(int length) => _F64(length);
-  static Float64Array createFloat64Array_fromList(List<num> list) =>
+  static Float64List createFloat64List(int length) => _F64(length);
+  static Float64List createFloat64List_fromList(List<num> list) =>
       _F64(ensureNative(list));
-  static Float64Array createFloat64Array_fromBuffer(ArrayBuffer buffer,
+  static Float64List createFloat64List_fromBuffer(ByteBuffer buffer,
       [int byteOffset = 0, int length]) {
     if (length == null) return _F64_2(buffer, byteOffset);
     return _F64_3(buffer, byteOffset, length);
   }
 
-  static Int8Array createInt8Array(int length) => _I8(length);
-  static Int8Array createInt8Array_fromList(List<num> list) =>
+  static Int8List createInt8List(int length) => _I8(length);
+  static Int8List createInt8List_fromList(List<num> list) =>
       _I8(ensureNative(list));
-  static Int8Array createInt8Array_fromBuffer(ArrayBuffer buffer,
+  static Int8List createInt8List_fromBuffer(ByteBuffer buffer,
       [int byteOffset = 0, int length]) {
     if (length == null) return _I8_2(buffer, byteOffset);
     return _I8_3(buffer, byteOffset, length);
   }
 
-  static Int16Array createInt16Array(int length) => _I16(length);
-  static Int16Array createInt16Array_fromList(List<num> list) =>
+  static Int16List createInt16List(int length) => _I16(length);
+  static Int16List createInt16List_fromList(List<num> list) =>
       _I16(ensureNative(list));
-  static Int16Array createInt16Array_fromBuffer(ArrayBuffer buffer,
+  static Int16List createInt16List_fromBuffer(ByteBuffer buffer,
       [int byteOffset = 0, int length]) {
     if (length == null) return _I16_2(buffer, byteOffset);
     return _I16_3(buffer, byteOffset, length);
   }
 
-  static Int32Array createInt32Array(int length) => _I32(length);
-  static Int32Array createInt32Array_fromList(List<num> list) =>
+  static Int32List createInt32List(int length) => _I32(length);
+  static Int32List createInt32List_fromList(List<num> list) =>
       _I32(ensureNative(list));
-  static Int32Array createInt32Array_fromBuffer(ArrayBuffer buffer,
+  static Int32List createInt32List_fromBuffer(ByteBuffer buffer,
       [int byteOffset = 0, int length]) {
     if (length == null) return _I32_2(buffer, byteOffset);
     return _I32_3(buffer, byteOffset, length);
   }
 
-  static Uint8Array createUint8Array(int length) => _U8(length);
-  static Uint8Array createUint8Array_fromList(List<num> list) =>
+  static Uint8List createUint8List(int length) => _U8(length);
+  static Uint8List createUint8List_fromList(List<num> list) =>
       _U8(ensureNative(list));
-  static Uint8Array createUint8Array_fromBuffer(ArrayBuffer buffer,
+  static Uint8List createUint8List_fromBuffer(ByteBuffer buffer,
       [int byteOffset = 0, int length]) {
     if (length == null) return _U8_2(buffer, byteOffset);
     return _U8_3(buffer, byteOffset, length);
   }
 
-  static Uint16Array createUint16Array(int length) => _U16(length);
-  static Uint16Array createUint16Array_fromList(List<num> list) =>
+  static Uint16List createUint16List(int length) => _U16(length);
+  static Uint16List createUint16List_fromList(List<num> list) =>
       _U16(ensureNative(list));
-  static Uint16Array createUint16Array_fromBuffer(ArrayBuffer buffer,
+  static Uint16List createUint16List_fromBuffer(ByteBuffer buffer,
       [int byteOffset = 0, int length]) {
     if (length == null) return _U16_2(buffer, byteOffset);
     return _U16_3(buffer, byteOffset, length);
   }
 
-  static Uint32Array createUint32Array(int length) => _U32(length);
-  static Uint32Array createUint32Array_fromList(List<num> list) =>
+  static Uint32List createUint32List(int length) => _U32(length);
+  static Uint32List createUint32List_fromList(List<num> list) =>
       _U32(ensureNative(list));
-  static Uint32Array createUint32Array_fromBuffer(ArrayBuffer buffer,
+  static Uint32List createUint32List_fromBuffer(ByteBuffer buffer,
       [int byteOffset = 0, int length]) {
     if (length == null) return _U32_2(buffer, byteOffset);
     return _U32_3(buffer, byteOffset, length);
   }
 
-  static Uint8ClampedArray createUint8ClampedArray(int length) => _U8C(length);
-  static Uint8ClampedArray createUint8ClampedArray_fromList(List<num> list) =>
+  static Uint8ClampedList createUint8ClampedList(int length) => _U8C(length);
+  static Uint8ClampedList createUint8ClampedList_fromList(List<num> list) =>
       _U8C(ensureNative(list));
-  static Uint8ClampedArray createUint8ClampedArray_fromBuffer(
-        ArrayBuffer buffer, [int byteOffset = 0, int length]) {
+  static Uint8ClampedList createUint8ClampedList_fromBuffer(
+        ByteBuffer buffer, [int byteOffset = 0, int length]) {
     if (length == null) return _U8C_2(buffer, byteOffset);
     return _U8C_3(buffer, byteOffset, length);
   }
 
-  static Float32Array _F32(arg) =>
-      JS('Float32Array', 'new Float32Array(#)', arg);
-  static Float64Array _F64(arg) =>
-      JS('Float64Array', 'new Float64Array(#)', arg);
-  static Int8Array _I8(arg) =>
-      JS('Int8Array', 'new Int8Array(#)', arg);
-  static Int16Array _I16(arg) =>
-      JS('Int16Array', 'new Int16Array(#)', arg);
-  static Int32Array _I32(arg) =>
-      JS('Int32Array', 'new Int32Array(#)', arg);
-  static Uint8Array _U8(arg) =>
-      JS('Uint8Array', 'new Uint8Array(#)', arg);
-  static Uint16Array _U16(arg) =>
-      JS('Uint16Array', 'new Uint16Array(#)', arg);
-  static Uint32Array _U32(arg) =>
-      JS('Uint32Array', 'new Uint32Array(#)', arg);
-  static Uint8ClampedArray _U8C(arg) =>
-      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#)', arg);
+  static ByteData _B8(arg) =>
+      JS('ByteData', 'new DataView(new ArrayBuffer(#))', arg);
+  static Float32List _F32(arg) =>
+      JS('Float32List', 'new Float32Array(#)', arg);
+  static Float64List _F64(arg) =>
+      JS('Float64List', 'new Float64Array(#)', arg);
+  static Int8List _I8(arg) =>
+      JS('Int8List', 'new Int8Array(#)', arg);
+  static Int16List _I16(arg) =>
+      JS('Int16List', 'new Int16Array(#)', arg);
+  static Int32List _I32(arg) =>
+      JS('Int32List', 'new Int32Array(#)', arg);
+  static Uint8List _U8(arg) =>
+      JS('Uint8List', 'new Uint8Array(#)', arg);
+  static Uint16List _U16(arg) =>
+      JS('Uint16List', 'new Uint16Array(#)', arg);
+  static Uint32List _U32(arg) =>
+      JS('Uint32List', 'new Uint32Array(#)', arg);
+  static Uint8ClampedList _U8C(arg) =>
+      JS('Uint8ClampedList', 'new Uint8ClampedArray(#)', arg);
 
-  static Float32Array _F32_2(arg1, arg2) =>
-      JS('Float32Array', 'new Float32Array(#, #)', arg1, arg2);
-  static Float64Array _F64_2(arg1, arg2) =>
-      JS('Float64Array', 'new Float64Array(#, #)', arg1, arg2);
-  static Int8Array _I8_2(arg1, arg2) =>
-      JS('Int8Array', 'new Int8Array(#, #)', arg1, arg2);
-  static Int16Array _I16_2(arg1, arg2) =>
-      JS('Int16Array', 'new Int16Array(#, #)', arg1, arg2);
-  static Int32Array _I32_2(arg1, arg2) =>
-      JS('Int32Array', 'new Int32Array(#, #)', arg1, arg2);
-  static Uint8Array _U8_2(arg1, arg2) =>
-      JS('Uint8Array', 'new Uint8Array(#, #)', arg1, arg2);
-  static Uint16Array _U16_2(arg1, arg2) =>
-      JS('Uint16Array', 'new Uint16Array(#, #)', arg1, arg2);
-  static Uint32Array _U32_2(arg1, arg2) =>
-      JS('Uint32Array', 'new Uint32Array(#, #)', arg1, arg2);
-  static Uint8ClampedArray _U8C_2(arg1, arg2) =>
-      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #)', arg1, arg2);
+  static ByteData _B8_2(arg1, arg2) =>
+      JS('ByteData', 'new DataView(#, #)', arg1, arg2);
+  static Float32List _F32_2(arg1, arg2) =>
+      JS('Float32List', 'new Float32Array(#, #)', arg1, arg2);
+  static Float64List _F64_2(arg1, arg2) =>
+      JS('Float64List', 'new Float64Array(#, #)', arg1, arg2);
+  static Int8List _I8_2(arg1, arg2) =>
+      JS('Int8List', 'new Int8Array(#, #)', arg1, arg2);
+  static Int16List _I16_2(arg1, arg2) =>
+      JS('Int16List', 'new Int16Array(#, #)', arg1, arg2);
+  static Int32List _I32_2(arg1, arg2) =>
+      JS('Int32List', 'new Int32Array(#, #)', arg1, arg2);
+  static Uint8List _U8_2(arg1, arg2) =>
+      JS('Uint8List', 'new Uint8Array(#, #)', arg1, arg2);
+  static Uint16List _U16_2(arg1, arg2) =>
+      JS('Uint16List', 'new Uint16Array(#, #)', arg1, arg2);
+  static Uint32List _U32_2(arg1, arg2) =>
+      JS('Uint32List', 'new Uint32Array(#, #)', arg1, arg2);
+  static Uint8ClampedList _U8C_2(arg1, arg2) =>
+      JS('Uint8ClampedList', 'new Uint8ClampedArray(#, #)', arg1, arg2);
 
-  static Float32Array _F32_3(arg1, arg2, arg3) =>
-      JS('Float32Array', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
-  static Float64Array _F64_3(arg1, arg2, arg3) =>
-      JS('Float64Array', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
-  static Int8Array _I8_3(arg1, arg2, arg3) =>
-      JS('Int8Array', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
-  static Int16Array _I16_3(arg1, arg2, arg3) =>
-      JS('Int16Array', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
-  static Int32Array _I32_3(arg1, arg2, arg3) =>
-      JS('Int32Array', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
-  static Uint8Array _U8_3(arg1, arg2, arg3) =>
-      JS('Uint8Array', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
-  static Uint16Array _U16_3(arg1, arg2, arg3) =>
-      JS('Uint16Array', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
-  static Uint32Array _U32_3(arg1, arg2, arg3) =>
-      JS('Uint32Array', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
-  static Uint8ClampedArray _U8C_3(arg1, arg2, arg3) =>
-      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3);
+  static ByteData _B8_3(arg1, arg2, arg3) =>
+      JS('ByteData', 'new DataView(#, #, #)', arg1, arg2, arg3);
+  static Float32List _F32_3(arg1, arg2, arg3) =>
+      JS('Float32List', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
+  static Float64List _F64_3(arg1, arg2, arg3) =>
+      JS('Float64List', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
+  static Int8List _I8_3(arg1, arg2, arg3) =>
+      JS('Int8List', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
+  static Int16List _I16_3(arg1, arg2, arg3) =>
+      JS('Int16List', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
+  static Int32List _I32_3(arg1, arg2, arg3) =>
+      JS('Int32List', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
+  static Uint8List _U8_3(arg1, arg2, arg3) =>
+      JS('Uint8List', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
+  static Uint16List _U16_3(arg1, arg2, arg3) =>
+      JS('Uint16List', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
+  static Uint32List _U32_3(arg1, arg2, arg3) =>
+      JS('Uint32List', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
+  static Uint8ClampedList _U8C_3(arg1, arg2, arg3) =>
+      JS('Uint8ClampedList', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3);
 
 
   // Ensures that [list] is a JavaScript Array or a typed array.  If necessary,
diff --git a/tools/dom/src/dartium_FactoryProviders.dart b/tools/dom/src/dartium_FactoryProviders.dart
index ade562c..5a4f3831 100644
--- a/tools/dom/src/dartium_FactoryProviders.dart
+++ b/tools/dom/src/dartium_FactoryProviders.dart
@@ -4,74 +4,6 @@
 
 part of html;
 
-class _TypedArrayFactoryProvider {
-  static Float32Array createFloat32Array(int length) => _F32(length);
-  static Float32Array createFloat32Array_fromList(List<num> list) =>
-      _F32(ensureNative(list));
-  static Float32Array createFloat32Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _F32(buffer, byteOffset, length);
-  static _F32(arg0, [arg1, arg2]) native "Float32Array_constructor_Callback";
-
-  static Float64Array createFloat64Array(int length) => _F64(length);
-  static Float64Array createFloat64Array_fromList(List<num> list) =>
-      _F64(ensureNative(list));
-  static Float64Array createFloat64Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _F64(buffer, byteOffset, length);
-  static _F64(arg0, [arg1, arg2]) native "Float64Array_constructor_Callback";
-
-  static Int8Array createInt8Array(int length) => _I8(length);
-  static Int8Array createInt8Array_fromList(List<num> list) =>
-      _I8(ensureNative(list));
-  static Int8Array createInt8Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _I8(buffer, byteOffset, length);
-  static _I8(arg0, [arg1, arg2]) native "Int8Array_constructor_Callback";
-
-  static Int16Array createInt16Array(int length) => _I16(length);
-  static Int16Array createInt16Array_fromList(List<num> list) =>
-      _I16(ensureNative(list));
-  static Int16Array createInt16Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _I16(buffer, byteOffset, length);
-  static _I16(arg0, [arg1, arg2]) native "Int16Array_constructor_Callback";
-
-  static Int32Array createInt32Array(int length) => _I32(length);
-  static Int32Array createInt32Array_fromList(List<num> list) =>
-      _I32(ensureNative(list));
-  static Int32Array createInt32Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _I32(buffer, byteOffset, length);
-  static _I32(arg0, [arg1, arg2]) native "Int32Array_constructor_Callback";
-
-  static Uint8Array createUint8Array(int length) => _U8(length);
-  static Uint8Array createUint8Array_fromList(List<num> list) =>
-      _U8(ensureNative(list));
-  static Uint8Array createUint8Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _U8(buffer, byteOffset, length);
-  static _U8(arg0, [arg1, arg2]) native "Uint8Array_constructor_Callback";
-
-  static Uint16Array createUint16Array(int length) => _U16(length);
-  static Uint16Array createUint16Array_fromList(List<num> list) =>
-      _U16(ensureNative(list));
-  static Uint16Array createUint16Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _U16(buffer, byteOffset, length);
-  static _U16(arg0, [arg1, arg2]) native "Uint16Array_constructor_Callback";
-
-  static Uint32Array createUint32Array(int length) => _U32(length);
-  static Uint32Array createUint32Array_fromList(List<num> list) =>
-      _U32(ensureNative(list));
-  static Uint32Array createUint32Array_fromBuffer(ArrayBuffer buffer,
-      [int byteOffset = 0, int length]) => _U32(buffer, byteOffset, length);
-  static _U32(arg0, [arg1, arg2]) native "Uint32Array_constructor_Callback";
-
-  static Uint8ClampedArray createUint8ClampedArray(int length) => _U8C(length);
-  static Uint8ClampedArray createUint8ClampedArray_fromList(
-      List<num> list) => _U8C(ensureNative(list));
-  static Uint8ClampedArray createUint8ClampedArray_fromBuffer(
-      ArrayBuffer buffer, [int byteOffset = 0, int length]) =>
-      _U8C(buffer, byteOffset, length);
-  static _U8C(arg0, [arg1, arg2]) native "Uint8ClampedArray_constructor_Callback";
-
-  static ensureNative(List list) => list;  // TODO: make sure.
-}
-
 class _TextFactoryProvider {
   static Text createText(String data) => document.$dom_createTextNode(data);
 }
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index bc4077d..47a9861 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -17,11 +17,12 @@
 import 'dart:isolate';
 import 'dart:json' as json;
 import 'dart:math';
-import 'dart:web_sql';
+import 'dart:typed_data';
 // Not actually used, but imported since dart:html can generate these objects.
 import 'dart:svg' as svg;
 import 'dart:web_audio' as web_audio;
 import 'dart:web_gl' as gl;
+import 'dart:web_sql';
 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
 import 'dart:_isolate_helper' show IsolateNatives;
 import 'dart:_foreign_helper' show JS;
@@ -55,7 +56,6 @@
 part '$AUXILIARY_DIR/dart2js_FactoryProviders.dart';
 part '$AUXILIARY_DIR/dart2js_LocationWrapper.dart';
 part '$AUXILIARY_DIR/dart2js_Platform.dart';
-part '$AUXILIARY_DIR/dart2js_TypedArrayFactoryProvider.dart';
 part '$AUXILIARY_DIR/_ListIterators.dart';
 
 
@@ -74,7 +74,7 @@
 
 // Workaround for tags like <cite> that lack their own Element subclass --
 // Dart issue 1990.
-class _HTMLElement extends Element native "*HTMLElement" {
+class _HTMLElement extends Element native "HTMLElement" {
 }
 
 // Support for Send/ReceivePortSync.
diff --git a/tools/dom/templates/html/dart2js/impl_ArrayBuffer.darttemplate b/tools/dom/templates/html/dart2js/impl_ArrayBuffer.darttemplate
deleted file mode 100644
index 121ed9b..0000000
--- a/tools/dom/templates/html/dart2js/impl_ArrayBuffer.darttemplate
+++ /dev/null
@@ -1,37 +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.
-
-part of $LIBRARYNAME;
-
-$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
-$!MEMBERS
-  @DomName('ArrayBuffer.slice')
-  ArrayBuffer slice(int begin, [int end]) {
-    // IE10 supports ArrayBuffers but does not have the slice method.
-    if (JS('bool', '!!#.slice', this)) {
-      if (?end) {
-        return JS('ArrayBuffer', '#.slice(#, #)', this, begin, end);
-      }
-      return JS('ArrayBuffer', '#.slice(#)', this, begin);
-    } else {
-      var start = begin;
-      // Negative values go from end.
-      if (start < 0) {
-        start = this.byteLength + start;
-      }
-      var finish = ?end ? min(end, byteLength) : byteLength;
-      if (finish < 0) {
-        finish = this.byteLength + finish;
-      }
-      var length = max(finish - start, 0);
-
-      var clone = new Int8Array(length);
-      var source = new Int8Array.fromBuffer(this, start);
-      for (var i = 0; i < length; ++i) {
-        clone[i] = source[i];
-      }
-      return clone.buffer;
-    }
-  }
-}
diff --git a/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate b/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
index 0d29c1c..8a96fbb 100644
--- a/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
@@ -11,6 +11,7 @@
 import 'dart:async';
 import 'dart:html';
 import 'dart:html_common';
+import 'dart:typed_data';
 import 'dart:_js_helper' show Creates, Returns, JSName, Null;
 import 'dart:_foreign_helper' show JS;
 
diff --git a/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
index 9016bcc..e9e62f3 100644
--- a/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
@@ -9,6 +9,7 @@
 import 'dart:_collection-dev';
 import 'dart:html';
 import 'dart:html_common';
+import 'dart:typed_data';
 import 'dart:_js_helper' show Creates, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 
diff --git a/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
index 4b24fa5..bb5c1ea 100644
--- a/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
@@ -8,6 +8,7 @@
 import 'dart:_collection-dev';
 import 'dart:html';
 import 'dart:html_common';
+import 'dart:typed_data';
 import 'dart:_js_helper' show Creates, JSName, Null, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 
diff --git a/tools/dom/templates/html/dartium/html_dartium.darttemplate b/tools/dom/templates/html/dartium/html_dartium.darttemplate
index 414ae05..07780e3 100644
--- a/tools/dom/templates/html/dartium/html_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/html_dartium.darttemplate
@@ -17,7 +17,7 @@
 import 'dart:json' as json;
 import 'dart:math';
 import 'dart:nativewrappers';
-import 'dart:typeddata' as _typeddata;
+import 'dart:typed_data';
 import 'dart:web_gl' as gl;
 import 'dart:web_sql';
 // Not actually used, but imported since dart:html can generate these objects.
diff --git a/tools/dom/templates/html/dartium/web_audio_dartium.darttemplate b/tools/dom/templates/html/dartium/web_audio_dartium.darttemplate
index 919ef20..97b9424 100644
--- a/tools/dom/templates/html/dartium/web_audio_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/web_audio_dartium.darttemplate
@@ -9,6 +9,6 @@
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
-import 'dart:typeddata' as _typeddata;
+import 'dart:typed_data';
 
 $!GENERATED_DART_FILES
diff --git a/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate b/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate
index 18615a1..ec1dcc9 100644
--- a/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate
@@ -9,7 +9,7 @@
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
-import 'dart:typeddata' as _typeddata;
+import 'dart:typed_data';
 
 part '$AUXILIARY_DIR/WebGLConstants.dart';
 
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 9fd0d99..3b24e20 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -179,13 +179,15 @@
     throw new UnimplementedError();
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     if (object is Element) {
       Element element = object;
       if (identical(element.parentNode, _element)) {
         _element.$dom_removeChild(element);
+        return true;
       }
     }
+    return false;
   }
 
   void removeWhere(bool test(Element element)) {
@@ -346,7 +348,7 @@
     throw new UnsupportedError('');
   }
 
-  void remove(Object element) {
+  bool remove(Object element) {
     throw new UnsupportedError('');
   }
 
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index af16447..1d84f30 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -106,11 +106,12 @@
     return result;
   }
 
-  void remove(Object object) {
-    if (object is! Node) return;
+  bool remove(Object object) {
+    if (object is! Node) return false;
     Node node = object;
-    if (!identical(_this, node.parentNode)) return;
+    if (!identical(_this, node.parentNode)) return false;
     _this.$dom_removeChild(node);
+    return true;
   }
 
   void _filter(bool test(Node node), bool removeMatching) {
diff --git a/tools/dom/templates/html/impl/impl_RadioNodeList.darttemplate b/tools/dom/templates/html/impl/impl_RadioNodeList.darttemplate
new file mode 100644
index 0000000..e1faa65
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_RadioNodeList.darttemplate
@@ -0,0 +1,16 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+$if DART2JS
+// Omit RadioNodeList for dart2js.  The Dart Form and FieldSet APIs don't
+// currently expose an API the returns RadioNodeList.  The only use of a
+// RadioNodeList is to get the selected value and it will be cleaner to
+// introduce a different API for that purpose.
+$else
+$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+$!MEMBERS
+}
+$endif
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
index 7d86600..f60f7d495 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -5,7 +5,7 @@
 part of $LIBRARYNAME;
 
 $if DART2JS
-$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "@*DOMWindow" {
+$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS native "Window,DOMWindow" {
 $else
 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
 $endif
@@ -200,7 +200,7 @@
   @SupportedBrowser(SupportedBrowser.IE, '10.0')
   @Experimental
   IdbFactory get indexedDB =>
-      JS('IdbFactory',
+      JS('IdbFactory|Null',  // If not supported, returns `null`.
          '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
          this, this, this);
 
diff --git a/tools/dom/templates/immutable_list_mixin.darttemplate b/tools/dom/templates/immutable_list_mixin.darttemplate
index 8baaa09..a984eab 100644
--- a/tools/dom/templates/immutable_list_mixin.darttemplate
+++ b/tools/dom/templates/immutable_list_mixin.darttemplate
@@ -159,7 +159,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void remove(Object object) {
+  bool remove(Object object) {
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
@@ -171,7 +171,7 @@
     throw new UnsupportedError("Cannot remove from immutable List.");
   }
 
-  void setRange(int start, int end, Iterable<$E> iterable, [int skipCount]) {
+  void setRange(int start, int end, Iterable<$E> iterable, [int skipCount=0]) {
     throw new UnsupportedError("Cannot setRange on immutable List.");
   }
 
diff --git a/tools/gyp/configurations_make.gypi b/tools/gyp/configurations_make.gypi
index b13dabd..a2b9e8a 100644
--- a/tools/gyp/configurations_make.gypi
+++ b/tools/gyp/configurations_make.gypi
@@ -46,12 +46,21 @@
       },
 
       'Dart_arm_Base': {
-        'cflags': [
-          '-march=armv7-a',
-          '-mfpu=vfp',
-          '-mfloat-abi=softfp',
-          '-fno-strict-overflow',
-        ],
+        'target_conditions': [
+        ['_toolset=="target"', {
+          'cflags': [
+            '-marm',
+            '-march=armv7-a',
+            '-mfpu=vfp',
+            '-mfloat-abi=softfp',
+            '-Wno-psabi', # suppresses va_list warning
+            '-fno-strict-overflow',
+          ],
+        }],
+        ['_toolset=="host"', {
+          'cflags': ['-m32', '-msse2'],
+          'ldflags': ['-m32'],
+        }]]
       },
 
       'Dart_simmips_Base': {
diff --git a/tools/gyp/configurations_xcode.gypi b/tools/gyp/configurations_xcode.gypi
index c308bdf..9098beb 100644
--- a/tools/gyp/configurations_xcode.gypi
+++ b/tools/gyp/configurations_xcode.gypi
@@ -51,7 +51,7 @@
 
           'GCC_ENABLE_PASCAL_STRINGS': 'NO',
           'GCC_ENABLE_TRIGRAPHS': 'NO',
-          'PREBINDING': 'NO',
+          'COMBINE_HIDPI_IMAGES': 'YES',
         },
       },
     },
diff --git a/tools/publish_all_pkgs.py b/tools/publish_all_pkgs.py
index 1958a3b..729d9a1 100644
--- a/tools/publish_all_pkgs.py
+++ b/tools/publish_all_pkgs.py
@@ -21,7 +21,7 @@
   pkgs_to_publish = []
   for name in os.listdir('pkg'):
     if os.path.isdir(os.path.join('pkg', name)):
-      if (name != '.svn' and name != 'fixnum' and name != 'expect':
+      if (name != '.svn' and name != 'fixnum' and name != 'expect'):
         pkgs_to_publish.append(os.path.join('pkg', name))
 
   # Publish dart2js as an "unsupported" package.
diff --git a/tools/release/version.dart b/tools/release/version.dart
index 99b44bd..74e1e66 100644
--- a/tools/release/version.dart
+++ b/tools/release/version.dart
@@ -149,7 +149,7 @@
 
   Future<int> getRevision() {
     if (repositoryType == RepositoryType.UNKNOWN) {
-      return new Future.value(0);
+      return new Future.immediate(0);
     }
     var isSvn = repositoryType == RepositoryType.SVN;
     var command = isSvn ? "svn" : "git";
diff --git a/tools/test.dart b/tools/test.dart
index 354c7946..f134352 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -66,7 +66,7 @@
     new Path('tests/utils'),
     new Path('utils/tests/css'),
     new Path('utils/tests/peg'),
-    new Path('utils/tests/pub'),
+    new Path('sdk/lib/_internal/pub'),
     // TODO(amouravski): move these to tests/ once they no longer rely on weird
     // dependencies.
     new Path('sdk/lib/_internal/dartdoc'),
@@ -158,6 +158,9 @@
         if (key == 'analyze_library') {
           testSuites.add(new AnalyzeLibraryTestSuite(conf));
         }
+        if (key == 'analyze_tests') {
+          testSuites.add(new AnalyzeTestsTestSuite(conf));
+        }
       }
     }
 
diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart
index 0932f21..6d2453e 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -12,7 +12,7 @@
 List<String> defaultTestSelectors =
     const ['dartc', 'samples', 'standalone', 'corelib', 'co19', 'language',
            'isolate', 'vm', 'html', 'json', 'benchmark_smoke',
-           'utils', 'lib', 'pkg', 'analyze_library'];
+           'utils', 'lib', 'pkg', 'analyze_library', 'analyze_tests'];
 
 /**
  * Specification of a single test option.
@@ -523,7 +523,7 @@
     String compiler = configuration['compiler'];
     configuration['browser'] = TestUtils.isBrowserRuntime(runtime);
     configuration['analyzer'] = TestUtils.isCommandLineAnalyzer(compiler);
-    
+
     // Set the javascript command line flag for less verbose status files.
     configuration['jscl'] = TestUtils.isJsCommandLineRuntime(runtime);
 
@@ -608,13 +608,6 @@
             timeout *= 2;
           }
 
-          const BROWSERS = const [
-            'ie9', 'ie10', 'ff', 'chrome', 'safari', 'opera'
-          ];
-
-          if (BROWSERS.contains(configuration['runtime'])) {
-            timeout *= 8; // Allow additional time for browser testing to run.
-          }
           break;
         default:
           if (configuration['mode'] == 'debug') {
diff --git a/tools/utils.py b/tools/utils.py
index 2245516..eeee968 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -300,7 +300,7 @@
                             stderr=subprocess.PIPE)
     (stdout, stderr) = proc.communicate()
     if proc.wait() != 0:
-      raise ToolError('non-zero exit code from ' + java_home)
+      return None
     new = stdout.strip()
     current = os.getenv('JAVA_HOME', default=new)
     if current != new:
diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart
index 233f9be..8979ddd 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -24,6 +24,7 @@
 // TODO(rnystrom): Use "package:" URL (#4968).
 import '../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart';
 import '../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
+import '../../sdk/lib/_internal/compiler/implementation/filenames.dart';
 import '../../sdk/lib/_internal/dartdoc/lib/dartdoc.dart';
 import '../../sdk/lib/_internal/libraries.dart';
 import 'package:pathos/path.dart' as pathos;
@@ -101,7 +102,7 @@
   // TODO(amouravski): move HtmlDiff inside of the future chain below to re-use
   // the MirrorSystem already analyzed.
   _diff = new HtmlDiff(printWarnings:false);
-  Future htmlDiff = _diff.run(libPath);
+  Future htmlDiff = _diff.run(currentDirectory.resolve(libPath.toString()));
 
   // TODO(johnniwinther): Libraries for the compilation seem to be more like
   // URIs. Perhaps Path should have a toURI() method.
@@ -353,7 +354,7 @@
     }
 
     var typeString = '';
-    if (HTML_LIBRARY_NAMES.contains(displayName(type.library))) {
+    if (HTML_LIBRARY_URIS.contains(type.library.uri)) {
       // If it's an HTML type, try to map it to a base DOM type so we can find
       // the MDN docs.
       final domTypes = _diff.htmlTypesToDom[type.qualifiedName];
@@ -390,7 +391,7 @@
   MdnComment includeMdnMemberComment(MemberMirror member) {
     var library = findLibrary(member);
     var memberString = '';
-    if (HTML_LIBRARY_NAMES.contains(displayName(library))) {
+    if (HTML_LIBRARY_URIS.contains(library.uri)) {
       // If it's an HTML type, try to map it to a DOM type name so we can find
       // the MDN docs.
       final domMembers = _diff.htmlToDom[member.qualifiedName];
@@ -443,7 +444,7 @@
   String _linkMember(MemberMirror member) {
     final typeName = member.owner.simpleName;
     var memberName = '$typeName.${member.simpleName}';
-    if (member is MethodMirror && (member.isConstructor || member.isFactory)) {
+    if (member is MethodMirror && member.isConstructor) {
       final separator = member.constructorName == '' ? '' : '.';
       memberName = 'new $typeName$separator${member.constructorName}';
     }
diff --git a/utils/apidoc/html_diff.dart b/utils/apidoc/html_diff.dart
index 9c3d2ee..fd8e0a2 100644
--- a/utils/apidoc/html_diff.dart
+++ b/utils/apidoc/html_diff.dart
@@ -10,6 +10,7 @@
 
 import 'dart:async';
 import 'dart:io';
+import 'dart:uri';
 
 import 'lib/metadata.dart';
 
@@ -17,22 +18,18 @@
 import '../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart';
 import '../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart';
 import '../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
+import '../../sdk/lib/_internal/compiler/implementation/source_file_provider.dart';
 import '../../sdk/lib/_internal/dartdoc/lib/dartdoc.dart';
 import '../../sdk/lib/html/html_common/metadata.dart';
 
 // TODO(amouravski): There is currently magic that looks at dart:* libraries
 // rather than the declared library names. This changed due to recent syntax
 // changes. We should only need to look at the library 'html'.
-const List<String> HTML_LIBRARY_NAMES = const [
-    'dart:html',
-    'dart:indexed_db',
-    'dart:svg',
-    'dart:web_audio'];
-const List<String> HTML_DECLARED_NAMES = const [
-    'dart.dom.html',
-    'dart.dom.indexed_db',
-    'dart.dom.svg',
-    'dart.dom.web_audio'];
+const List<Uri> HTML_LIBRARY_URIS = const [
+    const Uri.fromComponents(scheme: 'dart', path: 'html'),
+    const Uri.fromComponents(scheme: 'dart', path: 'indexed_db'),
+    const Uri.fromComponents(scheme: 'dart', path: 'svg'),
+    const Uri.fromComponents(scheme: 'dart', path: 'web_audio')];
 
 /**
  * A class for computing a many-to-many mapping between the types and
@@ -92,17 +89,19 @@
    * should be initialized (via [parseOptions] and [initializeWorld]) and
    * [HtmlDiff.initialize] should be called.
    */
-  Future run(Path libDir) {
+  Future run(Uri libraryRoot) {
     var result = new Completer();
-    var paths = <Path>[];
-    for (var libraryName in HTML_LIBRARY_NAMES) {
-      paths.add(new Path(libraryName));
-    }
-    analyze(paths, libDir).then((MirrorSystem mirrors) {
-      for (var libraryName in HTML_DECLARED_NAMES) {
-        var library = mirrors.libraries[libraryName];
+    var provider = new SourceFileProvider();
+    var handler = new FormattingDiagnosticHandler(provider);
+    Future<MirrorSystem> analysis = analyze(
+        HTML_LIBRARY_URIS, libraryRoot, null,
+        provider.readStringFromUri,
+        handler.diagnosticHandler);
+    analysis.then((MirrorSystem mirrors) {
+      for (var libraryUri in HTML_LIBRARY_URIS) {
+        var library = mirrors.libraries[libraryUri];
         if (library == null) {
-          warn('Could not find $libraryName');
+          warn('Could not find $libraryUri');
           result.complete(false);
         }
         for (ClassMirror type in library.classes.values) {
@@ -154,7 +153,7 @@
     final domNameMetadata = findMetadata(htmlType.metadata, 'DomName');
     if (domNameMetadata != null) {
       var domNames = <String>[];
-      var names = deprecatedFutureValue(domNameMetadata.getField('name'));
+      var names = domNameMetadata.getField('name');
       for (var s in names.reflectee.split(',')) {
         domNames.add(s.trim());
       }
@@ -178,7 +177,7 @@
     final domNameMetadata = findMetadata(htmlMember.metadata, 'DomName');
     if (domNameMetadata != null) {
       var domNames = <String>[];
-      var names = deprecatedFutureValue(domNameMetadata.getField('name'));
+      var names = domNameMetadata.getField('name');
       for (var s in names.reflectee.split(',')) {
         domNames.add(s.trim());
       }
diff --git a/utils/compiler/create_snapshot.dart b/utils/compiler/create_snapshot.dart
index f0e50082..f1bc9db 100644
--- a/utils/compiler/create_snapshot.dart
+++ b/utils/compiler/create_snapshot.dart
@@ -5,8 +5,12 @@
 import 'dart:io';
 
 Future<String> getVersion(var options, var rootPath) {
+  var os = Platform.operatingSystem;
+  var suffix = os == 'windows' ? '.exe' : '';
+  var checkedInBinary =
+      rootPath.join(new Path('tools/testing/bin/$os/dart$suffix'));
   var versionPath = rootPath.append("tools").append("version.dart");
-  return Process.run(options.executable,
+  return Process.run(checkedInBinary.toNativePath(),
                      [versionPath.toNativePath()])
       .then((result) {
         if (result.exitCode != 0) {
@@ -20,7 +24,7 @@
   var dart2js = rootPath.append(args["dart2js_main"]);
 
   return getVersion(options, rootPath).then((version) {
-    var snapshotGenerationText = 
+    var snapshotGenerationText =
 """
 import '${dart2js}' as dart2jsMain;
 import 'dart:io';
@@ -63,7 +67,7 @@
  * --output_dir=val     The full path to the output_dir.
  * --dart2js_main=val   The path to the dart2js main script releative to root.
  */
-void main() { 
+void main() {
   Options options = new Options();
   var validArguments = ["--output_dir", "--dart2js_main"];
   var args = {};
@@ -79,7 +83,7 @@
   if (!args.containsKey("output_dir")) throw "Please specify output_dir";
 
   var scriptFile = new File(options.script);
-  var path = new Path(scriptFile.directorySync().path); 
+  var path = new Path(scriptFile.directorySync().path);
   var rootPath = path.directoryPath.directoryPath;
 
   getSnapshotGenerationFile(options, args, rootPath).then((result) {
diff --git a/utils/pub/.gitignore b/utils/pub/.gitignore
new file mode 100644
index 0000000..cfb192d
--- /dev/null
+++ b/utils/pub/.gitignore
@@ -0,0 +1,21 @@
+/Makefile
+/out
+/xcodebuild
+/*.Makefile
+/*.sln
+/*.target.mk
+/*.vcproj
+/*.vcxproj
+/*.vcxproj.filters
+/*.vcxproj.user
+/*.xcodeproj
+/Debug
+/DebugARM
+/DebugIA32
+/DebugSIMARM
+/DebugX64
+/Release
+/ReleaseARM
+/ReleaseIA32
+/ReleaseSIMARM
+/ReleaseX64
diff --git a/utils/pub/pub.Makefile b/utils/pub/pub.Makefile
new file mode 100644
index 0000000..c1d628d
--- /dev/null
+++ b/utils/pub/pub.Makefile
@@ -0,0 +1,6 @@
+# This file is generated by gyp; do not edit.
+
+export builddir_name ?= dart/utils/pub/out
+.PHONY: all
+all:
+	$(MAKE) -C ../.. pub
diff --git a/utils/pub/pub.dart b/utils/pub/pub.dart
deleted file mode 100644
index 4f1b632..0000000
--- a/utils/pub/pub.dart
+++ /dev/null
@@ -1,348 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// The main entrypoint for the pub command line application.
-library pub;
-
-import 'dart:async';
-import 'dart:io';
-import 'dart:math';
-
-import 'package:args/args.dart';
-import 'package:pathos/path.dart' as path;
-
-import 'command_help.dart';
-import 'command_install.dart';
-import 'command_lish.dart';
-import 'command_update.dart';
-import 'command_uploader.dart';
-import 'command_version.dart';
-import 'command_cache.dart';
-import 'entrypoint.dart';
-import 'exit_codes.dart' as exit_codes;
-import 'http.dart';
-import 'io.dart';
-import 'log.dart' as log;
-import 'package.dart';
-import 'pubspec.dart';
-import 'sdk.dart' as sdk;
-import 'source.dart';
-import 'source_registry.dart';
-import 'system_cache.dart';
-import 'utils.dart';
-import 'version.dart';
-
-/// The commands that Pub understands.
-Map<String, PubCommand> get pubCommands {
-  var commands = {
-    'cache': new CacheCommand(),
-    'help': new HelpCommand(),
-    'install': new InstallCommand(),
-    'publish': new LishCommand(),
-    'update': new UpdateCommand(),
-    'uploader': new UploaderCommand(),
-    'version': new VersionCommand()
-   };
-  for (var command in commands.values.toList()) {
-    for (var alias in command.aliases) {
-      commands[alias] = command;
-    }
-  }
-  return commands;
-}
-
-/// The parser for arguments that are global to Pub rather than specific to a
-/// single command.
-ArgParser get pubArgParser {
-  var parser = new ArgParser();
-  parser.addFlag('help', abbr: 'h', negatable: false,
-      help: 'Print this usage information.');
-  parser.addFlag('version', negatable: false,
-      help: 'Print pub version.');
-  parser.addFlag('trace',
-       help: 'Print debugging information when an error occurs.');
-  parser.addOption('verbosity',
-      help: 'Control output verbosity.',
-      allowed: ['normal', 'io', 'solver', 'all'],
-      allowedHelp: {
-        'normal': 'Show errors, warnings, and user messages.',
-        'io':     'Also show IO operations.',
-        'solver': 'Show steps during version resolution.',
-        'all':    'Show all output including internal tracing messages.'
-      });
-  parser.addFlag('verbose', abbr: 'v', negatable: false,
-      help: 'Shortcut for "--verbosity=all"');
-  return parser;
-}
-
-main() {
-  var globalOptions;
-  try {
-    globalOptions = pubArgParser.parse(new Options().arguments);
-  } on FormatException catch (e) {
-    log.error(e.message);
-    log.error('Run "pub help" to see available options.');
-    exit(exit_codes.USAGE);
-  }
-
-  if (globalOptions['version']) {
-    printVersion();
-    return;
-  }
-
-  if (globalOptions['help'] || globalOptions.rest.isEmpty) {
-    printUsage();
-    return;
-  }
-
-  if (globalOptions['trace']) {
-    log.recordTranscript();
-  }
-
-  switch (globalOptions['verbosity']) {
-    case 'normal': log.showNormal(); break;
-    case 'io': log.showIO(); break;
-    case 'solver': log.showSolver(); break;
-    case 'all': log.showAll(); break;
-    default:
-      // No specific verbosity given, so check for the shortcut.
-      if (globalOptions['verbose']) {
-        log.showAll();
-      } else {
-        log.showNormal();
-      }
-      break;
-  }
-
-  SecureSocket.initialize(database: relativeToPub('resource/certs'));
-
-  var cacheDir;
-  if (Platform.environment.containsKey('PUB_CACHE')) {
-    cacheDir = Platform.environment['PUB_CACHE'];
-  } else if (Platform.operatingSystem == 'windows') {
-    var appData = Platform.environment['APPDATA'];
-    cacheDir = path.join(appData, 'Pub', 'Cache');
-  } else {
-    cacheDir = '${Platform.environment['HOME']}/.pub-cache';
-  }
-
-  validatePlatform().then((_) {
-    var cache = new SystemCache.withSources(cacheDir);
-
-    // Select the command.
-    var command = pubCommands[globalOptions.rest[0]];
-    if (command == null) {
-      log.error('Could not find a command named "${globalOptions.rest[0]}".');
-      log.error('Run "pub help" to see available commands.');
-      exit(exit_codes.USAGE);
-      return;
-    }
-
-    var commandArgs = globalOptions.rest.sublist(1);
-    command.run(cache, globalOptions, commandArgs);
-  });
-}
-
-/// Checks that pub is running on a supported platform. If it isn't, it prints
-/// an error message and exits. Completes when the validation is done.
-Future validatePlatform() {
-  return new Future.sync(() {
-    if (Platform.operatingSystem != 'windows') return;
-
-    return runProcess('ver', []).then((result) {
-      if (result.stdout.join('\n').contains('XP')) {
-        log.error('Sorry, but pub is not supported on Windows XP.');
-        exit(exit_codes.USAGE);
-      }
-    });
-  });
-}
-
-/// Displays usage information for the app.
-void printUsage([String description = 'Pub is a package manager for Dart.']) {
-  // Build up a buffer so it shows up as a single log entry.
-  var buffer = new StringBuffer();
-  buffer.write(description);
-  buffer.write('\n\n');
-  buffer.write('Usage: pub command [arguments]\n\n');
-  buffer.write('Global options:\n');
-  buffer.write('${pubArgParser.getUsage()}\n\n');
-
-  // Show the commands sorted.
-  buffer.write('Available commands:\n');
-
-  // TODO(rnystrom): A sorted map would be nice.
-  int length = 0;
-  var names = <String>[];
-  for (var command in pubCommands.keys) {
-    // Hide aliases.
-    if (pubCommands[command].aliases.indexOf(command) >= 0) continue;
-    length = max(length, command.length);
-    names.add(command);
-  }
-
-  names.sort((a, b) => a.compareTo(b));
-
-  for (var name in names) {
-    buffer.write('  ${padRight(name, length)}   '
-        '${pubCommands[name].description}\n');
-  }
-
-  buffer.write('\n');
-  buffer.write(
-      'Use "pub help [command]" for more information about a command.');
-  log.message(buffer.toString());
-}
-
-void printVersion() {
-  log.message('Pub ${sdk.version}');
-}
-
-abstract class PubCommand {
-  SystemCache cache;
-  ArgResults globalOptions;
-  ArgResults commandOptions;
-
-  Entrypoint entrypoint;
-
-  /// A one-line description of this command.
-  String get description;
-
-  /// How to invoke this command (e.g. `"pub install [package]"`).
-  String get usage;
-
-  /// Whether or not this command requires [entrypoint] to be defined. If false,
-  /// Pub won't look for a pubspec and [entrypoint] will be null when the
-  /// command runs.
-  final requiresEntrypoint = true;
-
-  /// Alternate names for this command. These names won't be used in the
-  /// documentation, but they will work when invoked on the command line.
-  final aliases = const <String>[];
-
-  /// Override this to define command-specific options. The results will be made
-  /// available in [commandOptions].
-  ArgParser get commandParser => new ArgParser();
-
-  void run(SystemCache cache_, ArgResults globalOptions_,
-      List<String> commandArgs) {
-    cache = cache_;
-    globalOptions = globalOptions_;
-
-    try {
-      commandOptions = commandParser.parse(commandArgs);
-    } on FormatException catch (e) {
-      log.error(e.message);
-      log.error('Use "pub help" for more information.');
-      exit(exit_codes.USAGE);
-    }
-
-    handleError(error) {
-      var trace = getAttachedStackTrace(error);
-
-      // This is basically the top-level exception handler so that we don't
-      // spew a stack trace on our users.
-      var message;
-
-      try {
-        // Most exception types have a "message" property. We prefer this since
-        // it skips the "Exception:", "HttpException:", etc. prefix that calling
-        // toString() adds. But, alas, "message" isn't actually defined in the
-        // base Exception type so there's no easy way to know if it's available
-        // short of a giant pile of type tests for each known exception type.
-        //
-        // So just try it. If it throws, default to toString().
-        message = error.message;
-      } on NoSuchMethodError catch (_) {
-        message = error.toString();
-      }
-
-      log.error(message);
-
-      if (trace != null) {
-        if (globalOptions['trace'] || !isUserFacingException(error)) {
-          log.error(trace);
-        } else {
-          log.fine(trace);
-        }
-      }
-
-      if (globalOptions['trace']) {
-        log.dumpTranscript();
-      } else if (!isUserFacingException(error)) {
-        log.error("""
-This is an unexpected error. Please run
-
-    pub --trace ${new Options().arguments.map((arg) => "'$arg'").join(' ')}
-
-and include the results in a bug report on http://dartbug.com/new.
-""");
-      }
-
-      exit(_chooseExitCode(error));
-    }
-
-    new Future.sync(() {
-      if (requiresEntrypoint) {
-        // TODO(rnystrom): Will eventually need better logic to walk up
-        // subdirectories until we hit one that looks package-like. For now,
-        // just assume the cwd is it.
-        entrypoint = new Entrypoint(path.current, cache);
-      }
-
-      var commandFuture = onRun();
-      if (commandFuture == null) return true;
-
-      return commandFuture;
-    }).whenComplete(() => cache_.deleteTempDir()).catchError((e) {
-      if (e is PubspecNotFoundException && e.name == null) {
-        e = 'Could not find a file named "pubspec.yaml" in the directory '
-          '${path.current}.';
-      } else if (e is PubspecHasNoNameException && e.name == null) {
-        e = 'pubspec.yaml is missing the required "name" field (e.g. "name: '
-          '${path.basename(path.current)}").';
-      }
-
-      handleError(e);
-    }).then((_) {
-      // Explicitly exit on success to ensure that any dangling dart:io handles
-      // don't cause the process to never terminate.
-      exit(0);
-    });
-  }
-
-  /// Override this to perform the specific command. Return a future that
-  /// completes when the command is done or fails if the command fails. If the
-  /// command is synchronous, it may return `null`.
-  Future onRun();
-
-  /// Displays usage information for this command.
-  void printUsage([String description]) {
-    if (description == null) description = this.description;
-
-    var buffer = new StringBuffer();
-    buffer.write('$description\n\nUsage: $usage');
-
-    var commandUsage = commandParser.getUsage();
-    if (!commandUsage.isEmpty) {
-      buffer.write('\n');
-      buffer.write(commandUsage);
-    }
-
-    log.message(buffer.toString());
-  }
-
-  /// Returns the appropriate exit code for [exception], falling back on 1 if no
-  /// appropriate exit code could be found.
-  int _chooseExitCode(exception) {
-    if (exception is HttpException || exception is HttpParserException ||
-        exception is SocketIOException || exception is PubHttpException) {
-      return exit_codes.UNAVAILABLE;
-    } else if (exception is FormatException) {
-      return exit_codes.DATA;
-    } else {
-      return 1;
-    }
-  }
-}
diff --git a/utils/pub/pub.gyp b/utils/pub/pub.gyp
new file mode 100644
index 0000000..d15bcdb
--- /dev/null
+++ b/utils/pub/pub.gyp
@@ -0,0 +1,37 @@
+# Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'pub',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+        '../../pkg/pkg.gyp:pkg_packages',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_pub_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../sdk/lib/_internal/pub"])',
+            '../../sdk/lib/_internal/libraries.dart',
+            '<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../sdk/lib/_internal/compiler"])',
+            '<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../pkg"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/pub.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--package-root=<(PRODUCT_DIR)/packages/',
+            '--generate-script-snapshot=<(SHARED_INTERMEDIATE_DIR)/pub.dart.snapshot',
+            '../../sdk/lib/_internal/pub/bin/pub.dart',
+          ],
+        },
+      ],
+    },
+  ],
+}
diff --git a/utils/pub/pub.target.mk b/utils/pub/pub.target.mk
new file mode 100644
index 0000000..6ddab0c
--- /dev/null
+++ b/utils/pub/pub.target.mk
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+TOOLSET := target
+TARGET := pub
+### Rules for action "generate_pub_snapshot":
+quiet_cmd_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot = ACTION dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot $@
+cmd_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd utils/pub; mkdir -p $(obj)/gen; "$(builddir)/dart" "--package-root=$(builddir)/packages/" "--generate-script-snapshot=$(obj)/gen/pub.dart.snapshot" ../../sdk/lib/_internal/pub/bin/pub.dart
+
+$(obj)/gen/pub.dart.snapshot: obj := $(abs_obj)
+$(obj)/gen/pub.dart.snapshot: builddir := $(abs_builddir)
+$(obj)/gen/pub.dart.snapshot: TOOLSET := $(TOOLSET)
+$(obj)/gen/pub.dart.snapshot: $(builddir)/dart sdk/lib/_internal/pub/bin/pub.dart sdk/lib/_internal/pub/lib/src/http.dart sdk/lib/_internal/pub/lib/src/utils.dart sdk/lib/_internal/pub/lib/src/git_source.dart sdk/lib/_internal/pub/lib/src/command_install.dart sdk/lib/_internal/pub/lib/src/exit_codes.dart sdk/lib/_internal/pub/lib/src/command.dart sdk/lib/_internal/pub/lib/src/source_registry.dart sdk/lib/_internal/pub/lib/src/pubspec.dart sdk/lib/_internal/pub/lib/src/command_help.dart sdk/lib/_internal/pub/lib/src/oauth2.dart sdk/lib/_internal/pub/lib/src/command_uploader.dart sdk/lib/_internal/pub/lib/src/error_group.dart sdk/lib/_internal/pub/lib/src/directory_tree.dart sdk/lib/_internal/pub/lib/src/sdk.dart sdk/lib/_internal/pub/lib/src/hosted_source.dart sdk/lib/_internal/pub/lib/src/version.dart sdk/lib/_internal/pub/lib/src/git.dart sdk/lib/_internal/pub/lib/src/io.dart sdk/lib/_internal/pub/lib/src/system_cache.dart sdk/lib/_internal/pub/lib/src/safe_http_server.dart sdk/lib/_internal/pub/lib/src/command_update.dart sdk/lib/_internal/pub/lib/src/command_version.dart sdk/lib/_internal/pub/lib/src/validator.dart sdk/lib/_internal/pub/lib/src/command_cache.dart sdk/lib/_internal/pub/lib/src/source.dart sdk/lib/_internal/pub/lib/src/command_lish.dart sdk/lib/_internal/pub/lib/src/package.dart sdk/lib/_internal/pub/lib/src/log.dart sdk/lib/_internal/pub/lib/src/entrypoint.dart sdk/lib/_internal/pub/lib/src/lock_file.dart sdk/lib/_internal/pub/lib/src/path_source.dart sdk/lib/_internal/pub/lib/src/validator/name.dart sdk/lib/_internal/pub/lib/src/validator/size.dart sdk/lib/_internal/pub/lib/src/validator/pubspec_field.dart sdk/lib/_internal/pub/lib/src/validator/compiled_dartdoc.dart sdk/lib/_internal/pub/lib/src/validator/directory.dart sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart sdk/lib/_internal/pub/lib/src/validator/dependency.dart sdk/lib/_internal/pub/lib/src/validator/license.dart sdk/lib/_internal/pub/lib/src/validator/lib.dart sdk/lib/_internal/pub/lib/src/solver/version_solver.dart sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart sdk/lib/_internal/pub/test/command_line_config.dart sdk/lib/_internal/pub/test/version_test.dart sdk/lib/_internal/pub/test/io_test.dart sdk/lib/_internal/pub/test/pub_cache_test.dart sdk/lib/_internal/pub/test/test_pub.dart sdk/lib/_internal/pub/test/lock_file_test.dart sdk/lib/_internal/pub/test/real_version_test.dart sdk/lib/_internal/pub/test/directory_tree_test.dart sdk/lib/_internal/pub/test/dev_dependency_test.dart sdk/lib/_internal/pub/test/pubspec_test.dart sdk/lib/_internal/pub/test/pub_test.dart sdk/lib/_internal/pub/test/version_solver_test.dart sdk/lib/_internal/pub/test/descriptor.dart sdk/lib/_internal/pub/test/error_group_test.dart sdk/lib/_internal/pub/test/pub_uploader_test.dart sdk/lib/_internal/pub/test/lish/cloud_storage_upload_doesnt_redirect_test.dart sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart sdk/lib/_internal/pub/test/lish/upload_form_provides_an_error_test.dart sdk/lib/_internal/pub/test/lish/utils.dart sdk/lib/_internal/pub/test/lish/package_creation_provides_a_malformed_error_test.dart sdk/lib/_internal/pub/test/lish/package_validation_has_a_warning_and_is_canceled_test.dart sdk/lib/_internal/pub/test/lish/force_cannot_be_combined_with_dry_run_test.dart sdk/lib/_internal/pub/test/lish/upload_form_fields_is_not_a_map_test.dart sdk/lib/_internal/pub/test/lish/package_creation_provides_invalid_json_test.dart sdk/lib/_internal/pub/test/lish/package_creation_provides_a_malformed_success_test.dart sdk/lib/_internal/pub/test/lish/package_creation_provides_an_error_test.dart sdk/lib/_internal/pub/test/lish/upload_form_is_missing_url_test.dart sdk/lib/_internal/pub/test/lish/force_does_not_publish_if_there_are_errors_test.dart sdk/lib/_internal/pub/test/lish/upload_form_is_missing_fields_test.dart sdk/lib/_internal/pub/test/lish/package_validation_has_an_error_test.dart sdk/lib/_internal/pub/test/lish/preview_package_validation_has_a_warning_test.dart sdk/lib/_internal/pub/test/lish/package_validation_has_a_warning_and_continues_test.dart sdk/lib/_internal/pub/test/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart sdk/lib/_internal/pub/test/lish/preview_package_validation_has_no_warnings_test.dart sdk/lib/_internal/pub/test/lish/archives_and_uploads_a_package_test.dart sdk/lib/_internal/pub/test/lish/upload_form_url_is_not_a_string_test.dart sdk/lib/_internal/pub/test/lish/force_publishes_if_there_are_warnings_test.dart sdk/lib/_internal/pub/test/lish/upload_form_fields_has_a_non_string_value_test.dart sdk/lib/_internal/pub/test/lish/upload_form_provides_invalid_json_test.dart sdk/lib/_internal/pub/test/update/pub_update_test.dart sdk/lib/_internal/pub/test/update/git/do_not_update_if_unneeded_test.dart sdk/lib/_internal/pub/test/update/git/update_to_incompatible_pubspec_test.dart sdk/lib/_internal/pub/test/update/git/update_to_nonexistent_pubspec_test.dart sdk/lib/_internal/pub/test/update/git/update_locked_test.dart sdk/lib/_internal/pub/test/update/git/update_one_locked_test.dart sdk/lib/_internal/pub/test/update/hosted/fail_gracefully_on_missing_package_test.dart sdk/lib/_internal/pub/test/update/hosted/unlock_dependers_test.dart sdk/lib/_internal/pub/test/update/hosted/unlock_if_necessary_test.dart sdk/lib/_internal/pub/test/update/hosted/fail_gracefully_on_url_resolve_test.dart sdk/lib/_internal/pub/test/update/hosted/remove_removed_transitive_dependency_test.dart sdk/lib/_internal/pub/test/update/hosted/update_removed_constraints_test.dart sdk/lib/_internal/pub/test/update/hosted/remove_removed_dependency_test.dart sdk/lib/_internal/pub/test/validator/license_test.dart sdk/lib/_internal/pub/test/validator/utils.dart sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart sdk/lib/_internal/pub/test/validator/dependency_test.dart sdk/lib/_internal/pub/test/validator/directory_test.dart sdk/lib/_internal/pub/test/validator/name_test.dart sdk/lib/_internal/pub/test/validator/lib_test.dart sdk/lib/_internal/pub/test/validator/size_test.dart sdk/lib/_internal/pub/test/validator/utf8_readme_test.dart sdk/lib/_internal/pub/test/validator/compiled_dartdoc_test.dart sdk/lib/_internal/pub/test/oauth2/utils.dart sdk/lib/_internal/pub/test/oauth2/with_server_rejected_credentials_authenticates_again_test.dart sdk/lib/_internal/pub/test/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart sdk/lib/_internal/pub/test/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart sdk/lib/_internal/pub/test/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart sdk/lib/_internal/pub/test/oauth2/with_a_malformed_credentials_authenticates_again_test.dart sdk/lib/_internal/pub/test/descriptor/tar.dart sdk/lib/_internal/pub/test/descriptor/git.dart sdk/lib/_internal/pub/test/install/pub_install_test.dart sdk/lib/_internal/pub/test/install/relative_symlink_test.dart sdk/lib/_internal/pub/test/install/broken_symlink_test.dart sdk/lib/_internal/pub/test/install/switch_source_test.dart sdk/lib/_internal/pub/test/install/git/check_out_transitive_test.dart sdk/lib/_internal/pub/test/install/git/unlock_if_incompatible_test.dart sdk/lib/_internal/pub/test/install/git/require_pubspec_test.dart sdk/lib/_internal/pub/test/install/git/check_out_with_trailing_slash_test.dart sdk/lib/_internal/pub/test/install/git/dependency_name_match_pubspec_test.dart sdk/lib/_internal/pub/test/install/git/check_out_branch_test.dart sdk/lib/_internal/pub/test/install/git/stay_locked_if_compatible_test.dart sdk/lib/_internal/pub/test/install/git/check_out_and_update_test.dart sdk/lib/_internal/pub/test/install/git/check_out_twice_test.dart sdk/lib/_internal/pub/test/install/git/check_out_test.dart sdk/lib/_internal/pub/test/install/git/lock_version_test.dart sdk/lib/_internal/pub/test/install/git/require_pubspec_name_test.dart sdk/lib/_internal/pub/test/install/git/check_out_revision_test.dart sdk/lib/_internal/pub/test/install/git/different_repo_name_test.dart sdk/lib/_internal/pub/test/install/hosted/unlock_if_incompatible_test.dart sdk/lib/_internal/pub/test/install/hosted/fail_gracefully_on_missing_package_test.dart sdk/lib/_internal/pub/test/install/hosted/do_not_update_on_removed_constraints_test.dart sdk/lib/_internal/pub/test/install/hosted/stay_locked_test.dart sdk/lib/_internal/pub/test/install/hosted/install_test.dart sdk/lib/_internal/pub/test/install/hosted/stay_locked_if_compatible_test.dart sdk/lib/_internal/pub/test/install/hosted/install_transitive_test.dart sdk/lib/_internal/pub/test/install/hosted/fail_gracefully_on_url_resolve_test.dart sdk/lib/_internal/pub/test/install/hosted/remove_removed_transitive_dependency_test.dart sdk/lib/_internal/pub/test/install/hosted/unlock_if_new_is_unsatisfied_test.dart sdk/lib/_internal/pub/test/install/hosted/stay_locked_if_new_is_satisfied_test.dart sdk/lib/_internal/pub/test/install/hosted/remove_removed_dependency_test.dart sdk/lib/_internal/pub/test/install/hosted/cached_pubspec_test.dart sdk/lib/_internal/pub/test/install/hosted/resolve_constraints_test.dart sdk/lib/_internal/pub/test/install/hosted/repair_cache_test.dart sdk/lib/_internal/pub/test/install/path/nonexistent_dir_test.dart sdk/lib/_internal/pub/test/install/path/absolute_path_test.dart sdk/lib/_internal/pub/test/install/path/relative_symlink_test.dart sdk/lib/_internal/pub/test/install/path/shared_dependency_test.dart sdk/lib/_internal/pub/test/install/path/shared_dependency_symlink_test.dart sdk/lib/_internal/pub/test/install/path/absolute_symlink_test.dart sdk/lib/_internal/pub/test/install/path/no_pubspec_test.dart sdk/lib/_internal/pub/test/install/path/relative_path_test.dart sdk/lib/_internal/pub/test/install/path/path_is_file_test.dart sdk/lib/_internal/libraries.dart sdk/lib/_internal/compiler/compiler.dart sdk/lib/_internal/compiler/implementation/dart_types.dart sdk/lib/_internal/compiler/implementation/string_validator.dart sdk/lib/_internal/compiler/implementation/world.dart sdk/lib/_internal/compiler/implementation/typechecker.dart sdk/lib/_internal/compiler/implementation/filenames.dart sdk/lib/_internal/compiler/implementation/dart2js.dart sdk/lib/_internal/compiler/implementation/patch_parser.dart sdk/lib/_internal/compiler/implementation/constants.dart sdk/lib/_internal/compiler/implementation/script.dart sdk/lib/_internal/compiler/implementation/library_loader.dart sdk/lib/_internal/compiler/implementation/enqueue.dart sdk/lib/_internal/compiler/implementation/compiler.dart sdk/lib/_internal/compiler/implementation/diagnostic_listener.dart sdk/lib/_internal/compiler/implementation/warnings.dart sdk/lib/_internal/compiler/implementation/source_file_provider.dart sdk/lib/_internal/compiler/implementation/tree_validator.dart sdk/lib/_internal/compiler/implementation/apiimpl.dart sdk/lib/_internal/compiler/implementation/native_handler.dart sdk/lib/_internal/compiler/implementation/constant_system_dart.dart sdk/lib/_internal/compiler/implementation/dart2jslib.dart sdk/lib/_internal/compiler/implementation/compile_time_constants.dart sdk/lib/_internal/compiler/implementation/closure.dart sdk/lib/_internal/compiler/implementation/code_buffer.dart sdk/lib/_internal/compiler/implementation/source_file.dart sdk/lib/_internal/compiler/implementation/deferred_load.dart sdk/lib/_internal/compiler/implementation/resolved_visitor.dart sdk/lib/_internal/compiler/implementation/colors.dart sdk/lib/_internal/compiler/implementation/source_map_builder.dart sdk/lib/_internal/compiler/implementation/constant_system.dart sdk/lib/_internal/compiler/implementation/util/characters.dart sdk/lib/_internal/compiler/implementation/util/util.dart sdk/lib/_internal/compiler/implementation/util/uri_extras.dart sdk/lib/_internal/compiler/implementation/util/link_implementation.dart sdk/lib/_internal/compiler/implementation/util/link.dart sdk/lib/_internal/compiler/implementation/util/util_implementation.dart sdk/lib/_internal/compiler/implementation/tools/mini_parser.dart sdk/lib/_internal/compiler/implementation/dart_backend/utils.dart sdk/lib/_internal/compiler/implementation/dart_backend/dart_backend.dart sdk/lib/_internal/compiler/implementation/dart_backend/emitter.dart sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart sdk/lib/_internal/compiler/implementation/dart_backend/renamer.dart sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart sdk/lib/_internal/compiler/implementation/js_backend/namer.dart sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart sdk/lib/_internal/compiler/implementation/js_backend/backend.dart sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart sdk/lib/_internal/compiler/implementation/lib/string_helper.dart sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_rti.dart sdk/lib/_internal/compiler/implementation/lib/core_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_array.dart sdk/lib/_internal/compiler/implementation/lib/mirrors_patch.dart sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart sdk/lib/_internal/compiler/implementation/lib/async_patch.dart sdk/lib/_internal/compiler/implementation/lib/collection_dev_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_helper.dart sdk/lib/_internal/compiler/implementation/lib/scalarlist_patch.dart sdk/lib/_internal/compiler/implementation/lib/native_helper.dart sdk/lib/_internal/compiler/implementation/lib/io_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_number.dart sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart sdk/lib/_internal/compiler/implementation/lib/constant_map.dart sdk/lib/_internal/compiler/implementation/lib/typed_data_patch.dart sdk/lib/_internal/compiler/implementation/lib/math_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_string.dart sdk/lib/_internal/compiler/implementation/lib/json_patch.dart sdk/lib/_internal/compiler/implementation/lib/foreign_helper.dart sdk/lib/_internal/compiler/implementation/lib/interceptors.dart sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart sdk/lib/_internal/compiler/implementation/mirrors/util.dart sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart sdk/lib/_internal/compiler/implementation/resolution/scope.dart sdk/lib/_internal/compiler/implementation/resolution/resolution.dart sdk/lib/_internal/compiler/implementation/resolution/secret_tree_element.dart sdk/lib/_internal/compiler/implementation/resolution/members.dart sdk/lib/_internal/compiler/implementation/ssa/ssa.dart sdk/lib/_internal/compiler/implementation/ssa/bailout.dart sdk/lib/_internal/compiler/implementation/ssa/codegen.dart sdk/lib/_internal/compiler/implementation/ssa/types.dart sdk/lib/_internal/compiler/implementation/ssa/validate.dart sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart sdk/lib/_internal/compiler/implementation/ssa/optimize.dart sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart sdk/lib/_internal/compiler/implementation/ssa/nodes.dart sdk/lib/_internal/compiler/implementation/ssa/value_set.dart sdk/lib/_internal/compiler/implementation/ssa/builder.dart sdk/lib/_internal/compiler/implementation/ssa/tracer.dart sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart sdk/lib/_internal/compiler/implementation/js/precedence.dart sdk/lib/_internal/compiler/implementation/js/nodes.dart sdk/lib/_internal/compiler/implementation/js/builder.dart sdk/lib/_internal/compiler/implementation/js/printer.dart sdk/lib/_internal/compiler/implementation/js/js.dart sdk/lib/_internal/compiler/implementation/types/types.dart sdk/lib/_internal/compiler/implementation/types/type_mask.dart sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart sdk/lib/_internal/compiler/implementation/elements/elements.dart sdk/lib/_internal/compiler/implementation/elements/modelx.dart sdk/lib/_internal/compiler/implementation/universe/selector_map.dart sdk/lib/_internal/compiler/implementation/universe/universe.dart sdk/lib/_internal/compiler/implementation/universe/function_set.dart sdk/lib/_internal/compiler/implementation/universe/full_function_set.dart sdk/lib/_internal/compiler/implementation/scanner/byte_array_scanner.dart sdk/lib/_internal/compiler/implementation/scanner/byte_strings.dart sdk/lib/_internal/compiler/implementation/scanner/scannerlib.dart sdk/lib/_internal/compiler/implementation/scanner/scanner_implementation.dart sdk/lib/_internal/compiler/implementation/scanner/listener.dart sdk/lib/_internal/compiler/implementation/scanner/class_element_parser.dart sdk/lib/_internal/compiler/implementation/scanner/parser_task.dart sdk/lib/_internal/compiler/implementation/scanner/scanner.dart sdk/lib/_internal/compiler/implementation/scanner/keyword.dart sdk/lib/_internal/compiler/implementation/scanner/scanner_task.dart sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart sdk/lib/_internal/compiler/implementation/scanner/token.dart sdk/lib/_internal/compiler/implementation/scanner/parser.dart sdk/lib/_internal/compiler/implementation/scanner/array_based_scanner.dart sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart sdk/lib/_internal/compiler/implementation/tree/visitors.dart sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart sdk/lib/_internal/compiler/implementation/tree/unparser.dart sdk/lib/_internal/compiler/implementation/tree/tree.dart sdk/lib/_internal/compiler/implementation/tree/nodes.dart sdk/lib/_internal/compiler/implementation/tree/dartstring.dart sdk/lib/_internal/compiler/samples/leap/leap_leg.dart sdk/lib/_internal/compiler/samples/leap/request_cache.dart sdk/lib/_internal/compiler/samples/leap/leap_script.dart sdk/lib/_internal/compiler/samples/leap/leap_server.dart sdk/lib/_internal/compiler/samples/leap/leap.dart pkg/intl/lib/number_symbols.dart pkg/intl/lib/intl.dart pkg/intl/lib/number_format.dart pkg/intl/lib/date_format.dart pkg/intl/lib/number_symbols_data.dart pkg/intl/lib/date_symbol_data_http_request.dart pkg/intl/lib/intl_browser.dart pkg/intl/lib/bidi_utils.dart pkg/intl/lib/date_symbol_data_local.dart pkg/intl/lib/date_time_patterns.dart pkg/intl/lib/message_lookup_by_library.dart pkg/intl/lib/date_symbol_data_file.dart pkg/intl/lib/extract_messages.dart pkg/intl/lib/generate_localized.dart pkg/intl/lib/bidi_formatter.dart pkg/intl/lib/date_symbols.dart pkg/intl/lib/intl_standalone.dart pkg/intl/lib/src/date_format_helpers.dart pkg/intl/lib/src/http_request_data_reader.dart pkg/intl/lib/src/file_data_reader.dart pkg/intl/lib/src/date_format_internal.dart pkg/intl/lib/src/intl_message.dart pkg/intl/lib/src/intl_helpers.dart pkg/intl/lib/src/date_format_field.dart pkg/intl/lib/src/lazy_locale_data.dart pkg/intl/lib/src/data/dates/localeList.dart pkg/intl/test/date_time_format_local_odd_test.dart pkg/intl/test/data_directory.dart pkg/intl/test/date_time_format_local_even_test.dart pkg/intl/test/intl_message_basic_example_test.dart pkg/intl/test/number_test_data.dart pkg/intl/test/bidi_utils_test.dart pkg/intl/test/date_time_format_test_data.dart pkg/intl/test/number_closure_test.dart pkg/intl/test/date_time_format_file_even_test.dart pkg/intl/test/number_format_test.dart pkg/intl/test/intl_test.dart pkg/intl/test/find_default_locale_standalone_test.dart pkg/intl/test/date_time_format_test_core.dart pkg/intl/test/date_time_format_http_request_test.dart pkg/intl/test/date_time_format_uninitialized_test.dart pkg/intl/test/date_time_format_test_stub.dart pkg/intl/test/find_default_locale_browser_test.dart pkg/intl/test/bidi_format_test.dart pkg/intl/test/date_time_format_file_odd_test.dart pkg/intl/test/message_extraction/generate_from_json.dart pkg/intl/test/message_extraction/sample_with_messages.dart pkg/intl/test/message_extraction/make_hardcoded_translation.dart pkg/intl/test/message_extraction/part_of_sample_with_messages.dart pkg/intl/test/message_extraction/extract_to_json.dart pkg/intl/test/message_extraction/message_extraction_test.dart pkg/intl/tool/generate_locale_data_files.dart pkg/intl/example/basic/basic_example_runner.dart pkg/intl/example/basic/basic_example.dart pkg/intl/example/basic/messages_de.dart pkg/intl/example/basic/messages_all.dart pkg/intl/example/basic/messages_th_th.dart pkg/serialization/lib/serialization.dart pkg/serialization/lib/src/format.dart pkg/serialization/lib/src/serialization_rule.dart pkg/serialization/lib/src/serialization_helpers.dart pkg/serialization/lib/src/mirrors_helpers.dart pkg/serialization/lib/src/basic_rule.dart pkg/serialization/lib/src/reader_writer.dart pkg/serialization/test/serialization_test.dart pkg/serialization/test/test_models.dart pkg/serialization/test/polyfill_identity_map_test.dart pkg/serialization/test/no_library_test.dart pkg/analyzer_experimental/bin/analyzer.dart pkg/analyzer_experimental/lib/options.dart pkg/analyzer_experimental/lib/analyzer.dart pkg/analyzer_experimental/lib/src/generated/constant.dart pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart pkg/analyzer_experimental/lib/src/generated/instrumentation.dart pkg/analyzer_experimental/lib/src/generated/source_io.dart pkg/analyzer_experimental/lib/src/generated/ast.dart pkg/analyzer_experimental/lib/src/generated/sdk.dart pkg/analyzer_experimental/lib/src/generated/element.dart pkg/analyzer_experimental/lib/src/generated/engine.dart pkg/analyzer_experimental/lib/src/generated/scanner.dart pkg/analyzer_experimental/lib/src/generated/java_core.dart pkg/analyzer_experimental/lib/src/generated/java_engine.dart pkg/analyzer_experimental/lib/src/generated/java_io.dart pkg/analyzer_experimental/lib/src/generated/parser.dart pkg/analyzer_experimental/lib/src/generated/java_junit.dart pkg/analyzer_experimental/lib/src/generated/sdk_io.dart pkg/analyzer_experimental/lib/src/generated/html.dart pkg/analyzer_experimental/lib/src/generated/java_engine_io.dart pkg/analyzer_experimental/lib/src/generated/error.dart pkg/analyzer_experimental/lib/src/generated/source.dart pkg/analyzer_experimental/lib/src/generated/resolver.dart pkg/analyzer_experimental/test/options_test.dart pkg/analyzer_experimental/test/generated/resolver_test.dart pkg/analyzer_experimental/test/generated/scanner_test.dart pkg/analyzer_experimental/test/generated/element_test.dart pkg/analyzer_experimental/test/generated/ast_test.dart pkg/analyzer_experimental/test/generated/test_support.dart pkg/analyzer_experimental/test/generated/parser_test.dart pkg/analyzer_experimental/example/scanner_driver.dart pkg/analyzer_experimental/example/resolver_driver.dart pkg/analyzer_experimental/example/parser_driver.dart pkg/webdriver/lib/webdriver.dart pkg/webdriver/lib/src/base64decoder.dart pkg/webdriver/test/webdriver_test.dart pkg/fixnum/lib/fixnum.dart pkg/fixnum/lib/src/int64.dart pkg/fixnum/lib/src/intx.dart pkg/fixnum/lib/src/int32.dart pkg/fixnum/test/int_32_test.dart pkg/fixnum/test/int_64_vm_test.dart pkg/fixnum/test/int_64_test.dart pkg/pathos/lib/path.dart pkg/pathos/test/pathos_test.dart pkg/pathos/test/pathos_windows_test.dart pkg/pathos/test/pathos_posix_test.dart pkg/meta/lib/meta.dart pkg/oauth2/lib/oauth2.dart pkg/oauth2/lib/src/utils.dart pkg/oauth2/lib/src/expiration_exception.dart pkg/oauth2/lib/src/credentials.dart pkg/oauth2/lib/src/authorization_exception.dart pkg/oauth2/lib/src/authorization_code_grant.dart pkg/oauth2/lib/src/handle_access_token_response.dart pkg/oauth2/lib/src/client.dart pkg/oauth2/test/utils.dart pkg/oauth2/test/handle_access_token_response_test.dart pkg/oauth2/test/authorization_code_grant_test.dart pkg/oauth2/test/client_test.dart pkg/oauth2/test/utils_test.dart pkg/oauth2/test/credentials_test.dart pkg/http/lib/http.dart pkg/http/lib/testing.dart pkg/http/lib/src/io_client.dart pkg/http/lib/src/utils.dart pkg/http/lib/src/base_request.dart pkg/http/lib/src/streamed_response.dart pkg/http/lib/src/byte_stream.dart pkg/http/lib/src/base_client.dart pkg/http/lib/src/streamed_request.dart pkg/http/lib/src/base_response.dart pkg/http/lib/src/mock_client.dart pkg/http/lib/src/response.dart pkg/http/lib/src/request.dart pkg/http/lib/src/client.dart pkg/http/lib/src/multipart_file.dart pkg/http/lib/src/multipart_request.dart pkg/http/test/mock_client_test.dart pkg/http/test/utils.dart pkg/http/test/streamed_request_test.dart pkg/http/test/multipart_test.dart pkg/http/test/client_test.dart pkg/http/test/http_test.dart pkg/http/test/request_test.dart pkg/http/test/response_test.dart pkg/http/test/safe_http_server.dart pkg/expect/lib/expect.dart pkg/logging/lib/logging.dart pkg/logging/test/logging_test.dart pkg/stack_trace/lib/stack_trace.dart pkg/stack_trace/lib/src/utils.dart pkg/stack_trace/lib/src/trace.dart pkg/stack_trace/lib/src/frame.dart pkg/stack_trace/test/frame_test.dart pkg/stack_trace/test/trace_test.dart pkg/yaml/lib/yaml.dart pkg/yaml/lib/src/composer.dart pkg/yaml/lib/src/utils.dart pkg/yaml/lib/src/yaml_exception.dart pkg/yaml/lib/src/deep_equals.dart pkg/yaml/lib/src/visitor.dart pkg/yaml/lib/src/yaml_map.dart pkg/yaml/lib/src/parser.dart pkg/yaml/lib/src/model.dart pkg/yaml/lib/src/constructor.dart pkg/yaml/test/yaml_test.dart pkg/scheduled_test/lib/scheduled_test.dart pkg/scheduled_test/lib/scheduled_process.dart pkg/scheduled_test/lib/scheduled_server.dart pkg/scheduled_test/lib/descriptor.dart pkg/scheduled_test/lib/src/utils.dart pkg/scheduled_test/lib/src/schedule_error.dart pkg/scheduled_test/lib/src/task.dart pkg/scheduled_test/lib/src/substitute_future.dart pkg/scheduled_test/lib/src/scheduled_future_matchers.dart pkg/scheduled_test/lib/src/value_future.dart pkg/scheduled_test/lib/src/mock_clock.dart pkg/scheduled_test/lib/src/future_group.dart pkg/scheduled_test/lib/src/schedule.dart pkg/scheduled_test/lib/src/scheduled_server/handler.dart pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart pkg/scheduled_test/lib/src/descriptor/async_descriptor.dart pkg/scheduled_test/lib/src/descriptor/nothing_descriptor.dart pkg/scheduled_test/lib/src/descriptor/descriptor.dart pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart pkg/scheduled_test/lib/src/descriptor/pattern_descriptor.dart pkg/scheduled_test/test/utils.dart pkg/scheduled_test/test/substitute_future_test.dart pkg/scheduled_test/test/scheduled_server_test.dart pkg/scheduled_test/test/scheduled_future_matchers_test.dart pkg/scheduled_test/test/metatest.dart pkg/scheduled_test/test/value_future_test.dart pkg/scheduled_test/test/scheduled_process_test.dart pkg/scheduled_test/test/descriptor/utils.dart pkg/scheduled_test/test/descriptor/file_test.dart pkg/scheduled_test/test/descriptor/nothing_test.dart pkg/scheduled_test/test/descriptor/pattern_test.dart pkg/scheduled_test/test/descriptor/directory_test.dart pkg/scheduled_test/test/descriptor/async_test.dart pkg/scheduled_test/test/scheduled_test/current_schedule_state_test.dart pkg/scheduled_test/test/scheduled_test/current_schedule_current_task_test.dart pkg/scheduled_test/test/scheduled_test/nested_task_test.dart pkg/scheduled_test/test/scheduled_test/on_exception_test.dart pkg/scheduled_test/test/scheduled_test/task_return_value_test.dart pkg/scheduled_test/test/scheduled_test/abort_test.dart pkg/scheduled_test/test/scheduled_test/timeout_test.dart pkg/scheduled_test/test/scheduled_test/out_of_band_task_test.dart pkg/scheduled_test/test/scheduled_test/wrap_async_test.dart pkg/scheduled_test/test/scheduled_test/capture_stack_traces_test.dart pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart pkg/scheduled_test/test/scheduled_test/signal_error_test.dart pkg/scheduled_test/test/scheduled_test/set_up_test.dart pkg/scheduled_test/test/scheduled_test/on_complete_test.dart pkg/scheduled_test/test/scheduled_test/simple_test.dart pkg/scheduled_test/test/scheduled_test/current_schedule_errors_test.dart pkg/unittest/lib/unittest.dart pkg/unittest/lib/html_individual_config.dart pkg/unittest/lib/vm_config.dart pkg/unittest/lib/html_enhanced_config.dart pkg/unittest/lib/matcher.dart pkg/unittest/lib/interactive_html_config.dart pkg/unittest/lib/mock.dart pkg/unittest/lib/html_config.dart pkg/unittest/lib/compact_vm_config.dart pkg/unittest/lib/src/expect.dart pkg/unittest/lib/src/basematcher.dart pkg/unittest/lib/src/string_matchers.dart pkg/unittest/lib/src/core_matchers.dart pkg/unittest/lib/src/interfaces.dart pkg/unittest/lib/src/description.dart pkg/unittest/lib/src/future_matchers.dart pkg/unittest/lib/src/numeric_matchers.dart pkg/unittest/lib/src/iterable_matchers.dart pkg/unittest/lib/src/map_matchers.dart pkg/unittest/lib/src/config.dart pkg/unittest/lib/src/test_case.dart pkg/unittest/lib/src/operator_matchers.dart pkg/unittest/test/mock_regexp_negative_test.dart pkg/unittest/test/matchers_test.dart pkg/unittest/test/unittest_test.dart pkg/unittest/test/test_utils.dart pkg/unittest/test/instance_test.dart pkg/unittest/test/mock_test.dart pkg/unittest/test/mock_stepwise_negative_test.dart pkg/args/lib/args.dart pkg/args/lib/src/parser.dart pkg/args/lib/src/usage.dart pkg/args/test/args_test.dart pkg/args/test/usage_test.dart pkg/args/test/command_test.dart pkg/args/test/parse_test.dart pkg/args/example/test_runner.dart pkg/source_maps/lib/span.dart pkg/source_maps/lib/source_maps.dart pkg/source_maps/lib/parser.dart pkg/source_maps/lib/builder.dart pkg/source_maps/lib/printer.dart pkg/source_maps/lib/src/utils.dart pkg/source_maps/lib/src/vlq.dart pkg/source_maps/test/vlq_test.dart pkg/source_maps/test/run.dart pkg/source_maps/test/builder_test.dart pkg/source_maps/test/utils_test.dart pkg/source_maps/test/common.dart pkg/source_maps/test/parser_test.dart pkg/source_maps/test/printer_test.dart pkg/source_maps/test/span_test.dart pkg/source_maps/test/end2end_test.dart FORCE_DO_CMD
+	$(call do_cmd,dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot)
+
+all_deps += $(obj)/gen/pub.dart.snapshot
+action_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot_outputs := $(obj)/gen/pub.dart.snapshot
+
+
+### Rules for final target.
+# Build our special outputs first.
+$(obj).target/utils/pub/pub.stamp: | $(action_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot_outputs)
+
+# Preserve order dependency of special output on deps.
+$(action_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot_outputs): | $(builddir)/dart $(obj).target/pkg/pkg_packages.stamp
+
+$(obj).target/utils/pub/pub.stamp: TOOLSET := $(TOOLSET)
+$(obj).target/utils/pub/pub.stamp: $(builddir)/dart $(obj).target/pkg/pkg_packages.stamp FORCE_DO_CMD
+	$(call do_cmd,touch)
+
+all_deps += $(obj).target/utils/pub/pub.stamp
+# Add target alias
+.PHONY: pub
+pub: $(obj).target/utils/pub/pub.stamp
+
+# Add target alias to "all" target.
+.PHONY: all
+all: pub
+
diff --git a/utils/pub/sdk/pub b/utils/pub/sdk/pub
deleted file mode 100755
index c732f16..0000000
--- a/utils/pub/sdk/pub
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-# Run pub.dart on the Dart VM. This script assumes the Dart SDK's directory
-# structure.
-
-# Setting BIN_DIR this way is ugly, but is needed to handle the case where
-# dart-sdk/bin has been symlinked to. On MacOS, readlink doesn't work
-# with this case.
-BIN_DIR="$(cd "${0%/*}" ; pwd -P)"
-DART_SDK="$(cd "${BIN_DIR%/*}" ; pwd -P)"
-
-exec "$BIN_DIR"/dart --package-root="$DART_SDK"/packages/ "$DART_SDK"/util/pub/pub.dart $@
diff --git a/utils/pub/sdk/pub.bat b/utils/pub/sdk/pub.bat
deleted file mode 100644
index e41b02b..0000000
--- a/utils/pub/sdk/pub.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-@echo off
-:: 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.
-
-:: Run pub.dart on the Dart VM. This script assumes the Dart SDK's directory
-:: structure.
-
-set SCRIPTPATH=%~dp0
-
-:: Does the string have a trailing slash? If so, remove it.
-if %SCRIPTPATH:~-1%==\ set SCRIPTPATH=%SCRIPTPATH:~0,-1%
-
-:: The trailing forward slash in --package-root is required because of issue
-:: 9499.
-"%SCRIPTPATH%\dart.exe" --package-root="%SCRIPTPATH%\..\packages/" "%SCRIPTPATH%\..\util\pub\pub.dart" %*
diff --git a/utils/testrunner/http_server.dart b/utils/testrunner/http_server.dart
index 1ebd53d..1f74290 100644
--- a/utils/testrunner/http_server.dart
+++ b/utils/testrunner/http_server.dart
@@ -21,6 +21,8 @@
 /** A simple HTTP server. Currently handles serving static files. */
 class HttpTestServer {
   HttpServer server;
+  List<Function> matchers = [];
+  List<Function> handlers = [];
 
   /** If set, serve up static files from this directory. */
   String staticFileDirectory;
@@ -52,21 +54,20 @@
   };
 
   HttpTestServer(int port, this.staticFileDirectory) {
-    server = new HttpServer();
-    try {
-      server.listen("127.0.0.1", port);
+    HttpServer.bind("127.0.0.1", port).then((s) {
+      server = s;
       print('Server listening on port $port');
-    } catch (e) {
-      print('Server listen on port $port failed');
-      throw e;
-    }
-    server.onError = (e) {
-    };
-    server.defaultRequestHandler =
-      (HttpRequest request, HttpResponse response) {
+      server.listen((HttpRequest request) {
+        for (var i = 0; i < matchers.length; i++) {
+          if (matchers[i](request)) {
+            handlers[i](request);
+            return;
+          }
+        }
+        HttpResponse response = request.response;
         try {
           if (staticFileDirectory != null) {
-            String fname = request.path;
+            String fname = request.uri.path;
             String path = '$staticFileDirectory$fname';
             File f = new File(path);
             if (f.existsSync()) {
@@ -78,31 +79,30 @@
                     new ContentType(ct.substring(0, idx),
                         ct.substring(idx + 1));
               }
-              f.openInputStream().pipe(response.outputStream);
+              response.addStream(f.openRead()).then((_) => response.close());
             } else {
               response.statusCode = HttpStatus.NOT_FOUND;
               response.reasonPhrase = '$path does not exist';
-              response.outputStream.close();
+              response.close();
             }
           }
         } catch(e,s) {
           response.statusCode = HttpStatus.INTERNAL_SERVER_ERROR;
           response.reasonPhrase = "$e";
-          response.outputStream.writeString(s.toString());
-          response.outputStream.close();
+          response.write(s);
+          response.close();
         }
-      };
+      });
+    });
   }
 
-  void addHandler(Function matcher, handler) {
-    if (handler is Function) {
-      server.addRequestHandler(matcher, handler);
-    } else {
-      server.addRequestHandler(matcher, handler.onRequest);
-    }
+  void addHandler(Function matcher, Function handler) {
+    matchers.add(matcher);
+    handlers.add(handler);
   }
 
   void close() {
     server.close();
   }
 }
+
diff --git a/utils/testrunner/layout_test_controller.dart b/utils/testrunner/layout_test_controller.dart
index b6c8ff7..27cd1cb 100644
--- a/utils/testrunner/layout_test_controller.dart
+++ b/utils/testrunner/layout_test_controller.dart
@@ -124,177 +124,223 @@
   notifyDone(failCount > 0 ? -1 : 0);
 }
 
+/*
+ * Run an external process [cmd] with command line arguments [args].
+ * [timeout] can be used to forcefully terminate the process after
+ * some number of seconds. This is used by runCommand and startProcess.
+ * If [procId] is non-zero (i.e. called from startProcess) then a reference
+ * to the [Process] will be put in a map with key [procId]; in this case
+ * the process can be terminated later by calling [stopProcess] and
+ * passing in the [procId].
+ * [outputMonitor] is an optional function that will be called back with each
+ * line of output from the process.
+ * Returns a [Future] for when the process terminates.
+ */
+Future _processHelper(String command, List<String> args,
+    List stdout, List stderr,
+    int timeout, int procId, Function outputMonitor, bool raw) {
+  var timer = null;
+  return Process.start(command, args).then((process) {
+
+    timer = new Timer(new Duration(seconds: timeout), () {
+      timer = null;
+      process.kill();
+    });
+
+    if (raw) {
+      process.stdout.listen((c) { stdout.addAll(c); });
+    } else {
+      _pipeStream(process.stdout, stdout, outputMonitor);
+    }
+    _pipeStream(process.stderr, stderr, outputMonitor);
+    return process.exitCode;
+  }).then((exitCode) {
+    if (timer != null) {
+      timer.cancel();
+    }
+    return exitCode;
+  })
+  .catchError((e) {
+    stderr.add("#Error starting process $command: ${e.error}");
+  });
+}
+
+void _pipeStream(Stream stream, List<String> destination,
+                 Function outputMonitor) {
+  stream
+      .transform(new StringDecoder())
+      .transform(new LineTransformer())
+      .listen((String line) {
+        if (outputMonitor != null) {
+          outputMonitor(line);
+        }
+        destination.add(line);
+      });
+}
+
+/**
+ * Run an external process [cmd] with command line arguments [args].
+ * [timeout] can be used to forcefully terminate the process after
+ * some number of seconds.
+ * Returns a [Future] for when the process terminates.
+ */
+Future runCommand(String command, List<String> args,
+                  List stdout, List stderr,
+                  {int timeout: 300, Function outputMonitor,
+                   bool raw: false}) {
+  return _processHelper(command, args, stdout, stderr, 
+      timeout, 0, outputMonitor, raw);
+}
+
+String parseLabel(String line) {
+  if (line.startsWith('CONSOLE MESSAGE')) {
+    var idx = line.indexOf('#TEST ');
+    if (idx > 0) {
+      return line.substring(idx + 6);
+    }
+  }
+  return null;
+}
+
 runTextLayoutTest(testNum) {
   var url = '$baseUrl?test=$testNum';
   var stdout = new List();
+  var stderr = new List();
   start = new DateTime.now();
-  Process.start(drt, [url]).then((process) {
-    // Drain stderr to not leak resources.
-    process.stderr.onData = process.stderr.read;
-    StringInputStream stdoutStringStream =
-        new StringInputStream(process.stdout);
-    stdoutStringStream.onLine = () {
-      if (stdoutStringStream.closed) return;
-      var line = stdoutStringStream.readLine();
-      while (null != line) {
-        stdout.add(line);
-        line = stdoutStringStream.readLine();
-      }
-    };
-    process.onExit = (exitCode) {
-      process.close();
-      if (stdout.length > 0 && stdout[stdout.length-1].startsWith('#EOF')) {
-        stdout.removeLast();
-      }
-      var done = false;
-      var i = 0;
-      var label = null;
-      var labelMarker = 'CONSOLE MESSAGE: #TEST ';
-      var contentMarker = 'layer at ';
-      while (i < stdout.length) {
-        if (label == null && stdout[i].startsWith(labelMarker)) {
-          label = stdout[i].substring(labelMarker.length);
-          if (label == 'NONEXISTENT') {
-            complete();
-          }
-        } else if (stdout[i].startsWith(contentMarker)) {
-          if (label == null) {
-            complete();
-          }
-          var expectedFileName =
-              '$sourceDir${Platform.pathSeparator}'
-              '${label.replaceAll("###", "_")
-                      .replaceAll(new RegExp("[^A-Za-z0-9]"),"_")}.txt';
-          var expected = new File(expectedFileName);
-          if (regenerate) {
-            var ostream = expected.openOutputStream(FileMode.WRITE);
-            while (i < stdout.length) {
-              ostream.writeString(stdout[i]);
-              ostream.writeString('\n');
-              i++;
-            }
-            ostream.close();
-            pass(start, label);
-          } else if (!expected.existsSync()) {
-            fail(start, label, 'No expectation file');
-          } else {
-            var lines = expected.readAsLinesSync();
-            var actualLength = stdout.length - i;
-            var compareCount = min(lines.length, actualLength);
-            var match = true;
-            for (var j = 0; j < compareCount; j++) {
-              if (lines[j] != stdout[i + j]) {
-                fail(start, label, 'Expectation differs at line ${j + 1}');
-                match = false;
-                break;
-              }
-            }
-            if (match) {
-              if (lines.length != actualLength) {
-                fail(start, label, 'Expectation file has wrong length');
-              } else {
-                pass(start, label);
-              }
-            }
-          }
-          done = true;
-          break;
+  runCommand(drt, [url], stdout, stderr).then((e) {
+    if (stdout.length > 0 && stdout[stdout.length-1].startsWith('#EOF')) {
+      stdout.removeLast();
+    }
+    var done = false;
+    var i = 0;
+    var label = null;
+    var contentMarker = 'layer at ';
+    while (i < stdout.length) {
+      if (label == null && (label = parseLabel(stdout[i])) != null) {
+        if (label == 'NONEXISTENT') {
+          complete();
+          return;
         }
-        i++;
+      } else if (stdout[i].startsWith(contentMarker)) {
+        if (label == null) {
+          complete();
+          return;
+        }
+        var expectedFileName =
+            '$sourceDir${Platform.pathSeparator}'
+            '${label.replaceAll("###", "_")
+                    .replaceAll(new RegExp("[^A-Za-z0-9]"),"_")}.txt';
+        var expected = new File(expectedFileName);
+        if (regenerate) {
+          var osink = expected.openWrite();
+          while (i < stdout.length) {
+            osink.write(stdout[i]);
+            osink.write('\n');
+            i++;
+          }
+          osink.close();
+          pass(start, label);
+        } else if (!expected.existsSync()) {
+          fail(start, label, 'No expectation file');
+        } else {
+          var lines = expected.readAsLinesSync();
+          var actualLength = stdout.length - i;
+          var compareCount = min(lines.length, actualLength);
+          var match = true;
+          for (var j = 0; j < compareCount; j++) {
+            if (lines[j] != stdout[i + j]) {
+              fail(start, label, 'Expectation differs at line ${j + 1}');
+              match = false;
+              break;
+            }
+          }
+          if (match) {
+            if (lines.length != actualLength) {
+              fail(start, label, 'Expectation file has wrong length');
+            } else {
+              pass(start, label);
+            }
+          }
+        }
+        done = true;
+        break;
       }
-      if (label != null) {
-        if (!done) error(start, label, 'Failed to parse output');
-        runTextLayoutTest(testNum + 1);
-      }
-    };
+      i++;
+    }
+    if (label != null) {
+      if (!done) error(start, label, 'Failed to parse output');
+      runTextLayoutTest(testNum + 1);
+    }
   });
 }
 
 runPixelLayoutTest(int testNum) {
   var url = '$baseUrl?test=$testNum';
   var stdout = new List();
+  var stderr = new List();
   start = new DateTime.now();
-  Process.start(drt, ["$url'-p"]).then((process) {
-    // Drain stderr to not leak resources.
-    process.stderr.onData = process.stderr.read;
-    ListInputStream stdoutStream = process.stdout;
-    stdoutStream.onData = () {
-      if (!stdoutStream.closed) {
-        var data = stdoutStream.read();
-        stdout.addAll(data);
+  runCommand(drt, ["$url'-p"], stdout, stderr, raw:true).then((exitCode) {
+    var contentMarker = 'Content-Length: ';
+    var eol = '\n'.codeUnitAt(0);
+    var pos = 0;
+    var label = null;
+    var done = false;
+
+    while(pos < stdout.length) {
+      StringBuffer sb = new StringBuffer();
+      while (pos < stdout.length && stdout[pos] != eol) {
+        sb.writeCharCode(stdout[pos++]);
       }
-    };
-    stdoutStream.onError = (e) {
-      print(e);
-    };
-    process.onExit = (exitCode) {
-      stdout.addAll(process.stdout.read());
-      process.close();
-      var labelMarker = 'CONSOLE MESSAGE: #TEST ';
-      var contentMarker = 'Content-Length: ';
-      var eol = '\n'.codeUnitAt(0);
-      var pos = -1;
-      var label = null;
-      var done = false;
+      if (++pos >= stdout.length && line == '') break;
+      var line = sb.toString();
 
-      while(pos < stdout.length) {
-        var idx = stdout.indexOf(eol, ++pos);
-        if (idx < 0) break;
-        StringBuffer sb = new StringBuffer();
-        for (var i = pos; i < idx; i++) {
-          sb.writeCharCode(stdout[i]);
+      if (label == null && (label = parseLabel(line)) != null) {
+        if (label == 'NONEXISTENT') {
+          complete();
         }
-        var line = sb.toString();
-
-        if (label == null && line.startsWith(labelMarker)) {
-          label = line.substring(labelMarker.length);
-          if (label == 'NONEXISTENT') {
-            complete();
-          }
-        } else if (line.startsWith(contentMarker)) {
-          if (label == null) {
-            complete();
-          }
-          var len = int.parse(line.substring(contentMarker.length));
-          pos = idx + 1;
-          var expectedFileName =
-              '$sourceDir${Platform.pathSeparator}'
-              '${label.replaceAll("###","_").
-                       replaceAll(new RegExp("[^A-Za-z0-9]"),"_")}.png';
-          var expected = new File(expectedFileName);
-          if (regenerate) {
-            var ostream = expected.openOutputStream(FileMode.WRITE);
-            ostream.writeFrom(stdout, pos, len);
-            ostream.close();
-            pass(start, label);
-          } else if (!expected.existsSync()) {
-            fail(start, label, 'No expectation file');
+      } else if (line.startsWith(contentMarker)) {
+        if (label == null) {
+          complete();
+        }
+        var len = int.parse(line.substring(contentMarker.length));
+        var expectedFileName =
+            '$sourceDir${Platform.pathSeparator}'
+            '${label.replaceAll("###","_").
+                     replaceAll(new RegExp("[^A-Za-z0-9]"),"_")}.png';
+        var expected = new File(expectedFileName);
+        if (regenerate) {
+          var osink = expected.openWrite();
+          stdout.removeRange(0, pos);
+          stdout.length = len;
+          osink.add(stdout);
+          osink.close();
+          pass(start, label);
+        } else if (!expected.existsSync()) {
+          fail(start, label, 'No expectation file');
+        } else {
+          var bytes = expected.readAsBytesSync();
+          if (bytes.length != len) {
+            fail(start, label, 'Expectation file has wrong length');
           } else {
-            var bytes = expected.readAsBytesSync();
-            if (bytes.length != len) {
-              fail(start, label, 'Expectation file has wrong length');
-            } else {
-              var match = true;
-              for (var j = 0; j < len; j++) {
-                if (bytes[j] != stdout[pos + j]) {
-                  fail(start, label, 'Expectation differs at byte ${j + 1}');
-                  match = false;
-                  break;
-                }
+            var match = true;
+            for (var j = 0; j < len; j++) {
+              if (bytes[j] != stdout[pos + j]) {
+                fail(start, label, 'Expectation differs at byte ${j + 1}');
+                match = false;
+                break;
               }
-              if (match) pass(start, label);
             }
+            if (match) pass(start, label);
           }
-          done = true;
-          break;
         }
-        pos = idx;
+        done = true;
+        break;
       }
-      if (label != null) {
-        if (!done) error(start, label, 'Failed to parse output');
-        runPixelLayoutTest(testNum + 1);
-      }
-    };
+    }
+    if (label != null) {
+      if (!done) error(start, label, 'Failed to parse output');
+      runPixelLayoutTest(testNum + 1);
+    }
   });
 }
 
diff --git a/utils/testrunner/layout_test_runner.dart b/utils/testrunner/layout_test_runner.dart
index 7dda9af..e4b91ab 100644
--- a/utils/testrunner/layout_test_runner.dart
+++ b/utils/testrunner/layout_test_runner.dart
@@ -2,15 +2,18 @@
 // 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 layout_test;
+
 // The filters must be set by the caller that #sources this file.
 List includeFilters;
-
-// TODO(gram): dart2js is not handling 'part of' properly yet; when it
-// does uncomment this.
-//part of layout_test;
-
 List excludeFilters;
 
+/**
+ * A special marker string used to separate group names and
+ * identify non-debug output.
+ */ 
+final marker = '###';
+
 class LayoutTestConfiguration extends unittest.Configuration {
   get autoStart => false;
   void onTestResult(unittest.TestCase testCase) {
@@ -19,7 +22,7 @@
 }
 
 filterTest(t) {
-  var name = t.description.replaceAll("###", " ");
+  var name = t.description.replaceAll(marker, " ");
   if (includeFilters.length > 0) {
     for (var f in includeFilters) {
       if (name.indexOf(f) >= 0) return true;
@@ -36,8 +39,8 @@
 }
 
 runTests(testMain) {
-  unittest.groupSep = '###';
-  unittest.configure(new LayoutTestConfiguration());
+  unittest.groupSep = marker;
+  unittest.unittestConfiguration = new LayoutTestConfiguration();
 
   // Create the set of test cases.
   unittest.group('', testMain);
diff --git a/utils/testrunner/options.dart b/utils/testrunner/options.dart
index 5d21bd4..0e736be 100644
--- a/utils/testrunner/options.dart
+++ b/utils/testrunner/options.dart
@@ -25,6 +25,9 @@
   parser.addFlag('checked', defaultsTo: false,
       help: 'Run tests in checked mode.');
 
+  parser.addFlag('sort', defaultsTo: false,
+      help: 'Sort test files before running.');
+
   parser.addFlag('layout-text', defaultsTo: false,
       help: 'Run text layout tests.');
 
@@ -78,8 +81,8 @@
   parser.addFlag('list-groups', defaultsTo: false,
       help: 'List test groups only, do not run tests.');
 
-  parser.addFlag('keep-files', defaultsTo: false,
-      help: 'Keep the generated files in the temporary directory.');
+  parser.addFlag('clean-files', defaultsTo: false,
+      help: 'Remove the generated files from the temporary directory.');
 
   parser.addFlag('list-options', defaultsTo: false,
       help: 'Print non-default option settings, usable as a test.config.');
@@ -92,7 +95,7 @@
       defaultsTo: false);
 
   parser.addFlag('stop-on-failure', defaultsTo: false,
-      help: 'Stop execution upon first failure.');
+      help: 'Stop execution after first file with failures.');
 
   parser.addFlag('isolate', defaultsTo: false,
       help: 'Runs each test in a separate isolate.');
@@ -101,18 +104,14 @@
 
   parser.addOption('dartsdk', help: 'Path to dart SDK.');
 
-  // The defaults here should be the name of the executable, with
-  // the assumption that it is available on the PATH.
-  parser.addOption('dart2js', help: 'Path to dart2js executable.',
-      defaultsTo: 'dart2js');
-  parser.addOption('dart',    help: 'Path to dart executable.',
-      defaultsTo: 'dart');
-  parser.addOption('drt',     help: 'Path to DumpRenderTree executable.',
-      defaultsTo: 'drt');
-
+  var tmp;
+  if (Platform.operatingSystem == 'windows') {
+    tmp = "c:\\tmp\\test";
+  } else {
+    tmp = "/tmp/test";
+  }
   parser.addOption('tempdir', help: 'Directory to store temp files.',
-      defaultsTo: '${Platform.pathSeparator}tmp'
-                  '${Platform.pathSeparator}testrunner');
+        defaultsTo: tmp);
 
   parser.addOption('test-file-pattern',
       help: 'A regular expression that test file names must match '
@@ -147,8 +146,6 @@
   parser.addOption('root',
       help: 'Root directory for HTTP server for static files');
 
-  parser.addOption('unittest',  help: '#import path for unit test library.');
-
   parser.addOption('pipeline',
       help: 'Pipeline script to use to run each test file.',
       defaultsTo: 'run_pipeline.dart');
@@ -157,34 +154,34 @@
 }
 
 /** Print a value option, quoting it if it has embedded spaces. */
-_printValueOption(String name, value, OutputStream stream) {
+_printValueOption(String name, value, IOSink dest) {
   if (value.indexOf(' ') >= 0) {
-    stream.writeString("--$name='$value'\n");
+    dest.write("--$name='$value'\n");
   } else {
-    stream.writeString("--$name=$value\n");
+    dest.write("--$name=$value\n");
   }
 }
 
 /** Print the current option values. */
 printOptions(ArgParser parser, ArgResults arguments,
-             bool includeDefaults, OutputStream stream) {
-  if (stream == null) return;
+             bool includeDefaults, IOSink dest) {
+  if (dest == null) return;
   for (var name in arguments.options) {
     if (!name.startsWith('list-')) {
       var value = arguments[name];
       var defaultValue = parser.getDefault(name);
       if (value is bool) {
         if (includeDefaults || (value != defaultValue)) {
-          stream.writeString('--${value ? "" : "no-"}$name\n');
+          dest.write('--${value ? "" : "no-"}$name\n');
         }
       } else if (value is List) {
         if (value.length > 0) {
           for (var v in value) {
-            _printValueOption(name, v, stream);
+            _printValueOption(name, v, dest);
           }
         }
       } else if (value != null && (includeDefaults || value != defaultValue)) {
-        _printValueOption(name, value, stream);
+        _printValueOption(name, value, dest);
       }
     }
   }
@@ -206,6 +203,7 @@
   // multi-valued they will take precedence over the ones in test.config.
   var commandLineArgs = new Options().arguments;
   var cfgarg = '--configfile';
+  var cfgarge = '--configfile=';
   for (var i = 0; i < commandLineArgs.length; i++) {
     if (commandLineArgs[i].startsWith(cfgarg)) {
       if (commandLineArgs[i] == cfgarg) {
@@ -214,9 +212,9 @@
         }
         options.addAll(getFileContents(commandLineArgs[++i], true).
             where((e) => e.trim().length > 0 && e[0] != '#'));
-      } else if (commandLineArgs[i].startsWith('$cfgarg=')) {
+      } else if (commandLineArgs[i].startsWith(cfgarge)) {
         options.addAll(
-            getFileContents(commandLineArgs[i].substring(cfgarg.length), true).
+            getFileContents(commandLineArgs[i].substring(cfgarge.length), true).
                 where((e) => e.trim().length > 0 && e[0] != '#'));
       } else {
         throw new Exception('Missing argument to $cfgarg');
@@ -247,10 +245,6 @@
     print('Missing required option --runtime');
     return false;
   }
-  if (config['unittest'] == null) {
-    print('Missing required option --unittest');
-    return false;
-  }
   if (config['include'].length > 0 &&
       config['exclude'].length > 0) {
     print('--include and --exclude are mutually exclusive.');
diff --git a/utils/testrunner/pipeline_utils.dart b/utils/testrunner/pipeline_utils.dart
index 94391dc..da9778a 100644
--- a/utils/testrunner/pipeline_utils.dart
+++ b/utils/testrunner/pipeline_utils.dart
@@ -4,7 +4,7 @@
 
 part of pipeline;
 
-List stdout, stderr, log;
+List log;
 var replyPort;
 int _procId = 1;
 Map _procs = {};
@@ -14,7 +14,7 @@
  * [tmpDir] directory, with name [basis], but with any extension
  * stripped and replaced by [suffix].
  */
-String createTempName(String tmpDir, String basis, String suffix) {
+String createTempName(String tmpDir, String basis, [String suffix='']) {
   var p = new Path(basis);
   return '$tmpDir${Platform.pathSeparator}'
       '${p.filenameWithoutExtension}${suffix}';
@@ -41,9 +41,7 @@
 /** Create a file [fileName] and populate it with [contents]. */
 void writeFile(String fileName, String contents) {
   var file = new File(fileName);
-  var ostream = file.openOutputStream(FileMode.WRITE);
-  ostream.writeString(contents);
-  ostream.close();
+  file.writeAsStringSync(contents);
 }
 
 /*
@@ -59,62 +57,62 @@
  * Returns a [Future] for when the process terminates.
  */
 Future _processHelper(String command, List<String> args,
-    [int timeout = 300, int procId = 0, Function outputMonitor]) {
-  var completer = procId == 0 ? new Completer() : null;
-  log.add('Running $command ${args.join(" ")}');
+    List stdout, List stderr,
+    [int timeout = 30, int procId = 0, Function outputMonitor]) {
   var timer = null;
-  var stdoutHandler, stderrHandler;
-  var processFuture = Process.start(command, args);
-  processFuture.then((process) {
-    _procs[procId] = process;
+  if (Platform.operatingSystem == 'windows' && command.endsWith('.bat')) {
+    var oldArgs = args;
+    args = new List();
+    args.add('/c');
+    // TODO(gram): We may need some escaping here if any of the
+    // components contain spaces.
+    args.add("$command ${oldArgs.join(' ')}");
+    command='cmd.exe';
+  }
+  log.add('Running $command ${args.join(" ")}');
+  
+  return Process.start(command, args)
+      .then((process) {
+        _procs[procId.toString()] = process;
 
-    timer = new Timer(new Duration(seconds: timeout), () {
-      timer = null;
-      process.kill();
-    });
+        var stdoutFuture = _pipeStream(process.stdout, stdout, outputMonitor);
+        var stderrFuture = _pipeStream(process.stderr, stderr, outputMonitor);
 
-    process.onExit = (exitCode) {
-      if (timer != null) {
-        timer.cancel();
-      }
-      process.close();
-      if (completer != null) {
-        completer.complete(exitCode);
-      }
-    };
-
-    _pipeStream(process.stdout, stdout, outputMonitor);
-    _pipeStream(process.stderr, stderr, outputMonitor);
-  });
-  processFuture.handleException((e) {
-    stderr.add("Error starting process:");
-    stderr.add("  Command: $command");
-    stderr.add("  Error: $e");
-    completePipeline(-1);
-    return true;
-  });
-
-  return completer.future;
+        timer = new Timer(new Duration(seconds: timeout), () {
+          timer = null;
+          process.kill();
+        });
+        return Future.wait([process.exitCode, stdoutFuture, stderrFuture])
+            .then((values) {
+              if (timer != null) {
+                timer.cancel();
+              }
+              return values[0];
+            });
+      })
+      .catchError((e) {
+        stderr.add("Error starting process:");
+        stderr.add("  Command: $command");
+        stderr.add("  Error: ${e.toString()}");
+        return new Future.value(-1);
+      });
 }
 
-void _pipeStream(InputStream stream, List<String> destination,
+Future _pipeStream(Stream stream, List<String> destination,
                  Function outputMonitor) {
-  var source = new StringInputStream(stream);
-  source.onLine = () {
-    if (source.available() == 0) return;
-    var line = source.readLine();
-    while (null != line) {
+  return stream
+    .transform(new StringDecoder())
+    .transform(new LineTransformer())
+    .listen((String line) {
       if (config["immediate"] && line.startsWith('###')) {
-        // TODO - when we dump the list later skip '###' messages if immediate.
         print(line.substring(3));
       }
       if (outputMonitor != null) {
         outputMonitor(line);
       }
       destination.add(line);
-      line = source.readLine();
-    }
-  };
+    })
+    .asFuture();
 }
 
 /**
@@ -124,26 +122,32 @@
  * Returns a [Future] for when the process terminates.
  */
 Future runCommand(String command, List<String> args,
-                  [int timeout = 300, Function outputMonitor]) {
-  return _processHelper(command, args, timeout, outputMonitor:outputMonitor);
+                  List stdout, List stderr,
+                  [int timeout = 30, Function outputMonitor]) {
+  return _processHelper(command, args, stdout, stderr, 
+      timeout, 0, outputMonitor);
 }
 
 /**
  * Start an external process [cmd] with command line arguments [args].
  * Returns an ID by which it can later be stopped.
  */
-int startProcess(String command, List<String> args, [Function outputMonitor]) {
+int startProcess(String command, List<String> args, List stdout, List stderr,
+                 [Function outputMonitor]) {
   int id = _procId++;
-  _processHelper(command, args, 3000, id,
-      outputMonitor:outputMonitor).then((e) {
-    _procs.remove(id);
-  });
+  var f = _processHelper(command, args, stdout, stderr, 3000, id,
+      outputMonitor);
+  if (f != null) {
+    f.then((e) {
+      _procs.remove(id.toString());
+    });
+  }
   return id;
 }
 
 /** Checks if a process is still running. */
 bool isProcessRunning(int id) {
-  return _procs.containsKey(id);
+  return _procs.containsKey(id.toString());
 }
 
 /**
@@ -151,15 +155,16 @@
  * given the id string.
  */
 void stopProcess(int id) {
-  if (_procs.containsKey(id)) {
-    Process p = _procs.remove(id);
+  var sid = id.toString();
+  if (_procs.containsKey(sid)) {
+    Process p = _procs.remove(sid);
     p.kill();
   }
 }
 
 /** Delete a file named [fname] if it exists. */
 bool cleanup(String fname) {
-  if (fname != null && !config['keep-files']) {
+  if (fname != null && config['clean-files']) {
     var f = new File(fname);
     try {
       if (f.existsSync()) {
@@ -173,6 +178,22 @@
   return true;
 }
 
+/** Delete a directory named [dname] if it exists. */
+bool cleanupDir(String dname) {
+  if (dname != null && config['clean-files']) {
+    var d = new Directory(dname);
+    try {
+      if (d.existsSync()) {
+        logMessage('Removing $dname');
+        d.deleteSync(recursive: true);
+      }
+    } catch (e) {
+      return false;
+    }
+  }
+  return true;
+}
+
 initPipeline(port) {
   replyPort = port;
   stdout = new List();
@@ -180,9 +201,12 @@
   log = new List();
 }
 
-void completePipeline([exitCode = 0]) {
+void completePipeline(List stdout, List stderr, [exitCode = 0]) {
   replyPort.send([stdout, stderr, log, exitCode]);
 }
 
 /** Utility function to log diagnostic messages. */
 void logMessage(msg) => log.add(msg);
+
+/** Turn file paths into standard form with forward slashes. */
+String normalizePath(String p) => (new Path(p)).toString();
diff --git a/utils/testrunner/pubspec.yaml b/utils/testrunner/pubspec.yaml
index 89b040e..4b47496 100644
--- a/utils/testrunner/pubspec.yaml
+++ b/utils/testrunner/pubspec.yaml
@@ -1,4 +1,3 @@
 name: testrunner
 dependencies:
-  args: { sdk: args }
-
+  args: any
diff --git a/utils/testrunner/run_pipeline.dart b/utils/testrunner/run_pipeline.dart
index ba0f75d..5fc1446 100644
--- a/utils/testrunner/run_pipeline.dart
+++ b/utils/testrunner/run_pipeline.dart
@@ -4,8 +4,10 @@
 
 /** The default pipeline code for running a test file. */
 library pipeline;
-import 'dart:isolate';
+import 'dart:async';
 import 'dart:io';
+import 'dart:isolate';
+import 'dart:math';
 part 'pipeline_utils.dart';
 
 /**
@@ -49,16 +51,26 @@
 /** Number of attempts we will make to start the HTTP server. */
 const int MAX_SERVER_TRIES = 10;
 
+/** Pipeline output. */
+List stdout;
+
+/** Pipeline errors. */
+List stderr;
+
+/** Directory where test wrappers are created. */
+String tmpDir;
+
 void main() {
   port.receive((cfg, replyPort) {
     config = cfg;
+    stdout = new List();
+    stderr = new List();
     initPipeline(replyPort);
     startHTTPServerStage();
   });
 }
 
 /** Initial pipeline stage - starts the HTTP server, if appropriate. */
-
 startHTTPServerStage() {
   if (config["server"]) {
     serverPath = config["testfile"];
@@ -86,7 +98,8 @@
         serverPort = int.parse(config["port"]);
         // Start the HTTP server.
         serverId = startProcess(config["dart"],
-            [ serverPath, '--port=$serverPort', '--root=$serverRoot']);
+            [ serverPath, '--port=$serverPort', '--root=$serverRoot'],
+            stdout, stderr);
       }
     }
   }
@@ -100,6 +113,7 @@
       '--root=$serverRoot');
   serverId = startProcess(config["dart"],
       [ serverPath, '--port=$serverPort', '--root=$serverRoot'],
+      stdout, stderr,
       (line) {
         if (line.startsWith('Server listening')) {
           wrapStage();
@@ -115,15 +129,9 @@
 
 /** Initial pipeline stage - generates Dart and HTML wrapper files. */
 wrapStage() {
-  var tmpDir = config["tempdir"];
+  tmpDir = config["targetDir"];
   var testFile = config["testfile"];
 
-  // Make sure the temp dir exists.
-  var d = new Directory(tmpDir);
-  if (!d.existsSync()) {
-    d.createSync();
-  }
-
   // Generate names for the generated wrapper files.
   tempDartFile = createTempName(tmpDir, testFile, '.dart');
   if (config["runtime"] != 'vm') {
@@ -146,50 +154,52 @@
 
   if (config["layout"]) {
     directives = '''
-      import 'dart:uri';
-      import 'dart:io';
-      import 'dart:math';
-      part '${config["runnerDir"]}/layout_test_controller.dart';
+import 'dart:async';
+import 'dart:io';
+import 'dart:math';
+import 'dart:uri';
+part '${normalizePath('${config["runnerDir"]}/layout_test_controller.dart')}';
     ''';
     extras = '''
-      sourceDir = '${config["expectedDirectory"]}';
-      baseUrl = 'file://$tempHtmlFile';
-      tprint = (msg) => print('###\$msg');
-      notifyDone = (e) => exit(e);
+  baseUrl = 'file://${normalizePath('$tempHtmlFile')}';
+  tprint = (msg) => print('###\$msg');
+  notifyDone = (e) => exit(e);
     ''';
   } else if (config["runtime"] == "vm") {
     directives = '''
-      import 'dart:io';
-      import 'dart:isolate';
-      import '${config["unittest"]}' as unittest;
-      import '${config["testfile"]}' as test;
-      part '${config["runnerDir"]}/standard_test_runner.dart';
+import 'dart:async';
+import 'dart:io';
+import 'dart:isolate';
+import 'package:unittest/unittest.dart';
+import '${normalizePath('${config["testfile"]}')}' as test;
+part '${normalizePath('${config["runnerDir"]}/standard_test_runner.dart')}';
     ''';
     extras = '''
-      includeFilters = ${config["include"]};
-      excludeFilters = ${config["exclude"]};
-      tprint = (msg) => print('###\$msg');
-      notifyDone = (e) {};
-      unittest.testState["port"] = $serverPort;
+  includeFilters = ${config["include"]};
+  excludeFilters = ${config["exclude"]};
+  tprint = (msg) => print('###\$msg');
+  notifyDone = (e) { exit(e); };
+  testState["port"] = $serverPort;
     ''';
   } else {
     directives = '''
-      import 'dart:html';
-      import 'dart:isolate';
-      import '${config["unittest"]}' as unittest;
-      import '${config["testfile"]}' as test;
-      part '${config["runnerDir"]}/standard_test_runner.dart';
+import 'dart:async';
+import 'dart:html';
+import 'dart:isolate';
+import 'package:unittest/unittest.dart';
+import '${normalizePath('${config["testfile"]}')}' as test;
+part '${normalizePath('${config["runnerDir"]}/standard_test_runner.dart')}';
     ''';
     extras = '''
-      includeFilters = ${config["include"]};
-      excludeFilters = ${config["exclude"]};
-      tprint = (msg) => query('#console').addText('###\$msg\\n');
-      notifyDone = (e) => window.postMessage('done', '*');
-      unittest.testState["port"] = $serverPort;
+  includeFilters = ${config["include"]};
+  excludeFilters = ${config["exclude"]};
+  tprint = (msg) => query('#console').appendText('###\$msg\\n');
+  notifyDone = (e) => window.postMessage('done', '*');
+  testState["port"] = $serverPort;
     ''';
   }
 
-  var action = 'process(test.main, unittest.runTests)';
+  var action = 'process(test.main, runTests)';
   if (config["layout-text"]) {
     action = 'runTextLayoutTests()';
   } else if (config["layout-pixel"]) {
@@ -204,44 +214,44 @@
 
   logMessage('Creating $tempDartFile');
   writeFile(tempDartFile, '''
-    library test_controller;
-    $directives
+library test_controller;
+$directives
 
-    main() {
-      immediate = ${config["immediate"]};
-      includeTime = ${config["time"]};
-      passFormat = '${config["pass-format"]}';
-      failFormat = '${config["fail-format"]}';
-      errorFormat = '${config["error-format"]}';
-      listFormat = '${config["list-format"]}';
-      regenerate = ${config["regenerate"]};
-      summarize = ${config["summary"]};
-      testfile = '$testFile';
-      drt = '${config["drt"]}';
-      $extras
-      $action;
-    }
+main() {
+  immediate = ${config["immediate"]};
+  includeTime = ${config["time"]};
+  passFormat = '${config["pass-format"]}';
+  failFormat = '${config["fail-format"]}';
+  errorFormat = '${config["error-format"]}';
+  listFormat = '${config["list-format"]}';
+  regenerate = ${config["regenerate"]};
+  summarize = ${config["summary"]};
+  testfile = '${testFile.replaceAll("\\","\\\\")}';
+  drt = '${config["drt"].replaceAll("\\","\\\\")}';
+$extras
+  $action;
+}
   ''');
 
   // Create the child wrapper for layout tests.
   if (config["layout"]) {
     logMessage('Creating $tempChildDartFile');
     writeFile(tempChildDartFile, '''
-        library layout_test;
-        import 'dart:math';
-        import 'dart:isolate';
-        import 'dart:html';
-        import 'dart:uri';
-        import '${config["unittest"]}' as 'unittest' ;
-        import '$testFile', prefix: 'test' ;
-        part '${config["runnerDir"]}/layout_test_runner.dart';
+library layout_test;
+import 'dart:math';
+import 'dart:isolate';
+import 'dart:html';
+import 'dart:uri';
+import 'package:unittest/unittest.dart' as unittest;
+import '${normalizePath('$testFile')}' as test;
+part '${normalizePath('${config["runnerDir"]}/layout_test_runner.dart')}';
 
-        main() {
-          includeFilters = ${config["include"]};
-          excludeFilters = ${config["exclude"]};
-          unittest.testState["port"] = $serverPort;
-          runTests(test.main);
-        }
+main() {
+  includeFilters = ${config["include"]};
+  excludeFilters = ${config["exclude"]};
+  unittest.testState["port"] = $serverPort;
+  runTests(test.main);
+}
     ''');
   }
 
@@ -258,7 +268,7 @@
       sourceFile = tempDartFile;
       scriptFile = isJavascript ? tempJsFile : tempDartFile;
       bodyElements = '<div id="container"></div><pre id="console"></pre>';
-      runAsText = "window.testRunner.dumpAsText();";
+      runAsText = "testRunner.dumpAsText();";
     }
     scriptType = isJavascript ? 'text/javascript' : 'application/dart';
 
@@ -272,13 +282,14 @@
     <title>$testFile</title>
     <link rel="stylesheet" href="${config["runnerDir"]}/testrunner.css">
     <script type='text/javascript'>
-      if (window.testRunner) {
+      var testRunner = window.testRunner || window.layoutTestController;
+      if (testRunner) {
         function handleMessage(m) {
           if (m.data == 'done') {
-            window.testRunner.notifyDone();
+            testRunner.notifyDone();
           }
         }
-        window.testRunner.waitUntilDone();
+        testRunner.waitUntilDone();
         $runAsText
         window.addEventListener("message", handleMessage, false);
       }
@@ -291,9 +302,6 @@
   $bodyElements
   <script type='$scriptType' src='$scriptFile'></script>
   </script>
-  <script
-src="http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js">
-  </script>
 </body>
 </html>
 ''');
@@ -305,14 +313,15 @@
 /** Second stage of pipeline - compiles Dart to Javascript if needed. */
 compileStage(isJavascript) {
   if (isJavascript) { // Compile the Dart file.
+    var cmd = config["dart2js"];
+    var input = sourceFile.replaceAll('/', Platform.pathSeparator);
+    var output = scriptFile.replaceAll('/', Platform.pathSeparator);
     if (config["checked"]) {
-      runCommand(config["dart2js"],
-          [ '--enable_checked_mode', '--out=$scriptFile', '$sourceFile' ]).
-          then(runTestStage);
+      runCommand(cmd, [ '-c', '-o$output', '$input' ], stdout, stderr)
+          .then(runTestStage);
     } else {
-      runCommand(config["dart2js"],
-          [ '--out=$scriptFile', '$sourceFile' ]).
-          then(runTestStage);
+      runCommand(cmd, [ '-o$output', '$input' ], stdout, stderr)
+          .then(runTestStage);
     }
   } else {
     runTestStage(0);
@@ -334,7 +343,7 @@
     cmd = config["drt"];
     args = [ '--no-timeout', tempHtmlFile ];
   }
-  runCommand(cmd, args, config["timeout"]).then(cleanupStage);
+  runCommand(cmd, args, stdout, stderr, config["timeout"]).then(cleanupStage);
 }
 
 /**
@@ -346,12 +355,15 @@
     stopProcess(serverId);
   }
 
-  if (!config["keep-files"]) { // Remove the temporary files.
+  if (config["clean-files"]) { // Remove the temporary files.
     cleanup(tempDartFile);
     cleanup(tempHtmlFile);
     cleanup(tempJsFile);
     cleanup(tempChildDartFile);
     cleanup(tempChildJsFile);
+    cleanup(createTempName(tmpDir, "pubspec", "yaml"));
+    cleanup(createTempName(tmpDir, "pubspec", "lock"));
+    cleanupDir(createTempName(tmpDir, "packages"));
   }
-  completePipeline(exitcode);
+  completePipeline(stdout, stderr, exitcode);
 }
diff --git a/utils/testrunner/standard_test_runner.dart b/utils/testrunner/standard_test_runner.dart
index 0b1019d..dddc2fd 100644
--- a/utils/testrunner/standard_test_runner.dart
+++ b/utils/testrunner/standard_test_runner.dart
@@ -2,9 +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.
 
-// TODO(gram): dart2js is not handling 'part of' properly yet; when it does
-// uncomment this.
-//part of test_controller;
+part of test_controller;
 
 /** Path to DRT executable. */
 String drt;
@@ -40,6 +38,12 @@
 /** The action function to use. */
 Function action;
 
+/**
+ * A special marker string used to separate group names and
+ * identify non-debug output.
+ */ 
+final marker = '###';
+
 class Macros {
   static const String testTime = '<TIME>';
   static const String testfile = '<FILENAME>';
@@ -49,10 +53,12 @@
   static const String testStacktrace = '<STACK>';
 }
 
-class TestRunnerConfiguration extends unittest.Configuration {
+class TestRunnerConfiguration extends Configuration {
   get name => 'Minimal test runner configuration';
   get autoStart => false;
 
+  void onInit() {}
+
   String formatMessage(filename, groupname,
       [ testname = '', testTime = '', result = '',
         message = '', stack = '' ]) {
@@ -68,7 +74,7 @@
         replaceAll(Macros.testStacktrace, stack);
   }
 
-  String elapsed(unittest.TestCase t) {
+  String elapsed(TestCase t) {
     if (includeTime) {
       double duration = t.runningTime.inMilliseconds.toDouble();
       duration /= 1000;
@@ -78,11 +84,11 @@
     }
   }
 
-  void dumpTestResult(source, unittest.TestCase t) {
+  void dumpTestResult(source, TestCase t) {
     var groupName = '', testName = '';
-    var idx = t.description.lastIndexOf('###');
+    var idx = t.description.lastIndexOf(marker);
     if (idx >= 0) {
-        groupName = t.description.substring(0, idx).replaceAll('###', ' ');
+        groupName = t.description.substring(0, idx).replaceAll(marker, ' ');
         testName = t.description.substring(idx+3);
     } else {
         testName = t.description;
@@ -94,7 +100,7 @@
         duration, t.result, message, stack));
   }
 
-  void onTestResult(unittest.TestCase testCase) {
+  void onTestResult(TestCase testCase) {
     if (immediate) {
       dumpTestResult('$testfile ', testCase);
     }
@@ -116,7 +122,7 @@
   }
 
   void onSummary(int passed, int failed, int errors,
-      List<unittest.TestCase> results, String uncaughtError) {
+      List<TestCase> results, String uncaughtError) {
     if (!immediate) {
       for (final testCase in results) {
         dumpTestResult('$testfile ', testCase);
@@ -134,12 +140,6 @@
   }
 }
 
-// Support for listing tests and groups. We use a minimal config.
-class MinimalTestRunnerConfiguration extends unittest.Configuration {
-  get name => 'Minimal test runner configuration';
-  get autoStart => false;
-}
-
 String formatListMessage(filename, groupname, [ testname = '']) {
   return listFormat.
       replaceAll(Macros.testfile, filename).
@@ -148,13 +148,13 @@
 }
 
 listGroups() {
-  List tests = unittest.testCases;
+  List tests = testCases;
   Map groups = {};
   for (var t in tests) {
     var groupName, testName = '';
-    var idx = t.description.lastIndexOf('###');
+    var idx = t.description.lastIndexOf(marker);
     if (idx >= 0) {
-      groupName = t.description.substring(0, idx).replaceAll('###', ' ');
+      groupName = t.description.substring(0, idx).replaceAll(marker, ' ');
       if (!groups.containsKey(groupName)) {
         groups[groupName] = '';
       }
@@ -162,7 +162,7 @@
   }
   for (var g in groups.keys) {
     var msg = formatListMessage('$testfile ', '$g ');
-    print('###$msg');
+    print('$marker$msg');
   }
   if (notifyDone != null) {
     notifyDone(0);
@@ -170,19 +170,19 @@
 }
 
 listTests() {
-  List tests = unittest.testCases;
+  List tests = testCases;
   for (var t in tests) {
     var groupName, testName = '';
-    var idx = t.description.lastIndexOf('###');
+    var idx = t.description.lastIndexOf(marker);
     if (idx >= 0) {
-      groupName = t.description.substring(0, idx).replaceAll('###', ' ');
+      groupName = t.description.substring(0, idx).replaceAll(marker, ' ');
       testName = t.description.substring(idx+3);
     } else {
       groupName = '';
       testName = t.description;
     }
     var msg = formatListMessage('$testfile ', '$groupName ', '$testName ');
-    print('###$msg');
+    print('$marker$msg');
   }
   if (notifyDone != null) {
     notifyDone(0);
@@ -191,13 +191,13 @@
 
 // Support for running in isolates.
 
-class TestRunnerChildConfiguration extends unittest.Configuration {
+class TestRunnerChildConfiguration extends Configuration {
   get name => 'Test runner child configuration';
   get autoStart => false;
 
   void onSummary(int passed, int failed, int errors,
-      List<unittest.TestCase> results, String uncaughtError) {
-    unittest.TestCase test = results[0];
+      List<TestCase> results, String uncaughtError) {
+    TestCase test = results[0];
     parentPort.send([test.result, test.runningTime.inMilliseconds,
                      test.message, test.stackTrace]);
   }
@@ -207,59 +207,43 @@
 runChildTest() {
   port.receive((testName, sendport) {
     parentPort = sendport;
-    unittest.configure(new TestRunnerChildConfiguration());
-    unittest.groupSep = '###';
-    unittest.group('', test.main);
-    unittest.filterTests(testName);
-    unittest.runTests();
+    unittestConfiguration = new TestRunnerChildConfiguration();
+    groupSep = marker;
+    group('', test.main);
+    filterTests(testName);
+    runTests();
   });
 }
 
-var testNum;
-var failed;
-var errors;
-var passed;
-
-runParentTest() {
-  var tests = unittest.testCases;
-  tests[testNum].startTime = new DateTime.now();
+isolatedTestParentWrapper(testCase) => () {
   SendPort childPort = spawnFunction(runChildTest);
-  childPort.call(tests[testNum].description).then((results) {
+  var f = childPort.call(testCase.description);
+  f.then((results) {
     var result = results[0];
     var duration = new Duration(milliseconds: results[1]);
     var message = results[2];
     var stack = results[3];
-    if (result == 'pass') {
-      tests[testNum].pass();
-      ++passed;
-    } else if (result == 'fail') {
-      tests[testNum].fail(message, stack);
-      ++failed;
-    } else {
-      tests[testNum].error(message, stack);
-      ++errors;
-    }
-    tests[testNum].runningTime = duration;
-    ++testNum;
-    if (testNum < tests.length) {
-      runParentTest();
-    } else {
-      unittest.config.onDone(passed, failed, errors,
-          unittest.testCases, null);
+    if (result == 'fail') {
+      testCase.fail(message, stack);
+    } else if (result == 'error') {
+      testCase.error(message, stack);
     }
   });
-}
+  return f;
+};
 
 runIsolateTests() {
-  testNum = 0;
-  passed = failed = errors = 0;
-  runParentTest();
+  // Replace each test with a wrapped version first.
+  for (var i = 0; i < testCases.length; i++) {
+    testCases[i].testFunction = isolatedTestParentWrapper(testCases[i]);
+  }
+  runTests();
 }
 
 // Main
 
 filterTest(t) {
-  var name = t.description.replaceAll("###", " ");
+  var name = t.description.replaceAll(marker, " ");
   if (includeFilters.length > 0) {
     for (var f in includeFilters) {
       if (name.indexOf(f) >= 0) return true;
@@ -276,10 +260,10 @@
 }
 
 process(testMain, action) {
-  unittest.groupSep = '###';
-  unittest.configure(new TestRunnerConfiguration());
-  unittest.group('', testMain);
+  groupSep = marker;
+  unittestConfiguration = new TestRunnerConfiguration();
+  group('', testMain);
   // Do any user-specified test filtering.
-  unittest.filterTests(filterTest);
+  filterTests(filterTest);
   action();
 }
diff --git a/utils/testrunner/testrunner.dart b/utils/testrunner/testrunner.dart
index b5f9b8d..dda5e31 100755
--- a/utils/testrunner/testrunner.dart
+++ b/utils/testrunner/testrunner.dart
@@ -10,7 +10,7 @@
  * of the removed features are:
  *
  *   - No support for test.status files. The assumption is that tests are
- *     expected to pass.
+ *     expected to pass. Status file support will be added in the future.
  *   - A restricted set of runtimes. The assumption here is that the Dart
  *     libraries deal with platform dependencies, and so the primary
  *     SKUs that a user of this app would be concerned with would be
@@ -43,7 +43,7 @@
  *   vm - run native Dart in the VM; i.e. using $DARTSDK/dart-sdk/bin/dart.
  *   drt-dart - run native Dart in DumpRenderTree, the headless version of
  *       Dartium, which is located in $DARTSDK/chromium/DumpRenderTree, if
- *       you intsalled the SDK that is bundled with the editor, or available
+ *       you installed the SDK that is bundled with the editor, or available
  *       from http://gsdview.appspot.com/dartium-archive/continuous/
  *       otherwise.
  *
@@ -67,10 +67,27 @@
  * which is run in an isolate. The `--pipeline` argument can be used to
  * specify a different script for running a test file pipeline, allowing
  * customization of the pipeline.
+ *
+ * Wrapper files are created for tests in the tmp directory, which can be
+ * overridden with --tempdir. These files are not removed after the tests
+ * are complete, primarily to reduce the amount of times pub must be 
+ * executed. You can use --clean-files to force file cleanup. The temp 
+ * directories will have pubspec.yaml files auto-generated unless the 
+ * original test file directories have such files; in that case the existing
+ * files will be copied. Whenever a new pubspec file is copied or 
+ * created pub will be run (but not otherwise - so if you want to do 
+ * the equivelent of pub update you should use --clean-files and the rerun
+ * the tests).
+ *
+ * TODO(gram): if the user has a pubspec.yaml file,  we should inspect the
+ * pubspec.lock file and give useful errors:
+ *  - if the lock file doesn't exit, then run pub install
+ *  - if it exists and it doesn't have the required packages (unittest or
+ *    browser), ask the user to add them and run pub install again.
  */
 
-// TODO - layout tests that use PNGs rather than DRT text render dumps.
 library testrunner;
+import 'dart:async';
 import 'dart:io';
 import 'dart:isolate';
 import 'dart:math';
@@ -91,18 +108,24 @@
 /** The index of the next pipeline runner to execute. */
 int _nextTask;
 
-/** The stream to use for high-value messages, like test results. */
-OutputStream _outStream;
+/** The sink to use for high-value messages, like test results. */
+IOSink _outSink;
 
-/** The stream to use for low-value messages, like verbose output. */
-OutputStream _logStream;
+/** The sink to use for low-value messages, like verbose output. */
+IOSink _logSink;
 
 /**
- * The user can specify output streams on the command line, using 'none',
- * 'stdout', 'stderr', or a file path; [getStream] will take such a name
- * and return an appropriate [OutputStream].
+ * The last temp test directory we accessed; we use this to know if we
+ * need to check the pub configuration.
  */
-OutputStream getStream(String name) {
+String _testDir;
+    
+/**
+ * The user can specify output streams on the command line, using 'none',
+ * 'stdout', 'stderr', or a file path; [getSink] will take such a name
+ * and return an appropriate [IOSink].
+ */
+IOSink getSink(String name) {
   if (name == null || name == 'none') {
     return null;
   }
@@ -112,7 +135,8 @@
   if (name == 'stderr') {
     return stderr;
   }
-  return new File(name).openOutputStream(FileMode.WRITE);
+  var f = new File(name);
+  return f.openWrite();
 }
 
 /**
@@ -120,13 +144,13 @@
  * and execute pipelines for the files.
  */
 void processTests(Map config, List testFiles) {
-  _outStream = getStream(config['out']);
-  _logStream = getStream(config['log']);
+  _outSink = getSink(config['out']);
+  _logSink = getSink(config['log']);
   if (config['list-files']) {
-    if (_outStream != null) {
+    if (_outSink != null) {
       for (var i = 0; i < testFiles.length; i++) {
-        _outStream.writeString(testFiles[i]);
-        _outStream.writeString('\n');
+        _outSink.write(testFiles[i]);
+        _outSink.write('\n');
       }
     }
   } else {
@@ -137,6 +161,69 @@
   }
 }
 
+/**
+ * Create or update a pubspec for the target test directory. We use the
+ * source directory pubspec if available; otherwise we create a minimal one.
+ * We return a Future if we are running pub install, or null otherwise.
+ */
+Future doPubConfig(Path sourcePath, String sourceDir,
+                   Path targetPath, String targetDir,
+                   String pub, String runtime) {
+  // Make sure the target directory exists.
+  var d = new Directory(targetDir);
+  if (!d.existsSync()) {
+    d.createSync(recursive: true);
+  }
+
+  // If the source has no pubspec, but the dest does, leave 
+  // things as they are. If neither do, create one in dest.
+
+  var sourcePubSpecName = new Path(sourceDir).append("pubspec.yaml").
+      toNativePath();
+  var targetPubSpecName = new Path(targetDir).append("pubspec.yaml").
+      toNativePath();
+  var sourcePubSpec = new File(sourcePubSpecName);
+  var targetPubSpec = new File(targetPubSpecName);
+
+  if (!sourcePubSpec.existsSync()) {
+    if (targetPubSpec.existsSync()) {
+      return null;
+    } else {
+      // Create one.
+      if (runtime == 'vm') {
+        writeFile(targetPubSpecName,
+          "name: testrunner\ndependencies:\n  unittest: any\n");
+      } else {
+        writeFile(targetPubSpecName,
+          "name: testrunner\ndependencies:\n  unittest: any\n  browser: any\n");
+      }
+    }
+  } else {
+    if (targetPubSpec.existsSync()) {
+      // If there is a source one, and it is older than the target,
+      // leave the target as is.
+      if (sourcePubSpec.lastModifiedSync().millisecondsSinceEpoch <
+          targetPubSpec.lastModifiedSync().millisecondsSinceEpoch) {
+        return null;
+      }
+    }
+    // Source exists and is newer than target or there is no target;
+    // copy the source to the target. If there is a pubspec.lock file,
+    // copy that too.
+    var s = sourcePubSpec.readAsStringSync();
+    targetPubSpec.writeAsStringSync(s);
+    var sourcePubLock = new File(sourcePubSpecName.replaceAll(".yaml", ".lock"));
+    if (sourcePubLock.existsSync()) {
+      var targetPubLock =
+          new File(targetPubSpecName.replaceAll(".yaml", ".lock"));
+      s = sourcePubLock.readAsStringSync();
+      targetPubLock.writeAsStringSync(s);
+    }
+  }
+  // A new target pubspec was created so run pub install.
+  return _processHelper(pub, [ 'install' ], workingDir: targetDir);
+}
+
 /** Execute as many tasks as possible up to the maxTasks limit. */
 void spawnTasks(Map config, List testFiles) {
   var verbose = config['verbose'];
@@ -154,12 +241,12 @@
       List stderr = msg[1];
       List log = msg[2];
       int exitCode = msg[3];
-      writelog(stdout, _outStream, _logStream, verbose, skipNonVerbose);
-      writelog(stderr, _outStream, _logStream, true, skipNonVerbose);
-      writelog(log, _outStream, _logStream, verbose, skipNonVerbose);
+      writelog(stdout, _outSink, _logSink, verbose, skipNonVerbose);
+      writelog(stderr, _outSink, _logSink, true, skipNonVerbose);
+      writelog(log, _outSink, _logSink, verbose, skipNonVerbose);
       port.close();
       --_numTasks;
-      if (exitCode == 0 || !config['stopOnFailure']) {
+      if (exitCode == 0 || !config['stop-on-failure']) {
         spawnTasks(config, testFiles);
       }
       if (_numTasks == 0) {
@@ -168,74 +255,129 @@
       }
     });
     SendPort s = spawnUri(config['pipeline']);
-    s.send(config, port.toSendPort());
+
+    // Get the names of the source and target test files and containing
+    // directories.
+    var testPath = new Path(testfile);
+    var sourcePath = testPath.directoryPath;
+    var sourceDir = sourcePath.toNativePath();
+
+    var targetPath = new Path(config["tempdir"]);
+    var normalizedTarget = testPath.directoryPath.toNativePath()
+        .replaceAll(Platform.pathSeparator, '_')
+        .replaceAll(':', '_');
+    targetPath = targetPath.append("${normalizedTarget}_${config['runtime']}");
+    var targetDir = targetPath.toNativePath();
+
+    config['targetDir'] = targetDir;
+    // If this is a new target dir, we need to redo the pub check.
+    var f = null;
+    if (targetDir != _testDir) {
+      f = doPubConfig(sourcePath, sourceDir, targetPath, targetDir,
+          config['pub'], config['runtime']);
+      _testDir = targetDir;
+    }
+    if (f == null) {
+      s.send(config, port.toSendPort());
+    } else {
+      f.then((_) {
+        s.send(config, port.toSendPort());
+      });
+      break; // Don't do any more until pub is done.
+    }
   }
 }
 
 /**
  * Our tests are configured so that critical messages have a '###' prefix.
- * [writeLog] takes the output from a pipeline execution and writes it to
- * our output streams. It will strip the '###' if necessary on critical
+ * [writelog] takes the output from a pipeline execution and writes it to
+ * our output sinks. It will strip the '###' if necessary on critical
  * messages; other messages will only be written if verbose output was
  * specified.
  */
-void writelog(List messages, OutputStream out, OutputStream log,
+void writelog(List messages, IOSink out, IOSink log,
               bool includeVerbose, bool skipNonVerbose) {
   for (var i = 0; i < messages.length; i++) {
     var msg = messages[i];
     if (msg.startsWith('###')) {
       if (!skipNonVerbose && out != null) {
-        out.writeString(msg.substring(3));
-        out.writeString('\n');
+        out.write(msg.substring(3));
+        out.write('\n');
       }
     } else if (msg.startsWith('CONSOLE MESSAGE:')) {
       if (!skipNonVerbose && out != null) {
         int idx = msg.indexOf('###');
         if (idx > 0) {
-          out.writeString(msg.substring(idx + 3));
-          out.writeString('\n');
+          out.write(msg.substring(idx + 3));
+          out.write('\n');
         }
       }
     } else if (includeVerbose && log != null) {
-      log.writeString(msg);
-      log.writeString('\n');
+      log.write(msg);
+      log.write('\n');
     }
   }
 }
 
-sanitizeConfig(Map config, ArgParser parser) {
+normalizeFilter(List filter) {
+  // We want the filter to be a quoted string or list of quoted
+  // strings.
+  for (var i = 0; i < filter.length; i++) {
+    var f = filter[i];
+    if (f[0] != "'" && f[0] != '"') {
+      filter[i] = "'$f'"; // TODO(gram): Quote embedded quotes.
+    }
+  }
+  return filter;
+}
+
+void sanitizeConfig(Map config, ArgParser parser) {
   config['layout'] = config['layout-text'] || config['layout-pixel'];
-
-  // TODO - check if next three are actually used.
-  config['runInBrowser'] = (config['runtime'] != 'vm');
   config['verbose'] = (config['log'] != 'none' && !config['list-groups']);
-  config['filtering'] = (config['include'].length > 0 ||
-      config['exclude'].length > 0);
-
   config['timeout'] = int.parse(config['timeout']);
   config['tasks'] = int.parse(config['tasks']);
 
   var dartsdk = config['dartsdk'];
   var pathSep = Platform.pathSeparator;
 
-  if (dartsdk != null) {
-    if (parser.getDefault('dart2js') == config['dart2js']) {
-      config['dart2js'] =
-          '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js';
+  if (dartsdk == null) {
+    var opt = new Options();
+    var runner = opt.executable;
+    var idx = runner.indexOf('dart-sdk');
+    if (idx < 0) {
+      print("Please use --dartsdk option or run using the dart executable "
+          "from the Dart SDK");
+      exit(0);
     }
-    if (parser.getDefault('dart') == config['dart']) {
-      config['dart'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart';
-    }
-    if (parser.getDefault('drt') == config['drt']) {
-      config['drt'] = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree';
-    }
+    dartsdk = runner.substring(0, idx);
+  }
+  if (Platform.operatingSystem == 'macos') {
+    config['dart2js'] =
+        '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js';
+    config['dart'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart';
+    config['pub'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}pub';
+    config['drt'] = 
+      '$dartsdk/chromium/DumpRenderTree.app/Contents/MacOS/DumpRenderTree';
+  } else if (Platform.operatingSystem == 'linux') {
+    config['dart2js'] =
+        '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js';
+    config['dart'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart';
+    config['pub'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}pub';
+    config['drt'] = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree';
+  } else {
+    config['dart2js'] =
+        '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart2js.bat';
+    config['dart'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}dart.exe';
+    config['pub'] = '$dartsdk${pathSep}dart-sdk${pathSep}bin${pathSep}pub.bat';
+    config['drt'] = '$dartsdk${pathSep}chromium${pathSep}DumpRenderTree.exe';
   }
 
-  config['unittest'] = makePathAbsolute(config['unittest']);
-  config['drt'] = makePathAbsolute(config['drt']);
-  config['dart'] = makePathAbsolute(config['dart']);
-  config['dart2js'] = makePathAbsolute(config['dart2js']);
+  for (var prog in [ 'drt', 'dart', 'pub', 'dart2js' ]) {
+    config[prog] = makePathAbsolute(config[prog]);
+  }
   config['runnerDir'] = runnerDirectory;
+  config['include'] = normalizeFilter(config['include']);
+  config['exclude'] = normalizeFilter(config['exclude']);
 }
 
 main() {
@@ -245,7 +387,7 @@
     if (options['list-options']) {
       printOptions(optionsParser, options, false, stdout);
     } else if (options['list-all-options']) {
-        printOptions(optionsParser, options, true, stdout);
+      printOptions(optionsParser, options, true, stdout);
     } else {
       var config = new Map();
       for (var option in options.options) {
@@ -273,9 +415,10 @@
       if (dirs.length == 0) {
         dirs.add('.'); // Use current working directory as default.
       }
-      buildFileList(dirs,
-          new RegExp(options['test-file-pattern']), options['recurse'],
-          (f) => processTests(config, f));
+      var f = buildFileList(dirs,
+          new RegExp(config['test-file-pattern']), config['recurse']);
+      if (config['sort']) f.sort();
+      processTests(config, f);
     }
   }
 }
diff --git a/utils/testrunner/utils.dart b/utils/testrunner/utils.dart
index 3bd7efb..6bb3a90 100644
--- a/utils/testrunner/utils.dart
+++ b/utils/testrunner/utils.dart
@@ -4,6 +4,12 @@
 
 part of testrunner;
 
+/** Create a file [fileName] and populate it with [contents]. */
+void writeFile(String fileName, String contents) {
+  var file = new File(fileName);
+  file.writeAsStringSync(contents);
+}
+
 /**
  * Read the contents of a file [fileName] into a [List] of [String]s.
  * If the file does not exist and [errorIfNoFile] is true, throw an
@@ -28,32 +34,24 @@
 String makePathAbsolute(String path) {
   var p = new Path(path).canonicalize();
   if (p.isAbsolute) {
-    return p.toString();
+    return p.toNativePath();
   } else {
     var cwd = new Path((new Directory.current()).path);
-    return cwd.join(p).toString();
+    return cwd.join(p).toNativePath();
   }
 }
 
 /**
  * Create the list of all the files in a set of directories
  * ([dirs]) whose names match [filePat]. If [recurse] is true
- * look at subdirectories too. Once they have all been enumerated,
- * call [onComplete]. An optional [excludePat] can be supplied
+ * look at subdirectories too. An optional [excludePat] can be supplied
  * and files or directories that match that will be excluded.
+ * [includeSymLinks] controls whether or not to include files that
+ * have symlinks in the traversed tree.
  */
- // TODO(gram): The key thing here is we want to avoid package
- // directories, which have symlinks. excludePat was added for
- // that but can't currently be used because the symlinked files
- // have canonicalized paths. So instead we exploit that fact and
- // assert that every file must have a prefix that matches the
- // directory. If this changes then we will need to switch to using
- // the exclude pattern or some other mechanism.
-void buildFileList(List dirs, RegExp filePat, bool recurse,
-                   Function onComplete,
+List buildFileList(List dirs, RegExp filePat, bool recurse,
                    [RegExp excludePat, bool includeSymLinks = false]) {
   var files = new List();
-  var dirCount = 1;
   for (var i = 0; i < dirs.length; i++) {
     var path = dirs[i];
     if (excludePat != null && excludePat.hasMatch(path)) {
@@ -69,33 +67,24 @@
       path = makePathAbsolute(path);
       Directory d = new Directory(path);
       if (d.existsSync()) {
-        ++dirCount;
-        d.list(recursive: recurse).listen(
-            (entity) {
-              if (entity is File) {
-                var file = entity.name;
-                if (filePat.hasMatch(file)) {
-                  if (excludePat == null || !excludePat.hasMatch(file)) {
-                    if (includeSymLinks || file.startsWith(path)) {
-                      files.add(file);
-                    }
-                  }
-                }
+        var contents = d.listSync(recursive: recurse,
+            followLinks: includeSymLinks);
+        for (var entity in contents) {
+          if (entity is File) {
+            var file = entity.path;
+            if (filePat.hasMatch(file)) {
+              if (excludePat == null || !excludePat.hasMatch(file)) {
+                files.add(file);
               }
-            },
-            onDone: () {
-              if (complete && --dirCount == 0) {
-                onComplete(files);
-              }
-            });
+            }
+          }
+        }
       } else { // Does not exist.
         print('$path does not exist.');
       }
     }
   }
-  if (--dirCount == 0) {
-    onComplete(files);
-  }
+  return files;
 }
 
 /**
@@ -108,3 +97,22 @@
   return libDirectory.substring(0,
       libDirectory.lastIndexOf(Platform.pathSeparator));
 }
+
+/*
+ * Run an external process [cmd] with command line arguments [args].
+ * Returns a [Future] for when the process terminates.
+ */
+Future _processHelper(String command, List<String> args,
+    {String workingDir}) {
+  var options = null;
+  if (workingDir != null) {
+    options = new ProcessOptions();
+    options.workingDirectory = workingDir;
+  }
+  return Process.run(command, args, options)
+      .then((result) => result.exitCode)
+      .catchError((e) {
+        print("$command ${args.join(' ')}: ${e.toString()}");
+      });
+}
+
diff --git a/utils/tests/testrunner/browser_tests/pubspec.yaml b/utils/tests/testrunner/browser_tests/pubspec.yaml
new file mode 100755
index 0000000..baa04d0
--- /dev/null
+++ b/utils/tests/testrunner/browser_tests/pubspec.yaml
@@ -0,0 +1,5 @@
+name: browser_tests
+dependencies:
+  html: any
+  unittest: any
+
diff --git a/utils/tests/testrunner/browser_tests/web/browser_test.dart b/utils/tests/testrunner/browser_tests/web/browser_test.dart
new file mode 100755
index 0000000..a72fdb6
--- /dev/null
+++ b/utils/tests/testrunner/browser_tests/web/browser_test.dart
@@ -0,0 +1,24 @@
+// 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 testrunner_test;
+
+import 'package:unittest/unittest.dart';
+
+foo(bool x) => x;
+
+main() {
+  group('group1', () {
+    test('test1', () {
+      expect(true, isFalse);
+    });
+  });
+  group('group2', () {
+    test('test2', () {
+      foo(3);
+      expect(true, isTrue);
+    });
+  });
+}
+
diff --git a/utils/tests/testrunner/browser_tests/web/browser_test.html b/utils/tests/testrunner/browser_tests/web/browser_test.html
new file mode 100755
index 0000000..218f22c
--- /dev/null
+++ b/utils/tests/testrunner/browser_tests/web/browser_test.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Testdriver tests</title>
+  </head>
+  <body>
+    <script type="application/dart" src="browser_test.dart"></script>
+  </body>
+</html>
+
diff --git a/utils/tests/testrunner/http_client_tests/http_client_test.dart b/utils/tests/testrunner/http_client_tests/http_client_test.dart
new file mode 100644
index 0000000..b43b4c1
--- /dev/null
+++ b/utils/tests/testrunner/http_client_tests/http_client_test.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library testrunner_test;
+
+import 'dart:async';
+import 'dart:io';
+import 'dart:uri';
+import 'package:unittest/unittest.dart';
+
+main() {
+  var get = (String what, int code, String text) {
+    var c = new Completer();
+    HttpClient client = new HttpClient();
+    client.getUrl(new Uri.fromString("http://127.0.0.1:3456/$what"))
+    .then((HttpClientRequest request) {
+      // Prepare the request then call close on it to send it.
+      return request.close();
+    })
+    .then((HttpClientResponse response) {
+      // Process the response.
+      expect(response.statusCode, code);
+      var sb = new StringBuffer();
+      response.transform(new StringDecoder())
+       .listen((data) {
+         sb.write(data);
+      }, onDone: () {
+        expect(sb.toString(), text);
+        c.complete();
+      });
+    });
+    return c.future;
+  };
+  test('test1', () {
+    return get('test.txt', 200, "Hello world!\n");
+  });
+  test('test2', () {
+    return get('fail.txt', 404, "");
+  });
+}
+
diff --git a/utils/tests/testrunner/layout_tests/pubspec.yaml b/utils/tests/testrunner/layout_tests/pubspec.yaml
new file mode 100755
index 0000000..d06c058
--- /dev/null
+++ b/utils/tests/testrunner/layout_tests/pubspec.yaml
@@ -0,0 +1,5 @@
+name: layout_tests
+dependencies:
+  html: any
+  unittest: any
+
diff --git a/utils/tests/testrunner/layout_tests/web/layout_test.dart b/utils/tests/testrunner/layout_tests/web/layout_test.dart
new file mode 100755
index 0000000..eead227
--- /dev/null
+++ b/utils/tests/testrunner/layout_tests/web/layout_test.dart
@@ -0,0 +1,17 @@
+// 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 testrunner_test;
+
+import 'dart:html';
+import 'package:unittest/unittest.dart';
+
+main() {
+  test("layout", () {
+    var lbl = new LabelElement();
+    lbl.text = 'Hello Dart!';
+    document.body.nodes.add(lbl);
+  });
+}
+
diff --git a/utils/tests/testrunner/layout_tests/web/layout_test.html b/utils/tests/testrunner/layout_tests/web/layout_test.html
new file mode 100755
index 0000000..218f22c
--- /dev/null
+++ b/utils/tests/testrunner/layout_tests/web/layout_test.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Testdriver tests</title>
+  </head>
+  <body>
+    <script type="application/dart" src="browser_test.dart"></script>
+  </body>
+</html>
+
diff --git a/utils/tests/testrunner/non_browser_tests/non_browser_test.dart b/utils/tests/testrunner/non_browser_tests/non_browser_test.dart
new file mode 100755
index 0000000..a72fdb6
--- /dev/null
+++ b/utils/tests/testrunner/non_browser_tests/non_browser_test.dart
@@ -0,0 +1,24 @@
+// 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 testrunner_test;
+
+import 'package:unittest/unittest.dart';
+
+foo(bool x) => x;
+
+main() {
+  group('group1', () {
+    test('test1', () {
+      expect(true, isFalse);
+    });
+  });
+  group('group2', () {
+    test('test2', () {
+      foo(3);
+      expect(true, isTrue);
+    });
+  });
+}
+
diff --git a/utils/tests/testrunner/non_browser_tests/non_browser_toast.dart b/utils/tests/testrunner/non_browser_tests/non_browser_toast.dart
new file mode 100755
index 0000000..fa32af37
--- /dev/null
+++ b/utils/tests/testrunner/non_browser_tests/non_browser_toast.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library testrunner_test;
+
+import 'package:unittest/unittest.dart';
+
+main() {
+  group('foo', () {
+    test('bar', () {
+      expect(true, isTrue);
+    });
+  });
+}
+
diff --git a/utils/tests/testrunner/non_browser_tests/pubspec.yaml b/utils/tests/testrunner/non_browser_tests/pubspec.yaml
new file mode 100755
index 0000000..21f4f00
--- /dev/null
+++ b/utils/tests/testrunner/non_browser_tests/pubspec.yaml
@@ -0,0 +1,4 @@
+name: non_browser_tests
+dependencies:
+  unittest: any
+
diff --git a/utils/tests/testrunner/pubspec.yaml b/utils/tests/testrunner/pubspec.yaml
new file mode 100755
index 0000000..21f4f00
--- /dev/null
+++ b/utils/tests/testrunner/pubspec.yaml
@@ -0,0 +1,4 @@
+name: non_browser_tests
+dependencies:
+  unittest: any
+
diff --git a/utils/tests/testrunner/test.txt b/utils/tests/testrunner/test.txt
new file mode 100644
index 0000000..cd08755
--- /dev/null
+++ b/utils/tests/testrunner/test.txt
@@ -0,0 +1 @@
+Hello world!
diff --git a/utils/tests/testrunner/testconfig b/utils/tests/testrunner/testconfig
new file mode 100644
index 0000000..08672ff
--- /dev/null
+++ b/utils/tests/testrunner/testconfig
@@ -0,0 +1 @@
+--checked
diff --git a/utils/tests/testrunner/testrunner_test.dart b/utils/tests/testrunner/testrunner_test.dart
new file mode 100755
index 0000000..516afe1
--- /dev/null
+++ b/utils/tests/testrunner/testrunner_test.dart
@@ -0,0 +1,522 @@
+// 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 testrunner_test;
+
+import 'dart:async';
+import 'dart:io';
+import 'package:unittest/unittest.dart';
+
+var dart;
+var debug = false;
+
+Future runTestrunner(command, List<String> args,
+                     List<String> stdout, List<String> stderr) {
+  if (debug) {
+    print("Running $command ${args.join(' ')}");
+  }
+  return Process.run(command, args).then((ProcessResult result) {
+    var lineEndings = new RegExp("\r\n|\n");
+    stdout.addAll(result.stdout.trim().split(lineEndings));
+    stderr.addAll(result.stderr.trim().split(lineEndings));
+  })
+  .catchError((e) {
+    stderr.add("Error starting process:");
+    stderr.add("  Command: $command");
+    stderr.add("  Error: ${e}");
+    completer.complete(-1);
+  });
+}
+
+// Useful utility for debugging test failures.
+void dump(label, list) {
+  if (!debug) return;
+  print('\n@=[ $label ]=============================\n');
+  for (var i = 0; i < list.length; i++)
+    print('@ ${list[i]}\n');
+  print('------------------------------------------\n');
+}
+
+int stringCompare(String s1, String s2) => s1.compareTo(s2);
+
+Future runTest(
+    List<String> args,
+    List<String> expected_stdout,
+    {List<String> expected_stderr, sort: false}) {
+  var stdout = new List<String>();
+  var stderr = new List<String>();
+  for (var i = 0; i < expected_stdout.length; i++) {
+    expected_stdout[i] = expected_stdout[i].
+        replaceAll('/', Platform.pathSeparator);
+  }
+  if (debug) {
+    args.insert(1, "--log=stderr");
+  }
+  var rtn = runTestrunner(dart, args, stdout, stderr);
+  rtn.then((_) {
+    dump('stderr', stderr);
+    dump('stdout', stdout);
+
+    if (expected_stderr != null) {
+      expect(stderr.length, orderedEquals(expected_stderr));
+    }
+    var i, l = 0, matched = 0;
+    if (sort) {
+      stdout.sort(stringCompare);
+      expected_stdout.sort(stringCompare);
+    }
+    for (i = 0; i < stdout.length; i++) {
+      if (!stdout[i].startsWith('@')) {
+        if (expected_stdout.length <= l) {
+          fail("Extra text in output: ${stdout[i]}");
+          return;
+        }
+        var actual = stdout[i].trim();
+        if (debug) {
+          print("Compare <$actual> and <${expected_stdout[l]}>");
+        }
+        if (expected_stdout[l].startsWith('*')) {
+          expect(actual, endsWith(expected_stdout[l].substring(1)));
+        } else if (expected_stdout[l].startsWith('?')) {
+	  var pat = expected_stdout[l].substring(1);
+	  if (Platform.operatingSystem == 'windows') {
+	    // The joys of Windows...
+	    pat = pat.replaceAll('\\','\\\\');
+          }
+          expect(actual, matches(pat));		  
+        } else {
+          expect(actual, expected_stdout[l]);
+        }
+        ++l;
+      }
+    }
+    if (l < expected_stdout.length) {
+      fail("Only matched $l of ${expected_stdout.length} lines");
+    }
+  });
+  return rtn;
+}
+
+// A useful function to quickly disable a group of tests; just
+// replace group() with skip_group().
+skip_group(_1,_2) {}
+
+main() {
+  var opt = new Options();
+  dart = opt.executable;
+  var idx = dart.indexOf('dart-sdk');
+  if (idx < 0) {
+    print("Please run using the dart executable from the Dart SDK");
+    exit(-1);
+  }
+  var _ = Platform.pathSeparator;
+  var testrunner = '../../testrunner/testrunner.dart'
+          .replaceAll('/', Platform.pathSeparator);
+
+  group("list tests", () {
+    test('list file', () {
+      return runTest(
+          [ testrunner,
+            '--list-files',
+            'non_browser_tests' ],
+          [ '?.*/non_browser_tests/non_browser_test.dart' ]);
+    });
+    test('list files', () {
+      return runTest(
+          [ testrunner,
+            '--recurse',
+            '--sort',
+            '--list-files',
+            '--test-file-pattern=.dart\$' ],
+          [ '*browser_tests/web/browser_test.dart',
+            '*http_client_tests/http_client_test.dart',
+            '*layout_tests/web/layout_test.dart',
+            '*non_browser_tests/non_browser_test.dart',
+            '*non_browser_tests/non_browser_toast.dart',
+            '*/testrunner_test.dart' ]
+      );
+    });
+    test('list files', () {
+      return runTest(
+          [ testrunner,
+            '--list-files',
+            '--test-file-pattern=.dart\$',
+            'non_browser_tests' ],
+          [ '*non_browser_tests/non_browser_test.dart',
+            '*non_browser_tests/non_browser_toast.dart' ],
+          sort:true
+      );
+    });
+    test('list groups', () {
+      return runTest(
+        [ testrunner,
+          '--list-groups',
+          'non_browser_tests' ],
+        [ '*non_browser_tests/non_browser_test.dart group1',
+          '*non_browser_tests/non_browser_test.dart group2']);
+    });
+    test('list tests', () {
+      return runTest(
+        [ testrunner,
+          '--list-tests',
+          'non_browser_tests' ],
+        [ '*non_browser_tests/non_browser_test.dart group1 test1',
+          '*non_browser_tests/non_browser_test.dart group2 test2' ]);
+    });
+  });
+
+  group("vm", () {
+    test("vm without timing info", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          'non_browser_tests' ],
+        [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1'
+              ' Expected: false',
+          '?PASS .*/non_browser_tests/non_browser_test.dart group2 test2' ]);
+    });
+  
+    test("vm with timing info", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--time',
+          'non_browser_tests' ],
+        [ '?FAIL [0-9.]+s .*/non_browser_tests/non_browser_test.dart group1'
+              ' test1 Expected: false',
+          '?PASS [0-9.]+s .*/non_browser_tests/non_browser_test.dart group2'
+              ' test2' ]);
+    });
+  });
+  
+  group("selection", () {
+    test("--include", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--include=group1',
+          'non_browser_tests' ],
+        [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1 '
+              'Expected: false' ]);
+    });
+  
+    test("--exclude", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--exclude=group1',
+          'non_browser_tests' ],
+        [ '?PASS .*/non_browser_tests/non_browser_test.dart group2 test2' ]);
+    });
+  
+    test("test file pattern", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--test-file-pattern=toast',
+          'non_browser_tests' ],
+        [ '?PASS .*/non_browser_tests/non_browser_toast.dart foo bar' ]);
+    });
+  });
+
+  group("stop on failure tests", () {
+    test("without stop", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--sort',
+          '--tasks=1',
+          '--test-file-pattern=.dart\$',
+          'non_browser_tests' ],
+        [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1 '
+              'Expected: false',
+          '?PASS .*/non_browser_tests/non_browser_test.dart group2 test2',
+          '?PASS .*/non_browser_tests/non_browser_toast.dart foo bar' ]);
+    });
+    test("with stop", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--sort',
+          '--tasks=1',
+          '--test-file-pattern=.dart\$',
+          '--stop-on-failure',
+          'non_browser_tests' ],
+        [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1 '
+              'Expected: false',
+          '?PASS .*/non_browser_tests/non_browser_test.dart group2 test2' ]);
+    });
+  });
+
+  group("output control", () {
+    test("summary test", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--summary',
+          'non_browser_tests' ],
+        [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1 '
+              'Expected: false',
+          '?PASS .*/non_browser_tests/non_browser_test.dart group2 test2',
+          '',
+          '?.*/non_browser_tests/non_browser_test.dart: '
+              '1 PASSED, 1 FAILED, 0 ERRORS' ]);
+    });
+
+    test('list tests with custom format', () {
+      return runTest(
+        [ testrunner,
+          '--list-tests',
+          '--list-format="<FILENAME><TESTNAME>"',
+          'non_browser_tests' ],
+        [ '?.*/non_browser_tests/non_browser_test.dart test1',
+          '?.*/non_browser_tests/non_browser_test.dart test2' ]);
+    });
+  
+    test("custom message formatting", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--pass-format=YIPPEE! <GROUPNAME><TESTNAME>',
+          '--fail-format=EPIC FAIL! <GROUPNAME><TESTNAME>',
+          'non_browser_tests' ],
+        [ 'EPIC FAIL! group1 test1', 'YIPPEE! group2 test2' ]);
+    });
+  });
+
+  test("checked mode test", () {
+    return runTest(
+      [ testrunner,
+        '--recurse',
+        '--checked',
+        'non_browser_tests' ],
+      [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1 '
+            'Expected: false',
+        "?FAIL .*/non_browser_tests/non_browser_test.dart group2 test2 "
+            "Caught type 'int' is not a subtype of type 'bool' of 'x'." ]);
+  });
+
+  group("browser", () {
+    test("native test", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--runtime=drt-dart',
+          'browser_tests' ],
+        [ '?FAIL .*/browser_tests/web/browser_test.dart group1 test1 '
+              'Expected: false',
+          '?PASS .*/browser_tests/web/browser_test.dart group2 test2' ]);
+    });
+  
+    test("compiled test", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--runtime=drt-js',
+          'browser_tests' ],
+        [ '?FAIL .*/browser_tests/web/browser_test.dart group1 test1 '
+              'Expected: false',
+          '?PASS .*/browser_tests/web/browser_test.dart group2 test2' ]);
+    });
+  });
+
+  group("textual layout tests", () {
+    group("drt-dart", () {
+      test("no baseline", () {
+        var f = new File("layout_tests/web/layout_test/layout.txt");
+        if (f.existsSync()) {
+          f.deleteSync();
+        }
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-dart',
+            '--recurse',
+            '--layout-text',
+            'layout_tests' ],
+          [ '?FAIL .*/layout_tests/web/layout_test.dart layout '
+                'No expectation file' ]);
+      });
+      test("create baseline", () {
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-dart',
+            '--recurse',
+            '--layout-text',
+            '--regenerate',
+            'layout_tests' ],
+          [ '?PASS .*/layout_tests/web/layout_test.dart layout' ]);
+      });
+      test("test baseline", () {
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-dart',
+            '--recurse',
+            '--layout-text',
+            'layout_tests' ],
+          [ '?PASS .*/layout_tests/web/layout_test.dart layout' ]);
+      });
+    });
+    group("drt-js", () {
+      test("no baseline", () {
+        var f = new File("layout_tests/web/layout_test/layout.txt");
+        if (f.existsSync()) {
+          f.deleteSync();
+        }
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-js',
+            '--recurse',
+            '--layout-text',
+            'layout_tests' ],
+          [ '?FAIL .*/layout_tests/web/layout_test.dart layout '
+                'No expectation file' ]);
+      });
+      test("create baseline", () {
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-js',
+            '--recurse',
+            '--layout-text',
+            '--regenerate',
+            'layout_tests' ],
+          [ '?PASS .*/layout_tests/web/layout_test.dart layout' ]);
+      });
+      test("test baseline", () {
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-js',
+            '--recurse',
+            '--layout-text',
+            'layout_tests' ],
+          [ '?PASS .*/layout_tests/web/layout_test.dart layout' ]);
+      });
+    });
+  });
+
+  group("pixel layout tests", () {
+    group("drt-dart", () {
+      test("no baseline", () {
+        var f = new File("layout_tests/web/layout_test/layout.png");
+        if (f.existsSync()) {
+          f.deleteSync();
+        }
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-dart',
+            '--recurse',
+            '--layout-pixel',
+            'layout_tests' ],
+          [ '?FAIL .*/layout_tests/web/layout_test.dart layout '
+                'No expectation file' ]);
+      });
+      test("create baseline", () {
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-dart',
+            '--recurse',
+            '--layout-pixel',
+            '--regenerate',
+            'layout_tests' ],
+          [ '?PASS .*/layout_tests/web/layout_test.dart layout' ]);
+      });
+      test("test baseline", () {
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-dart',
+            '--recurse',
+            '--layout-pixel',
+            'layout_tests' ],
+          [ '?PASS .*/layout_tests/web/layout_test.dart layout' ]);
+      });
+      // TODO(gram): Should add a test that changes a byte of the
+      // expectation .png.
+    });
+    group("drt-js", () {
+      test("no baseline", () {
+        var f = new File("layout_tests/web/layout_test/layout.png");
+        if (f.existsSync()) {
+          f.deleteSync();
+        }
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-js',
+            '--recurse',
+            '--layout-pixel',
+            'layout_tests' ],
+          [ '?FAIL .*/layout_tests/web/layout_test.dart layout '
+                'No expectation file' ]);
+      });
+      test("create baseline", () {
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-js',
+            '--recurse',
+            '--layout-pixel',
+            '--regenerate',
+            'layout_tests' ],
+          [ '?PASS .*/layout_tests/web/layout_test.dart layout' ]);
+      });
+      test("test baseline", () {
+        return runTest(
+          [ testrunner,
+            '--runtime=drt-js',
+            '--recurse',
+            '--layout-pixel',
+            'layout_tests' ],
+          [ '?PASS .*/layout_tests/web/layout_test.dart layout' ]);
+      });
+    });
+  });
+
+  group("run in isolate", () {
+    test("vm", () {
+      return runTest(
+        [ testrunner,
+          '--runtime=vm',
+          '--recurse',
+          '--isolate',
+          'non_browser_tests' ],
+        [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1'
+              ' Expected: false',
+          '?PASS .*/non_browser_tests/non_browser_test.dart group2 test2' ]);
+    });
+    test("drt-dart", () {
+      return runTest(
+        [ testrunner,
+          '--runtime=drt-dart',
+          '--recurse',
+          '--isolate',
+          'non_browser_tests' ],
+        [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1'
+              ' Expected: false',
+          '?PASS .*/non_browser_tests/non_browser_test.dart group2 test2' ]);
+    });
+    test("drt-js", () {
+      return runTest(
+        [ testrunner,
+          '--runtime=drt-js',
+          '--recurse',
+          '--isolate',
+          'non_browser_tests' ],
+        [ '?FAIL .*/non_browser_tests/non_browser_test.dart group1 test1 '
+             'Expected: false',
+          '?PASS .*/non_browser_tests/non_browser_test.dart group2 test2' ]);
+    });
+  });
+
+  group("embedded server", () {
+    test("get test", () {
+      return runTest(
+        [ testrunner,
+          '--recurse',
+          '--server',
+          '--port=3456',
+          '--root=${new Directory.current().path}',
+          'http_client_tests' ],
+        [ '?PASS .*/http_client_tests/http_client_test.dart  test1',
+          '?PASS .*/http_client_tests/http_client_test.dart  test2' ]);
+    });
+  });
+}
+