Update trunk to version 0.4.5.0 (cut at r20992)

svn merge -r 20748:20992 https://dart.googlecode.com/svn/branches/bleeding_edge trunk

git-svn-id: http://dart.googlecode.com/svn/trunk@20995 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/client/tools/buildbot_annotated_steps.py b/client/tools/buildbot_annotated_steps.py
index c424255..bbb6447 100755
--- a/client/tools/buildbot_annotated_steps.py
+++ b/client/tools/buildbot_annotated_steps.py
@@ -203,16 +203,14 @@
   if name.startswith('dart-editor'):
     # TODO(kustermann,ricow): This is a temporary hack until we can safely
     # enable it on main waterfall. We need to remove this eventually
-    is_fyi = False
     if name.startswith('dart-editor-fyi'):
       match = re.search('dart-editor-fyi(.*)', name)
       name = 'dart-editor' + match.group(1)
-      is_fyi = True
-    # Run the old annotated steps script first.
-    status = ProcessTools('release', name, version)
-    # In case we're an FYI builder, run 'tools/bots/editor.py' as well
-    if is_fyi:
-      status = ProcessBot(name, 'editor') or status
+      # In case we're an FYI builder, run 'tools/bots/editor.py'.
+      status = ProcessBot(name, 'editor')
+    else:
+      # Run the old annotated steps script
+      status = ProcessTools('release', name, version)
   elif name.startswith('pub-'):
     status = ProcessBot(name, 'pub')
   elif name.startswith('vm-android'):
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 1e4e281..2d614f39 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -2005,8 +2005,12 @@
   public void test_conditionalExpressionType_genericInterface() throws Exception {
     AnalyzeLibraryResult result = analyzeLibrary(
         "// filler filler filler filler filler filler filler filler filler filler",
+        "class A<T> { const A(); }",
+        "class B<T> extends A<T> { const B(); }",
+        "class C<T> implements B<T> { const C(); }",
+        "class D<T> implements B<T> { const D(); }",
         "main() {",
-        "  Collection<int> test = true ? new Set<int>() : const [null];",
+        "  B<int> test = true ? new C<int>() : const D<int>();",
         "}",
         "");
     assertErrors(result.getErrors());
@@ -3275,7 +3279,7 @@
    * Sometimes inferred type is too generic - such as "Object" or "Collection", so there are no
    * reason to reports problems.
    */
-  public void test_typesPropagation_dontWant_ifTooGeneric() throws Exception {
+  public void deprecatedCollection_test_typesPropagation_dontWant_ifTooGeneric() throws Exception {
     compilerConfiguration = new DefaultCompilerConfiguration(new CompilerOptions() {
       @Override
       public boolean typeChecksForInferredTypes() {
diff --git a/dart.gyp b/dart.gyp
index 7f5ec30..a40eae5 100644
--- a/dart.gyp
+++ b/dart.gyp
@@ -5,6 +5,36 @@
 {
   'targets': [
     {
+      # Contains all dependencies.
+      'target_name': 'everything',
+      'type': 'none',
+      'dependencies': [
+        # Most dependencies.
+        'default',
+        # All other targets.
+        'api_docs',
+        'dartc_bot',
+        'dart2js_bot',
+      ],
+    },
+    {
+      # Contains all the dependencies that will run by default.
+      # Excludes api_docs.
+      'target_name': 'default',
+      'type': 'none',
+      'dependencies': [
+        'analyzer',
+        'compiler',
+        'create_sdk',
+        'dart2js',
+        'editor',
+        'packages',
+        'runtime',
+        'samples',
+        'upload_sdk',
+      ],
+    },
+    {
       'target_name': 'compiler',
       'type': 'none',
       'dependencies': [
diff --git a/pkg/http/lib/src/byte_stream.dart b/pkg/http/lib/src/byte_stream.dart
index b53b8eb..f2c6a0b 100644
--- a/pkg/http/lib/src/byte_stream.dart
+++ b/pkg/http/lib/src/byte_stream.dart
@@ -23,7 +23,7 @@
   /// Collects the data of this stream in a [Uint8List].
   Future<Uint8List> toBytes() {
     /// TODO(nweiz): use BufferList when issue 6409 is fixed.
-    return reduce(<int>[], (buffer, chunk) {
+    return fold(<int>[], (buffer, chunk) {
       buffer.addAll(chunk);
       return buffer;
     }).then(toUint8List);
diff --git a/pkg/http/test/safe_http_server.dart b/pkg/http/test/safe_http_server.dart
index 64adf5b..408f080 100644
--- a/pkg/http/test/safe_http_server.dart
+++ b/pkg/http/test/safe_http_server.dart
@@ -31,7 +31,7 @@
       : super(server),
         _inner = server;
 
-  void close() => _inner.close();
+  Future close() => _inner.close();
 
   int get port => _inner.port;
 
@@ -136,9 +136,10 @@
     _inner.consume(stream);
   Future<HttpResponse> writeStream(Stream<List<int>> stream) =>
     _inner.writeStream(stream);
-  void close() => _inner.close();
+  Future close() => _inner.close();
   void write(Object obj) => _inner.write(obj);
-  void writeAll(Iterable objects) => _inner.writeAll(objects);
+  void writeAll(Iterable objects, [String separator = ""]) =>
+      _inner.writeAll(objects, separator);
   void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
   void writeln([Object obj = ""]) => _inner.writeln(obj);
 }
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 0affdd6..96f05ef 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -12,7 +12,8 @@
 # Skip non-test files ending with "_test".
 scheduled_test/lib/*: Skip
 
-scheduled_test/test/scheduled_test_test: Pass, Slow # Issue 9231
+scheduled_test/test/scheduled_server_test: Pass, Fail, Slow # Issue 9231, 9582
+scheduled_test/test/scheduled_process_test: Pass, Slow # Issue 9231
 
 # WebDriver tests have 3rd party dependencies (we need to run
 # selenium_standalone.jar), so we skip these in our automated
@@ -122,6 +123,9 @@
 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/src/schedule.dart b/pkg/scheduled_test/lib/src/schedule.dart
index 42c6fa2..88c26eb 100644
--- a/pkg/scheduled_test/lib/src/schedule.dart
+++ b/pkg/scheduled_test/lib/src/schedule.dart
@@ -7,6 +7,7 @@
 import 'dart:async';
 import 'dart:collection';
 
+import 'package:stack_trace/stack_trace.dart';
 import 'package:unittest/unittest.dart' as unittest;
 
 import 'mock_clock.dart' as mock_clock;
@@ -495,6 +496,8 @@
     if (description == null) {
       description = "Out-of-band operation #${_totalCallbacks}";
     }
+    var stackString = prefixLines(terseTraceString(new Trace.current()));
+    description = "$description\n\nStack trace:\n$stackString";
     _totalCallbacks++;
 
     _pendingCallbacks.add(description);
@@ -558,7 +561,10 @@
   String generateTree([Task highlight]) {
     assert(highlight == null || highlight.queue == this);
     return _contents.map((task) {
-      var taskString = prefixLines(task.toString(),
+      var taskString = task == highlight
+          ? task.toStringWithStackTrace()
+          : task.toString();
+      taskString = prefixLines(taskString,
           firstPrefix: task == highlight ? "> " : "* ");
 
       if (task == highlight && !task.children.isEmpty) {
@@ -570,7 +576,10 @@
             prefix = "*";
           }
 
-          return prefixLines(child.toString(),
+          var childString = prefix == "*"
+              ? child.toString()
+              : child.toStringWithStackTrace();
+          return prefixLines(childString,
               firstPrefix: "  $prefix ", prefix: "  | ");
         }).join('\n');
         taskString = '$taskString\n$childrenString';
diff --git a/pkg/scheduled_test/lib/src/schedule_error.dart b/pkg/scheduled_test/lib/src/schedule_error.dart
index a1f8a96..3df208a 100644
--- a/pkg/scheduled_test/lib/src/schedule_error.dart
+++ b/pkg/scheduled_test/lib/src/schedule_error.dart
@@ -6,6 +6,8 @@
 
 import 'dart:async';
 
+import 'package:stack_trace/stack_trace.dart';
+
 import 'schedule.dart';
 import 'task.dart';
 import 'utils.dart';
@@ -36,7 +38,7 @@
 
   /// Creates a new [ScheduleError] wrapping [error]. The metadata in
   /// [AsyncError]s and [ScheduleError]s will be preserved.
-  factory ScheduleError.from(Schedule schedule, error, {stackTrace,
+  factory ScheduleError.from(Schedule schedule, error, {StackTrace stackTrace,
       AsyncError cause}) {
     if (error is ScheduleError) return error;
 
@@ -59,7 +61,8 @@
     return new ScheduleError(schedule, error, stackTrace, cause);
   }
 
-  ScheduleError(Schedule schedule, error, stackTrace, AsyncError cause)
+  ScheduleError(Schedule schedule, error, StackTrace stackTrace,
+      AsyncError cause)
       : super.withCause(error, stackTrace, cause),
         schedule = schedule,
         task = schedule.currentTask,
@@ -86,7 +89,7 @@
     }
 
     result.write('Stack trace:\n');
-    result.write(prefixLines(stackTrace.toString().trim()));
+    result.write(prefixLines(terseTraceString(stackTrace)));
     result.write("\n\n");
 
     if (task != null) {
@@ -106,7 +109,7 @@
       result.write("\n\n");
       result.writeln("Pending out-of-band callbacks:");
       for (var callback in pendingCallbacks) {
-        result.writeln("* $callback");
+        result.writeln(prefixLines(callback, firstPrefix: "* "));
       }
     }
 
diff --git a/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart b/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart
index 4e1d0ff..83609f5 100644
--- a/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart
+++ b/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart
@@ -6,6 +6,8 @@
 
 import 'dart:async';
 
+import 'package:stack_trace/stack_trace.dart';
+
 import '../scheduled_test.dart';
 
 /// Matches a [Future] that completes successfully with a value. Note that this
@@ -60,8 +62,15 @@
       }
     }
 
+    var outerTrace = new Trace.current();
     currentSchedule.wrapFuture(item.then((value) {
-      if (_matcher != null) expect(value, _matcher);
+      if (_matcher == null) return;
+
+      try {
+        expect(value, _matcher);
+      } catch (e, stackTrace) {
+        throw new AsyncError(e, outerTrace);
+      }
     }), description);
 
     return true;
diff --git a/pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart b/pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart
index 64adf5b..f326ac1 100644
--- a/pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart
+++ b/pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart
@@ -134,11 +134,14 @@
   void writeBytes(List<int> data) => _inner.writeBytes(data);
   Future<HttpResponse> consume(Stream<List<int>> stream) =>
     _inner.consume(stream);
+  Future<HttpResponse> addStream(Stream<List<int>> stream) =>
+    _inner.writeStream(stream);
   Future<HttpResponse> writeStream(Stream<List<int>> stream) =>
     _inner.writeStream(stream);
-  void close() => _inner.close();
+  Future close() => _inner.close();
   void write(Object obj) => _inner.write(obj);
-  void writeAll(Iterable objects) => _inner.writeAll(objects);
+  void writeAll(Iterable objects, [String separator = ""]) =>
+    _inner.writeAll(objects, separator);
   void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
   void writeln([Object obj = ""]) => _inner.writeln(obj);
 }
diff --git a/pkg/scheduled_test/lib/src/task.dart b/pkg/scheduled_test/lib/src/task.dart
index 2ce3905..4ccb201 100644
--- a/pkg/scheduled_test/lib/src/task.dart
+++ b/pkg/scheduled_test/lib/src/task.dart
@@ -7,6 +7,8 @@
 import 'dart:async';
 import 'dart:collection';
 
+import 'package:stack_trace/stack_trace.dart';
+
 import 'future_group.dart';
 import 'schedule.dart';
 import 'utils.dart';
@@ -59,6 +61,8 @@
   Future get result => _resultCompleter.future;
   final _resultCompleter = new Completer();
 
+  final stackTrace = new Trace.current();
+
   Task(fn(), String description, TaskQueue queue)
     : this._(fn, description, queue, null, queue.contents.length);
 
@@ -116,6 +120,11 @@
 
   String toString() => description == null ? "#$_id" : description;
 
+  String toStringWithStackTrace() {
+    var stackString = prefixLines(terseTraceString(stackTrace));
+    return "$this\n\nStack trace:\n$stackString";
+  }
+
   /// Returns a detailed representation of [queue] with this task highlighted.
   String generateTree() => queue.generateTree(this);
 }
diff --git a/pkg/scheduled_test/lib/src/utils.dart b/pkg/scheduled_test/lib/src/utils.dart
index 57c341d..419e47e 100644
--- a/pkg/scheduled_test/lib/src/utils.dart
+++ b/pkg/scheduled_test/lib/src/utils.dart
@@ -6,6 +6,8 @@
 
 import 'dart:async';
 
+import 'package:stack_trace/stack_trace.dart';
+
 /// A pair of values.
 class Pair<E, F> {
   E first;
@@ -182,3 +184,12 @@
   if (matches.isEmpty) return false;
   return matches.first.start == 0 && matches.first.end == string.length;
 }
+
+/// Returns a string representation of [trace] that has the core and test frames
+/// folded together.
+String terseTraceString(StackTrace trace) {
+  return new Trace.from(trace).terse.foldFrames((frame) {
+    return frame.package == 'scheduled_test' || frame.package == 'unittest' ||
+        frame.isCore;
+  }).toString().trim();
+}
diff --git a/pkg/scheduled_test/pubspec.yaml b/pkg/scheduled_test/pubspec.yaml
index 8cccf1b..eb1291c 100644
--- a/pkg/scheduled_test/pubspec.yaml
+++ b/pkg/scheduled_test/pubspec.yaml
@@ -9,6 +9,7 @@
   read like synchronous, linear code, despite executing asynchronously.
 
 dependencies:
-  unittest: any
   http: ">=0.4.1 <1.0.0"
   pathos: ">=0.3.2 <1.0.0"
+  stack_trace: ">=0.4.3 <1.0.0"
+  unittest: ">=0.4.3 <1.0.0"
diff --git a/pkg/scheduled_test/test/descriptor/async_test.dart b/pkg/scheduled_test/test/descriptor/async_test.dart
new file mode 100644
index 0000000..b35718f
--- /dev/null
+++ b/pkg/scheduled_test/test/descriptor/async_test.dart
@@ -0,0 +1,143 @@
+// 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 'package:pathos/path.dart' as path;
+import 'package:scheduled_test/descriptor.dart' as d;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import 'utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("async().create() forwards to file().create", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.async(pumpEventQueue().then((_) {
+        return d.file('name.txt', 'contents');
+      })).create();
+
+      d.file('name.txt', 'contents').validate();
+    });
+  });
+
+  expectTestsPass("async().create() forwards to directory().create", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.async(pumpEventQueue().then((_) {
+        return d.dir('dir', [
+          d.file('file1.txt', 'contents1'),
+          d.file('file2.txt', 'contents2')
+        ]);
+      })).create();
+
+      d.dir('dir', [
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]).validate();
+    });
+  });
+
+  expectTestsPass("async().validate() forwards to file().validate", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.file('name.txt', 'contents').create();
+
+      d.async(pumpEventQueue().then((_) {
+        return d.file('name.txt', 'contents');
+      })).validate();
+    });
+  });
+
+  expectTestsPass("async().validate() fails if file().validate fails", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.async(pumpEventQueue().then((_) {
+        return d.file('name.txt', 'contents');
+      })).validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error,
+          matches(r"^File not found: '[^']+[\\/]name\.txt'\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("async().validate() forwards to directory().validate", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.dir('dir', [
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]).create();
+
+      d.async(pumpEventQueue().then((_) {
+        return d.dir('dir', [
+          d.file('file1.txt', 'contents1'),
+          d.file('file2.txt', 'contents2')
+        ]);
+      })).validate();
+    });
+  });
+
+  expectTestsPass("async().create() fails if directory().create fails", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.async(pumpEventQueue().then((_) {
+        return d.dir('dir', [
+          d.file('file1.txt', 'contents1'),
+          d.file('file2.txt', 'contents2')
+        ]);
+      })).validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error,
+          matches(r"^Directory not found: '[^']+[\\/]dir'\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("async().load() fails", () {
+    test('test', () {
+      scheduleSandbox();
+
+      expect(d.async(new Future.immediate(d.file('name.txt')))
+              .load('path').toList(),
+          throwsA(equals("AsyncDescriptors don't support load().")));
+    });
+  });
+
+  expectTestsPass("async().read() fails", () {
+    test('test', () {
+      scheduleSandbox();
+
+      expect(d.async(new Future.immediate(d.file('name.txt'))).read().toList(),
+          throwsA(equals("AsyncDescriptors don't support read().")));
+    });
+  });
+}
diff --git a/pkg/scheduled_test/test/descriptor/directory_test.dart b/pkg/scheduled_test/test/descriptor/directory_test.dart
new file mode 100644
index 0000000..e54b191
--- /dev/null
+++ b/pkg/scheduled_test/test/descriptor/directory_test.dart
@@ -0,0 +1,414 @@
+// 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 'package:pathos/path.dart' as path;
+import 'package:scheduled_test/descriptor.dart' as d;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import 'utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("directory().create() creates a directory and its contents",
+      () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.dir('dir', [
+        d.dir('subdir', [
+          d.file('subfile1.txt', 'subcontents1'),
+          d.file('subfile2.txt', 'subcontents2')
+        ]),
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]).create();
+
+      schedule(() {
+        expect(new File(path.join(sandbox, 'dir', 'file1.txt')).readAsString(),
+            completion(equals('contents1')));
+        expect(new File(path.join(sandbox, 'dir', 'file2.txt')).readAsString(),
+            completion(equals('contents2')));
+        expect(new File(path.join(sandbox, 'dir', 'subdir', 'subfile1.txt'))
+                .readAsString(),
+            completion(equals('subcontents1')));
+        expect(new File(path.join(sandbox, 'dir', 'subdir', 'subfile2.txt'))
+                .readAsString(),
+            completion(equals('subcontents2')));
+      });
+    });
+  });
+
+  expectTestsPass("directory().create() works if the directory already exists",
+      () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.dir('dir').create();
+      d.dir('dir', [d.file('name.txt', 'contents')]).create();
+
+      schedule(() {
+        expect(new File(path.join(sandbox, 'dir', 'name.txt')).readAsString(),
+            completion(equals('contents')));
+      });
+    });
+  });
+
+  expectTestsPass("directory().validate() completes successfully if the "
+      "filesystem matches the descriptor", () {
+    test('test', () {
+      scheduleSandbox();
+
+      schedule(() {
+        var dirPath = path.join(sandbox, 'dir');
+        var subdirPath = path.join(dirPath, 'subdir');
+        return new Directory(subdirPath).create(recursive: true).then((_) {
+          return Future.wait([
+            new File(path.join(dirPath, 'file1.txt'))
+                .writeAsString('contents1'),
+            new File(path.join(dirPath, 'file2.txt'))
+                .writeAsString('contents2'),
+            new File(path.join(subdirPath, 'subfile1.txt'))
+                .writeAsString('subcontents1'),
+            new File(path.join(subdirPath, 'subfile2.txt'))
+                .writeAsString('subcontents2')
+          ]);
+        });
+      });
+
+      d.dir('dir', [
+        d.dir('subdir', [
+          d.file('subfile1.txt', 'subcontents1'),
+          d.file('subfile2.txt', 'subcontents2')
+        ]),
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]).validate();
+    });
+  });
+
+  expectTestsPass("directory().validate() fails if a directory isn't found"
+      , () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        var dirPath = path.join(sandbox, 'dir');
+        return new Directory(dirPath).create().then((_) {
+          return Future.wait([
+            new File(path.join(dirPath, 'file1.txt'))
+                .writeAsString('contents1'),
+            new File(path.join(dirPath, 'file2.txt'))
+                .writeAsString('contents2')
+          ]);
+        });
+      });
+
+      d.dir('dir', [
+        d.dir('subdir', [
+          d.file('subfile1.txt', 'subcontents1'),
+          d.file('subfile2.txt', 'subcontents2')
+        ]),
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]).validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error.toString(),
+          matches(r"^Directory not found: '[^']+[\\/]dir[\\/]subdir'\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("directory().validate() fails if a file isn't found", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        var dirPath = path.join(sandbox, 'dir');
+        var subdirPath = path.join(dirPath, 'subdir');
+        return new Directory(subdirPath).create(recursive: true).then((_) {
+          return Future.wait([
+            new File(path.join(dirPath, 'file1.txt'))
+                .writeAsString('contents1'),
+            new File(path.join(subdirPath, 'subfile1.txt'))
+                .writeAsString('subcontents1'),
+            new File(path.join(subdirPath, 'subfile2.txt'))
+                .writeAsString('subcontents2')
+          ]);
+        });
+      });
+
+      d.dir('dir', [
+        d.dir('subdir', [
+          d.file('subfile1.txt', 'subcontents1'),
+          d.file('subfile2.txt', 'subcontents2')
+        ]),
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]).validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error.toString(),
+          matches(r"^File not found: '[^']+[\\/]dir[\\/]file2\.txt'\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("directory().validate() fails if multiple children aren't "
+      "found or have the wrong contents", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        var dirPath = path.join(sandbox, 'dir');
+        var subdirPath = path.join(dirPath, 'subdir');
+        return new Directory(subdirPath).create(recursive: true).then((_) {
+          return Future.wait([
+            new File(path.join(dirPath, 'file1.txt'))
+                .writeAsString('contents1'),
+            new File(path.join(subdirPath, 'subfile2.txt'))
+                .writeAsString('subwrongtents2')
+          ]);
+        });
+      });
+
+      d.dir('dir', [
+        d.dir('subdir', [
+          d.file('subfile1.txt', 'subcontents1'),
+          d.file('subfile2.txt', 'subcontents2')
+        ]),
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]).validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error.toString(), matches(
+          r"^\* File not found: '[^']+[\\/]dir[\\/]subdir[\\/]subfile1\.txt'\."
+              r"\n"
+          r"\* File 'subfile2\.txt' should contain:\n"
+          r"  \| subcontents2\n"
+          r"  but actually contained:\n"
+          r"  X subwrongtents2\n"
+          r"\* File not found: '[^']+[\\/]dir[\\/]file2\.txt'\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("directory().validate() fails if a file has the wrong "
+      "contents", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        var dirPath = path.join(sandbox, 'dir');
+        var subdirPath = path.join(dirPath, 'subdir');
+        return new Directory(subdirPath).create(recursive: true).then((_) {
+          return Future.wait([
+            new File(path.join(dirPath, 'file1.txt'))
+                .writeAsString('contents1'),
+            new File(path.join(dirPath, 'file2.txt'))
+                .writeAsString('contents2'),
+            new File(path.join(subdirPath, 'subfile1.txt'))
+                .writeAsString('wrongtents1'),
+            new File(path.join(subdirPath, 'subfile2.txt'))
+                .writeAsString('subcontents2')
+          ]);
+        });
+      });
+
+      d.dir('dir', [
+        d.dir('subdir', [
+          d.file('subfile1.txt', 'subcontents1'),
+          d.file('subfile2.txt', 'subcontents2')
+        ]),
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]).validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error.toString()), equals([
+        "File 'subfile1.txt' should contain:\n"
+        "| subcontents1\n"
+        "but actually contained:\n"
+        "X wrongtents1"
+      ]));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("directory().load() loads a file", () {
+    test('test', () {
+      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
+      expect(byteStreamToString(dir.load('name.txt')),
+          completion(equals('contents')));
+    });
+  });
+
+  expectTestsPass("directory().load() loads a deeply-nested file", () {
+    test('test', () {
+      var dir = d.dir('dir', [
+        d.dir('subdir', [
+          d.file('name.txt', 'subcontents')
+        ]),
+        d.file('name.txt', 'contents')
+      ]);
+
+      expect(byteStreamToString(dir.load('subdir/name.txt')),
+          completion(equals('subcontents')));
+    });
+  });
+
+  expectTestsPass("directory().read() fails", () {
+    test('test', () {
+      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
+      expect(dir.read().toList(),
+          throwsA(equals("Can't read the contents of 'dir': is a directory.")));
+    });
+  });
+
+  expectTestsPass("directory().load() fails to load a nested directory", () {
+    test('test', () {
+      var dir = d.dir('dir', [
+        d.dir('subdir', [
+          d.file('name.txt', 'subcontents')
+        ]),
+        d.file('name.txt', 'contents')
+      ]);
+
+      expect(dir.load('subdir').toList(),
+          throwsA(equals("Can't read the contents of 'subdir': is a "
+              "directory.")));
+    });
+  });
+
+  expectTestsPass("directory().load() fails to load an absolute path", () {
+    test('test', () {
+      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
+
+      expect(dir.load('/name.txt').toList(),
+          throwsA(equals("Can't load absolute path '/name.txt'.")));
+    });
+  });
+
+  expectTestsPass("directory().load() fails to load '.', '..', or ''", () {
+    test('test', () {
+      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
+
+      expect(dir.load('.').toList(),
+          throwsA(equals("Can't load '.' from within 'dir'.")));
+
+      expect(dir.load('..').toList(),
+          throwsA(equals("Can't load '..' from within 'dir'.")));
+
+      expect(dir.load('').toList(),
+          throwsA(equals("Can't load '' from within 'dir'.")));
+    });
+  });
+
+  expectTestsPass("directory().load() fails to load a file that doesn't exist",
+      () {
+    test('test', () {
+      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
+
+      expect(dir.load('not-name.txt').toList(),
+          throwsA(equals("Couldn't find an entry named 'not-name.txt' within "
+              "'dir'.")));
+    });
+  });
+
+  expectTestsPass("directory().load() fails to load a file that exists "
+      "multiple times", () {
+    test('test', () {
+      var dir = d.dir('dir', [
+        d.file('name.txt', 'contents'),
+        d.file('name.txt', 'contents')
+      ]);
+
+      expect(dir.load('name.txt').toList(),
+          throwsA(equals("Found multiple entries named 'name.txt' within "
+              "'dir'.")));
+    });
+  });
+
+  expectTestsPass("directory().describe() lists the contents of the directory",
+      () {
+    test('test', () {
+      var dir = d.dir('dir', [
+        d.file('file1.txt', 'contents1'),
+        d.file('file2.txt', 'contents2')
+      ]);
+
+      expect(dir.describe(), equals(
+          "dir\n"
+          "|-- file1.txt\n"
+          "'-- file2.txt"));
+    });
+  });
+
+  expectTestsPass("directory().describe() lists the contents of nested "
+      "directories", () {
+    test('test', () {
+      var dir = d.dir('dir', [
+        d.file('file1.txt', 'contents1'),
+        d.dir('subdir', [
+          d.file('subfile1.txt', 'subcontents1'),
+          d.file('subfile2.txt', 'subcontents2'),
+          d.dir('subsubdir', [
+            d.file('subsubfile.txt', 'subsubcontents')
+          ])
+        ]),
+        d.file('file2.txt', 'contents2')
+      ]);
+
+      expect(dir.describe(), equals(
+          "dir\n"
+          "|-- file1.txt\n"
+          "|-- subdir\n"
+          "|   |-- subfile1.txt\n"
+          "|   |-- subfile2.txt\n"
+          "|   '-- subsubdir\n"
+          "|       '-- subsubfile.txt\n"
+          "'-- file2.txt"));
+    });
+  });
+
+  expectTestsPass("directory().describe() with no contents returns the "
+      "directory name", () {
+    test('test', () {
+      expect(d.dir('dir').describe(), equals('dir'));
+    });
+  });
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/descriptor/file_test.dart b/pkg/scheduled_test/test/descriptor/file_test.dart
new file mode 100644
index 0000000..877c02a
--- /dev/null
+++ b/pkg/scheduled_test/test/descriptor/file_test.dart
@@ -0,0 +1,183 @@
+// 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 'package:pathos/path.dart' as path;
+import 'package:scheduled_test/descriptor.dart' as d;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import 'utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass('file().create() creates a file', () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.file('name.txt', 'contents').create();
+
+      schedule(() {
+        expect(new File(path.join(sandbox, 'name.txt')).readAsString(),
+            completion(equals('contents')));
+      });
+    });
+  });
+
+  expectTestsPass('file().create() overwrites an existing file', () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.file('name.txt', 'contents1').create();
+
+      d.file('name.txt', 'contents2').create();
+
+      schedule(() {
+        expect(new File(path.join(sandbox, 'name.txt')).readAsString(),
+            completion(equals('contents2')));
+      });
+    });
+  });
+
+  expectTestsPass('file().validate() completes successfully if the filesystem '
+      'matches the descriptor', () {
+    test('test', () {
+      scheduleSandbox();
+
+      schedule(() {
+        return new File(path.join(sandbox, 'name.txt'))
+            .writeAsString('contents');
+      });
+
+      d.file('name.txt', 'contents').validate();
+    });
+  });
+
+  expectTestsPass("file().validate() fails if there's a file with the wrong "
+      "contents", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        return new File(path.join(sandbox, 'name.txt'))
+            .writeAsString('wrongtents');
+      });
+
+      d.file('name.txt', 'contents').validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals([
+        "File 'name.txt' should contain:\n"
+        "| contents\n"
+        "but actually contained:\n"
+        "X wrongtents"
+      ]), verbose: true);
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("file().validate() fails if there's no file", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.file('name.txt', 'contents').validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error,
+          matches(r"^File not found: '[^']+[\\/]name\.txt'\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("file().read() returns the contents of the file as a stream",
+      () {
+    test('test', () {
+      expect(byteStreamToString(d.file('name.txt', 'contents').read()),
+          completion(equals('contents')));
+    });
+  });
+
+  expectTestsPass("file().load() throws an error", () {
+    test('test', () {
+      expect(d.file('name.txt', 'contents').load('path').toList(),
+          throwsA(equals("Can't load 'path' from within 'name.txt': not a "
+                         "directory.")));
+    });
+  });
+
+  expectTestsPass("file().describe() returns the filename", () {
+    test('test', () {
+      expect(d.file('name.txt', 'contents').describe(), equals('name.txt'));
+    });
+  });
+
+  expectTestsPass('binaryFile().create() creates a file', () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.binaryFile('name.bin', [1, 2, 3, 4, 5]).create();
+
+      schedule(() {
+        expect(new File(path.join(sandbox, 'name.bin')).readAsBytes(),
+            completion(equals([1, 2, 3, 4, 5])));
+      });
+    });
+  });
+
+  expectTestsPass('binaryFile().validate() completes successfully if the '
+      'filesystem matches the descriptor', () {
+    test('test', () {
+      scheduleSandbox();
+
+      schedule(() {
+        return new File(path.join(sandbox, 'name.bin'))
+            .writeAsBytes([1, 2, 3, 4, 5]);
+      });
+
+      d.binaryFile('name.bin', [1, 2, 3, 4, 5]).validate();
+    });
+  });
+
+  expectTestsPass("binaryFile().validate() fails if there's a file with the "
+      "wrong contents", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        return new File(path.join(sandbox, 'name.bin'))
+            .writeAsBytes([2, 4, 6, 8, 10]);
+      });
+
+      d.binaryFile('name.bin', [1, 2, 3, 4, 5]).validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals([
+        "File 'name.bin' didn't contain the expected binary data."
+      ]), verbose: true);
+    });
+  }, passing: ['test 2']);
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/descriptor/nothing_test.dart b/pkg/scheduled_test/test/descriptor/nothing_test.dart
new file mode 100644
index 0000000..902fc4e
--- /dev/null
+++ b/pkg/scheduled_test/test/descriptor/nothing_test.dart
@@ -0,0 +1,105 @@
+// 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 'package:pathos/path.dart' as path;
+import 'package:scheduled_test/descriptor.dart' as d;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import 'utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("nothing().create() does nothing", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.nothing('foo').create();
+
+      schedule(() {
+        expect(new File(path.join(sandbox, 'foo')).exists(),
+            completion(isFalse));
+      });
+
+      schedule(() {
+        expect(new Directory(path.join(sandbox, 'foo')).exists(),
+            completion(isFalse));
+      });
+    });
+  });
+
+  expectTestsPass("nothing().validate() succeeds if nothing's there", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.nothing('foo').validate();
+    });
+  });
+
+  expectTestsPass("nothing().validate() fails if there's a file", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.file('name.txt', 'contents').create();
+      d.nothing('name.txt').validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error,
+          matches(r"^Expected nothing to exist at '[^']+[\\/]name.txt', but "
+              r"found a file\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("nothing().validate() fails if there's a directory", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.dir('dir').create();
+      d.nothing('dir').validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error,
+          matches(r"^Expected nothing to exist at '[^']+[\\/]dir', but found a "
+              r"directory\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("nothing().load() fails", () {
+    test('test', () {
+      scheduleSandbox();
+
+      expect(d.nothing('name.txt').load('path').toList(),
+          throwsA(equals("Nothing descriptors don't support load().")));
+    });
+  });
+
+  expectTestsPass("nothing().read() fails", () {
+    test('test', () {
+      scheduleSandbox();
+
+      expect(d.nothing('name.txt').read().toList(),
+          throwsA(equals("Nothing descriptors don't support read().")));
+    });
+  });
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/descriptor/pattern_test.dart b/pkg/scheduled_test/test/descriptor/pattern_test.dart
new file mode 100644
index 0000000..a9f734e
--- /dev/null
+++ b/pkg/scheduled_test/test/descriptor/pattern_test.dart
@@ -0,0 +1,169 @@
+// 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 'package:pathos/path.dart' as path;
+import 'package:scheduled_test/descriptor.dart' as d;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import 'utils.dart';
+
+String sandbox;
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("pattern().validate() succeeds if there's a file matching "
+      "the pattern and the child entry", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.file('foo', 'blap').create();
+
+      d.filePattern(new RegExp(r'f..'), 'blap').validate();
+    });
+  });
+
+  expectTestsPass("pattern().validate() succeeds if there's a dir matching "
+      "the pattern and the child entry", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.dir('foo', [
+        d.file('bar', 'baz')
+      ]).create();
+
+      d.dirPattern(new RegExp(r'f..'), [
+        d.file('bar', 'baz')
+      ]).validate();
+    });
+  });
+
+  expectTestsPass("pattern().validate() succeeds if there's multiple files "
+      "matching the pattern but only one matching the child entry", () {
+    test('test', () {
+      scheduleSandbox();
+
+      d.file('foo', 'blap').create();
+      d.file('fee', 'blak').create();
+      d.file('faa', 'blut').create();
+
+      d.filePattern(new RegExp(r'f..'), 'blap').validate();
+    });
+  });
+
+  expectTestsPass("pattern().validate() fails if there's no file matching the "
+      "pattern", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.filePattern(new RegExp(r'f..'), 'bar').validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error,
+          matches(r"^No entry found in '[^']+' matching /f\.\./\.$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("pattern().validate() fails if there's a file matching the "
+      "pattern but not the entry", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.file('foo', 'bap').create();
+      d.filePattern(new RegExp(r'f..'), 'bar').validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error,
+          matches(r"^Caught error\n"
+              r"| File 'foo' should contain:\n"
+              r"| | bar\n"
+              r"| but actually contained:\n"
+              r"| X bap\n"
+              r"while validating\n"
+              r"| foo$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("pattern().validate() fails if there's a dir matching the "
+      "pattern but not the entry", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.dir('foo', [
+        d.file('bar', 'bap')
+      ]).create();
+
+      d.dirPattern(new RegExp(r'f..'), [
+        d.file('bar', 'baz')
+      ]).validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error,
+          matches(r"^Caught error\n"
+              r"| File 'bar' should contain:\n"
+              r"| | baz\n"
+              r"| but actually contained:\n"
+              r"| X bap"
+              r"while validating\n"
+              r"| foo\n"
+              r"| '-- bar$"));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("pattern().validate() fails if there's multiple files "
+      "matching the pattern and the child entry", () {
+    var errors;
+    test('test 1', () {
+      scheduleSandbox();
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      d.file('foo', 'bar').create();
+      d.file('fee', 'bar').create();
+      d.file('faa', 'bar').create();
+      d.filePattern(new RegExp(r'f..'), 'bar').validate();
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error, matches(
+              r"^Multiple valid entries found in '[^']+' matching "
+                  r"\/f\.\./:\n"
+              r"\* faa\n"
+              r"\* fee\n"
+              r"\* foo$"));
+    });
+  }, passing: ['test 2']);
+}
diff --git a/pkg/scheduled_test/test/descriptor/utils.dart b/pkg/scheduled_test/test/descriptor/utils.dart
new file mode 100644
index 0000000..bd9ae57
--- /dev/null
+++ b/pkg/scheduled_test/test/descriptor/utils.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.descriptor.utils;
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:scheduled_test/descriptor.dart' as d;
+import 'package:scheduled_test/scheduled_test.dart';
+
+export '../utils.dart';
+
+String sandbox;
+
+void scheduleSandbox() {
+  schedule(() {
+    return new Directory('').createTemp().then((dir) {
+      sandbox = dir.path;
+      d.defaultRoot = sandbox;
+    });
+  });
+
+  currentSchedule.onComplete.schedule(() {
+    d.defaultRoot = null;
+    if (sandbox == null) return;
+    var oldSandbox = sandbox;
+    sandbox = null;
+    return new Directory(oldSandbox).delete(recursive: true);
+  });
+}
+
+Future<List<int>> byteStreamToList(Stream<List<int>> stream) {
+  return stream.fold(<int>[], (buffer, chunk) {
+    buffer.addAll(chunk);
+    return buffer;
+  });
+}
+
+Future<String> byteStreamToString(Stream<List<int>> stream) =>
+  byteStreamToList(stream).then((bytes) => new String.fromCharCodes(bytes));
+
diff --git a/pkg/scheduled_test/test/descriptor_test.dart b/pkg/scheduled_test/test/descriptor_test.dart
deleted file mode 100644
index f43e159..0000000
--- a/pkg/scheduled_test/test/descriptor_test.dart
+++ /dev/null
@@ -1,979 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library descriptor_test;
-
-import 'dart:async';
-import 'dart:io';
-
-import 'package:pathos/path.dart' as path;
-import 'package:scheduled_test/descriptor.dart' as d;
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'metatest.dart';
-import 'utils.dart';
-
-String sandbox;
-
-void main() {
-  metaSetUp(() {
-    // The windows bots are very slow, so we increase the default timeout.
-    if (Platform.operatingSystem != "windows") return;
-    currentSchedule.timeout = new Duration(seconds: 10);
-  });
-
-  expectTestsPass('file().create() creates a file', () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.file('name.txt', 'contents').create();
-
-      schedule(() {
-        expect(new File(path.join(sandbox, 'name.txt')).readAsString(),
-            completion(equals('contents')));
-      });
-    });
-  });
-
-  expectTestsPass('file().create() overwrites an existing file', () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.file('name.txt', 'contents1').create();
-
-      d.file('name.txt', 'contents2').create();
-
-      schedule(() {
-        expect(new File(path.join(sandbox, 'name.txt')).readAsString(),
-            completion(equals('contents2')));
-      });
-    });
-  });
-
-  expectTestsPass('file().validate() completes successfully if the filesystem '
-      'matches the descriptor', () {
-    test('test', () {
-      scheduleSandbox();
-
-      schedule(() {
-        return new File(path.join(sandbox, 'name.txt'))
-            .writeAsString('contents');
-      });
-
-      d.file('name.txt', 'contents').validate();
-    });
-  });
-
-  expectTestsPass("file().validate() fails if there's a file with the wrong "
-      "contents", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        return new File(path.join(sandbox, 'name.txt'))
-            .writeAsString('wrongtents');
-      });
-
-      d.file('name.txt', 'contents').validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals([
-        "File 'name.txt' should contain:\n"
-        "| contents\n"
-        "but actually contained:\n"
-        "X wrongtents"
-      ]), verbose: true);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("file().validate() fails if there's no file", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.file('name.txt', 'contents').validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error,
-          matches(r"^File not found: '[^']+[\\/]name\.txt'\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("file().read() returns the contents of the file as a stream",
-      () {
-    test('test', () {
-      expect(byteStreamToString(d.file('name.txt', 'contents').read()),
-          completion(equals('contents')));
-    });
-  });
-
-  expectTestsPass("file().load() throws an error", () {
-    test('test', () {
-      expect(d.file('name.txt', 'contents').load('path').toList(),
-          throwsA(equals("Can't load 'path' from within 'name.txt': not a "
-                         "directory.")));
-    });
-  });
-
-  expectTestsPass("file().describe() returns the filename", () {
-    test('test', () {
-      expect(d.file('name.txt', 'contents').describe(), equals('name.txt'));
-    });
-  });
-
-  expectTestsPass('binaryFile().create() creates a file', () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.binaryFile('name.bin', [1, 2, 3, 4, 5]).create();
-
-      schedule(() {
-        expect(new File(path.join(sandbox, 'name.bin')).readAsBytes(),
-            completion(equals([1, 2, 3, 4, 5])));
-      });
-    });
-  });
-
-  expectTestsPass('binaryFile().validate() completes successfully if the '
-      'filesystem matches the descriptor', () {
-    test('test', () {
-      scheduleSandbox();
-
-      schedule(() {
-        return new File(path.join(sandbox, 'name.bin'))
-            .writeAsBytes([1, 2, 3, 4, 5]);
-      });
-
-      d.binaryFile('name.bin', [1, 2, 3, 4, 5]).validate();
-    });
-  });
-
-  expectTestsPass("binaryFile().validate() fails if there's a file with the "
-      "wrong contents", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        return new File(path.join(sandbox, 'name.bin'))
-            .writeAsBytes([2, 4, 6, 8, 10]);
-      });
-
-      d.binaryFile('name.bin', [1, 2, 3, 4, 5]).validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals([
-        "File 'name.bin' didn't contain the expected binary data."
-      ]), verbose: true);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("directory().create() creates a directory and its contents",
-      () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.dir('dir', [
-        d.dir('subdir', [
-          d.file('subfile1.txt', 'subcontents1'),
-          d.file('subfile2.txt', 'subcontents2')
-        ]),
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]).create();
-
-      schedule(() {
-        expect(new File(path.join(sandbox, 'dir', 'file1.txt')).readAsString(),
-            completion(equals('contents1')));
-        expect(new File(path.join(sandbox, 'dir', 'file2.txt')).readAsString(),
-            completion(equals('contents2')));
-        expect(new File(path.join(sandbox, 'dir', 'subdir', 'subfile1.txt'))
-                .readAsString(),
-            completion(equals('subcontents1')));
-        expect(new File(path.join(sandbox, 'dir', 'subdir', 'subfile2.txt'))
-                .readAsString(),
-            completion(equals('subcontents2')));
-      });
-    });
-  });
-
-  expectTestsPass("directory().create() works if the directory already exists",
-      () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.dir('dir').create();
-      d.dir('dir', [d.file('name.txt', 'contents')]).create();
-
-      schedule(() {
-        expect(new File(path.join(sandbox, 'dir', 'name.txt')).readAsString(),
-            completion(equals('contents')));
-      });
-    });
-  });
-
-  expectTestsPass("directory().validate() completes successfully if the "
-      "filesystem matches the descriptor", () {
-    test('test', () {
-      scheduleSandbox();
-
-      schedule(() {
-        var dirPath = path.join(sandbox, 'dir');
-        var subdirPath = path.join(dirPath, 'subdir');
-        return new Directory(subdirPath).create(recursive: true).then((_) {
-          return Future.wait([
-            new File(path.join(dirPath, 'file1.txt'))
-                .writeAsString('contents1'),
-            new File(path.join(dirPath, 'file2.txt'))
-                .writeAsString('contents2'),
-            new File(path.join(subdirPath, 'subfile1.txt'))
-                .writeAsString('subcontents1'),
-            new File(path.join(subdirPath, 'subfile2.txt'))
-                .writeAsString('subcontents2')
-          ]);
-        });
-      });
-
-      d.dir('dir', [
-        d.dir('subdir', [
-          d.file('subfile1.txt', 'subcontents1'),
-          d.file('subfile2.txt', 'subcontents2')
-        ]),
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]).validate();
-    });
-  });
-
-  expectTestsPass("directory().validate() fails if a directory isn't found"
-      , () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        var dirPath = path.join(sandbox, 'dir');
-        return new Directory(dirPath).create().then((_) {
-          return Future.wait([
-            new File(path.join(dirPath, 'file1.txt'))
-                .writeAsString('contents1'),
-            new File(path.join(dirPath, 'file2.txt'))
-                .writeAsString('contents2')
-          ]);
-        });
-      });
-
-      d.dir('dir', [
-        d.dir('subdir', [
-          d.file('subfile1.txt', 'subcontents1'),
-          d.file('subfile2.txt', 'subcontents2')
-        ]),
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]).validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error.toString(),
-          matches(r"^Directory not found: '[^']+[\\/]dir[\\/]subdir'\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("directory().validate() fails if a file isn't found", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        var dirPath = path.join(sandbox, 'dir');
-        var subdirPath = path.join(dirPath, 'subdir');
-        return new Directory(subdirPath).create(recursive: true).then((_) {
-          return Future.wait([
-            new File(path.join(dirPath, 'file1.txt'))
-                .writeAsString('contents1'),
-            new File(path.join(subdirPath, 'subfile1.txt'))
-                .writeAsString('subcontents1'),
-            new File(path.join(subdirPath, 'subfile2.txt'))
-                .writeAsString('subcontents2')
-          ]);
-        });
-      });
-
-      d.dir('dir', [
-        d.dir('subdir', [
-          d.file('subfile1.txt', 'subcontents1'),
-          d.file('subfile2.txt', 'subcontents2')
-        ]),
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]).validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error.toString(),
-          matches(r"^File not found: '[^']+[\\/]dir[\\/]file2\.txt'\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("directory().validate() fails if multiple children aren't "
-      "found or have the wrong contents", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        var dirPath = path.join(sandbox, 'dir');
-        var subdirPath = path.join(dirPath, 'subdir');
-        return new Directory(subdirPath).create(recursive: true).then((_) {
-          return Future.wait([
-            new File(path.join(dirPath, 'file1.txt'))
-                .writeAsString('contents1'),
-            new File(path.join(subdirPath, 'subfile2.txt'))
-                .writeAsString('subwrongtents2')
-          ]);
-        });
-      });
-
-      d.dir('dir', [
-        d.dir('subdir', [
-          d.file('subfile1.txt', 'subcontents1'),
-          d.file('subfile2.txt', 'subcontents2')
-        ]),
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]).validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error.toString(), matches(
-          r"^\* File not found: '[^']+[\\/]dir[\\/]subdir[\\/]subfile1\.txt'\."
-              r"\n"
-          r"\* File 'subfile2\.txt' should contain:\n"
-          r"  \| subcontents2\n"
-          r"  but actually contained:\n"
-          r"  X subwrongtents2\n"
-          r"\* File not found: '[^']+[\\/]dir[\\/]file2\.txt'\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("directory().validate() fails if a file has the wrong "
-      "contents", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        var dirPath = path.join(sandbox, 'dir');
-        var subdirPath = path.join(dirPath, 'subdir');
-        return new Directory(subdirPath).create(recursive: true).then((_) {
-          return Future.wait([
-            new File(path.join(dirPath, 'file1.txt'))
-                .writeAsString('contents1'),
-            new File(path.join(dirPath, 'file2.txt'))
-                .writeAsString('contents2'),
-            new File(path.join(subdirPath, 'subfile1.txt'))
-                .writeAsString('wrongtents1'),
-            new File(path.join(subdirPath, 'subfile2.txt'))
-                .writeAsString('subcontents2')
-          ]);
-        });
-      });
-
-      d.dir('dir', [
-        d.dir('subdir', [
-          d.file('subfile1.txt', 'subcontents1'),
-          d.file('subfile2.txt', 'subcontents2')
-        ]),
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]).validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error.toString()), equals([
-        "File 'subfile1.txt' should contain:\n"
-        "| subcontents1\n"
-        "but actually contained:\n"
-        "X wrongtents1"
-      ]));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("directory().load() loads a file", () {
-    test('test', () {
-      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
-      expect(byteStreamToString(dir.load('name.txt')),
-          completion(equals('contents')));
-    });
-  });
-
-  expectTestsPass("directory().load() loads a deeply-nested file", () {
-    test('test', () {
-      var dir = d.dir('dir', [
-        d.dir('subdir', [
-          d.file('name.txt', 'subcontents')
-        ]),
-        d.file('name.txt', 'contents')
-      ]);
-
-      expect(byteStreamToString(dir.load('subdir/name.txt')),
-          completion(equals('subcontents')));
-    });
-  });
-
-  expectTestsPass("directory().read() fails", () {
-    test('test', () {
-      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
-      expect(dir.read().toList(),
-          throwsA(equals("Can't read the contents of 'dir': is a directory.")));
-    });
-  });
-
-  expectTestsPass("directory().load() fails to load a nested directory", () {
-    test('test', () {
-      var dir = d.dir('dir', [
-        d.dir('subdir', [
-          d.file('name.txt', 'subcontents')
-        ]),
-        d.file('name.txt', 'contents')
-      ]);
-
-      expect(dir.load('subdir').toList(),
-          throwsA(equals("Can't read the contents of 'subdir': is a "
-              "directory.")));
-    });
-  });
-
-  expectTestsPass("directory().load() fails to load an absolute path", () {
-    test('test', () {
-      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
-
-      expect(dir.load('/name.txt').toList(),
-          throwsA(equals("Can't load absolute path '/name.txt'.")));
-    });
-  });
-
-  expectTestsPass("directory().load() fails to load '.', '..', or ''", () {
-    test('test', () {
-      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
-
-      expect(dir.load('.').toList(),
-          throwsA(equals("Can't load '.' from within 'dir'.")));
-
-      expect(dir.load('..').toList(),
-          throwsA(equals("Can't load '..' from within 'dir'.")));
-
-      expect(dir.load('').toList(),
-          throwsA(equals("Can't load '' from within 'dir'.")));
-    });
-  });
-
-  expectTestsPass("directory().load() fails to load a file that doesn't exist",
-      () {
-    test('test', () {
-      var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
-
-      expect(dir.load('not-name.txt').toList(),
-          throwsA(equals("Couldn't find an entry named 'not-name.txt' within "
-              "'dir'.")));
-    });
-  });
-
-  expectTestsPass("directory().load() fails to load a file that exists "
-      "multiple times", () {
-    test('test', () {
-      var dir = d.dir('dir', [
-        d.file('name.txt', 'contents'),
-        d.file('name.txt', 'contents')
-      ]);
-
-      expect(dir.load('name.txt').toList(),
-          throwsA(equals("Found multiple entries named 'name.txt' within "
-              "'dir'.")));
-    });
-  });
-
-  expectTestsPass("directory().describe() lists the contents of the directory",
-      () {
-    test('test', () {
-      var dir = d.dir('dir', [
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]);
-
-      expect(dir.describe(), equals(
-          "dir\n"
-          "|-- file1.txt\n"
-          "'-- file2.txt"));
-    });
-  });
-
-  expectTestsPass("directory().describe() lists the contents of nested "
-      "directories", () {
-    test('test', () {
-      var dir = d.dir('dir', [
-        d.file('file1.txt', 'contents1'),
-        d.dir('subdir', [
-          d.file('subfile1.txt', 'subcontents1'),
-          d.file('subfile2.txt', 'subcontents2'),
-          d.dir('subsubdir', [
-            d.file('subsubfile.txt', 'subsubcontents')
-          ])
-        ]),
-        d.file('file2.txt', 'contents2')
-      ]);
-
-      expect(dir.describe(), equals(
-          "dir\n"
-          "|-- file1.txt\n"
-          "|-- subdir\n"
-          "|   |-- subfile1.txt\n"
-          "|   |-- subfile2.txt\n"
-          "|   '-- subsubdir\n"
-          "|       '-- subsubfile.txt\n"
-          "'-- file2.txt"));
-    });
-  });
-
-  expectTestsPass("directory().describe() with no contents returns the "
-      "directory name", () {
-    test('test', () {
-      expect(d.dir('dir').describe(), equals('dir'));
-    });
-  });
-
-  expectTestsPass("async().create() forwards to file().create", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.async(pumpEventQueue().then((_) {
-        return d.file('name.txt', 'contents');
-      })).create();
-
-      d.file('name.txt', 'contents').validate();
-    });
-  });
-
-  expectTestsPass("async().create() forwards to directory().create", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.async(pumpEventQueue().then((_) {
-        return d.dir('dir', [
-          d.file('file1.txt', 'contents1'),
-          d.file('file2.txt', 'contents2')
-        ]);
-      })).create();
-
-      d.dir('dir', [
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]).validate();
-    });
-  });
-
-  expectTestsPass("async().validate() forwards to file().validate", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.file('name.txt', 'contents').create();
-
-      d.async(pumpEventQueue().then((_) {
-        return d.file('name.txt', 'contents');
-      })).validate();
-    });
-  });
-
-  expectTestsPass("async().validate() fails if file().validate fails", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.async(pumpEventQueue().then((_) {
-        return d.file('name.txt', 'contents');
-      })).validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error,
-          matches(r"^File not found: '[^']+[\\/]name\.txt'\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("async().validate() forwards to directory().validate", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.dir('dir', [
-        d.file('file1.txt', 'contents1'),
-        d.file('file2.txt', 'contents2')
-      ]).create();
-
-      d.async(pumpEventQueue().then((_) {
-        return d.dir('dir', [
-          d.file('file1.txt', 'contents1'),
-          d.file('file2.txt', 'contents2')
-        ]);
-      })).validate();
-    });
-  });
-
-  expectTestsPass("async().create() fails if directory().create fails", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.async(pumpEventQueue().then((_) {
-        return d.dir('dir', [
-          d.file('file1.txt', 'contents1'),
-          d.file('file2.txt', 'contents2')
-        ]);
-      })).validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error,
-          matches(r"^Directory not found: '[^']+[\\/]dir'\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("async().load() fails", () {
-    test('test', () {
-      scheduleSandbox();
-
-      expect(d.async(new Future.immediate(d.file('name.txt')))
-              .load('path').toList(),
-          throwsA(equals("AsyncDescriptors don't support load().")));
-    });
-  });
-
-  expectTestsPass("async().read() fails", () {
-    test('test', () {
-      scheduleSandbox();
-
-      expect(d.async(new Future.immediate(d.file('name.txt'))).read().toList(),
-          throwsA(equals("AsyncDescriptors don't support read().")));
-    });
-  });
-
-  expectTestsPass("nothing().create() does nothing", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.nothing('foo').create();
-
-      schedule(() {
-        expect(new File(path.join(sandbox, 'foo')).exists(),
-            completion(isFalse));
-      });
-
-      schedule(() {
-        expect(new Directory(path.join(sandbox, 'foo')).exists(),
-            completion(isFalse));
-      });
-    });
-  });
-
-  expectTestsPass("nothing().validate() succeeds if nothing's there", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.nothing('foo').validate();
-    });
-  });
-
-  expectTestsPass("nothing().validate() fails if there's a file", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.file('name.txt', 'contents').create();
-      d.nothing('name.txt').validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error,
-          matches(r"^Expected nothing to exist at '[^']+[\\/]name.txt', but "
-              r"found a file\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("nothing().validate() fails if there's a directory", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.dir('dir').create();
-      d.nothing('dir').validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error,
-          matches(r"^Expected nothing to exist at '[^']+[\\/]dir', but found a "
-              r"directory\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("nothing().load() fails", () {
-    test('test', () {
-      scheduleSandbox();
-
-      expect(d.nothing('name.txt').load('path').toList(),
-          throwsA(equals("Nothing descriptors don't support load().")));
-    });
-  });
-
-  expectTestsPass("nothing().read() fails", () {
-    test('test', () {
-      scheduleSandbox();
-
-      expect(d.nothing('name.txt').read().toList(),
-          throwsA(equals("Nothing descriptors don't support read().")));
-    });
-  });
-
-  expectTestsPass("pattern().validate() succeeds if there's a file matching "
-      "the pattern and the child entry", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.file('foo', 'blap').create();
-
-      d.filePattern(new RegExp(r'f..'), 'blap').validate();
-    });
-  });
-
-  expectTestsPass("pattern().validate() succeeds if there's a dir matching "
-      "the pattern and the child entry", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.dir('foo', [
-        d.file('bar', 'baz')
-      ]).create();
-
-      d.dirPattern(new RegExp(r'f..'), [
-        d.file('bar', 'baz')
-      ]).validate();
-    });
-  });
-
-  expectTestsPass("pattern().validate() succeeds if there's multiple files "
-      "matching the pattern but only one matching the child entry", () {
-    test('test', () {
-      scheduleSandbox();
-
-      d.file('foo', 'blap').create();
-      d.file('fee', 'blak').create();
-      d.file('faa', 'blut').create();
-
-      d.filePattern(new RegExp(r'f..'), 'blap').validate();
-    });
-  });
-
-  expectTestsPass("pattern().validate() fails if there's no file matching the "
-      "pattern", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.filePattern(new RegExp(r'f..'), 'bar').validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error,
-          matches(r"^No entry found in '[^']+' matching /f\.\./\.$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("pattern().validate() fails if there's a file matching the "
-      "pattern but not the entry", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.file('foo', 'bap').create();
-      d.filePattern(new RegExp(r'f..'), 'bar').validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error,
-          matches(r"^Caught error\n"
-              r"| File 'foo' should contain:\n"
-              r"| | bar\n"
-              r"| but actually contained:\n"
-              r"| X bap\n"
-              r"while validating\n"
-              r"| foo$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("pattern().validate() fails if there's a dir matching the "
-      "pattern but not the entry", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.dir('foo', [
-        d.file('bar', 'bap')
-      ]).create();
-
-      d.dirPattern(new RegExp(r'f..'), [
-        d.file('bar', 'baz')
-      ]).validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error,
-          matches(r"^Caught error\n"
-              r"| File 'bar' should contain:\n"
-              r"| | baz\n"
-              r"| but actually contained:\n"
-              r"| X bap"
-              r"while validating\n"
-              r"| foo\n"
-              r"| '-- bar$"));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("pattern().validate() fails if there's multiple files "
-      "matching the pattern and the child entry", () {
-    var errors;
-    test('test 1', () {
-      scheduleSandbox();
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      d.file('foo', 'bar').create();
-      d.file('fee', 'bar').create();
-      d.file('faa', 'bar').create();
-      d.filePattern(new RegExp(r'f..'), 'bar').validate();
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error, matches(
-              r"^Multiple valid entries found in '[^']+' matching "
-                  r"\/f\.\./:\n"
-              r"\* faa\n"
-              r"\* fee\n"
-              r"\* foo$"));
-    });
-  }, passing: ['test 2']);
-}
-
-void scheduleSandbox() {
-  schedule(() {
-    return new Directory('').createTemp().then((dir) {
-      sandbox = dir.path;
-      d.defaultRoot = sandbox;
-    });
-  });
-
-  currentSchedule.onComplete.schedule(() {
-    d.defaultRoot = null;
-    if (sandbox == null) return;
-    var oldSandbox = sandbox;
-    sandbox = null;
-    return new Directory(oldSandbox).delete(recursive: true);
-  });
-}
-
-Future<List<int>> byteStreamToList(Stream<List<int>> stream) {
-  return stream.reduce(<int>[], (buffer, chunk) {
-    buffer.addAll(chunk);
-    return buffer;
-  });
-}
-
-Future<String> byteStreamToString(Stream<List<int>> stream) =>
-  byteStreamToList(stream).then((bytes) => new String.fromCharCodes(bytes));
diff --git a/pkg/scheduled_test/test/scheduled_future_matchers_test.dart b/pkg/scheduled_test/test/scheduled_future_matchers_test.dart
new file mode 100644
index 0000000..bd253ba
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_future_matchers_test.dart
@@ -0,0 +1,85 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import 'metatest.dart';
+import 'utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("expect(..., completes) with a completing future should pass",
+      () {
+    test('test', () {
+      expect(pumpEventQueue(), completes);
+    });
+  });
+
+  expectTestsPass("expect(..., completes) with a failing future should signal "
+      "an out-of-band error", () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      expect(pumpEventQueue().then((_) {
+        throw 'error';
+      }), completes);
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("expect(..., completion(...)) with a matching future should "
+      "pass", () {
+    test('test', () {
+      expect(pumpEventQueue().then((_) => 'foo'), completion(equals('foo')));
+    });
+  });
+
+  expectTestsPass("expect(..., completion(...)) with a non-matching future "
+      "should signal an out-of-band error", () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      expect(pumpEventQueue().then((_) => 'foo'), completion(equals('bar')));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.length, equals(1));
+      expect(errors.first.error, new isInstanceOf<TestFailure>());
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("expect(..., completion(...)) with a failing future should "
+      "signal an out-of-band error", () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      expect(pumpEventQueue().then((_) {
+        throw 'error';
+      }), completion(equals('bar')));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+}
diff --git a/pkg/scheduled_test/test/scheduled_process_test.dart b/pkg/scheduled_test/test/scheduled_process_test.dart
index 4b89da1..f24758c 100644
--- a/pkg/scheduled_test/test/scheduled_process_test.dart
+++ b/pkg/scheduled_test/test/scheduled_process_test.dart
@@ -16,11 +16,7 @@
 import 'utils.dart';
 
 void main() {
-  metaSetUp(() {
-    // The windows bots are very slow, so we increase the default timeout.
-    if (Platform.operatingSystem != "windows") return;
-    currentSchedule.timeout = new Duration(seconds: 10);
-  });
+  setUpTimeout();
 
   expectTestsPass("a process must have kill() or shouldExit() called", () {
     var errors;
diff --git a/pkg/scheduled_test/test/scheduled_server_test.dart b/pkg/scheduled_test/test/scheduled_server_test.dart
index b34765c..ec08bb5 100644
--- a/pkg/scheduled_test/test/scheduled_server_test.dart
+++ b/pkg/scheduled_test/test/scheduled_server_test.dart
@@ -16,11 +16,7 @@
 import 'utils.dart';
 
 void main() {
-  metaSetUp(() {
-    // The windows bots are very slow, so we increase the default timeout.
-    if (Platform.operatingSystem != "windows") return;
-    currentSchedule.timeout = new Duration(seconds: 10);
-  });
+  setUpTimeout();
 
   expectTestsPass("a server with no handlers does nothing", () {
     test('test', () => new ScheduledServer());
diff --git a/pkg/scheduled_test/test/scheduled_test/abort_test.dart b/pkg/scheduled_test/test/scheduled_test/abort_test.dart
new file mode 100644
index 0000000..7fc8b1a
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/abort_test.dart
@@ -0,0 +1,94 @@
+// 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 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("aborting the schedule before it's started running should "
+      "cause no tasks to be run", () {
+    test('test', () {
+      schedule(() {
+        throw 'error';
+      });
+
+      currentSchedule.abort();
+    });
+  });
+
+  expectTestsPass("aborting the schedule while it's running should stop future "
+      "tasks from running", () {
+    test('test', () {
+      schedule(currentSchedule.abort);
+
+      schedule(() {
+        throw 'error';
+      });
+    });
+  });
+
+  expectTestsPass("aborting the schedule while it's running shouldn't stop "
+      "tasks in other queues from running", () {
+    var onCompleteRun = false;
+    test('test 1', () {
+      schedule(currentSchedule.abort);
+
+      currentSchedule.onComplete.schedule(() {
+        onCompleteRun = true;
+      });
+    });
+
+    test('test 2', () {
+      expect(onCompleteRun, isTrue);
+    });
+  });
+
+  expectTestsPass("aborting the schedule while it's running shouldn't stop "
+      "out-of-band callbacks", () {
+    test('test', () {
+      var outOfBandFinished = false;
+      schedule(() {
+        wrapFuture(pumpEventQueue().then((_) {
+          outOfBandFinished = true;
+        }));
+
+        currentSchedule.abort();
+      });
+
+      currentSchedule.onComplete.schedule(() {
+        expect(outOfBandFinished, isTrue);
+      });
+    });
+  });
+
+  expectTestsPass("aborting the schedule in a non-tasks queue should stop "
+      "future tasks from running", () {
+    test('test', () {
+      currentSchedule.onComplete.schedule(() {
+        currentSchedule.abort();
+      });
+
+      currentSchedule.onComplete.schedule(() {
+        throw 'error';
+      });
+    });
+  });
+
+  expectTestsFail("aborting the schedule after an out-of-band error should "
+      "still surface the error", () {
+    test('test', () {
+      schedule(() {
+        currentSchedule.signalError('error');
+        currentSchedule.abort();
+      });
+    });
+  });
+}
diff --git a/pkg/scheduled_test/test/scheduled_test/current_schedule_current_task_test.dart b/pkg/scheduled_test/test/scheduled_test/current_schedule_current_task_test.dart
new file mode 100644
index 0000000..5dc3361
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/current_schedule_current_task_test.dart
@@ -0,0 +1,68 @@
+// 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 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass('currentSchedule.currentTask returns the current task while '
+      'executing a task', () {
+    test('test', () {
+      schedule(() => expect('foo', equals('foo')), 'task 1');
+
+      schedule(() {
+        expect(currentSchedule.currentTask.description, equals('task 2'));
+      }, 'task 2');
+
+      schedule(() => expect('bar', equals('bar')), 'task 3');
+    });
+  });
+
+  expectTestsPass('currentSchedule.currentTask is null before the schedule has '
+      'started', () {
+    test('test', () {
+      schedule(() => expect('foo', equals('foo')));
+
+      expect(currentSchedule.currentTask, isNull);
+    });
+  });
+
+  expectTestsPass('currentSchedule.currentTask is null after the schedule has '
+      'completed', () {
+    test('test', () {
+      schedule(() {
+        expect(pumpEventQueue().then((_) {
+          expect(currentSchedule.currentTask, isNull);
+        }), completes);
+      });
+
+      schedule(() => expect('foo', equals('foo')));
+    });
+  });
+
+  expectTestsPass('currentSchedule.currentQueue returns the current queue '
+      'while executing a task', () {
+    test('test', () {
+      schedule(() {
+        expect(currentSchedule.currentQueue.name, equals('tasks'));
+      });
+    });
+  });
+
+  expectTestsPass('currentSchedule.currentQueue is tasks before the schedule '
+      'has started', () {
+    test('test', () {
+      schedule(() => expect('foo', equals('foo')));
+
+      expect(currentSchedule.currentQueue.name, equals('tasks'));
+    });
+  });
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/scheduled_test/current_schedule_errors_test.dart b/pkg/scheduled_test/test/scheduled_test/current_schedule_errors_test.dart
new file mode 100644
index 0000000..4766b43
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/current_schedule_errors_test.dart
@@ -0,0 +1,239 @@
+// 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' hide sleep;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass('currentSchedule.errors contains the error in the onComplete '
+      'queue', () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      throw 'error';
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains the error in the '
+      'onException queue', () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      throw 'error';
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains an error passed into '
+      'signalError synchronously', () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      currentSchedule.signalError('error');
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains an error passed into '
+      'signalError asynchronously', () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() => currentSchedule.signalError('error'));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains an error passed into '
+      'signalError out-of-band', () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      pumpEventQueue().then(wrapAsync((_) {
+        return currentSchedule.signalError('error');
+      }));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains errors from both the task '
+      'queue and the onException queue in onComplete', () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      currentSchedule.onException.schedule(() {
+        throw 'error2';
+      });
+
+      throw 'error1';
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error1', 'error2']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains multiple out-of-band errors '
+      'from both the main task queue and onException in onComplete', () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      currentSchedule.onException.schedule(() {
+        sleep(1).then(wrapAsync((_) {
+          throw 'error3';
+        }));
+        sleep(2).then(wrapAsync((_) {
+          throw 'error4';
+        }));
+      });
+
+      sleep(1).then(wrapAsync((_) {
+        throw 'error1';
+      }));
+      sleep(2).then(wrapAsync((_) {
+        throw 'error2';
+      }));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error),
+          orderedEquals(['error1', 'error2', 'error3', 'error4']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains multiple out-of-band errors '
+      'from both the main task queue and onException in onComplete reported '
+      'via wrapFuture', () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      currentSchedule.onException.schedule(() {
+        wrapFuture(sleep(1).then((_) {
+          throw 'error3';
+        }));
+        wrapFuture(sleep(2).then((_) {
+          throw 'error4';
+        }));
+      });
+
+      wrapFuture(sleep(1).then((_) {
+        throw 'error1';
+      }));
+      wrapFuture(sleep(2).then((_) {
+        throw 'error2';
+      }));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error),
+          orderedEquals(['error1', 'error2', 'error3', 'error4']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains both an out-of-band error '
+      'and an error raised afterwards in a task', () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      sleep(1).then(wrapAsync((_) {
+        throw 'out-of-band';
+      }));
+
+      schedule(() => sleep(2).then((_) {
+        throw 'in-band';
+      }));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['out-of-band', 'in-band']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('currentSchedule.errors contains both an error raised in a '
+      'task and an error raised afterwards out-of-band', () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      sleep(2).then(wrapAsync((_) {
+        throw 'out-of-band';
+      }));
+
+      schedule(() => sleep(1).then((_) {
+        throw 'in-band';
+      }));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['in-band', 'out-of-band']));
+    });
+  }, passing: ['test 2']);
+}
diff --git a/pkg/scheduled_test/test/scheduled_test/current_schedule_state_test.dart b/pkg/scheduled_test/test/scheduled_test/current_schedule_state_test.dart
new file mode 100644
index 0000000..0c40ff9
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/current_schedule_state_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.
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass('currentSchedule.state starts out as SET_UP', () {
+    test('test', () {
+      expect(currentSchedule.state, equals(ScheduleState.SET_UP));
+    });
+  });
+
+  expectTestsPass('currentSchedule.state is RUNNING in tasks', () {
+    test('test', () {
+      schedule(() {
+        expect(currentSchedule.state, equals(ScheduleState.RUNNING));
+      });
+
+      currentSchedule.onComplete.schedule(() {
+        expect(currentSchedule.state, equals(ScheduleState.RUNNING));
+      });
+    });
+  });
+
+  expectTestsPass('currentSchedule.state is DONE after the test', () {
+    var oldSchedule;
+    test('test 1', () {
+      oldSchedule = currentSchedule;
+    });
+
+    test('test 2', () {
+      expect(oldSchedule.state, equals(ScheduleState.DONE));
+    });
+  });
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/scheduled_test/nested_task_test.dart b/pkg/scheduled_test/test/scheduled_test/nested_task_test.dart
new file mode 100644
index 0000000..2e7a10b
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/nested_task_test.dart
@@ -0,0 +1,137 @@
+// 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' hide sleep;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("nested schedule() runs its function immediately (but "
+      "asynchronously)", () {
+    test('test', () {
+      schedule(() {
+        var nestedScheduleRun = false;
+        schedule(() {
+          nestedScheduleRun = true;
+        });
+
+        expect(nestedScheduleRun, isFalse);
+        expect(pumpEventQueue().then((_) => nestedScheduleRun),
+            completion(isTrue));
+      });
+    });
+  });
+
+  expectTestsPass("nested schedule() calls don't wait for one another", () {
+    mock_clock.mock().run();
+    test('test', () {
+      var sleepFinished = false;
+      schedule(() {
+        schedule(() => sleep(1).then((_) {
+          sleepFinished = true;
+        }));
+        schedule(() => expect(sleepFinished, isFalse));
+      });
+    });
+  });
+
+  expectTestsPass("nested schedule() calls block their parent task", () {
+    mock_clock.mock().run();
+    test('test', () {
+      var sleepFinished = false;
+      schedule(() {
+        schedule(() => sleep(1).then((_) {
+          sleepFinished = true;
+        }));
+      });
+
+      schedule(() => expect(sleepFinished, isTrue));
+    });
+  });
+
+  expectTestsPass("nested schedule() calls forward their Future values", () {
+    mock_clock.mock().run();
+    test('test', () {
+      schedule(() {
+        expect(schedule(() => 'foo'), completion(equals('foo')));
+      });
+    });
+  });
+
+  expectTestsPass("errors in nested schedule() calls are properly registered",
+      () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        schedule(() {
+          throw 'error';
+        });
+      });
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("nested scheduled blocks whose return values are passed to "
+      "wrapFuture should report exceptions once", () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        wrapFuture(schedule(() {
+          throw 'error';
+        }));
+
+        return pumpEventQueue();
+      });
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("a nested task failing shouldn't short-circuit the parent "
+      "task", () {
+    var parentTaskFinishedBeforeOnComplete = false;
+    test('test 1', () {
+      var parentTaskFinished = false;
+      currentSchedule.onComplete.schedule(() {
+        parentTaskFinishedBeforeOnComplete = parentTaskFinished;
+      });
+
+      schedule(() {
+        schedule(() {
+          throw 'error';
+        });
+
+        return sleep(1).then((_) {
+          parentTaskFinished = true;
+        });
+      });
+    });
+
+    test('test 2', () {
+      expect(parentTaskFinishedBeforeOnComplete, isTrue);
+    });
+  }, passing: ['test 2']);
+}
diff --git a/pkg/scheduled_test/test/scheduled_test/on_complete_test.dart b/pkg/scheduled_test/test/scheduled_test/on_complete_test.dart
new file mode 100644
index 0000000..2c37da5
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/on_complete_test.dart
@@ -0,0 +1,162 @@
+// 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 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass('the onComplete queue is run if a test is successful', () {
+    var onCompleteRun = false;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        onCompleteRun = true;
+      });
+
+      schedule(() => expect('foo', equals('foo')));
+    });
+
+    test('test 2', () {
+      expect(onCompleteRun, isTrue);
+    });
+  });
+
+  expectTestsPass('the onComplete queue is run after an out-of-band callback',
+      () {
+    var outOfBandRun = false;
+    test('test1', () {
+      currentSchedule.onComplete.schedule(() {
+        expect(outOfBandRun, isTrue);
+      });
+
+      pumpEventQueue().then(wrapAsync((_) {
+        outOfBandRun = true;
+      }));
+    });
+  });
+
+  expectTestsPass('the onComplete queue is run after an out-of-band callback '
+      'and waits for another out-of-band callback', () {
+    var outOfBand1Run = false;
+    var outOfBand2Run = false;
+    test('test1', () {
+      currentSchedule.onComplete.schedule(() {
+        expect(outOfBand1Run, isTrue);
+
+        pumpEventQueue().then(wrapAsync((_) {
+          outOfBand2Run = true;
+        }));
+      });
+
+      pumpEventQueue().then(wrapAsync((_) {
+        outOfBand1Run = true;
+      }));
+    });
+
+    test('test2', () => expect(outOfBand2Run, isTrue));
+  });
+
+  expectTestsFail('an out-of-band callback in the onComplete queue blocks the '
+      'test', () {
+    test('test', () {
+      currentSchedule.onComplete.schedule(() {
+        pumpEventQueue().then(wrapAsync((_) => expect('foo', equals('bar'))));
+      });
+    });
+  });
+
+  expectTestsPass('an out-of-band callback blocks onComplete even with an '
+      'unrelated error', () {
+    var outOfBandRun = false;
+    var outOfBandSetInOnComplete = false;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        outOfBandSetInOnComplete = outOfBandRun;
+      });
+
+      pumpEventQueue().then(wrapAsync((_) {
+        outOfBandRun = true;
+      }));
+
+      schedule(() => expect('foo', equals('bar')));
+    });
+
+    test('test 2', () => expect(outOfBandSetInOnComplete, isTrue));
+  }, passing: ['test 2']);
+
+  expectTestsPass('the onComplete queue is run after an asynchronous error',
+      () {
+    var onCompleteRun = false;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        onCompleteRun = true;
+      });
+
+      schedule(() => expect('foo', equals('bar')));
+    });
+
+    test('test 2', () {
+      expect(onCompleteRun, isTrue);
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('the onComplete queue is run after a synchronous error', () {
+    var onCompleteRun = false;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        onCompleteRun = true;
+      });
+
+      throw 'error';
+    });
+
+    test('test 2', () {
+      expect(onCompleteRun, isTrue);
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('the onComplete queue is run after an out-of-band error', () {
+    var onCompleteRun = false;
+    test('test 1', () {
+      currentSchedule.onComplete.schedule(() {
+        onCompleteRun = true;
+      });
+
+      pumpEventQueue().then(wrapAsync((_) => expect('foo', equals('bar'))));
+    });
+
+    test('test 2', () {
+      expect(onCompleteRun, isTrue);
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('onComplete tasks can be scheduled during normal tasks', () {
+    var onCompleteRun = false;
+    test('test 1', () {
+      schedule(() {
+        currentSchedule.onComplete.schedule(() {
+          onCompleteRun = true;
+        });
+      });
+    });
+
+    test('test 2', () {
+      expect(onCompleteRun, isTrue);
+    });
+  });
+
+  expectTestsFail('failures in onComplete cause test failures', () {
+    test('test', () {
+      currentSchedule.onComplete.schedule(() {
+        expect('foo', equals('bar'));
+      });
+    });
+  });
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/scheduled_test/on_exception_test.dart b/pkg/scheduled_test/test/scheduled_test/on_exception_test.dart
new file mode 100644
index 0000000..3e98864
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/on_exception_test.dart
@@ -0,0 +1,78 @@
+// 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 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass('the onException queue is not run if a test is successful',
+      () {
+    var onExceptionRun = false;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        onExceptionRun = true;
+      });
+
+      schedule(() => expect('foo', equals('foo')));
+    });
+
+    test('test 2', () {
+      expect(onExceptionRun, isFalse);
+    });
+  });
+
+  expectTestsPass('the onException queue is run after an asynchronous error',
+      () {
+    var onExceptionRun = false;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        onExceptionRun = true;
+      });
+
+      schedule(() => expect('foo', equals('bar')));
+    });
+
+    test('test 2', () {
+      expect(onExceptionRun, isTrue);
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('the onException queue is run after a synchronous error', () {
+    var onExceptionRun = false;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        onExceptionRun = true;
+      });
+
+      throw 'error';
+    });
+
+    test('test 2', () {
+      expect(onExceptionRun, isTrue);
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass('the onException queue is run after an out-of-band error',
+      () {
+    var onExceptionRun = false;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        onExceptionRun = true;
+      });
+
+      pumpEventQueue().then(wrapAsync((_) => expect('foo', equals('bar'))));
+    });
+
+    test('test 2', () {
+      expect(onExceptionRun, isTrue);
+    });
+  }, passing: ['test 2']);
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/scheduled_test/out_of_band_task_test.dart b/pkg/scheduled_test/test/scheduled_test/out_of_band_task_test.dart
new file mode 100644
index 0000000..35bd68e
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/out_of_band_task_test.dart
@@ -0,0 +1,49 @@
+// 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' hide sleep;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("out-of-band schedule() runs its function immediately (but "
+      "asynchronously)", () {
+    mock_clock.mock().run();
+    test('test', () {
+      schedule(() {
+        wrapFuture(sleep(1).then((_) {
+          var nestedScheduleRun = false;
+          schedule(() {
+            nestedScheduleRun = true;
+          });
+
+          expect(nestedScheduleRun, isFalse);
+          expect(pumpEventQueue().then((_) => nestedScheduleRun),
+              completion(isTrue));
+        }));
+      });
+    });
+  });
+
+  expectTestsPass("out-of-band schedule() calls block their parent queue", () {
+    mock_clock.mock().run();
+    test('test', () {
+      var scheduleRun = false;
+      wrapFuture(sleep(1).then((_) {
+        schedule(() => sleep(1).then((_) {
+          scheduleRun = true;
+        }));
+      }));
+
+      currentSchedule.onComplete.schedule(() => expect(scheduleRun, isTrue));
+    });
+  });
+}
diff --git a/pkg/scheduled_test/test/scheduled_test/set_up_test.dart b/pkg/scheduled_test/test/scheduled_test/set_up_test.dart
new file mode 100644
index 0000000..0d83d20
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/set_up_test.dart
@@ -0,0 +1,143 @@
+// 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 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass('setUp is run before each test', () {
+    var setUpRun = false;
+    setUp(() {
+      setUpRun = true;
+    });
+
+    test('test 1', () {
+      expect(setUpRun, isTrue);
+      setUpRun = false;
+    });
+
+    test('test 2', () {
+      expect(setUpRun, isTrue);
+      setUpRun = false;
+    });
+  });
+
+  expectTestsPass('setUp can schedule events', () {
+    var setUpRun = false;
+    setUp(() {
+      schedule(() {
+        setUpRun = true;
+      });
+      currentSchedule.onComplete.schedule(() {
+        setUpRun = false;
+      });
+    });
+
+    test('test 1', () {
+      expect(setUpRun, isFalse);
+      schedule(() => expect(setUpRun, isTrue));
+    });
+
+    test('test 2', () {
+      expect(setUpRun, isFalse);
+      schedule(() => expect(setUpRun, isTrue));
+    });
+  });
+
+  expectTestsFail('synchronous errors in setUp will cause tests to fail', () {
+    setUp(() => expect('foo', equals('bar')));
+    test('test 1', () => expect('foo', equals('foo')));
+    test('test 2', () => expect('foo', equals('foo')));
+  });
+
+  expectTestsFail('scheduled errors in setUp will cause tests to fail', () {
+    setUp(() => schedule(() => expect('foo', equals('bar'))));
+    test('test 1', () => expect('foo', equals('foo')));
+    test('test 2', () => expect('foo', equals('foo')));
+  });
+
+  expectTestsPass('synchronous errors in setUp will cause onException to run',
+      () {
+    var onExceptionRun = false;
+    setUp(() {
+      currentSchedule.onException.schedule(() {
+        onExceptionRun = true;
+      });
+
+      if (!onExceptionRun) expect('foo', equals('bar'));
+    });
+
+    test('test 1', () => expect('foo', equals('foo')));
+    test('test 2', () => expect(onExceptionRun, isTrue));
+  }, passing: ['test 2']);
+
+  expectTestsPass("setUp doesn't apply to child groups", () {
+    var setUpRun = false;
+    setUp(() {
+      setUpRun = true;
+      currentSchedule.onComplete.schedule(() {
+        setUpRun = false;
+      });
+    });
+
+    test('outer', () {
+      expect(setUpRun, isTrue);
+    });
+
+    group('group', () {
+      test('inner', () {
+        expect(setUpRun, isFalse);
+      });
+    });
+  });
+
+  expectTestsPass("setUp doesn't apply to parent groups", () {
+    var setUpRun = false;
+    group('group', () {
+      setUp(() {
+        setUpRun = true;
+        currentSchedule.onComplete.schedule(() {
+          setUpRun = false;
+        });
+      });
+
+      test('inner', () {
+        expect(setUpRun, isTrue);
+      });
+    });
+
+    test('outer', () {
+      expect(setUpRun, isFalse);
+    });
+  });
+
+  expectTestsPass("setUp doesn't apply to sibling groups", () {
+    var setUpRun = false;
+    group('group 1', () {
+      setUp(() {
+        setUpRun = true;
+        currentSchedule.onComplete.schedule(() {
+          setUpRun = false;
+        });
+      });
+
+      test('test 1', () {
+        expect(setUpRun, isTrue);
+      });
+    });
+
+    group('group 2', () {
+      test('test 2', () {
+        expect(setUpRun, isFalse);
+      });
+    });
+  });
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/scheduled_test/signal_error_test.dart b/pkg/scheduled_test/test/scheduled_test/signal_error_test.dart
new file mode 100644
index 0000000..ba52515
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/signal_error_test.dart
@@ -0,0 +1,48 @@
+// 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' hide sleep;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsFail('an out-of-band error reported via signalError is '
+      'handled', () {
+    mock_clock.mock().run();
+    test('test', () {
+      schedule(() {
+        sleep(1).then((_) => currentSchedule.signalError('bad'));
+      });
+      schedule(() => sleep(2));
+    });
+  });
+
+  expectTestsFail('an out-of-band error reported via signalError that finished '
+      'after the schedule is handled', () {
+    mock_clock.mock().run();
+    test('test', () {
+      schedule(() {
+        var done = wrapAsync((_) {});
+        sleep(2).then((_) {
+          currentSchedule.signalError('bad');
+          done(null);
+        });
+      });
+      schedule(() => sleep(1));
+    });
+  });
+
+  expectTestsFail('a synchronous error reported via signalError is handled', () {
+    test('test', () {
+      currentSchedule.signalError('bad');
+    });
+  });
+}
diff --git a/pkg/scheduled_test/test/scheduled_test/simple_test.dart b/pkg/scheduled_test/test/scheduled_test/simple_test.dart
new file mode 100644
index 0000000..ea51921
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/simple_test.dart
@@ -0,0 +1,123 @@
+// 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 'package:scheduled_test/scheduled_test.dart';
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass('a scheduled test with a correct synchronous expectation '
+      'should pass', () {
+    test('test', () {
+      expect('foo', equals('foo'));
+    });
+  });
+
+  expectTestsFail('a scheduled test with an incorrect synchronous expectation '
+      'should fail', () {
+    test('test', () {
+      expect('foo', equals('bar'));
+    });
+  });
+
+  expectTestsPass('a scheduled test with a correct asynchronous expectation '
+      'should pass', () {
+    test('test', () {
+      expect(new Future.immediate('foo'), completion(equals('foo')));
+    });
+  });
+
+  expectTestsFail('a scheduled test with an incorrect asynchronous expectation '
+      'should fail', () {
+    test('test', () {
+      expect(new Future.immediate('foo'), completion(equals('bar')));
+    });
+  });
+
+  expectTestsPass('a passing scheduled synchronous expect should register', () {
+    test('test', () {
+      schedule(() => expect('foo', equals('foo')));
+    });
+  });
+
+  expectTestsFail('a failing scheduled synchronous expect should register', () {
+    test('test', () {
+      schedule(() => expect('foo', equals('bar')));
+    });
+  });
+
+  expectTestsPass('a passing scheduled asynchronous expect should '
+      'register', () {
+    test('test', () {
+      schedule(() =>
+          expect(new Future.immediate('foo'), completion(equals('foo'))));
+    });
+  });
+
+  expectTestsFail('a failing scheduled synchronous expect should '
+      'register', () {
+    test('test', () {
+      schedule(() =>
+          expect(new Future.immediate('foo'), completion(equals('bar'))));
+    });
+  });
+
+  expectTestsPass('scheduled blocks should be run in order after the '
+      'synchronous setup', () {
+    test('test', () {
+      var list = [1];
+      schedule(() => list.add(2));
+      list.add(3);
+      schedule(() => expect(list, equals([1, 3, 4, 2])));
+      list.add(4);
+    });
+  });
+
+  expectTestsPass('scheduled blocks should forward their return values as '
+      'Futures', () {
+    test('synchronous value', () {
+      var future = schedule(() => 'value');
+      expect(future, completion(equals('value')));
+    });
+
+    test('asynchronous value', () {
+      var future = schedule(() => new Future.immediate('value'));
+      expect(future, completion(equals('value')));
+    });
+  });
+
+  expectTestsPass('scheduled blocks should wait for their Future return values '
+      'to complete before proceeding', () {
+    test('test', () {
+      var value = 'unset';
+      schedule(() => pumpEventQueue().then((_) {
+        value = 'set';
+      }));
+      schedule(() => expect(value, equals('set')));
+    });
+  });
+
+  expectTestsFail('a test failure in a chained future in a scheduled block '
+      'should be registered', () {
+    test('test', () {
+      schedule(() => new Future.immediate('foo')
+          .then((v) => expect(v, equals('bar'))));
+    });
+  });
+
+  expectTestsFail('an error in a chained future in a scheduled block should be '
+      'registered', () {
+    test('test', () {
+      schedule(() => new Future.immediate(null).then((_) {
+        throw 'error';
+      }));
+    });
+  });
+}
\ No newline at end of file
diff --git a/pkg/scheduled_test/test/scheduled_test/task_return_value_test.dart b/pkg/scheduled_test/test/scheduled_test/task_return_value_test.dart
new file mode 100644
index 0000000..e597167
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/task_return_value_test.dart
@@ -0,0 +1,82 @@
+// 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' hide sleep;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("an error thrown in a scheduled task should be piped to that "
+      "task's return value", () {
+    var error;
+    test('test 1', () {
+      schedule(() {
+        throw 'error';
+      }).catchError((e) {
+        error = e;
+      });
+    });
+
+    test('test 2', () {
+      expect(error, new isInstanceOf<ScheduleError>());
+      expect(error.error, equals('error'));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("an error thrown in a scheduled task should be piped to "
+      "future tasks' return values", () {
+    var error;
+    test('test 1', () {
+      schedule(() {
+        throw 'error';
+      });
+
+      schedule(() => null).catchError((e) {
+        error = e;
+      });
+    });
+
+    test('test 2', () {
+      expect(error, new isInstanceOf<ScheduleError>());
+      expect(error.error, equals('error'));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("an out-of-band error should be piped to future tasks' "
+      "return values, but not the current task's", () {
+    mock_clock.mock().run();
+    var error;
+    var firstTaskError = false;
+    var secondTaskRun = false;
+    test('test 1', () {
+      schedule(() => sleep(2)).catchError((_) {
+        firstTaskError = true;
+      });
+
+      sleep(1).then(wrapAsync((_) {
+        throw 'error';
+      }));
+
+      schedule(() {
+        secondTaskRun = true;
+      }).catchError((e) {
+        error = e;
+      });
+    });
+
+    test('test 2', () {
+      expect(firstTaskError, isFalse);
+      expect(secondTaskRun, isFalse);
+      expect(error, new isInstanceOf<ScheduleError>());
+      expect(error.error, equals('error'));
+    });
+  }, passing: ['test 2']);
+}
diff --git a/pkg/scheduled_test/test/scheduled_test/timeout_test.dart b/pkg/scheduled_test/test/scheduled_test/timeout_test.dart
new file mode 100644
index 0000000..ffcf32f
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/timeout_test.dart
@@ -0,0 +1,202 @@
+// 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' hide sleep;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsPass("a single task that takes too long will cause a timeout "
+      "error", () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.timeout = new Duration(milliseconds: 1);
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() => sleep(2));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(["The schedule timed out after "
+        "0:00:00.001000 of inactivity."]));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("an out-of-band callback that takes too long will cause a "
+      "timeout error", () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.timeout = new Duration(milliseconds: 1);
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      sleep(2).then(wrapAsync((_) => expect('foo', equals('foo'))));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(["The schedule timed out after "
+        "0:00:00.001000 of inactivity."]));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("each task resets the timeout timer", () {
+    mock_clock.mock().run();
+    test('test', () {
+      currentSchedule.timeout = new Duration(milliseconds: 2);
+
+      schedule(() => sleep(1));
+      schedule(() => sleep(1));
+      schedule(() => sleep(1));
+    });
+  });
+
+  expectTestsPass("setting up the test doesn't trigger a timeout", () {
+    var clock = mock_clock.mock();
+    test('test', () {
+      currentSchedule.timeout = new Duration(milliseconds: 1);
+
+      clock.tick(2);
+      schedule(() => expect('foo', equals('foo')));
+    });
+  });
+
+  expectTestsPass("an out-of-band error that's signaled after a timeout but "
+      "before the test completes is registered", () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.timeout = new Duration(milliseconds: 3);
+
+      currentSchedule.onException.schedule(() => sleep(2));
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      sleep(4).then(wrapAsync((_) {
+        throw 'out-of-band';
+      }));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals([
+        "The schedule timed out after 0:00:00.003000 of inactivity.",
+        "out-of-band"
+      ]));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("an out-of-band error that's signaled after a timeout but "
+      "before the test completes plays nicely with other out-of-band callbacks",
+      () {
+    mock_clock.mock().run();
+    var errors;
+    var onExceptionCallbackRun = false;
+    var onCompleteRunAfterOnExceptionCallback = false;
+    test('test 1', () {
+      currentSchedule.timeout = new Duration(milliseconds: 2);
+
+      currentSchedule.onException.schedule(() {
+        sleep(1).then(wrapAsync((_) {
+          onExceptionCallbackRun = true;
+        }));
+      });
+
+      currentSchedule.onComplete.schedule(() {
+        onCompleteRunAfterOnExceptionCallback = onExceptionCallbackRun;
+      });
+
+      sleep(3).then(wrapAsync((_) {
+        throw 'out-of-band';
+      }));
+    });
+
+    test('test 2', () {
+      expect(onCompleteRunAfterOnExceptionCallback, isTrue);
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("a task that times out while waiting to handle an "
+      "out-of-band error records both", () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.timeout = new Duration(milliseconds: 2);
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() => sleep(4));
+      sleep(1).then((_) => currentSchedule.signalError('out-of-band'));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals([
+        "out-of-band",
+        "The schedule timed out after 0:00:00.002000 of inactivity."
+      ]));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("a task that has an error then times out waiting for an "
+      "out-of-band callback records both", () {
+    mock_clock.mock().run();
+    var errors;
+    test('test 1', () {
+      currentSchedule.timeout = new Duration(milliseconds: 2);
+
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      schedule(() {
+        throw 'error';
+      });
+      wrapFuture(sleep(3));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals([
+        "error",
+        "The schedule timed out after 0:00:00.002000 of inactivity."
+      ]));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("currentSchedule.heartbeat resets the timeout timer", () {
+    mock_clock.mock().run();
+    test('test', () {
+      currentSchedule.timeout = new Duration(milliseconds: 3);
+
+      schedule(() {
+        return sleep(2).then((_) {
+          currentSchedule.heartbeat();
+          return sleep(2);
+        });
+      });
+    });
+  });
+
+  // TODO(nweiz): test out-of-band post-timeout errors that are detected after
+  // the test finishes once we can detect top-level errors (issue 8417).
+}
diff --git a/pkg/scheduled_test/test/scheduled_test/wrap_async_test.dart b/pkg/scheduled_test/test/scheduled_test/wrap_async_test.dart
new file mode 100644
index 0000000..322e17f
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/wrap_async_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io' hide sleep;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsFail('an out-of-band failure in wrapAsync is handled', () {
+    mock_clock.mock().run();
+    test('test', () {
+      schedule(() {
+        sleep(1).then(wrapAsync((_) => expect('foo', equals('bar'))));
+      });
+      schedule(() => sleep(2));
+    });
+  });
+
+  expectTestsFail('an out-of-band failure in wrapAsync that finishes after the '
+      'schedule is handled', () {
+    mock_clock.mock().run();
+    test('test', () {
+      schedule(() {
+        sleep(2).then(wrapAsync((_) => expect('foo', equals('bar'))));
+      });
+      schedule(() => sleep(1));
+    });
+  });
+}
diff --git a/pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart b/pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart
new file mode 100644
index 0000000..fd8e003
--- /dev/null
+++ b/pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart
@@ -0,0 +1,84 @@
+// 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' hide sleep;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
+
+import '../metatest.dart';
+import '../utils.dart';
+
+void main() {
+  setUpTimeout();
+
+  expectTestsFail('an out-of-band failure in wrapFuture is handled', () {
+    mock_clock.mock().run();
+    test('test', () {
+      schedule(() {
+        wrapFuture(sleep(1).then((_) => expect('foo', equals('bar'))));
+      });
+      schedule(() => sleep(2));
+    });
+  });
+
+  expectTestsFail('an out-of-band failure in wrapFuture that finishes after '
+      'the schedule is handled', () {
+    mock_clock.mock().run();
+    test('test', () {
+      schedule(() {
+        wrapFuture(sleep(2).then((_) => expect('foo', equals('bar'))));
+      });
+      schedule(() => sleep(1));
+    });
+  });
+
+  expectTestsPass("wrapFuture should return the value of the wrapped future",
+      () {
+    test('test', () {
+      schedule(() {
+        expect(wrapFuture(pumpEventQueue().then((_) => 'foo')),
+            completion(equals('foo')));
+      });
+    });
+  });
+
+  expectTestsPass("wrapFuture should pass through the error of the wrapped "
+      "future", () {
+    var error;
+    test('test 1', () {
+      schedule(() {
+        wrapFuture(pumpEventQueue().then((_) {
+          throw 'error';
+        })).catchError(wrapAsync((e) {
+          error = e.error;
+        }));
+      });
+    });
+
+    test('test 2', () {
+      expect(error, equals('error'));
+    });
+  }, passing: ['test 2']);
+
+  expectTestsPass("scheduled blocks whose return values are passed to "
+      "wrapFuture should report exceptions once", () {
+    var errors;
+    test('test 1', () {
+      currentSchedule.onException.schedule(() {
+        errors = currentSchedule.errors;
+      });
+
+      wrapFuture(schedule(() {
+        throw 'error';
+      }));
+    });
+
+    test('test 2', () {
+      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
+      expect(errors.map((e) => e.error), equals(['error']));
+    });
+  }, passing: ['test 2']);
+}
diff --git a/pkg/scheduled_test/test/scheduled_test_test.dart b/pkg/scheduled_test/test/scheduled_test_test.dart
deleted file mode 100644
index b1c0acb..0000000
--- a/pkg/scheduled_test/test/scheduled_test_test.dart
+++ /dev/null
@@ -1,1448 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library scheduled_test_test;
-
-import 'dart:async';
-import 'dart:io';
-
-import 'package:scheduled_test/scheduled_test.dart';
-import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
-
-import 'metatest.dart';
-import 'utils.dart';
-
-void main() {
-  metaSetUp(() {
-    // The windows bots are very slow, so we increase the default timeout.
-    if (Platform.operatingSystem != "windows") return;
-    currentSchedule.timeout = new Duration(seconds: 10);
-  });
-
-  expectTestsPass('a scheduled test with a correct synchronous expectation '
-      'should pass', () {
-    test('test', () {
-      expect('foo', equals('foo'));
-    });
-  });
-
-  expectTestsFail('a scheduled test with an incorrect synchronous expectation '
-      'should fail', () {
-    test('test', () {
-      expect('foo', equals('bar'));
-    });
-  });
-
-  expectTestsPass('a scheduled test with a correct asynchronous expectation '
-      'should pass', () {
-    test('test', () {
-      expect(new Future.immediate('foo'), completion(equals('foo')));
-    });
-  });
-
-  expectTestsFail('a scheduled test with an incorrect asynchronous expectation '
-      'should fail', () {
-    test('test', () {
-      expect(new Future.immediate('foo'), completion(equals('bar')));
-    });
-  });
-
-  expectTestsPass('a passing scheduled synchronous expect should register', () {
-    test('test', () {
-      schedule(() => expect('foo', equals('foo')));
-    });
-  });
-
-  expectTestsFail('a failing scheduled synchronous expect should register', () {
-    test('test', () {
-      schedule(() => expect('foo', equals('bar')));
-    });
-  });
-
-  expectTestsPass('a passing scheduled asynchronous expect should '
-      'register', () {
-    test('test', () {
-      schedule(() =>
-          expect(new Future.immediate('foo'), completion(equals('foo'))));
-    });
-  });
-
-  expectTestsFail('a failing scheduled synchronous expect should '
-      'register', () {
-    test('test', () {
-      schedule(() =>
-          expect(new Future.immediate('foo'), completion(equals('bar'))));
-    });
-  });
-
-  expectTestsPass('scheduled blocks should be run in order after the '
-      'synchronous setup', () {
-    test('test', () {
-      var list = [1];
-      schedule(() => list.add(2));
-      list.add(3);
-      schedule(() => expect(list, equals([1, 3, 4, 2])));
-      list.add(4);
-    });
-  });
-
-  expectTestsPass('scheduled blocks should forward their return values as '
-      'Futures', () {
-    test('synchronous value', () {
-      var future = schedule(() => 'value');
-      expect(future, completion(equals('value')));
-    });
-
-    test('asynchronous value', () {
-      var future = schedule(() => new Future.immediate('value'));
-      expect(future, completion(equals('value')));
-    });
-  });
-
-  expectTestsPass('scheduled blocks should wait for their Future return values '
-      'to complete before proceeding', () {
-    test('test', () {
-      var value = 'unset';
-      schedule(() => pumpEventQueue().then((_) {
-        value = 'set';
-      }));
-      schedule(() => expect(value, equals('set')));
-    });
-  });
-
-  expectTestsFail('a test failure in a chained future in a scheduled block '
-      'should be registered', () {
-    test('test', () {
-      schedule(() => new Future.immediate('foo')
-          .then((v) => expect(v, equals('bar'))));
-    });
-  });
-
-  expectTestsFail('an error in a chained future in a scheduled block should be '
-      'registered', () {
-    test('test', () {
-      schedule(() => new Future.immediate(null).then((_) {
-        throw 'error';
-      }));
-    });
-  });
-
-  expectTestsFail('an out-of-band failure in wrapAsync is handled', () {
-    mock_clock.mock().run();
-    test('test', () {
-      schedule(() {
-        sleep(1).then(wrapAsync((_) => expect('foo', equals('bar'))));
-      });
-      schedule(() => sleep(2));
-    });
-  });
-
-  expectTestsFail('an out-of-band failure in wrapAsync that finishes after the '
-      'schedule is handled', () {
-    mock_clock.mock().run();
-    test('test', () {
-      schedule(() {
-        sleep(2).then(wrapAsync((_) => expect('foo', equals('bar'))));
-      });
-      schedule(() => sleep(1));
-    });
-  });
-
-  expectTestsFail('an out-of-band failure in wrapFuture is handled', () {
-    mock_clock.mock().run();
-    test('test', () {
-      schedule(() {
-        wrapFuture(sleep(1).then((_) => expect('foo', equals('bar'))));
-      });
-      schedule(() => sleep(2));
-    });
-  });
-
-  expectTestsFail('an out-of-band failure in wrapFuture that finishes after '
-      'the schedule is handled', () {
-    mock_clock.mock().run();
-    test('test', () {
-      schedule(() {
-        wrapFuture(sleep(2).then((_) => expect('foo', equals('bar'))));
-      });
-      schedule(() => sleep(1));
-    });
-  });
-
-  expectTestsPass("wrapFuture should return the value of the wrapped future",
-      () {
-    test('test', () {
-      schedule(() {
-        expect(wrapFuture(pumpEventQueue().then((_) => 'foo')),
-            completion(equals('foo')));
-      });
-    });
-  });
-
-  expectTestsPass("wrapFuture should pass through the error of the wrapped "
-      "future", () {
-    var error;
-    test('test 1', () {
-      schedule(() {
-        wrapFuture(pumpEventQueue().then((_) {
-          throw 'error';
-        })).catchError(wrapAsync((e) {
-          error = e.error;
-        }));
-      });
-    });
-
-    test('test 2', () {
-      expect(error, equals('error'));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("scheduled blocks whose return values are passed to "
-      "wrapFuture should report exceptions once", () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      wrapFuture(schedule(() {
-        throw 'error';
-      }));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsFail('an out-of-band error reported via signalError is '
-      'handled', () {
-    mock_clock.mock().run();
-    test('test', () {
-      schedule(() {
-        sleep(1).then((_) => currentSchedule.signalError('bad'));
-      });
-      schedule(() => sleep(2));
-    });
-  });
-
-  expectTestsFail('an out-of-band error reported via signalError that finished '
-      'after the schedule is handled', () {
-    mock_clock.mock().run();
-    test('test', () {
-      schedule(() {
-        var done = wrapAsync((_) {});
-        sleep(2).then((_) {
-          currentSchedule.signalError('bad');
-          done(null);
-        });
-      });
-      schedule(() => sleep(1));
-    });
-  });
-
-  expectTestsFail('a synchronous error reported via signalError is handled', () {
-    test('test', () {
-      currentSchedule.signalError('bad');
-    });
-  });
-
-  expectTestsPass('the onComplete queue is run if a test is successful', () {
-    var onCompleteRun = false;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        onCompleteRun = true;
-      });
-
-      schedule(() => expect('foo', equals('foo')));
-    });
-
-    test('test 2', () {
-      expect(onCompleteRun, isTrue);
-    });
-  });
-
-  expectTestsPass('the onComplete queue is run after an out-of-band callback',
-      () {
-    var outOfBandRun = false;
-    test('test1', () {
-      currentSchedule.onComplete.schedule(() {
-        expect(outOfBandRun, isTrue);
-      });
-
-      pumpEventQueue().then(wrapAsync((_) {
-        outOfBandRun = true;
-      }));
-    });
-  });
-
-  expectTestsPass('the onComplete queue is run after an out-of-band callback '
-      'and waits for another out-of-band callback', () {
-    var outOfBand1Run = false;
-    var outOfBand2Run = false;
-    test('test1', () {
-      currentSchedule.onComplete.schedule(() {
-        expect(outOfBand1Run, isTrue);
-
-        pumpEventQueue().then(wrapAsync((_) {
-          outOfBand2Run = true;
-        }));
-      });
-
-      pumpEventQueue().then(wrapAsync((_) {
-        outOfBand1Run = true;
-      }));
-    });
-
-    test('test2', () => expect(outOfBand2Run, isTrue));
-  });
-
-  expectTestsFail('an out-of-band callback in the onComplete queue blocks the '
-      'test', () {
-    test('test', () {
-      currentSchedule.onComplete.schedule(() {
-        pumpEventQueue().then(wrapAsync((_) => expect('foo', equals('bar'))));
-      });
-    });
-  });
-
-  expectTestsPass('an out-of-band callback blocks onComplete even with an '
-      'unrelated error', () {
-    var outOfBandRun = false;
-    var outOfBandSetInOnComplete = false;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        outOfBandSetInOnComplete = outOfBandRun;
-      });
-
-      pumpEventQueue().then(wrapAsync((_) {
-        outOfBandRun = true;
-      }));
-
-      schedule(() => expect('foo', equals('bar')));
-    });
-
-    test('test 2', () => expect(outOfBandSetInOnComplete, isTrue));
-  }, passing: ['test 2']);
-
-  expectTestsPass('the onComplete queue is run after an asynchronous error',
-      () {
-    var onCompleteRun = false;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        onCompleteRun = true;
-      });
-
-      schedule(() => expect('foo', equals('bar')));
-    });
-
-    test('test 2', () {
-      expect(onCompleteRun, isTrue);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('the onComplete queue is run after a synchronous error', () {
-    var onCompleteRun = false;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        onCompleteRun = true;
-      });
-
-      throw 'error';
-    });
-
-    test('test 2', () {
-      expect(onCompleteRun, isTrue);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('the onComplete queue is run after an out-of-band error', () {
-    var onCompleteRun = false;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        onCompleteRun = true;
-      });
-
-      pumpEventQueue().then(wrapAsync((_) => expect('foo', equals('bar'))));
-    });
-
-    test('test 2', () {
-      expect(onCompleteRun, isTrue);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains the error in the onComplete '
-      'queue', () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      throw 'error';
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('onComplete tasks can be scheduled during normal tasks', () {
-    var onCompleteRun = false;
-    test('test 1', () {
-      schedule(() {
-        currentSchedule.onComplete.schedule(() {
-          onCompleteRun = true;
-        });
-      });
-    });
-
-    test('test 2', () {
-      expect(onCompleteRun, isTrue);
-    });
-  });
-
-  expectTestsFail('failures in onComplete cause test failures', () {
-    test('test', () {
-      currentSchedule.onComplete.schedule(() {
-        expect('foo', equals('bar'));
-      });
-    });
-  });
-
-  expectTestsPass('the onException queue is not run if a test is successful',
-      () {
-    var onExceptionRun = false;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        onExceptionRun = true;
-      });
-
-      schedule(() => expect('foo', equals('foo')));
-    });
-
-    test('test 2', () {
-      expect(onExceptionRun, isFalse);
-    });
-  });
-
-  expectTestsPass('the onException queue is run after an asynchronous error',
-      () {
-    var onExceptionRun = false;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        onExceptionRun = true;
-      });
-
-      schedule(() => expect('foo', equals('bar')));
-    });
-
-    test('test 2', () {
-      expect(onExceptionRun, isTrue);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('the onException queue is run after a synchronous error', () {
-    var onExceptionRun = false;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        onExceptionRun = true;
-      });
-
-      throw 'error';
-    });
-
-    test('test 2', () {
-      expect(onExceptionRun, isTrue);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('the onException queue is run after an out-of-band error', () {
-    var onExceptionRun = false;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        onExceptionRun = true;
-      });
-
-      pumpEventQueue().then(wrapAsync((_) => expect('foo', equals('bar'))));
-    });
-
-    test('test 2', () {
-      expect(onExceptionRun, isTrue);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains the error in the '
-      'onException queue', () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      throw 'error';
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains an error passed into '
-      'signalError synchronously', () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      currentSchedule.signalError('error');
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains an error passed into '
-      'signalError asynchronously', () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() => currentSchedule.signalError('error'));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains an error passed into '
-      'signalError out-of-band', () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      pumpEventQueue().then(wrapAsync((_) {
-        return currentSchedule.signalError('error');
-      }));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains errors from both the task '
-      'queue and the onException queue in onComplete', () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      currentSchedule.onException.schedule(() {
-        throw 'error2';
-      });
-
-      throw 'error1';
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error1', 'error2']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains multiple out-of-band errors '
-      'from both the main task queue and onException in onComplete', () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      currentSchedule.onException.schedule(() {
-        sleep(1).then(wrapAsync((_) {
-          throw 'error3';
-        }));
-        sleep(2).then(wrapAsync((_) {
-          throw 'error4';
-        }));
-      });
-
-      sleep(1).then(wrapAsync((_) {
-        throw 'error1';
-      }));
-      sleep(2).then(wrapAsync((_) {
-        throw 'error2';
-      }));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error),
-          orderedEquals(['error1', 'error2', 'error3', 'error4']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains multiple out-of-band errors '
-      'from both the main task queue and onException in onComplete reported '
-      'via wrapFuture', () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      currentSchedule.onException.schedule(() {
-        wrapFuture(sleep(1).then((_) {
-          throw 'error3';
-        }));
-        wrapFuture(sleep(2).then((_) {
-          throw 'error4';
-        }));
-      });
-
-      wrapFuture(sleep(1).then((_) {
-        throw 'error1';
-      }));
-      wrapFuture(sleep(2).then((_) {
-        throw 'error2';
-      }));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error),
-          orderedEquals(['error1', 'error2', 'error3', 'error4']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains both an out-of-band error '
-      'and an error raised afterwards in a task', () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      sleep(1).then(wrapAsync((_) {
-        throw 'out-of-band';
-      }));
-
-      schedule(() => sleep(2).then((_) {
-        throw 'in-band';
-      }));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['out-of-band', 'in-band']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.errors contains both an error raised in a '
-      'task and an error raised afterwards out-of-band', () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.onComplete.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      sleep(2).then(wrapAsync((_) {
-        throw 'out-of-band';
-      }));
-
-      schedule(() => sleep(1).then((_) {
-        throw 'in-band';
-      }));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['in-band', 'out-of-band']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass('currentSchedule.currentTask returns the current task while '
-      'executing a task', () {
-    test('test', () {
-      schedule(() => expect('foo', equals('foo')), 'task 1');
-
-      schedule(() {
-        expect(currentSchedule.currentTask.description, equals('task 2'));
-      }, 'task 2');
-
-      schedule(() => expect('bar', equals('bar')), 'task 3');
-    });
-  });
-
-  expectTestsPass('currentSchedule.currentTask is null before the schedule has '
-      'started', () {
-    test('test', () {
-      schedule(() => expect('foo', equals('foo')));
-
-      expect(currentSchedule.currentTask, isNull);
-    });
-  });
-
-  expectTestsPass('currentSchedule.currentTask is null after the schedule has '
-      'completed', () {
-    test('test', () {
-      schedule(() {
-        expect(pumpEventQueue().then((_) {
-          expect(currentSchedule.currentTask, isNull);
-        }), completes);
-      });
-
-      schedule(() => expect('foo', equals('foo')));
-    });
-  });
-
-  expectTestsPass('currentSchedule.currentQueue returns the current queue while '
-      'executing a task', () {
-    test('test', () {
-      schedule(() {
-        expect(currentSchedule.currentQueue.name, equals('tasks'));
-      });
-    });
-  });
-
-  expectTestsPass('currentSchedule.currentQueue is tasks before the schedule '
-      'has started', () {
-    test('test', () {
-      schedule(() => expect('foo', equals('foo')));
-
-      expect(currentSchedule.currentQueue.name, equals('tasks'));
-    });
-  });
-
-  expectTestsPass('currentSchedule.state starts out as SET_UP', () {
-    test('test', () {
-      expect(currentSchedule.state, equals(ScheduleState.SET_UP));
-    });
-  });
-
-  expectTestsPass('currentSchedule.state is RUNNING in tasks', () {
-    test('test', () {
-      schedule(() {
-        expect(currentSchedule.state, equals(ScheduleState.RUNNING));
-      });
-
-      currentSchedule.onComplete.schedule(() {
-        expect(currentSchedule.state, equals(ScheduleState.RUNNING));
-      });
-    });
-  });
-
-  expectTestsPass('currentSchedule.state is DONE after the test', () {
-    var oldSchedule;
-    test('test 1', () {
-      oldSchedule = currentSchedule;
-    });
-
-    test('test 2', () {
-      expect(oldSchedule.state, equals(ScheduleState.DONE));
-    });
-  });
-
-  expectTestsPass('setUp is run before each test', () {
-    var setUpRun = false;
-    setUp(() {
-      setUpRun = true;
-    });
-
-    test('test 1', () {
-      expect(setUpRun, isTrue);
-      setUpRun = false;
-    });
-
-    test('test 2', () {
-      expect(setUpRun, isTrue);
-      setUpRun = false;
-    });
-  });
-
-  expectTestsPass('setUp can schedule events', () {
-    var setUpRun = false;
-    setUp(() {
-      schedule(() {
-        setUpRun = true;
-      });
-      currentSchedule.onComplete.schedule(() {
-        setUpRun = false;
-      });
-    });
-
-    test('test 1', () {
-      expect(setUpRun, isFalse);
-      schedule(() => expect(setUpRun, isTrue));
-    });
-
-    test('test 2', () {
-      expect(setUpRun, isFalse);
-      schedule(() => expect(setUpRun, isTrue));
-    });
-  });
-
-  expectTestsFail('synchronous errors in setUp will cause tests to fail', () {
-    setUp(() => expect('foo', equals('bar')));
-    test('test 1', () => expect('foo', equals('foo')));
-    test('test 2', () => expect('foo', equals('foo')));
-  });
-
-  expectTestsFail('scheduled errors in setUp will cause tests to fail', () {
-    setUp(() => schedule(() => expect('foo', equals('bar'))));
-    test('test 1', () => expect('foo', equals('foo')));
-    test('test 2', () => expect('foo', equals('foo')));
-  });
-
-  expectTestsPass('synchronous errors in setUp will cause onException to run',
-      () {
-    var onExceptionRun = false;
-    setUp(() {
-      currentSchedule.onException.schedule(() {
-        onExceptionRun = true;
-      });
-
-      if (!onExceptionRun) expect('foo', equals('bar'));
-    });
-
-    test('test 1', () => expect('foo', equals('foo')));
-    test('test 2', () => expect(onExceptionRun, isTrue));
-  }, passing: ['test 2']);
-
-  expectTestsPass("setUp doesn't apply to child groups", () {
-    var setUpRun = false;
-    setUp(() {
-      setUpRun = true;
-      currentSchedule.onComplete.schedule(() {
-        setUpRun = false;
-      });
-    });
-
-    test('outer', () {
-      expect(setUpRun, isTrue);
-    });
-
-    group('group', () {
-      test('inner', () {
-        expect(setUpRun, isFalse);
-      });
-    });
-  });
-
-  expectTestsPass("setUp doesn't apply to parent groups", () {
-    var setUpRun = false;
-    group('group', () {
-      setUp(() {
-        setUpRun = true;
-        currentSchedule.onComplete.schedule(() {
-          setUpRun = false;
-        });
-      });
-
-      test('inner', () {
-        expect(setUpRun, isTrue);
-      });
-    });
-
-    test('outer', () {
-      expect(setUpRun, isFalse);
-    });
-  });
-
-  expectTestsPass("setUp doesn't apply to sibling groups", () {
-    var setUpRun = false;
-    group('group 1', () {
-      setUp(() {
-        setUpRun = true;
-        currentSchedule.onComplete.schedule(() {
-          setUpRun = false;
-        });
-      });
-
-      test('test 1', () {
-        expect(setUpRun, isTrue);
-      });
-    });
-
-    group('group 2', () {
-      test('test 2', () {
-        expect(setUpRun, isFalse);
-      });
-    });
-  });
-
-  expectTestsPass("a single task that takes too long will cause a timeout "
-      "error", () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.timeout = new Duration(milliseconds: 1);
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() => sleep(2));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(["The schedule timed out after "
-        "0:00:00.001000 of inactivity."]));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("an out-of-band callback that takes too long will cause a "
-      "timeout error", () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.timeout = new Duration(milliseconds: 1);
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      sleep(2).then(wrapAsync((_) => expect('foo', equals('foo'))));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(["The schedule timed out after "
-        "0:00:00.001000 of inactivity."]));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("each task resets the timeout timer", () {
-    mock_clock.mock().run();
-    test('test', () {
-      currentSchedule.timeout = new Duration(milliseconds: 2);
-
-      schedule(() => sleep(1));
-      schedule(() => sleep(1));
-      schedule(() => sleep(1));
-    });
-  });
-
-  expectTestsPass("setting up the test doesn't trigger a timeout", () {
-    var clock = mock_clock.mock();
-    test('test', () {
-      currentSchedule.timeout = new Duration(milliseconds: 1);
-
-      clock.tick(2);
-      schedule(() => expect('foo', equals('foo')));
-    });
-  });
-
-  expectTestsPass("an out-of-band error that's signaled after a timeout but "
-      "before the test completes is registered", () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.timeout = new Duration(milliseconds: 3);
-
-      currentSchedule.onException.schedule(() => sleep(2));
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      sleep(4).then(wrapAsync((_) {
-        throw 'out-of-band';
-      }));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals([
-        "The schedule timed out after 0:00:00.003000 of inactivity.",
-        "out-of-band"
-      ]));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("an out-of-band error that's signaled after a timeout but "
-      "before the test completes plays nicely with other out-of-band callbacks",
-      () {
-    mock_clock.mock().run();
-    var errors;
-    var onExceptionCallbackRun = false;
-    var onCompleteRunAfterOnExceptionCallback = false;
-    test('test 1', () {
-      currentSchedule.timeout = new Duration(milliseconds: 2);
-
-      currentSchedule.onException.schedule(() {
-        sleep(1).then(wrapAsync((_) {
-          onExceptionCallbackRun = true;
-        }));
-      });
-
-      currentSchedule.onComplete.schedule(() {
-        onCompleteRunAfterOnExceptionCallback = onExceptionCallbackRun;
-      });
-
-      sleep(3).then(wrapAsync((_) {
-        throw 'out-of-band';
-      }));
-    });
-
-    test('test 2', () {
-      expect(onCompleteRunAfterOnExceptionCallback, isTrue);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("a task that times out while waiting to handle an "
-      "out-of-band error records both", () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.timeout = new Duration(milliseconds: 2);
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() => sleep(4));
-      sleep(1).then((_) => currentSchedule.signalError('out-of-band'));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals([
-        "out-of-band",
-        "The schedule timed out after 0:00:00.002000 of inactivity."
-      ]));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("a task that has an error then times out waiting for an "
-      "out-of-band callback records both", () {
-    mock_clock.mock().run();
-    var errors;
-    test('test 1', () {
-      currentSchedule.timeout = new Duration(milliseconds: 2);
-
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        throw 'error';
-      });
-      wrapFuture(sleep(3));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals([
-        "error",
-        "The schedule timed out after 0:00:00.002000 of inactivity."
-      ]));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("currentSchedule.heartbeat resets the timeout timer", () {
-    mock_clock.mock().run();
-    test('test', () {
-      currentSchedule.timeout = new Duration(milliseconds: 3);
-
-      schedule(() {
-        return sleep(2).then((_) {
-          currentSchedule.heartbeat();
-          return sleep(2);
-        });
-      });
-    });
-  });
-
-  // TODO(nweiz): test out-of-band post-timeout errors that are detected after
-  // the test finishes once we can detect top-level errors (issue 8417).
-
-  expectTestsPass("nested schedule() runs its function immediately (but "
-      "asynchronously)", () {
-    test('test', () {
-      schedule(() {
-        var nestedScheduleRun = false;
-        schedule(() {
-          nestedScheduleRun = true;
-        });
-
-        expect(nestedScheduleRun, isFalse);
-        expect(pumpEventQueue().then((_) => nestedScheduleRun),
-            completion(isTrue));
-      });
-    });
-  });
-
-  expectTestsPass("out-of-band schedule() runs its function immediately (but "
-      "asynchronously)", () {
-    mock_clock.mock().run();
-    test('test', () {
-      schedule(() {
-        wrapFuture(sleep(1).then((_) {
-          var nestedScheduleRun = false;
-          schedule(() {
-            nestedScheduleRun = true;
-          });
-
-          expect(nestedScheduleRun, isFalse);
-          expect(pumpEventQueue().then((_) => nestedScheduleRun),
-              completion(isTrue));
-        }));
-      });
-    });
-  });
-
-  expectTestsPass("nested schedule() calls don't wait for one another", () {
-    mock_clock.mock().run();
-    test('test', () {
-      var sleepFinished = false;
-      schedule(() {
-        schedule(() => sleep(1).then((_) {
-          sleepFinished = true;
-        }));
-        schedule(() => expect(sleepFinished, isFalse));
-      });
-    });
-  });
-
-  expectTestsPass("nested schedule() calls block their parent task", () {
-    mock_clock.mock().run();
-    test('test', () {
-      var sleepFinished = false;
-      schedule(() {
-        schedule(() => sleep(1).then((_) {
-          sleepFinished = true;
-        }));
-      });
-
-      schedule(() => expect(sleepFinished, isTrue));
-    });
-  });
-
-  expectTestsPass("out-of-band schedule() calls block their parent queue", () {
-    mock_clock.mock().run();
-    test('test', () {
-      var scheduleRun = false;
-      wrapFuture(sleep(1).then((_) {
-        schedule(() => sleep(1).then((_) {
-          scheduleRun = true;
-        }));
-      }));
-
-      currentSchedule.onComplete.schedule(() => expect(scheduleRun, isTrue));
-    });
-  });
-
-  expectTestsPass("nested schedule() calls forward their Future values", () {
-    mock_clock.mock().run();
-    test('test', () {
-      schedule(() {
-        expect(schedule(() => 'foo'), completion(equals('foo')));
-      });
-    });
-  });
-
-  expectTestsPass("errors in nested schedule() calls are properly registered",
-      () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        schedule(() {
-          throw 'error';
-        });
-      });
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("nested scheduled blocks whose return values are passed to "
-      "wrapFuture should report exceptions once", () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      schedule(() {
-        wrapFuture(schedule(() {
-          throw 'error';
-        }));
-
-        return pumpEventQueue();
-      });
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("a nested task failing shouldn't short-circuit the parent "
-      "task", () {
-    var parentTaskFinishedBeforeOnComplete = false;
-    test('test 1', () {
-      var parentTaskFinished = false;
-      currentSchedule.onComplete.schedule(() {
-        parentTaskFinishedBeforeOnComplete = parentTaskFinished;
-      });
-
-      schedule(() {
-        schedule(() {
-          throw 'error';
-        });
-
-        return sleep(1).then((_) {
-          parentTaskFinished = true;
-        });
-      });
-    });
-
-    test('test 2', () {
-      expect(parentTaskFinishedBeforeOnComplete, isTrue);
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("an error thrown in a scheduled task should be piped to that "
-      "task's return value", () {
-    var error;
-    test('test 1', () {
-      schedule(() {
-        throw 'error';
-      }).catchError((e) {
-        error = e;
-      });
-    });
-
-    test('test 2', () {
-      expect(error, new isInstanceOf<ScheduleError>());
-      expect(error.error, equals('error'));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("an error thrown in a scheduled task should be piped to "
-      "future tasks' return values", () {
-    var error;
-    test('test 1', () {
-      schedule(() {
-        throw 'error';
-      });
-
-      schedule(() => null).catchError((e) {
-        error = e;
-      });
-    });
-
-    test('test 2', () {
-      expect(error, new isInstanceOf<ScheduleError>());
-      expect(error.error, equals('error'));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("an out-of-band error should be piped to future tasks' "
-      "return values, but not the current task's", () {
-    mock_clock.mock().run();
-    var error;
-    var firstTaskError = false;
-    var secondTaskRun = false;
-    test('test 1', () {
-      schedule(() => sleep(2)).catchError((_) {
-        firstTaskError = true;
-      });
-
-      sleep(1).then(wrapAsync((_) {
-        throw 'error';
-      }));
-
-      schedule(() {
-        secondTaskRun = true;
-      }).catchError((e) {
-        error = e;
-      });
-    });
-
-    test('test 2', () {
-      expect(firstTaskError, isFalse);
-      expect(secondTaskRun, isFalse);
-      expect(error, new isInstanceOf<ScheduleError>());
-      expect(error.error, equals('error'));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("expect(..., completes) with a completing future should pass",
-      () {
-    test('test', () {
-      expect(pumpEventQueue(), completes);
-    });
-  });
-
-  expectTestsPass("expect(..., completes) with a failing future should signal "
-      "an out-of-band error", () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      expect(pumpEventQueue().then((_) {
-        throw 'error';
-      }), completes);
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("expect(..., completion(...)) with a matching future should "
-      "pass", () {
-    test('test', () {
-      expect(pumpEventQueue().then((_) => 'foo'), completion(equals('foo')));
-    });
-  });
-
-  expectTestsPass("expect(..., completion(...)) with a non-matching future "
-      "should signal an out-of-band error", () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      expect(pumpEventQueue().then((_) => 'foo'), completion(equals('bar')));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.length, equals(1));
-      expect(errors.first.error, new isInstanceOf<TestFailure>());
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("expect(..., completion(...)) with a failing future should "
-      "signal an out-of-band error", () {
-    var errors;
-    test('test 1', () {
-      currentSchedule.onException.schedule(() {
-        errors = currentSchedule.errors;
-      });
-
-      expect(pumpEventQueue().then((_) {
-        throw 'error';
-      }), completion(equals('bar')));
-    });
-
-    test('test 2', () {
-      expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
-      expect(errors.map((e) => e.error), equals(['error']));
-    });
-  }, passing: ['test 2']);
-
-  expectTestsPass("aborting the schedule before it's started running should "
-      "cause no tasks to be run", () {
-    test('test', () {
-      schedule(() {
-        throw 'error';
-      });
-
-      currentSchedule.abort();
-    });
-  });
-
-  expectTestsPass("aborting the schedule while it's running should stop future "
-      "tasks from running", () {
-    test('test', () {
-      schedule(currentSchedule.abort);
-
-      schedule(() {
-        throw 'error';
-      });
-    });
-  });
-
-  expectTestsPass("aborting the schedule while it's running shouldn't stop "
-      "tasks in other queues from running", () {
-    var onCompleteRun = false;
-    test('test 1', () {
-      schedule(currentSchedule.abort);
-
-      currentSchedule.onComplete.schedule(() {
-        onCompleteRun = true;
-      });
-    });
-
-    test('test 2', () {
-      expect(onCompleteRun, isTrue);
-    });
-  });
-
-  expectTestsPass("aborting the schedule while it's running shouldn't stop "
-      "out-of-band callbacks", () {
-    test('test', () {
-      var outOfBandFinished = false;
-      schedule(() {
-        wrapFuture(pumpEventQueue().then((_) {
-          outOfBandFinished = true;
-        }));
-
-        currentSchedule.abort();
-      });
-
-      currentSchedule.onComplete.schedule(() {
-        expect(outOfBandFinished, isTrue);
-      });
-    });
-  });
-
-  expectTestsPass("aborting the schedule in a non-tasks queue should stop "
-      "future tasks from running", () {
-    test('test', () {
-      currentSchedule.onComplete.schedule(() {
-        currentSchedule.abort();
-      });
-
-      currentSchedule.onComplete.schedule(() {
-        throw 'error';
-      });
-    });
-  });
-
-  expectTestsFail("aborting the schedule after an out-of-band error should "
-      "still surface the error", () {
-    test('test', () {
-      schedule(() {
-        currentSchedule.signalError('error');
-        currentSchedule.abort();
-      });
-    });
-  });
-}
diff --git a/pkg/scheduled_test/test/utils.dart b/pkg/scheduled_test/test/utils.dart
index d6c272d4..4dd7ef9 100644
--- a/pkg/scheduled_test/test/utils.dart
+++ b/pkg/scheduled_test/test/utils.dart
@@ -7,9 +7,12 @@
 import 'dart:io';
 import 'dart:async';
 
+import 'package:scheduled_test/scheduled_test.dart';
 import 'package:scheduled_test/src/utils.dart';
 import 'package:scheduled_test/src/mock_clock.dart' as mock_clock;
 
+import 'metatest.dart';
+
 export 'package:scheduled_test/src/utils.dart';
 
 /// Wraps [input] to provide a timeout. If [input] completes before
@@ -45,3 +48,14 @@
   });
   return completer.future;
 }
+
+/// Sets up a timeout for every metatest in this file.
+void setUpTimeout() {
+  metaSetUp(() {
+    // TODO(nweiz): We used to only increase the timeout to 10s for the Windows
+    // bots, but the Linux and Mac bots have started taking upwards of 5s when
+    // running pumpEventQueue, so we're increasing the timeout across the board
+    // (see issue 9248).
+    currentSchedule.timeout = new Duration(seconds: 10);
+  });
+}
diff --git a/pkg/serialization/lib/serialization.dart b/pkg/serialization/lib/serialization.dart
index a72dc57..130be27 100644
--- a/pkg/serialization/lib/serialization.dart
+++ b/pkg/serialization/lib/serialization.dart
@@ -16,13 +16,15 @@
  *      address.city = 'Seattle';
  *      var serialization = new Serialization()
  *          ..addRuleFor(address);
- *      String output = serialization.write(address);
+ *      Map output = serialization.write(address);
  *
  * This creates a new serialization and adds a rule for address objects. Right
  * now it has to be passed an address instance because of limitations using
- * Address as a literal. Then we ask the Serialization to write the address
+ * Address as a literal. Then we ask the [Serialization] to write the address
  * and we get back a Map which is a [json]able representation of the state of
- * the address and related objects.
+ * the address and related objects. Note that while the output in this case
+ * is a [Map], the type will vary depending on which output format we've told
+ * the [Serialization] to use.
  *
  * The version above used reflection to automatically identify the public
  * fields of the address object. We can also specify those fields explicitly.
diff --git a/pkg/serialization/lib/src/serialization_rule.dart b/pkg/serialization/lib/src/serialization_rule.dart
index 01b3b05..483197a 100644
--- a/pkg/serialization/lib/src/serialization_rule.dart
+++ b/pkg/serialization/lib/src/serialization_rule.dart
@@ -552,7 +552,6 @@
   }
   operator []=(x, y) => _throw();
   add(x) => _throw();
-  addLast(x) => _throw();
   addAll(x) => _throw();
   sort([f]) => _throw();
   clear() => _throw();
diff --git a/pkg/stack_trace/lib/src/frame.dart b/pkg/stack_trace/lib/src/frame.dart
index 5f0777c..f05b469 100644
--- a/pkg/stack_trace/lib/src/frame.dart
+++ b/pkg/stack_trace/lib/src/frame.dart
@@ -46,6 +46,13 @@
     return path.relative(fileUriToPath(uri));
   }
 
+  /// Returns the name of the package this stack frame comes from, or `null` if
+  /// this stack frame doesn't come from a `package:` URL.
+  String get package {
+    if (uri.scheme != 'package') return null;
+    return uri.path.split('/').first;
+  }
+
   /// A human-friendly description of the code location.
   ///
   /// For Dart core libraries, this will omit the line and column information,
diff --git a/pkg/stack_trace/lib/src/trace.dart b/pkg/stack_trace/lib/src/trace.dart
index 1ab7695..43a598c 100644
--- a/pkg/stack_trace/lib/src/trace.dart
+++ b/pkg/stack_trace/lib/src/trace.dart
@@ -79,19 +79,32 @@
   String get fullStackTrace => toString();
 
   /// Returns a terser version of [this]. This is accomplished by folding
-  /// together multiple stack frames from the core library. If multiple such
-  /// frames appear in a row, only the last (the one directly called by user
-  /// code) is kept. Core library patches are also renamed to remove their
-  /// `-patch` suffix.
+  /// together multiple stack frames from the core library, as in [foldFrames].
+  /// Core library patches are also renamed to remove their `-patch` suffix.
   Trace get terse {
+    return new Trace(foldFrames((frame) => frame.isCore).frames.map((frame) {
+      if (!frame.isCore) return frame;
+      var library = frame.library.replaceAll(_patchRegExp, '');
+      return new Frame(
+          Uri.parse(library), frame.line, frame.column, frame.member);
+    }));
+  }
+
+  /// Returns a new [Trace] based on [this] where multiple stack frames matching
+  /// [predicate] are folded together. This means that whenever there are
+  /// multiple frames in a row that match [predicate], only the last one is
+  /// kept.
+  ///
+  /// This is useful for limiting the amount of library code that appears in a
+  /// stack trace by only showing user code and code that's called by user code.
+  Trace foldFrames(bool predicate(frame)) {
     var newFrames = <Frame>[];
     for (var frame in frames.reversed) {
-      if (!frame.isCore) {
+      if (!predicate(frame)) {
         newFrames.add(frame);
-      } else if (newFrames.isEmpty || !newFrames.last.isCore) {
-        var library = frame.library.replaceAll(_patchRegExp, '');
+      } else if (newFrames.isEmpty || !predicate(newFrames.last)) {
         newFrames.add(new Frame(
-            Uri.parse(library), frame.line, frame.column, frame.member));
+            frame.uri, frame.line, frame.column, frame.member));
       }
     }
 
diff --git a/pkg/stack_trace/test/frame_test.dart b/pkg/stack_trace/test/frame_test.dart
index c65f395..02bec68 100644
--- a/pkg/stack_trace/test/frame_test.dart
+++ b/pkg/stack_trace/test/frame_test.dart
@@ -139,6 +139,22 @@
     });
   });
 
+  group('.package', () {
+    test('returns null for non-package URIs', () {
+      expect(new Frame.parse('#0 Foo (dart:async:0:0)').package, isNull);
+      expect(new Frame.parse('#0 Foo '
+              '(http://dartlang.org/stuff/thing.dart:0:0)').package,
+          isNull);
+    });
+
+    test('returns the package name for package: URIs', () {
+      expect(new Frame.parse('#0 Foo (package:foo/foo.dart:0:0)').package,
+          equals('foo'));
+      expect(new Frame.parse('#0 Foo (package:foo/zap/bar.dart:0:0)').package,
+          equals('foo'));
+    });
+  });
+
   group('.toString()', () {
     test('returns the library and line/column numbers for non-core '
         'libraries', () {
diff --git a/pkg/stack_trace/test/trace_test.dart b/pkg/stack_trace/test/trace_test.dart
index ed8fa6b..cbbf90b 100644
--- a/pkg/stack_trace/test/trace_test.dart
+++ b/pkg/stack_trace/test/trace_test.dart
@@ -133,4 +133,23 @@
 dart:async      bottom
 '''));
   });
+
+  test('.foldFrames folds frames together bottom-up', () {
+    var trace = new Trace.parse('''
+#0 notFoo (foo.dart:42:21)
+#1 fooTop (bar.dart:0:2)
+#2 fooBottom (foo.dart:1:100)
+#3 alsoNotFoo (bar.dart:10:20)
+#4 fooTop (dart:io:5:10)
+#5 fooBottom (dart:async-patch:9:11)
+''');
+
+    var folded = trace.foldFrames((frame) => frame.member.startsWith('foo'));
+    expect(folded.toString(), equals('''
+foo.dart 42:21    notFoo
+foo.dart 1:100    fooBottom
+bar.dart 10:20    alsoNotFoo
+dart:async-patch  fooBottom
+'''));
+  });
 }
diff --git a/pkg/unittest/lib/interactive_html_config.dart b/pkg/unittest/lib/interactive_html_config.dart
index a1d05c0..0f7ff03 100644
--- a/pkg/unittest/lib/interactive_html_config.dart
+++ b/pkg/unittest/lib/interactive_html_config.dart
@@ -131,7 +131,7 @@
    * messages in turn get passed to this method, which adds
    * a timestamp and posts them back to the parent window.
    */
-  void logTestCaseMessage(TestCase testCase, String message) {
+  void onLogMessage(TestCase testCase, String message) {
     int elapsed;
     if (testCase == null) {
       elapsed = -1;
@@ -359,7 +359,7 @@
   // Actually test logging is handled by the child, then posted
   // back to the parent. So here we know that the [message] argument
   // is in the format used by [_Message].
-  void logTestCaseMessage(TestCase testCase, String message) {
+  void onLogMessage(TestCase testCase, String message) {
     var msg = new _Message.fromString(message);
     if (msg.elapsed < 0) { // No associated test case.
       document.query('#otherlogs').nodes.add(
@@ -380,7 +380,7 @@
     if (!testCase.enabled) return;
     super.onTestResult(testCase);
     if (testCase.message != '') {
-      logTestCaseMessage(testCase,
+      onLogMessage(testCase,
           _Message.text(_Message.LOG, -1, testCase.message));
     }
     int id = testCase.id;
diff --git a/pkg/unittest/lib/src/config.dart b/pkg/unittest/lib/src/config.dart
index b557783..dc25771 100644
--- a/pkg/unittest/lib/src/config.dart
+++ b/pkg/unittest/lib/src/config.dart
@@ -21,13 +21,13 @@
    * Particularly useful in cases where we have parent/child configurations
    * such as layout tests.
    */
-  String get name => 'Configuration';
+  final String name = 'Configuration';
 
   /**
    * If true, then tests are started automatically (otherwise [runTests]
    * must be called explicitly after the tests are set up.
    */
-  bool get autoStart => true;
+  final bool autoStart = true;
 
   /**
    * Called as soon as the unittest framework becomes initialized. This is done
@@ -70,25 +70,10 @@
   }
 
   /**
-   * Can be called by tests to log status. Tests should use this
-   * instead of print. Subclasses should not override this; they
-   * should instead override logMessage which is passed the test case.
-   */
-  void logMessage(String message) {
-    if (currentTestCase == null) {
-      // Before or after tests run. In this case we pass null for the test
-      // case reference and let the config decide what to do with this.
-      logTestCaseMessage(null, message);
-    } else {
-      logTestCaseMessage(currentTestCase, message);
-    }
-  }
-
-  /**
    * Handles the logging of messages by a test case. The default in
    * this base configuration is to call print();
    */
-  void logTestCaseMessage(TestCase testCase, String message) {
+  void onLogMessage(TestCase testCase, String message) {
     print(message);
   }
 
@@ -103,7 +88,7 @@
   void onSummary(int passed, int failed, int errors, List<TestCase> results,
       String uncaughtError) {
     // Print each test's result.
-    for (final t in testCases) {
+    for (final t in results) {
       var resultString = "${t.result}".toUpperCase();
       print('$resultString: ${t.description}');
 
@@ -119,13 +104,11 @@
     // Show the summary.
     print('');
 
-    var success = false;
     if (passed == 0 && failed == 0 && errors == 0 && uncaughtError == null) {
       print('No tests found.');
       // This is considered a failure too.
     } else if (failed == 0 && errors == 0 && uncaughtError == null) {
       print('All $passed tests passed.');
-      success = true;
     } else {
       if (uncaughtError != null) {
         print('Top-level uncaught error: $uncaughtError');
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index a0f5ffc..efe6f8d 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -185,7 +185,12 @@
   }
 }
 
-void logMessage(String message) => _config.logMessage(message);
+/**
+ * Can be called by tests to log status. Tests should use this
+ * instead of [print].
+ */
+void logMessage(String message) =>
+    _config.onLogMessage(currentTestCase, message);
 
 /**
  * Description text of the current test group. If multiple groups are nested,
@@ -692,6 +697,7 @@
 
 /** Runs all queued tests, one at a time. */
 void runTests() {
+  _ensureInitialized(false);
   _currentTestCaseIndex = 0;
   _currentGroup = '';
 
@@ -785,7 +791,7 @@
       case ERROR: errors++; break;
     }
   }
-  _config.onSummary(passed, failed, errors, _testCases, _uncaughtErrorMessage);
+  _config.onSummary(passed, failed, errors, testCases, _uncaughtErrorMessage);
   _config.onDone(passed > 0 && failed == 0 && errors == 0 &&
       _uncaughtErrorMessage == null);
   _initialized = false;
@@ -800,6 +806,10 @@
  * Lazily initializes the test library if not already initialized.
  */
 void ensureInitialized() {
+  _ensureInitialized(true);
+}
+
+void _ensureInitialized(bool configAutoStart) {
   if (_initialized) {
     return;
   }
@@ -814,7 +824,7 @@
   }
   _config.onInit();
 
-  if (_config.autoStart) {
+  if (configAutoStart && _config.autoStart) {
     // Immediately queue the suite up. It will run after a timeout (i.e. after
     // main() has returned).
     _defer(runTests);
diff --git a/pkg/unittest/test/matchers_test.dart b/pkg/unittest/test/matchers_test.dart
index b11f7a6..f49e0cb 100644
--- a/pkg/unittest/test/matchers_test.dart
+++ b/pkg/unittest/test/matchers_test.dart
@@ -5,6 +5,7 @@
 library unittestTests;
 import 'package:unittest/unittest.dart';
 import 'dart:async';
+import 'dart:collection';
 part 'test_utils.dart';
 
 doesNotThrow() {}
@@ -542,16 +543,16 @@
     });
 
     test('equals with different lengths', () {
-      var a = new Map();
+      var a = new LinkedHashMap();
       a['foo'] = 'bar';
-      var b = new Map();
+      var b = new LinkedHashMap();
       b['foo'] = 'bar';
       b['bar'] = 'foo';
-      var c = new Map();
+      var c = new LinkedHashMap();
       c['bar'] = 'foo';
       c['barrista'] = 'caffeine';
       shouldFail(a, equals(b),
-          "Expected: <{bar: foo, foo: bar}> "
+          "Expected: <{foo: bar, bar: foo}> "
           "but: different map lengths; missing map key 'bar'.");
       shouldFail(b, equals(a),
           "Expected: <{foo: bar}> "
@@ -560,7 +561,7 @@
           "Expected: <{bar: foo, barrista: caffeine}> "
           "but: missing map key 'barrista'.");
       shouldFail(c, equals(b),
-          "Expected: <{bar: foo, foo: bar}> "
+          "Expected: <{foo: bar, bar: foo}> "
           "but: missing map key 'foo'.");
       shouldFail(a, equals(c),
           "Expected: <{bar: foo, barrista: caffeine}> "
diff --git a/pkg/unittest/test/unittest_test.dart b/pkg/unittest/test/unittest_test.dart
index 7f62c50..8a641a4 100644
--- a/pkg/unittest/test/unittest_test.dart
+++ b/pkg/unittest/test/unittest_test.dart
@@ -14,10 +14,6 @@
 import 'dart:async';
 import 'package:unittest/unittest.dart';
 
-var tests; // array of test names
-var expected; // array of test expected results (from buildStatusString)
-var actual; // actual test results (from buildStatusString in config.onDone)
-
 Future _defer(void fn()) {
   return new Future.of(fn);
 }
@@ -29,20 +25,22 @@
                          String uncaughtError: null,
                          String message: ''}) {
   var totalTests = 0;
-  String testDetails = '';
-  if (results is String) {
+  var testDetails = new StringBuffer();
+  if(results == null) {
+    // no op
+    assert(message == '');
+  } else if (results is String) {
     totalTests = passed + failed + errors;
-    testDetails = ':$results:$message';
+    testDetails.write(':$results:$message');
   } else {
     totalTests = results.length;
     for (var i = 0; i < results.length; i++) {
-      testDetails = '$testDetails:${results[i].description}:'
-          '${collapseWhitespace(results[i].message)}';
+      testDetails.write(':${results[i].description}:'
+          '${collapseWhitespace(results[i].message)}');
     }
   }
-  var result = '$passed:$failed:$errors:$totalTests:$count:'
+  return '$passed:$failed:$errors:$totalTests:$count:'
       '$setup:$teardown:$uncaughtError$testDetails';
-  return result;
 }
 
 class TestConfiguration extends Configuration {
@@ -71,9 +69,9 @@
 }
 
 runTest() {
-  port.receive((testName, sendport) {
-    var _testconfig= new TestConfiguration(sendport);
-    unittestConfiguration = _testconfig;
+  port.receive((String testName, sendport) {
+    var testConfig = new TestConfiguration(sendport);
+    unittestConfiguration = testConfig;
 
     if (testName == 'single correct test') {
       test(testName, () => expect(2 + 3, equals(5)));
@@ -90,27 +88,27 @@
       });
     } else if (testName == 'setup test') {
       group('a', () {
-        setUp(() { _testconfig.setup = 'setup'; });
+        setUp(() { testConfig.setup = 'setup'; });
         test(testName, () {});
       });
     } else if (testName == 'teardown test') {
       group('a', () {
-        tearDown(() { _testconfig.teardown = 'teardown'; });
+        tearDown(() { testConfig.teardown = 'teardown'; });
         test(testName, () {});
       });
     } else if (testName == 'setup and teardown test') {
       group('a', () {
-        setUp(() { _testconfig.setup = 'setup'; });
-        tearDown(() { _testconfig.teardown = 'teardown'; });
+        setUp(() { testConfig.setup = 'setup'; });
+        tearDown(() { testConfig.teardown = 'teardown'; });
         test(testName, () {});
       });
     } else if (testName == 'correct callback test') {
       test(testName,
-        () =>_defer(expectAsync0((){ ++_testconfig.count;})));
+        () =>_defer(expectAsync0((){ ++testConfig.count;})));
     } else if (testName == 'excess callback test') {
       test(testName, () {
-        var _callback0 = expectAsync0(() => ++_testconfig.count);
-        var _callback1 = expectAsync0(() => ++_testconfig.count);
+        var _callback0 = expectAsync0(() => ++testConfig.count);
+        var _callback1 = expectAsync0(() => ++testConfig.count);
         var _callback2 = expectAsync0(() {
           _callback1();
           _callback1();
@@ -122,11 +120,11 @@
       test(testName, () {
              var _callback;
              _callback = expectAsyncUntil0(() {
-               if (++_testconfig.count < 10) {
+               if (++testConfig.count < 10) {
                  _defer(_callback);
                }
              },
-             () => (_testconfig.count == 10));
+             () => (testConfig.count == 10));
              _defer(_callback);
       });
     } else if (testName == 'async exception test') {
@@ -299,67 +297,40 @@
         expect(() => testCases.clear(), throwsUnsupportedError);
         expect(() => testCases.removeLast(), throwsUnsupportedError);
       });
-    }
-  });
-}
-
-void nextTest(int testNum) {
-  SendPort sport = spawnFunction(runTest);
-  sport.call(tests[testNum]).then((msg) {
-    actual.add(msg);
-    if (actual.length == expected.length) {
-      for (var i = 0; i < tests.length; i++) {
-        test(tests[i], () => expect(actual[i].trim(), equals(expected[i])));
-      }
-    } else {
-      nextTest(testNum+1);
+    } else if (testName == 'runTests without tests') {
+      runTests();
     }
   });
 }
 
 main() {
-  tests = [
-    'single correct test',
-    'single failing test',
-    'exception test',
-    'group name test',
-    'setup test',
-    'teardown test',
-    'setup and teardown test',
-    'correct callback test',
-    'excess callback test',
-    'completion test',
-    'async exception test',
-    'late exception test',
-    'middle exception test',
-    'async setup/teardown test',
-    'test returning future',
-    'test returning future using Timer',
-    'testCases immutable'
-  ];
-
-  expected = [
-    buildStatusString(1, 0, 0, tests[0]),
-    buildStatusString(0, 1, 0, tests[1],
+  var tests = {
+    'single correct test': buildStatusString(1, 0, 0, 'single correct test'),
+    'single failing test': buildStatusString(0, 1, 0, 'single failing test',
         message: 'Expected: <5> but: was <4>.'),
-    buildStatusString(0, 1, 0, tests[2], message: 'Caught Exception: Fail.'),
-    buildStatusString(2, 0, 0, 'a a::a b b'),
-    buildStatusString(1, 0, 0, 'a ${tests[4]}', count: 0, setup: 'setup'),
-    buildStatusString(1, 0, 0, 'a ${tests[5]}', count: 0, setup: '',
+    'exception test': buildStatusString(0, 1, 0, 'exception test',
+        message: 'Caught Exception: Fail.'),
+    'group name test': buildStatusString(2, 0, 0, 'a a::a b b'),
+    'setup test': buildStatusString(1, 0, 0, 'a setup test',
+        count: 0, setup: 'setup'),
+    'teardown test': buildStatusString(1, 0, 0, 'a teardown test',
+        count: 0, setup: '', teardown: 'teardown'),
+    'setup and teardown test': buildStatusString(1, 0, 0,
+        'a setup and teardown test', count: 0, setup: 'setup',
         teardown: 'teardown'),
-    buildStatusString(1, 0, 0, 'a ${tests[6]}', count: 0,
-        setup: 'setup', teardown: 'teardown'),
-    buildStatusString(1, 0, 0, tests[7], count: 1),
-    buildStatusString(0, 1, 0, tests[8], count: 1,
-        message: 'Callback called more times than expected (1).'),
-    buildStatusString(1, 0, 0, tests[9], count: 10),
-    buildStatusString(0, 1, 0, tests[10], message: 'Caught error!'),
-    buildStatusString(1, 0, 1, 'testOne',
+    'correct callback test': buildStatusString(1, 0, 0, 'correct callback test',
+        count: 1),
+    'excess callback test': buildStatusString(0, 1, 0, 'excess callback test',
+        count: 1, message: 'Callback called more times than expected (1).'),
+    'completion test': buildStatusString(1, 0, 0, 'completion test', count: 10),
+    'async exception test': buildStatusString(0, 1, 0, 'async exception test',
+        message: 'Caught error!'),
+    'late exception test': buildStatusString(1, 0, 1, 'testOne',
         message: 'Callback called (2) after test case testOne has already '
                  'been marked as pass.:testTwo:'),
-    buildStatusString(2, 1, 0,
+    'middle exception test': buildStatusString(2, 1, 0,
         'testOne::testTwo:Expected: false but: was <true>.:testThree'),
-    buildStatusString(2, 0, 3,
+    'async setup/teardown test': buildStatusString(2, 0, 3,
         'good setup/good teardown foo1::'
         'good setup/bad teardown foo2:good setup/bad teardown '
         'foo2: Test teardown failed: Failed to complete tearDown:'
@@ -368,25 +339,29 @@
         'bad setup/bad teardown foo4:bad setup/bad teardown '
         'foo4: Test teardown failed: Failed to complete tearDown:'
         'post groups'),
-    buildStatusString(2, 4, 0,
+    'test returning future': buildStatusString(2, 4, 0,
         'successful::'
         'error1:Callback called more times than expected (1).:'
         'fail1:Expected: <false> but: was <true>.:'
         'error2:Callback called more times than expected (1).:'
         'fail2:failure:'
         'foo5'),
-    buildStatusString(2, 4, 0,
+    'test returning future using Timer': buildStatusString(2, 4, 0,
         'successful::'
         'fail1:Expected: <false> but: was <true>.:'
         'error1:Callback called more times than expected (1).:'
         'fail2:failure:'
         'error2:Callback called more times than expected (1).:'
         'foo6'),
-    buildStatusString(1, 0, 0, 'testCases immutable'),
-  ];
+    'testCases immutable':
+        buildStatusString(1, 0, 0, 'testCases immutable'),
+    'runTests without tests': buildStatusString(0, 0, 0, null)
+  };
 
-  actual = [];
-
-  nextTest(0);
+  tests.forEach((String name, String expected) {
+    test(name, () => spawnFunction(runTest)
+        .call(name)
+        .then((String msg) => expect(msg.trim(), equals(expected))));
+    });
 }
 
diff --git a/runtime/bin/dbg_message.cc b/runtime/bin/dbg_message.cc
index 0097225..d364d87 100644
--- a/runtime/bin/dbg_message.cc
+++ b/runtime/bin/dbg_message.cc
@@ -389,6 +389,31 @@
 }
 
 
+static void FormatLocationFromTrace(dart::TextBuffer* msg,
+                                    Dart_StackTrace trace) {
+  intptr_t trace_len = 0;
+  Dart_Handle res = Dart_StackTraceLength(trace, &trace_len);
+  ASSERT_NOT_ERROR(res);
+  Dart_ActivationFrame frame;
+  res = Dart_GetActivationFrame(trace, 0, &frame);
+  ASSERT_NOT_ERROR(res);
+  Dart_Handle script_url;
+  intptr_t token_number = 0;
+  intptr_t line_number = 0;
+  res = Dart_ActivationFrameInfo(frame, NULL, NULL, &line_number, NULL);
+  ASSERT_NOT_ERROR(res);
+  res = Dart_ActivationFrameGetLocation(frame, &script_url, &token_number);
+  ASSERT_NOT_ERROR(res);
+  if (!Dart_IsNull(script_url)) {
+    ASSERT(Dart_IsString(script_url));
+    msg->Printf("\"location\": { \"url\":");
+    FormatEncodedString(msg, script_url);
+    msg->Printf(",\"tokenOffset\":%"Pd",", token_number);
+    msg->Printf("\"lineNumber\":%"Pd"},", line_number);
+  }
+}
+
+
 static void FormatCallFrames(dart::TextBuffer* msg, Dart_StackTrace trace) {
   intptr_t trace_len = 0;
   Dart_Handle res = Dart_StackTraceLength(trace, &trace_len);
@@ -401,19 +426,26 @@
     Dart_Handle func_name;
     Dart_Handle script_url;
     intptr_t line_number = 0;
+    intptr_t token_number = 0;
     intptr_t library_id = 0;
     res = Dart_ActivationFrameInfo(
-        frame, &func_name, &script_url, &line_number, &library_id);
+        frame, &func_name, NULL, &line_number, &library_id);
     ASSERT_NOT_ERROR(res);
+
     ASSERT(Dart_IsString(func_name));
     msg->Printf("%s{\"functionName\":", (i > 0) ? "," : "");
     FormatEncodedString(msg, func_name);
     msg->Printf(",\"libraryId\": %"Pd",", library_id);
 
-    ASSERT(Dart_IsString(script_url));
-    msg->Printf("\"location\": { \"url\":");
-    FormatEncodedString(msg, script_url);
-    msg->Printf(",\"lineNumber\":%"Pd"},", line_number);
+    res = Dart_ActivationFrameGetLocation(frame, &script_url, &token_number);
+    ASSERT_NOT_ERROR(res);
+    if (!Dart_IsNull(script_url)) {
+      ASSERT(Dart_IsString(script_url));
+      msg->Printf("\"location\": { \"url\":");
+      FormatEncodedString(msg, script_url);
+      msg->Printf(",\"tokenOffset\":%"Pd",", token_number);
+      msg->Printf("\"lineNumber\":%"Pd"},", line_number);
+    }
 
     Dart_Handle locals = Dart_GetLocalVariables(frame);
     ASSERT_NOT_ERROR(locals);
@@ -912,17 +944,22 @@
 }
 
 
+// TODO(hausner): Remove stack trace parameter once we remove the stack
+// trace from the paused event in the wire protocol.
 void DbgMsgQueue::SendBreakpointEvent(Dart_StackTrace trace) {
   dart::TextBuffer msg(128);
   msg.Printf("{ \"event\": \"paused\", \"params\": { ");
   msg.Printf("\"reason\": \"breakpoint\", ");
   msg.Printf("\"id\": %"Pd64", ", isolate_id_);
+  FormatLocationFromTrace(&msg, trace);
   FormatCallFrames(&msg, trace);
   msg.Printf("}}");
   DebuggerConnectionHandler::BroadcastMsg(&msg);
 }
 
 
+// TODO(hausner): Remove stack trace parameter once we remove the stack
+// trace from the paused event in the wire protocol.
 void DbgMsgQueue::SendExceptionEvent(Dart_Handle exception,
                                      Dart_StackTrace stack_trace) {
   intptr_t exception_id = Dart_CacheObject(exception);
@@ -934,12 +971,15 @@
   msg.Printf("\"exception\":");
   FormatRemoteObj(&msg, exception);
   msg.Printf(", ");
+  FormatLocationFromTrace(&msg, stack_trace);
   FormatCallFrames(&msg, stack_trace);
   msg.Printf("}}");
   DebuggerConnectionHandler::BroadcastMsg(&msg);
 }
 
 
+// TODO(hausner): Remove stack trace parameter once we remove the stack
+// trace from the interrupted event in the wire protocol.
 void DbgMsgQueue::SendIsolateEvent(Dart_IsolateId isolate_id,
                                    Dart_IsolateEvent kind) {
   dart::TextBuffer msg(128);
@@ -950,6 +990,7 @@
     msg.Printf("{ \"event\": \"paused\", \"params\": { ");
     msg.Printf("\"reason\": \"interrupted\", ");
     msg.Printf("\"id\": %"Pd64", ", isolate_id);
+    FormatLocationFromTrace(&msg, trace);
     FormatCallFrames(&msg, trace);
     msg.Printf("}}");
   } else {
diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
index 9a2d166..1fb42cb 100644
--- a/runtime/bin/directory_android.cc
+++ b/runtime/bin/directory_android.cc
@@ -169,6 +169,9 @@
         int stat_success;
         if (follow_links) {
           stat_success = TEMP_FAILURE_RETRY(stat(path->data, &entry_info));
+          if (stat_success == -1) {
+            stat_success = TEMP_FAILURE_RETRY(lstat(path->data, &entry_info));
+          }
         } else {
           stat_success = TEMP_FAILURE_RETRY(lstat(path->data, &entry_info));
         }
@@ -189,7 +192,6 @@
                                path,
                                listing) && success;
         } else if (S_ISLNK(entry_info.st_mode)) {
-          ASSERT(!follow_links);
           success = HandleLink(entry.d_name,
                                path,
                                listing) && success;
@@ -232,7 +234,6 @@
 
 
 static bool DeleteRecursively(PathBuffer* path) {
-  if (!path->Add(File::PathSeparator())) return false;
   // Do not recurse into links for deletion. Instead delete the link.
   struct stat st;
   if (TEMP_FAILURE_RETRY(lstat(path->data, &st)) == -1) {
@@ -241,6 +242,8 @@
     return (remove(path->data) == 0);
   }
 
+  if (!path->Add(File::PathSeparator())) return false;
+
   // Not a link. Attempt to open as a directory and recurse into the
   // directory.
   DIR* dir_pointer;
diff --git a/runtime/bin/directory_linux.cc b/runtime/bin/directory_linux.cc
index f6ad163..a316633 100644
--- a/runtime/bin/directory_linux.cc
+++ b/runtime/bin/directory_linux.cc
@@ -169,6 +169,9 @@
         int stat_success;
         if (follow_links) {
           stat_success = TEMP_FAILURE_RETRY(stat(path->data, &entry_info));
+          if (stat_success == -1) {
+            stat_success = TEMP_FAILURE_RETRY(lstat(path->data, &entry_info));
+          }
         } else {
           stat_success = TEMP_FAILURE_RETRY(lstat(path->data, &entry_info));
         }
@@ -189,7 +192,6 @@
                                path,
                                listing) && success;
         } else if (S_ISLNK(entry_info.st_mode)) {
-          ASSERT(!follow_links);
           success = HandleLink(entry.d_name,
                                path,
                                listing) && success;
@@ -232,7 +234,6 @@
 
 
 static bool DeleteRecursively(PathBuffer* path) {
-  if (!path->Add(File::PathSeparator())) return false;
   // Do not recurse into links for deletion. Instead delete the link.
   struct stat st;
   if (TEMP_FAILURE_RETRY(lstat(path->data, &st)) == -1) {
@@ -241,6 +242,8 @@
     return (remove(path->data) == 0);
   }
 
+  if (!path->Add(File::PathSeparator())) return false;
+
   // Not a link. Attempt to open as a directory and recurse into the
   // directory.
   DIR* dir_pointer;
diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc
index d66a809..401f80c 100644
--- a/runtime/bin/directory_macos.cc
+++ b/runtime/bin/directory_macos.cc
@@ -169,6 +169,9 @@
         int stat_success;
         if (follow_links) {
           stat_success = TEMP_FAILURE_RETRY(stat(path->data, &entry_info));
+          if (stat_success == -1) {
+            stat_success = TEMP_FAILURE_RETRY(lstat(path->data, &entry_info));
+          }
         } else {
           stat_success = TEMP_FAILURE_RETRY(lstat(path->data, &entry_info));
         }
@@ -189,7 +192,6 @@
                                path,
                                listing) && success;
         } else if (S_ISLNK(entry_info.st_mode)) {
-          ASSERT(!follow_links);
           success = HandleLink(entry.d_name,
                                path,
                                listing) && success;
@@ -232,8 +234,7 @@
 
 
 static bool DeleteRecursively(PathBuffer* path) {
-  if (!path->Add(File::PathSeparator())) return false;
-      // Do not recurse into links for deletion. Instead delete the link.
+  // Do not recurse into links for deletion. Instead delete the link.
   struct stat st;
   if (TEMP_FAILURE_RETRY(lstat(path->data, &st)) == -1) {
     return false;
@@ -241,6 +242,8 @@
     return (remove(path->data) == 0);
   }
 
+  if (!path->Add(File::PathSeparator())) return false;
+
   // Not a link. Attempt to open as a directory and recurse into the
   // directory.
   DIR* dir_pointer;
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index 857739a..d4b0aaf 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -118,9 +118,25 @@
                         bool follow_links,
                         DirectoryListing* listing) {
   DWORD attributes = find_file_data->dwFileAttributes;
-  if (!follow_links && (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) {
-    return HandleLink(find_file_data->cFileName, path, listing);
-  } else if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
+  if ((attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) {
+    if (!follow_links) {
+      return HandleLink(find_file_data->cFileName, path, listing);
+    }
+    // Attempt to list the directory, to see if it's a valid link or not.
+    int path_length = path->length;
+    if (!path->Add(find_file_data->cFileName)) return false;
+    if (!path->Add(L"\\*")) return false;
+    WIN32_FIND_DATAW tmp_file_data;
+    HANDLE find_handle = FindFirstFileW(path->data, &tmp_file_data);
+    path->Reset(path_length);
+    if (find_handle == INVALID_HANDLE_VALUE) {
+      // Invalid handle, report as (broken) link.
+      return HandleLink(find_file_data->cFileName, path, listing);
+    } else {
+      FindClose(find_handle);
+    }
+  }
+  if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
     return HandleDir(find_file_data->cFileName,
                      path,
                      recursive,
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index a4c6d4b..0895a84 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -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.
 
@@ -54,7 +54,7 @@
     kPipe = 1,
     kFile = 2,
     kSocket = 3,
-    kOther = -1
+    kOther = 4
   };
 
   enum FileRequest {
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index 8e618d3..3780fca 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -259,12 +259,19 @@
 
 bool File::Delete(const char* name) {
   const wchar_t* system_name = StringUtils::Utf8ToWide(name);
-  int status = _wremove(system_name);
-  free(const_cast<wchar_t*>(system_name));
-  if (status == -1) {
-    return false;
+  DWORD attributes = GetFileAttributesW(system_name);
+  if ((attributes != INVALID_FILE_ATTRIBUTES) &&
+      (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) {
+    // It's a junction(link), delete it.
+    return RemoveDirectoryW(system_name) != 0;
+  } else {
+    int status = _wremove(system_name);
+    free(const_cast<wchar_t*>(system_name));
+    if (status == -1) {
+      return false;
+    }
+    return true;
   }
-  return true;
 }
 
 
diff --git a/runtime/bin/io_natives.cc b/runtime/bin/io_natives.cc
index 660005e..93f4e89 100644
--- a/runtime/bin/io_natives.cc
+++ b/runtime/bin/io_natives.cc
@@ -35,6 +35,7 @@
   V(Process_Kill, 3)                                                           \
   V(Process_SetExitCode, 1)                                                    \
   V(Process_Exit, 1)                                                           \
+  V(Process_Sleep, 1)                                                          \
   V(ServerSocket_CreateBindListen, 4)                                          \
   V(ServerSocket_Accept, 2)                                                    \
   V(Socket_CreateConnect, 3)                                                   \
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index ac75854..7a0c555 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -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.
 
@@ -9,7 +9,6 @@
 
 #include "include/dart_api.h"
 
-
 static const int kProcessIdNativeField = 0;
 
 int Process::global_exit_code_ = 0;
@@ -190,6 +189,16 @@
 }
 
 
+void FUNCTION_NAME(Process_Sleep)(Dart_NativeArguments args) {
+  Dart_EnterScope();
+  int64_t milliseconds = 0;
+  // Ignore result if passing invalid argument and just set exit code to 0.
+  DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &milliseconds);
+  TimerUtils::Sleep(milliseconds);
+  Dart_ExitScope();
+}
+
+
 Dart_Handle Process::GetProcessIdNativeField(Dart_Handle process,
                                              intptr_t* pid) {
   return Dart_GetNativeInstanceField(process, kProcessIdNativeField, pid);
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index 4893cee..281259b 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.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.
 
@@ -33,6 +33,7 @@
 patch class _ProcessUtils {
   /* patch */ static _exit(int status) native "Process_Exit";
   /* patch */ static _setExitCode(int status) native "Process_SetExitCode";
+  /* patch */ static _sleep(int millis) native "Process_Sleep";
 }
 
 
@@ -299,7 +300,7 @@
     // Setup stdout handling.
     Future<StringBuffer> stdout = p.stdout
         .transform(new StringDecoder(stdoutEncoding))
-        .reduce(
+        .fold(
             new StringBuffer(),
             (buf, data) {
               buf.write(data);
@@ -308,7 +309,7 @@
 
     Future<StringBuffer> stderr = p.stderr
         .transform(new StringDecoder(stderrEncoding))
-        .reduce(
+        .fold(
             new StringBuffer(),
             (buf, data) {
               buf.write(data);
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index 33e632d..23e492c 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -147,9 +147,9 @@
 
 int Socket::GetType(intptr_t fd) {
   struct stat buf;
-  if (isatty(fd)) return File::kTerminal;
   int result = fstat(fd, &buf);
   if (result == -1) return -1;
+  if (S_ISCHR(buf.st_mode)) return File::kTerminal;
   if (S_ISFIFO(buf.st_mode)) return File::kPipe;
   if (S_ISREG(buf.st_mode)) return File::kFile;
   return File::kOther;
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index b11da00..ff1e28e 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -143,9 +143,9 @@
 
 int Socket::GetType(intptr_t fd) {
   struct stat buf;
-  if (isatty(fd)) return File::kTerminal;
   int result = fstat(fd, &buf);
   if (result == -1) return -1;
+  if (S_ISCHR(buf.st_mode)) return File::kTerminal;
   if (S_ISFIFO(buf.st_mode)) return File::kPipe;
   if (S_ISREG(buf.st_mode)) return File::kFile;
   return File::kOther;
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 0e9c25f..cb289e8 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -689,6 +689,34 @@
     return socket._doneFuture;
   }
 
+  Future<Socket> addStream(Stream<List<int>> stream) {
+    Completer completer = new Completer<Socket>();
+    if (socket._raw != null) {
+      subscription = stream.listen(
+          (data) {
+            assert(!paused);
+            assert(buffer == null);
+            buffer = data;
+            offset = 0;
+            write();
+          },
+          onError: (error) {
+            socket._consumerDone(error);
+            completer.completeError(error.error, error.stackTrace);
+          },
+          onDone: () {
+            completer.complete(socket);
+          },
+          unsubscribeOnError: true);
+    }
+    return completer.future;
+  }
+
+  Future<Socket> close() {
+    socket._consumerDone();
+    return completer.future;
+  }
+
   void write() {
     try {
       if (subscription == null) return;
diff --git a/runtime/bin/stdio_patch.dart b/runtime/bin/stdio_patch.dart
index 38c488d..941ae37 100644
--- a/runtime/bin/stdio_patch.dart
+++ b/runtime/bin/stdio_patch.dart
@@ -31,7 +31,11 @@
   }
 
   static int _socketType(nativeSocket) {
-    return _getSocketType(nativeSocket);
+    var result = _getSocketType(nativeSocket);
+    if (result is OSError) {
+      throw new FileIOException("Error retreiving socket type", result);
+    }
+    return result;
   }
 }
 
diff --git a/runtime/bin/utils.h b/runtime/bin/utils.h
index 470f26a..c0aab6b 100644
--- a/runtime/bin/utils.h
+++ b/runtime/bin/utils.h
@@ -82,6 +82,7 @@
  public:
   static int64_t GetCurrentTimeMicros();
   static int64_t GetCurrentTimeMilliseconds();
+  static void Sleep(int64_t millis);
 };
 
 #endif  // BIN_UTILS_H_
diff --git a/runtime/bin/utils_android.cc b/runtime/bin/utils_android.cc
index 89becdc..180dc39 100644
--- a/runtime/bin/utils_android.cc
+++ b/runtime/bin/utils_android.cc
@@ -87,4 +87,8 @@
   return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
 }
 
+void TimerUtils::Sleep(int64_t millis) {
+  usleep(millis * 1000);
+}
+
 #endif  // defined(TARGET_OS_ANDROID)
diff --git a/runtime/bin/utils_linux.cc b/runtime/bin/utils_linux.cc
index 39dcce6..3defd39 100644
--- a/runtime/bin/utils_linux.cc
+++ b/runtime/bin/utils_linux.cc
@@ -87,4 +87,8 @@
   return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
 }
 
+void TimerUtils::Sleep(int64_t millis) {
+  usleep(millis * 1000);
+}
+
 #endif  // defined(TARGET_OS_LINUX)
diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc
index 1c79c0d..f717edd 100644
--- a/runtime/bin/utils_macos.cc
+++ b/runtime/bin/utils_macos.cc
@@ -87,4 +87,8 @@
   return (static_cast<int64_t>(tv.tv_sec) * 1000000) + tv.tv_usec;
 }
 
+void TimerUtils::Sleep(int64_t millis) {
+  usleep(millis * 1000);
+}
+
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/utils_win.cc b/runtime/bin/utils_win.cc
index 2c41278..6c25d5b 100644
--- a/runtime/bin/utils_win.cc
+++ b/runtime/bin/utils_win.cc
@@ -141,4 +141,8 @@
   return (time.t_ - kTimeEpoc) / kTimeScaler;
 }
 
+void TimerUtils::Sleep(int64_t millis) {
+  ::Sleep(millis);
+}
+
 #endif  // defined(TARGET_OS_WINDOWS)
diff --git a/runtime/bin/vmstats/bargraph.dart b/runtime/bin/vmstats/bargraph.dart
index 502ff8e..c353253 100644
--- a/runtime/bin/vmstats/bargraph.dart
+++ b/runtime/bin/vmstats/bargraph.dart
@@ -16,6 +16,7 @@
   static const int LEGEND_WIDTH = 130;
   static const int LEGEND_Y = 20;
   static const int INSIDE_MARGIN = 2;
+  static const int LINE_WIDTH = 2;
 
   static const int NUM_DIVIDERS = 5;
   static const String FONT = "14px sans-serif";
@@ -49,7 +50,7 @@
     var x = _canvas.width - LEGEND_WIDTH;
     var y = LEGEND_Y;
     context.font = FONT;
-    for (var i = 0; i < _elements.length; i++) {
+    for (var i = _elements.length - 1; i >= 0; i--) {
       context.fillStyle = _elements[i].color;
       context.fillRect(x, y, 20, 20);
       context.fillStyle = 'black';
@@ -81,6 +82,7 @@
     var scaledY = dividerHeight * scale;
 
     // Draw the vertical axis values and lines.
+    context.clearRect(0, 0, LEFT_MARGIN - INSIDE_MARGIN, maxHeight);
     for (var i = 1; i < NUM_DIVIDERS; i++) {
       height -= (dividerHeight ~/ 100) * 100;
       context.font = FONT;
@@ -88,7 +90,7 @@
       context.textAlign = 'right';
       context.textBaseline = 'middle';
       context.fillText(height.toString(), LEFT_MARGIN - 10, scaledY);
-      context.moveTo(LEFT_MARGIN - 2, scaledY);
+      context.moveTo(LEFT_MARGIN - INSIDE_MARGIN, scaledY);
       context.strokeStyle = 'grey';
       context.lineWidth = 0.5;
       context.lineTo(_canvas.width - RIGHT_MARGIN, scaledY);
@@ -100,6 +102,10 @@
   void drawValues(int maxHeight, num scale) {
     Iterator<Sample> iterator = _model.iterator;
     var x = LEFT_MARGIN + INSIDE_MARGIN;
+    var y = INSIDE_MARGIN;
+    var w = _canvas.width - LEFT_MARGIN - RIGHT_MARGIN - INSIDE_MARGIN;
+    var h = (maxHeight * scale).ceil() - (2 * INSIDE_MARGIN);
+    _canvas.context2d.clearRect(x, y, w, h);
 
     while (iterator.moveNext()) {
       Sample s = iterator.current;
@@ -136,11 +142,7 @@
     if (y < INSIDE_MARGIN) {
       y = INSIDE_MARGIN;
     }
-    var max = _canvas.width - INSIDE_MARGIN;
-    if ((x + w) > max) {
-      w = max - x;
-    }
-    max = _canvas.height - INSIDE_MARGIN;
+    var max = _canvas.height - INSIDE_MARGIN;
     if ((y + h) > max) {
       h = max - y;
     }
@@ -218,6 +220,6 @@
   Iterator<int> get iterator => _segments.iterator;
 
   int total() {
-    return _segments.reduce(0, (int prev, int element) => prev + element);
+    return _segments.fold(0, (int prev, int element) => prev + element);
   }
 }
diff --git a/runtime/bin/vmstats/isolate_list.dart b/runtime/bin/vmstats/isolate_list.dart
index 835e7b8..cff3bb9 100644
--- a/runtime/bin/vmstats/isolate_list.dart
+++ b/runtime/bin/vmstats/isolate_list.dart
@@ -5,58 +5,121 @@
 part of dart.vmstats;
 
 class IsolateList {
-  UListElement _listArea;
+  TableElement _isolateTable;
 
-  static const String CSS_VISIBLE = 'isolate_details';
-  static const String CSS_HIDDEN  = 'isolate_details_hidden';
+  static const String DETAILS = 'isolate_details';
+  static const String VISIBLE = 'visible';
+  static const String HIDDEN  = 'hidden';
+  static const String ISOLATE_LIST_ITEM = 'isolate_list_item';
+  static const String ISOLATE_DETAILS_COLUMN = 'isolate_details_column';
+  static const String ISOLATE_ROW = 'isolate_row';
+  static const String ISOLATE_STACKTRACE_COLUMN = 'isolate_stacktrace_column';
+  static const String NEW_SPACE = 'new_space';
+  static const String OLD_SPACE = 'old_space';
+  static const String STACK_FRAME = 'stack_frame';
+  static const String STACK_LIMIT = 'stack_limit';
+  static const String STACK_TRACE = 'stack_trace';
+  static const String STACK_TRACE_TITLE = 'stack_trace_title';
 
-  IsolateList(this._listArea) {}
+  IsolateList(this._isolateTable) {}
 
   void updateList(IsolateListModel model) {
-    var detailsClass = CSS_HIDDEN;
-    if (_listArea.children.length > 0) {
-      // Preserve visibility state.
-      var listItem = _listArea.children.first;
-      var item = listItem.children.first;
-      if (item.classes.length > 0 && item.classes.first == CSS_VISIBLE) {
-        detailsClass = CSS_VISIBLE;
-      }
-      _listArea.children.clear();
-    }
     var iterator = model.iterator;
     while (iterator.moveNext()) {
       var isolate = iterator.current;
-      var listItem = new LIElement();
-      listItem.classes.add('isolate_list');
-      listItem.text = isolate.name
+      var isolateId = 'isolate-${isolate.port}';
+      var isolateRow = _isolateTable.query('#$isolateId');
+      if (isolateRow != null) {
+        updateIsolateDetails(isolate, isolateRow);
+      } else {
+        isolateRow = new TableRowElement();
+        isolateRow.$dom_className = ISOLATE_ROW;
+        isolateRow.id = isolateId;
+        _isolateTable.children.add(isolateRow);
+        var detailsCell = new TableCellElement();
+        detailsCell.$dom_className = ISOLATE_DETAILS_COLUMN;
+        isolateRow.children.add(detailsCell);
+        var basicData = new DivElement();
+        basicData.text = isolate.name
           .replaceAll('\$', ': ')  // Split script from isolate, and ...
           .replaceAll('-', ' ');   // ... split name from port number.
+        detailsCell.children.add(basicData);
 
-      // Add isolate details as hidden children.
-      var details = new DivElement();
-      isolateDetails(isolate, details);
-      details.classes.add(detailsClass);
-      listItem.children.add(details);
-      listItem.onClick.listen((e) => toggle(details));
+        // Add isolate details as hidden children.
+        var details = new DivElement();
+        details.classes.addAll([DETAILS, HIDDEN]);
+        detailsCell.children.add(details);
 
-      _listArea.children.add(listItem);
+        // Add stacktrace column.
+        var stacktraceCell = new TableCellElement();
+        stacktraceCell.classes.addAll([ISOLATE_STACKTRACE_COLUMN, HIDDEN]);
+        isolateRow.children.add(stacktraceCell);
+        var stacktrace = new DivElement();
+        stacktrace.classes.addAll([STACK_TRACE, HIDDEN]);
+        stacktraceCell.children.add(stacktrace);
+
+        isolateRow.onClick.listen((e) => toggle(isolateRow));
+        updateIsolateDetails(isolate, isolateRow);
+      }
     }
   }
 
-  void isolateDetails(Isolate isolate, DivElement parent) {
-    var newSpace = new DivElement();
-    newSpace.text = 'New space: ${isolate.newSpace.used}K';
-    parent.children.add(newSpace);
-    var oldSpace = new DivElement();
-    oldSpace.text = 'Old space: ${isolate.oldSpace.used}K';
-    parent.children.add(oldSpace);
-    var stack = new DivElement();
-    stack.text = 'Stack limit: ${(isolate.stackLimit / 1000000).round()}M';
-    parent.children.add(stack);
+  void setStacktrace(DivElement element, String json) {
+    element.children.clear();
+    var response = JSON.parse(json);
+    element.id = response['handle'];
+    var title = new DivElement();
+    title.$dom_className = STACK_TRACE_TITLE;
+    title.text = "Stack Trace";
+    element.children.add(title);
+
+    var stackIterator = response['stacktrace'].iterator;
+    var i = 0;
+    while (stackIterator.moveNext()) {
+      i++;
+      var frame = stackIterator.current;
+      var frameElement = new DivElement();
+      frameElement.$dom_className = STACK_FRAME;
+      var text = '$i: ${frame["url"]}:${frame["line"]}: ${frame["function"]}';
+      var code = frame["code"];
+      if (code['optimized']) {
+        text = '$text (optimized)';
+      }
+      frameElement.text = text;
+      element.children.add(frameElement);
+    }
   }
 
-  void toggle(DivElement e) {
-    e.classes.toggle(CSS_VISIBLE);
-    e.classes.toggle(CSS_HIDDEN);
+  Element findOrAddChild(DivElement parent, String className) {
+    var child = parent.query('.$className');
+    if (child == null) {
+      child = new DivElement();
+      child.$dom_className = className;
+      parent.children.add(child);
+    }
+    return child;
+  }
+
+  void updateIsolateDetails(Isolate isolate, TableRowElement row) {
+    var details = row.query('.$DETAILS');
+    var newSpace = findOrAddChild(details, NEW_SPACE);
+    newSpace.text = 'New space: ${isolate.newSpace.used}K';
+    var oldSpace = findOrAddChild(details, OLD_SPACE);
+    oldSpace.text = 'Old space: ${isolate.oldSpace.used}K';
+    var stackLimit = findOrAddChild(details, STACK_LIMIT);
+    stackLimit.text =
+        'Stack limit: ${(isolate.stackLimit.abs() / 1000000).round()}M';
+    var stackTrace = findOrAddChild(row, ISOLATE_STACKTRACE_COLUMN);
+    HttpRequest.getString('/isolate/${isolate.handle}/stacktrace').then(
+        (String response) => setStacktrace(stackTrace, response));
+  }
+
+  void toggle(TableRowElement row) {
+    var details = row.query('.$DETAILS');
+    details.classes.toggle(VISIBLE);
+    details.classes.toggle(HIDDEN);
+    var stacktrace = row.query('.$ISOLATE_STACKTRACE_COLUMN');
+    stacktrace.classes.toggle(VISIBLE);
+    stacktrace.classes.toggle(HIDDEN);
   }
 }
diff --git a/runtime/bin/vmstats/models.dart b/runtime/bin/vmstats/models.dart
index ae07fbc..965f4cd 100644
--- a/runtime/bin/vmstats/models.dart
+++ b/runtime/bin/vmstats/models.dart
@@ -83,6 +83,7 @@
 
 // Model of a single isolate.
 class Isolate {
+  final String handle;
   final String name;
   final int port;
   final int startTime;
@@ -92,6 +93,7 @@
 
   // Create an isolate from a map describing an isolate in the observed VM.
   Isolate(Map raw):
+      handle = raw['handle'],
       name = raw['name'],
       port = raw['port'],
       startTime = raw['starttime'],
diff --git a/runtime/bin/vmstats/vmstats.css b/runtime/bin/vmstats/vmstats.css
index 3757344..3255d5d 100644
--- a/runtime/bin/vmstats/vmstats.css
+++ b/runtime/bin/vmstats/vmstats.css
@@ -35,12 +35,23 @@
 .isolate_list {
   font-family: 'Open Sans', sans-serif;
   font-size: 14px;
+  vertical-align: top;
 }
 
 .isolate_details {
   visibility:visible;
 }
 
-.isolate_details_hidden {
+.hidden {
   visibility:hidden;
 }
+
+.stack_trace_title {
+  font-weight: bold;
+}
+
+td {
+  padding-left: 10px;
+  padding-right: 10px;
+  vertical-align: top;
+}
diff --git a/runtime/bin/vmstats/vmstats.dart b/runtime/bin/vmstats/vmstats.dart
index 3c2f6c3..2eda2c2 100644
--- a/runtime/bin/vmstats/vmstats.dart
+++ b/runtime/bin/vmstats/vmstats.dart
@@ -19,15 +19,16 @@
 Timer _updater;
 
 final int _POLL_INTERVAL = const Duration(seconds: 1);
+final String CYAN = '#00EE76';
+final String GREEN = '#97FFFF';
 
 void main() {
   DivElement dashBoard = query('#dashboard');
   CanvasElement canvas = query('#graph');
-  var elements = [ new Element("Old Space", "#97FFFF"),
-                   new Element("New Space", "#00EE76")];
+  var elements = [ new Element("Old Space", GREEN),
+                   new Element("New Space", CYAN)];
   _graph = new BarGraph(canvas, elements);
-  UListElement isolateListElement = query('#isolateList');
-  _isolateList = new IsolateList(isolateListElement);
+  _isolateList = new IsolateList(query('#isolateList'));
   _statusText = query('#statusText');
 
   _isolates = new IsolateListModel();
diff --git a/runtime/bin/vmstats/vmstats.html b/runtime/bin/vmstats/vmstats.html
index 5ad19aa..c64b629 100644
--- a/runtime/bin/vmstats/vmstats.html
+++ b/runtime/bin/vmstats/vmstats.html
@@ -17,7 +17,7 @@
         <h3>Allocated Memory</h3>
         <canvas id="graph" width="480px" height="240px"></canvas>
         <h3>Isolates</h3>
-        <ul id="isolateList"></ul>
+        <table id="isolateList"></table>
       </p>
     </div>
     <div id="statusSection">
diff --git a/runtime/include/dart_debugger_api.h b/runtime/include/dart_debugger_api.h
index 319b773..810623d9 100755
--- a/runtime/include/dart_debugger_api.h
+++ b/runtime/include/dart_debugger_api.h
@@ -415,6 +415,29 @@
 
 
 /**
+ * Returns text location of the given activation frame.
+ * \script_url receives a string handle with the url of the
+ *    source script that contains the frame's function.
+ *    Receives a null handle if there is no textual location
+ *    that corresponds to the frame, e.g. for implicitly
+ *    generated constructors.
+ * \token_number receives the line number in the script.
+ *
+ * Any or all of the out parameters above may be NULL.
+ *
+ * Requires there to be a current isolate.
+ *
+ * \return A handle to the True object if no error occurs.
+ *         A handle to the False object if there is no text
+ *         position for the frame.
+ */
+DART_EXPORT Dart_Handle Dart_ActivationFrameGetLocation(
+                            Dart_ActivationFrame activation_frame,
+                            Dart_Handle* script_url,
+                            intptr_t* token_number);
+
+
+/**
  * Returns an array containing all the local variable names and values of
  * the given \activation_frame.
  *
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 1a8977e..e92744c 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -118,6 +118,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  fold(initialValue, combine(previousValue, E element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   Iterable<E> where(bool f(E element)) {
     return IterableMixinWorkaround.where(this, f);
   }
@@ -194,10 +198,6 @@
         "Cannot add to a non-extendable array");
   }
 
-  void addLast(E element) {
-    add(element);
-  }
-
   void addAll(Iterable<E> iterable) {
     throw new UnsupportedError(
         "Cannot add to a non-extendable array");
@@ -365,6 +365,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  fold(initialValue, combine(previousValue, E element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   Iterable<E> where(bool f(E element)) {
     return IterableMixinWorkaround.where(this, f);
   }
@@ -446,10 +450,6 @@
         "Cannot add to an immutable array");
   }
 
-  void addLast(E element) {
-    add(element);
-  }
-
   void addAll(Iterable<E> elements) {
     throw new UnsupportedError(
         "Cannot add to an immutable array");
diff --git a/runtime/lib/collection_patch.dart b/runtime/lib/collection_patch.dart
new file mode 100644
index 0000000..2d4881e
--- /dev/null
+++ b/runtime/lib/collection_patch.dart
@@ -0,0 +1,191 @@
+// 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.
+
+patch class HashMap<K, V> {
+  final _HashMapTable<K, V> _hashTable = new _HashMapTable<K, V>();
+
+  /* patch */ HashMap() {
+    _hashTable._container = this;
+  }
+
+
+  /* patch */ bool containsKey(K key) {
+    return _hashTable._get(key) >= 0;
+  }
+
+  /* patch */ bool containsValue(V value) {
+    List table = _hashTable._table;
+    int entrySize = _hashTable._entrySize;
+    for (int offset = 0; offset < table.length; offset += entrySize) {
+      if (!_hashTable._isFree(table[offset]) &&
+          _hashTable._value(offset) == value) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /* patch */ void addAll(Map<K, V> other) {
+    other.forEach((K key, V value) {
+      int offset = _hashTable._put(key);
+      _hashTable._setValue(offset, value);
+      _hashTable._checkCapacity();
+    });
+  }
+
+  /* patch */ V operator [](K key) {
+    int offset = _hashTable._get(key);
+    if (offset >= 0) return _hashTable._value(offset);
+    return null;
+  }
+
+  /* patch */ void operator []=(K key, V value) {
+    int offset = _hashTable._put(key);
+    _hashTable._setValue(offset, value);
+    _hashTable._checkCapacity();
+  }
+
+  /* patch */ V putIfAbsent(K key, V ifAbsent()) {
+    int offset = _hashTable._probeForAdd(_hashTable._hashCodeOf(key), key);
+    Object entry = _hashTable._table[offset];
+    if (!_hashTable._isFree(entry)) {
+      return _hashTable._value(offset);
+    }
+    int modificationCount = _hashTable._modificationCount;
+    V value = ifAbsent();
+    if (modificationCount == _hashTable._modificationCount) {
+      _hashTable._setKey(offset, key);
+      _hashTable._setValue(offset, value);
+      if (entry == null) {
+        _hashTable._entryCount++;
+        _hashTable._checkCapacity();
+      } else {
+        assert(identical(entry, _TOMBSTONE));
+        _hashTable._deletedCount--;
+      }
+      _hashTable._recordModification();
+    } else {
+      // The table might have changed, so we can't trust [offset] any more.
+      // Do another lookup before setting the value.
+      offset = _hashTable._put(key);
+      _hashTable._setValue(offset, value);
+      _hashTable._checkCapacity();
+    }
+    return value;
+  }
+
+  /* patch */ V remove(K key) {
+    int offset = _hashTable._remove(key);
+    if (offset < 0) return null;
+    V oldValue = _hashTable._value(offset);
+    _hashTable._setValue(offset, null);
+    _hashTable._checkCapacity();
+    return oldValue;
+  }
+
+  /* patch */ void clear() {
+    _hashTable._clear();
+  }
+
+  /* patch */ void forEach(void action(K key, V value)) {
+    int modificationCount = _hashTable._modificationCount;
+    List table = _hashTable._table;
+    int entrySize = _hashTable._entrySize;
+    for (int offset = 0; offset < table.length; offset += entrySize) {
+      Object entry = table[offset];
+      if (!_hashTable._isFree(entry)) {
+        K key = entry;
+        V value = _hashTable._value(offset);
+        action(key, value);
+        _hashTable._checkModification(modificationCount);
+      }
+    }
+  }
+
+  /* patch */ Iterable<K> get keys => new _HashTableKeyIterable<K>(_hashTable);
+  /* patch */ Iterable<V> get values =>
+      new _HashTableValueIterable<V>(_hashTable, _HashMapTable._VALUE_INDEX);
+
+  /* patch */ int get length => _hashTable._elementCount;
+
+  /* patch */ bool get isEmpty => _hashTable._elementCount == 0;
+}
+
+patch class HashSet<E> {
+  static const int _INITIAL_CAPACITY = 8;
+  final _HashTable<E> _table;
+
+  /* patch */ HashSet() : _table = new _HashTable(_INITIAL_CAPACITY) {
+    _table._container = this;
+  }
+
+  factory HashSet.from(Iterable<E> iterable) {
+    return new HashSet<E>()..addAll(iterable);
+  }
+
+  // Iterable.
+  /* patch */ Iterator<E> get iterator => new _HashTableKeyIterator<E>(_table);
+
+  /* patch */ int get length => _table._elementCount;
+
+  /* patch */ bool get isEmpty => _table._elementCount == 0;
+
+  /* patch */ bool contains(Object object) => _table._get(object) >= 0;
+
+  // Collection.
+  /* patch */ void add(E element) {
+    _table._put(element);
+    _table._checkCapacity();
+  }
+
+  /* patch */ void addAll(Iterable<E> objects) {
+    for (E object in objects) {
+      _table._put(object);
+      _table._checkCapacity();
+    }
+  }
+
+  /* patch */ bool remove(Object object) {
+    int offset = _table._remove(object);
+    _table._checkCapacity();
+    return offset >= 0;
+  }
+
+  /* patch */ void removeAll(Iterable objectsToRemove) {
+    for (Object object in objectsToRemove) {
+      _table._remove(object);
+      _table._checkCapacity();
+    }
+  }
+
+  void _filterWhere(bool test(E element), bool removeMatching) {
+    int entrySize = _table._entrySize;
+    int length = _table._table.length;
+    for (int offset =  0; offset < length; offset += entrySize) {
+      Object entry = _table._table[offset];
+      if (!_table._isFree(entry)) {
+        E key = identical(entry, _NULL) ? null : entry;
+        int modificationCount = _table._modificationCount;
+        bool shouldRemove = (removeMatching == test(key));
+        _table._checkModification(modificationCount);
+        if (shouldRemove) {
+          _table._deleteEntry(offset);
+        }
+      }
+    }
+    _table._checkCapacity();
+  }
+
+  /* patch */ void removeWhere(bool test(E element)) {
+    _filterWhere(test, true);
+  }
+
+  /* patch */ void retainWhere(bool test(E element)) {
+    _filterWhere(test, false);
+  }
+
+  /* patch */ void clear() {
+    _table._clear();
+  }
+}
diff --git a/runtime/lib/collection_sources.gypi b/runtime/lib/collection_sources.gypi
new file mode 100644
index 0000000..0783b7d
--- /dev/null
+++ b/runtime/lib/collection_sources.gypi
@@ -0,0 +1,9 @@
+ # Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'sources': [
+    'collection_patch.dart',
+  ],
+}
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index db020ad..753ba1e 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -178,10 +178,6 @@
     this[len] = value;
   }
 
-  void addLast(T element) {
-    add(element);
-  }
-
   void addAll(Iterable<T> iterable) {
     for (T elem in iterable) {
       add(elem);
@@ -272,6 +268,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  fold(initialValue, combine(previousValue, T element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   Iterable<T> where(bool f(T element)) {
     return IterableMixinWorkaround.where(this, f);
   }
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index ea975ca..5282247 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -171,32 +171,34 @@
                             char** canonical_uri,
                             char** error) {
   Zone* zone = isolate->current_zone();
+  bool retval = false;
   Dart_LibraryTagHandler handler = isolate->library_tag_handler();
-  if (handler == NULL) {
+  if (handler != NULL) {
+    Dart_EnterScope();
+    Dart_Handle result = handler(kCanonicalizeUrl,
+                                 Api::NewHandle(isolate, library.raw()),
+                                 Api::NewHandle(isolate, uri.raw()));
+    const Object& obj = Object::Handle(Api::UnwrapHandle(result));
+    if (obj.IsString()) {
+      *canonical_uri = zone->MakeCopyOfString(String::Cast(obj).ToCString());
+      retval = true;
+    } else if (obj.IsError()) {
+      Error& error_obj = Error::Handle();
+      error_obj ^= obj.raw();
+      *error = zone->PrintToString("Unable to canonicalize uri '%s': %s",
+                                   uri.ToCString(), error_obj.ToErrorCString());
+    } else {
+      *error = zone->PrintToString("Unable to canonicalize uri '%s': "
+                                   "library tag handler returned wrong type",
+                                   uri.ToCString());
+    }
+    Dart_ExitScope();
+  } else {
     *error = zone->PrintToString(
         "Unable to canonicalize uri '%s': no library tag handler found.",
         uri.ToCString());
-    return false;
   }
-  Dart_Handle result = handler(kCanonicalizeUrl,
-                               Api::NewHandle(isolate, library.raw()),
-                               Api::NewHandle(isolate, uri.raw()));
-  const Object& obj = Object::Handle(Api::UnwrapHandle(result));
-  if (obj.IsError()) {
-    Error& error_obj = Error::Handle();
-    error_obj ^= obj.raw();
-    *error = zone->PrintToString("Unable to canonicalize uri '%s': %s",
-                                 uri.ToCString(), error_obj.ToErrorCString());
-    return false;
-  } else if (obj.IsString()) {
-    *canonical_uri = zone->MakeCopyOfString(String::Cast(obj).ToCString());
-    return true;
-  } else {
-    *error = zone->PrintToString("Unable to canonicalize uri '%s': "
-                                 "library tag handler returned wrong type",
-                                 uri.ToCString());
-    return false;
-  }
+  return retval;
 }
 
 
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc
index 48dacdf..8bc8e4d 100644
--- a/runtime/lib/object.cc
+++ b/runtime/lib/object.cc
@@ -12,6 +12,9 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, enable_type_checks);
+
+
 DEFINE_NATIVE_ENTRY(Object_toString, 1) {
   const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0));
   const char* c_str = instance.ToCString();
@@ -90,7 +93,7 @@
     StackFrame* caller_frame = iterator.NextFrame();
     ASSERT(caller_frame != NULL);
     const intptr_t location = caller_frame->GetTokenPos();
-    String& malformed_error_message =  String::Handle(
+    String& malformed_error_message = String::Handle(
         String::New(malformed_error.ToErrorCString()));
     Exceptions::CreateAndThrowTypeError(
         location, Symbols::Empty(), Symbols::Empty(),
@@ -101,6 +104,64 @@
 }
 
 
+DEFINE_NATIVE_ENTRY(Object_as, 4) {
+  const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0));
+  // Instantiator at position 1 is not used. It is passed along so that the call
+  // can be easily converted to an optimized implementation. Instantiator is
+  // used to populate the subtype cache.
+  const AbstractTypeArguments& instantiator_type_arguments =
+      AbstractTypeArguments::CheckedHandle(arguments->NativeArgAt(2));
+  const AbstractType& type =
+      AbstractType::CheckedHandle(arguments->NativeArgAt(3));
+  ASSERT(type.IsFinalized());
+  ASSERT(!type.IsMalformed());
+  Error& malformed_error = Error::Handle();
+  if (instance.IsNull()) {
+    return instance.raw();
+  }
+  const bool is_instance_of = instance.IsInstanceOf(type,
+                                                    instantiator_type_arguments,
+                                                    &malformed_error);
+  if (!is_instance_of) {
+    DartFrameIterator iterator;
+    StackFrame* caller_frame = iterator.NextFrame();
+    ASSERT(caller_frame != NULL);
+    const intptr_t location = caller_frame->GetTokenPos();
+    const AbstractType& instance_type =
+        AbstractType::Handle(instance.GetType());
+    const String& instance_type_name =
+        String::Handle(instance_type.UserVisibleName());
+    String& type_name = String::Handle();
+    if (!type.IsInstantiated()) {
+      // Instantiate type before reporting the error.
+      const AbstractType& instantiated_type = AbstractType::Handle(
+          type.InstantiateFrom(instantiator_type_arguments, NULL));
+      // Note that instantiated_type may be malformed.
+      type_name = instantiated_type.UserVisibleName();
+    } else {
+      type_name = type.UserVisibleName();
+    }
+    String& malformed_error_message =  String::Handle();
+    if (malformed_error.IsNull()) {
+      const String& dst_name = String::ZoneHandle(
+          Symbols::New(Exceptions::kCastErrorDstName));
+
+      Exceptions::CreateAndThrowTypeError(
+          location, instance_type_name, type_name,
+          dst_name, String::Handle());
+    } else {
+      ASSERT(FLAG_enable_type_checks);
+      malformed_error_message = String::New(malformed_error.ToErrorCString());
+      Exceptions::CreateAndThrowTypeError(
+          location, instance_type_name, Symbols::Empty(),
+          Symbols::Empty(), malformed_error_message);
+    }
+    UNREACHABLE();
+  }
+  return instance.raw();
+}
+
+
 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) {
   const AbstractType& type =
       AbstractType::CheckedHandle(arguments->NativeArgAt(0));
diff --git a/runtime/lib/object_patch.dart b/runtime/lib/object_patch.dart
index 2c0c0a3..f6c6439 100644
--- a/runtime/lib/object_patch.dart
+++ b/runtime/lib/object_patch.dart
@@ -41,13 +41,17 @@
                          invocation.namedArguments);
   }
 
+  /* patch */ Type get runtimeType native "Object_runtimeType";
+
   // Call this function instead of inlining instanceof, thus collecting
   // type feedback and reducing code size of unoptimized code.
-  _instanceOf(instantiator,
-              instantiator_type_arguments,
-              type,
-              bool negate)
+  bool _instanceOf(instantiator,
+                   instantiator_type_arguments,
+                   type,
+                   bool negate)
       native "Object_instanceOf";
 
-  /* patch */ Type get runtimeType native "Object_runtimeType";
+  // Call this function instead of inlining 'as', thus collecting type
+  // feedback. Returns receiver.
+  _as(instantiator, instantiator_type_arguments, type) native "Object_as";
 }
diff --git a/runtime/lib/typeddata.dart b/runtime/lib/typeddata.dart
index 4ece1af..244948c 100644
--- a/runtime/lib/typeddata.dart
+++ b/runtime/lib/typeddata.dart
@@ -278,7 +278,7 @@
   /* patch */ factory ByteData.view(ByteBuffer buffer,
                                     [int offsetInBytes = 0, int length]) {
     if (length == null) {
-      length = buffer.lengthInBytes;
+      length = buffer.lengthInBytes - offsetInBytes;
     }
     return new _ByteDataView(buffer, offsetInBytes, length);
   }
@@ -312,7 +312,12 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
-  Collection where(bool f(int element)) {
+  dynamic fold(dynamic initialValue,
+                 dynamic combine(dynamic initialValue, element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
+  Iterable where(bool f(int element)) {
     return IterableMixinWorkaround.where(this, f);
   }
 
@@ -377,11 +382,6 @@
         "Cannot add to a non-extendable array");
   }
 
-  void addLast(value) {
-    throw new UnsupportedError(
-        "Cannot add to a non-extendable array");
-  }
-
   void addAll(Iterable value) {
     throw new UnsupportedError(
         "Cannot add to a non-extendable array");
@@ -583,7 +583,7 @@
   factory _Int8Array.view(ByteBuffer buffer,
                           [int offsetInBytes = 0, int length]) {
     if (length == null) {
-      length = buffer.lengthInBytes;
+      length = buffer.lengthInBytes - offsetInBytes;
     }
     return new _Int8ArrayView(buffer, offsetInBytes, length);
   }
@@ -641,7 +641,7 @@
   factory _Uint8Array.view(ByteBuffer buffer,
                            [int offsetInBytes = 0, int length]) {
     if (length == null) {
-      length = buffer.lengthInBytes;
+      length = buffer.lengthInBytes - offsetInBytes;
     }
     return new _Uint8ArrayView(buffer, offsetInBytes, length);
   }
@@ -697,7 +697,7 @@
   factory _Uint8ClampedArray.view(ByteBuffer buffer,
                                   [int offsetInBytes = 0, int length]) {
     if (length == null) {
-      length = buffer.lengthInBytes;
+      length = buffer.lengthInBytes - offsetInBytes;
     }
     return new _Uint8ClampedArrayView(buffer, offsetInBytes, length);
   }
@@ -2327,7 +2327,7 @@
 }
 
 
-class _Uint8ClampedArrayView extends _TypedListView implements Uint8List {
+class _Uint8ClampedArrayView extends _TypedListView implements Uint8ClampedList {
   // Constructor.
   _Uint8ClampedArrayView(ByteBuffer buffer,
                          [int _offsetInBytes = 0, int _length])
@@ -2873,7 +2873,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setInt8(_offset + byteOffset, value);
+    _typeddata._setInt8(_offset + byteOffset, _toInt8(value));
   }
 
   int getUint8(int byteOffset) {
@@ -2886,7 +2886,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint8(_offset + byteOffset, value);
+    _typeddata._setUint8(_offset + byteOffset,_toUint8( value));
   }
 
   int getInt16(int byteOffset) {
@@ -2899,7 +2899,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setInt16(_offset + byteOffset, value);
+    _typeddata._setInt16(_offset + byteOffset, _toInt16(value));
   }
 
   int getUint16(int byteOffset) {
@@ -2912,7 +2912,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint16(_offset + byteOffset, value);
+    _typeddata._setUint16(_offset + byteOffset, _toUint16(value));
   }
 
   int getInt32(int byteOffset) {
@@ -2925,7 +2925,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setInt32(_offset + byteOffset, value);
+    _typeddata._setInt32(_offset + byteOffset, _toInt32(value));
   }
 
   int getUint32(int byteOffset) {
@@ -2938,7 +2938,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint32(_offset + byteOffset, value);
+    _typeddata._setUint32(_offset + byteOffset, _toUint32(value));
   }
 
   int getInt64(int byteOffset) {
@@ -2951,7 +2951,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setInt64(_offset + byteOffset, value);
+    _typeddata._setInt64(_offset + byteOffset, _toInt64(value));
   }
 
   int getUint64(int byteOffset) {
@@ -2964,7 +2964,7 @@
     if (byteOffset < 0 || byteOffset >= length) {
       _throwRangeError(byteOffset, length);
     }
-    _typeddata._setUint64(_offset + byteOffset, value);
+    _typeddata._setUint64(_offset + byteOffset, _toUint64(value));
   }
 
   double getFloat32(int byteOffset) {
diff --git a/runtime/platform/c99_support_win.h b/runtime/platform/c99_support_win.h
index 10fcf2b..0c06add 100644
--- a/runtime/platform/c99_support_win.h
+++ b/runtime/platform/c99_support_win.h
@@ -9,6 +9,7 @@
 // functions. Define them here.
 
 #include <float.h>
+#include <string.h>
 
 static const unsigned __int64 kQuietNaNMask =
     static_cast<unsigned __int64>(0xfff) << 51;
@@ -64,4 +65,18 @@
   }
 }
 
+// size_t used to match function signature on other platforms.
+static inline char* strndup(const char* s, size_t n) {
+  size_t len = strlen(s);
+  if (n < len) {
+    len = n;
+  }
+  char* result = reinterpret_cast<char*>(malloc(len + 1));
+  if (!result) {
+    return NULL;
+  }
+  result[len] = '\0';
+  return reinterpret_cast<char*>(memcpy(result, s, len));
+}
+
 #endif  // PLATFORM_C99_SUPPORT_WIN_H_
diff --git a/runtime/platform/thread_win.cc b/runtime/platform/thread_win.cc
index 662b3766..6265f6f 100644
--- a/runtime/platform/thread_win.cc
+++ b/runtime/platform/thread_win.cc
@@ -174,12 +174,15 @@
 
 
 void MonitorWaitData::ThreadExit() {
-  uword raw_wait_data =
-    Thread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
-  if (raw_wait_data != 0) {
-    MonitorWaitData* wait_data =
-        reinterpret_cast<MonitorWaitData*>(raw_wait_data);
-    delete wait_data;
+  if (MonitorWaitData::monitor_wait_data_key_ !=
+      Thread::kUnsetThreadLocalKey) {
+    uword raw_wait_data =
+      Thread::GetThreadLocal(MonitorWaitData::monitor_wait_data_key_);
+    if (raw_wait_data != 0) {
+      MonitorWaitData* wait_data =
+          reinterpret_cast<MonitorWaitData*>(raw_wait_data);
+      delete wait_data;
+    }
   }
 }
 
diff --git a/runtime/tests/vm/dart/byte_array_optimized_test.dart b/runtime/tests/vm/dart/byte_array_optimized_test.dart
index 153ebc39..8713ecb 100644
--- a/runtime/tests/vm/dart/byte_array_optimized_test.dart
+++ b/runtime/tests/vm/dart/byte_array_optimized_test.dart
@@ -30,8 +30,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -117,8 +115,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -193,8 +189,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -281,8 +275,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -357,8 +349,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -451,8 +441,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -533,8 +521,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -628,8 +614,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -707,8 +691,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0.0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0.0); },
@@ -773,8 +755,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0.0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0.0); },
@@ -869,8 +849,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1000,8 +978,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1111,8 +1087,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1250,8 +1224,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1367,8 +1339,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1525,8 +1495,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1658,8 +1626,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1861,8 +1827,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -2019,8 +1983,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0.0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0.0); },
@@ -2126,8 +2088,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0.0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0.0); },
diff --git a/runtime/tests/vm/dart/byte_array_test.dart b/runtime/tests/vm/dart/byte_array_test.dart
index eecd716..f4ede60 100644
--- a/runtime/tests/vm/dart/byte_array_test.dart
+++ b/runtime/tests/vm/dart/byte_array_test.dart
@@ -28,8 +28,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -122,8 +120,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -205,8 +201,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -284,8 +278,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -379,8 +371,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -462,8 +452,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -563,8 +551,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -650,8 +636,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -752,8 +736,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0); },
@@ -838,8 +820,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0.0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0.0); },
@@ -911,8 +891,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0.0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0.0); },
@@ -1157,8 +1135,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1290,8 +1266,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1403,8 +1377,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1544,8 +1516,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1663,8 +1633,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1821,8 +1789,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -1956,8 +1922,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -2161,8 +2125,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { view.addLast(0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { view.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { view.insertRange(0, view.length, 0); },
@@ -2321,8 +2283,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0.0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0.0); },
@@ -2430,8 +2390,6 @@
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.addAll([0]); },
                   (e) { return e is UnsupportedError; });
-    Expect.throws(() { array.addLast(0.0); },
-                  (e) { return e is UnsupportedError; });
     Expect.throws(() { array.clear(); },
                   (e) { return e is UnsupportedError; });
     Expect.throws(() { array.insertRange(0, array.length, 0.0); },
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index b341251..1939598 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -60,8 +60,6 @@
 [ $arch == simarm ]
 # Tests missing code generation support.
 cc/Dart2JSCompileAll: Skip
-cc/FrameLookup: Skip
-cc/UseDartApi: Skip
 # Tests needing Dart execution.
 dart/*: Skip
 
@@ -70,13 +68,8 @@
 
 [ $arch == simmips ]
 # Tests needing an assembler.
-cc/CallLeafRuntimeStubCode: Skip
-cc/CallRuntimeStubCode: Skip
 cc/Dart2JSCompileAll: Skip
 cc/FrameLookup: Skip
-cc/IcDataAccess: Skip
-cc/Jump: Skip
-cc/PatchStaticCall: Skip
 cc/UseDartApi: Skip
 # Tests needing Dart execution.
 dart/*: Skip
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index 3e0fa6a..a698ada 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -1310,7 +1310,7 @@
   ldr(result, FieldAddress(CTX, Context::isolate_offset()));
   const intptr_t table_offset_in_isolate =
       Isolate::class_table_offset() + ClassTable::table_offset();
-  ldr(result, Address(result, table_offset_in_isolate));
+  LoadFromOffset(kLoadWord, result, result, table_offset_in_isolate);
   ldr(result, Address(result, class_id, LSL, 2));
 }
 
@@ -1322,7 +1322,7 @@
   ldr(result, FieldAddress(CTX, Context::isolate_offset()));
   const intptr_t table_offset_in_isolate =
       Isolate::class_table_offset() + ClassTable::table_offset();
-  ldr(result, Address(result, table_offset_in_isolate));
+  LoadFromOffset(kLoadWord, result, result, table_offset_in_isolate);
   ldr(result, Address(result, scratch, LSL, 2));
 }
 
@@ -1790,7 +1790,7 @@
     cmp(rn, shifter_op, cond);
   } else {
     ASSERT(rn != IP);
-    LoadImmediate(IP, cond);
+    LoadImmediate(IP, value, cond);
     cmp(rn, ShifterOperand(IP), cond);
   }
 }
@@ -1910,16 +1910,31 @@
 }
 
 
-void Assembler::EnterStubFrame() {
+void Assembler::EnterStubFrame(bool uses_pp) {
   // Push 0 as saved PC for stub frames.
   mov(IP, ShifterOperand(LR));
   mov(LR, ShifterOperand(0));
-  EnterFrame((1 << FP) | (1 << IP) | (1 << LR), 0);
+  RegList regs = (1 << FP) | (1 << IP) | (1 << LR);
+  if (uses_pp) {
+    regs |= (1 << PP);
+  }
+  EnterFrame(regs, 0);
+  if (uses_pp) {
+    // Setup pool pointer for this stub.
+    const intptr_t object_pool_pc_dist =
+       Instructions::HeaderSize() - Instructions::object_pool_offset() +
+       CodeSize() + Instr::kPCReadOffset;
+    ldr(PP, Address(PC, -object_pool_pc_dist));
+  }
 }
 
 
-void Assembler::LeaveStubFrame() {
-  LeaveFrame((1 << FP) | (1 << LR));
+void Assembler::LeaveStubFrame(bool uses_pp) {
+  RegList regs = (1 << FP) | (1 << LR);
+  if (uses_pp) {
+    regs |= (1 << PP);
+  }
+  LeaveFrame(regs);
   // Adjust SP for null PC pushed in EnterStubFrame.
   AddImmediate(SP, kWordSize);
 }
@@ -2005,6 +2020,34 @@
   return object_pool_.Length() - 1;
 }
 
+
+static const char* cpu_reg_names[kNumberOfCpuRegisters] = {
+  "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+  "r8", "ctx", "pp", "fp", "ip", "sp", "lr", "pc",
+};
+
+
+const char* Assembler::RegisterName(Register reg) {
+  ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters));
+  return cpu_reg_names[reg];
+}
+
+
+static const char* fpu_reg_names[kNumberOfFpuRegisters] = {
+  "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
+  "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15",
+#ifdef VFPv3_D32
+  "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23",
+  "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31",
+#endif
+};
+
+
+const char* Assembler::FpuRegisterName(FpuRegister reg) {
+  ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
+  return fpu_reg_names[reg];
+}
+
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_ARM
diff --git a/runtime/vm/assembler_arm.h b/runtime/vm/assembler_arm.h
index 64a51e9..c5a2940 100644
--- a/runtime/vm/assembler_arm.h
+++ b/runtime/vm/assembler_arm.h
@@ -251,8 +251,8 @@
     encoding_ |= static_cast<uint32_t>(rn) << kRnShift;
   }
 
-  explicit Address(Register rn, Register rm, Shift shift = LSL,
-                   uint32_t shift_imm = 0, Mode am = Offset) {
+  Address(Register rn, Register rm,
+          Shift shift = LSL, uint32_t shift_imm = 0, Mode am = Offset) {
     ShifterOperand so(rm, shift, shift_imm);
 
     kind_ = ShiftedRegister;
@@ -337,15 +337,9 @@
 
   const Code::Comments& GetCodeComments() const;
 
-  static const char* RegisterName(Register reg) {
-    UNIMPLEMENTED();
-    return NULL;
-  }
+  static const char* RegisterName(Register reg);
 
-  static const char* FpuRegisterName(FpuRegister reg) {
-    UNIMPLEMENTED();
-    return NULL;
-  }
+  static const char* FpuRegisterName(FpuRegister reg);
 
   // Data-processing instructions.
   void and_(Register rd, Register rn, ShifterOperand so, Condition cond = AL);
@@ -639,8 +633,8 @@
 
   // Set up a stub frame so that the stack traversal code can easily identify
   // a stub frame.
-  void EnterStubFrame();
-  void LeaveStubFrame();
+  void EnterStubFrame(bool uses_pp = false);
+  void LeaveStubFrame(bool uses_pp = false);
 
   // Instruction pattern from entrypoint is used in Dart frame prologs
   // to set up the frame and save a PC which can be used to figure out the
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index 8d0221c..3359f46 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -1890,6 +1890,7 @@
 }
 
 
+// Destroys the value register.
 void Assembler::StoreIntoObject(Register object,
                                 const Address& dest,
                                 Register value,
@@ -1905,7 +1906,9 @@
   }
   // A store buffer update is required.
   if (value != EAX) pushl(EAX);  // Preserve EAX.
-  leal(EAX, dest);
+  if (object != EAX) {
+    movl(EAX, object);
+  }
   call(&StubCode::UpdateStoreBufferLabel());
   if (value != EAX) popl(EAX);  // Restore EAX.
   Bind(&done);
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index b98cc4b..c1b9721 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -6,6 +6,9 @@
 #if defined(TARGET_ARCH_MIPS)
 
 #include "vm/assembler.h"
+#include "vm/runtime_entry.h"
+#include "vm/simulator.h"
+#include "vm/stub_code.h"
 
 namespace dart {
 
@@ -128,6 +131,41 @@
 }
 
 
+void Assembler::LoadClassId(Register result, Register object) {
+  ASSERT(RawObject::kClassIdTagBit == 16);
+  ASSERT(RawObject::kClassIdTagSize == 16);
+  const intptr_t class_id_offset = Object::tags_offset() +
+      RawObject::kClassIdTagBit / kBitsPerByte;
+  lhu(result, FieldAddress(object, class_id_offset));
+}
+
+
+void Assembler::LoadClassById(Register result, Register class_id) {
+  ASSERT(result != class_id);
+  lw(result, FieldAddress(CTX, Context::isolate_offset()));
+  const intptr_t table_offset_in_isolate =
+      Isolate::class_table_offset() + ClassTable::table_offset();
+  lw(result, Address(result, table_offset_in_isolate));
+  sll(TMP, class_id, 2);
+  addu(result, result, TMP);
+  lw(result, Address(result));
+}
+
+
+void Assembler::LoadClass(Register result, Register object, Register scratch) {
+  ASSERT(scratch != result);
+  LoadClassId(scratch, object);
+
+  lw(result, FieldAddress(CTX, Context::isolate_offset()));
+  const intptr_t table_offset_in_isolate =
+      Isolate::class_table_offset() + ClassTable::table_offset();
+  lw(result, Address(result, table_offset_in_isolate));
+  sll(scratch, scratch, 2);
+  addu(result, result, scratch);
+  lw(result, Address(result));
+}
+
+
 void Assembler::EnterStubFrame() {
   addiu(SP, SP, Immediate(-3 * kWordSize));
   sw(ZR, Address(SP, 2 * kWordSize));  // PC marker is 0 in stubs.
@@ -145,6 +183,11 @@
 }
 
 
+void Assembler::CallRuntime(const RuntimeEntry& entry) {
+  entry.Call(this);
+}
+
+
 void Assembler::EnterDartFrame(intptr_t frame_size) {
   const intptr_t offset = CodeSize();
 
@@ -201,6 +244,17 @@
 }
 
 
+void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
+  // Reserve space for arguments and align frame before entering
+  // the C++ world.
+  addiu(SP, SP, Immediate(-frame_space));
+  if (OS::ActivationFrameAlignment() > 0) {
+    LoadImmediate(TMP, ~(OS::ActivationFrameAlignment() - 1));
+    and_(SP, SP, TMP);
+  }
+}
+
+
 int32_t Assembler::AddExternalLabel(const ExternalLabel* label) {
   if (object_pool_.IsNull()) {
     // The object pool cannot be used in the vm isolate.
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 68cc734..dda489f 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -10,7 +10,9 @@
 #endif
 
 #include "platform/assert.h"
+#include "platform/utils.h"
 #include "vm/constants_mips.h"
+#include "vm/simulator.h"
 
 // References to documentation in this file refer to:
 // "MIPS® Architecture For Programmers Volume I-A:
@@ -20,6 +22,9 @@
 //   The MIPS32® Instruction Set" in short "VolII-A"
 namespace dart {
 
+// Forward declarations.
+class RuntimeEntry;
+
 class Immediate : public ValueObject {
  public:
   explicit Immediate(int32_t value) : value_(value) { }
@@ -170,7 +175,8 @@
   // Instruction pattern from entrypoint is used in dart frame prologs
   // to set up the frame and save a PC which can be used to figure out the
   // RawInstruction object corresponding to the code running in the frame.
-  static const intptr_t kOffsetOfSavedPCfromEntrypoint = -1;  // UNIMPLEMENTED.
+  // See EnterDartFrame. There are 6 instructions before we know the PC.
+  static const intptr_t kOffsetOfSavedPCfromEntrypoint = 6 * Instr::kInstrSize;
 
   // Inlined allocation of an instance of class 'cls', code has no runtime
   // calls. Jump to 'failure' if the instance cannot be allocated here.
@@ -486,10 +492,6 @@
     EmitRType(SPECIAL, rs, rt, rd, 0, SRLV);
   }
 
-  void sub(Register rd, Register rs, Register rt) {
-    EmitRType(SPECIAL, rs, rt, rd, 0, SUB);
-  }
-
   void subu(Register rd, Register rs, Register rt) {
     EmitRType(SPECIAL, rs, rt, rd, 0, SUBU);
   }
@@ -505,31 +507,22 @@
   // Macros in alphabetical order.
 
   void Branch(const ExternalLabel* label) {
-    // Doesn't need to be patchable, so use the delay slot.
-    if (Utils::IsInt(16, label->address())) {
-      jr(TMP);
-      delay_slot()->addiu(TMP, ZR, Immediate(label->address()));
-    } else {
-      const uint16_t low = Utils::Low16Bits(label->address());
-      const uint16_t high = Utils::High16Bits(label->address());
-      lui(TMP, Immediate(high));
-      jr(TMP);
-      delay_slot()->ori(TMP, TMP, Immediate(low));
-    }
+    LoadImmediate(TMP, label->address());
+    jr(TMP);
+  }
+
+  void BranchPatchable(const ExternalLabel* label) {
+    const uint16_t low = Utils::Low16Bits(label->address());
+    const uint16_t high = Utils::High16Bits(label->address());
+    lui(TMP, Immediate(high));
+    ori(TMP, TMP, Immediate(low));
+    jr(TMP);
+    delay_slot_available_ = false;  // CodePatcher expects a nop.
   }
 
   void BranchLink(const ExternalLabel* label) {
-    // Doesn't need to be patchable, so use the delay slot.
-    if (Utils::IsInt(16, label->address())) {
-      jalr(TMP);
-      delay_slot()->addiu(TMP, ZR, Immediate(label->address()));
-    } else {
-      const uint16_t low = Utils::Low16Bits(label->address());
-      const uint16_t high = Utils::High16Bits(label->address());
-      lui(TMP, Immediate(high));
-      jalr(TMP);
-      delay_slot()->ori(TMP, TMP, Immediate(low));
-    }
+    LoadImmediate(TMP, label->address());
+    jalr(TMP);
   }
 
   void BranchLinkPatchable(const ExternalLabel* label) {
@@ -537,11 +530,7 @@
         Array::data_offset() + 4*AddExternalLabel(label) - kHeapObjectTag;
     LoadWordFromPoolOffset(TMP, offset);
     jalr(TMP);
-  }
-
-  void BranchPatchable(const ExternalLabel* label) {
-    LoadImmediate(TMP, label->address());
-    jr(TMP);
+    delay_slot_available_ = false;  // CodePatcher expects a nop.
   }
 
   // If the signed value in rs is less than value, rd is 1, and 0 otherwise.
@@ -596,6 +585,8 @@
     sra(reg, reg, kSmiTagSize);
   }
 
+  void ReserveAlignedFrameSpace(intptr_t frame_space);
+
   void LoadWordFromPoolOffset(Register rd, int32_t offset);
   void LoadObject(Register rd, const Object& object);
   void PushObject(const Object& object);
@@ -604,6 +595,12 @@
   // set to non-zero otherwise.
   void CompareObject(Register rd, Register rn, const Object& object);
 
+  void LoadClassId(Register result, Register object);
+  void LoadClassById(Register result, Register class_id);
+  void LoadClass(Register result, Register object, Register scratch);
+
+  void CallRuntime(const RuntimeEntry& entry);
+
   // Set up a Dart frame on entry with a frame pointer and PC information to
   // enable easy access to the RawInstruction object of code corresponding
   // to this frame.
@@ -675,7 +672,7 @@
          imm);
   }
 
-  void EmitJType(Opcode opcode, Label* label) {
+  void EmitJType(Opcode opcode, uint32_t destination) {
     UNIMPLEMENTED();
   }
 
@@ -703,7 +700,8 @@
       EmitIType(b, rs, rt, dest_off);
     } else {
       const int position = buffer_.Size();
-      EmitIType(b, rs, rt, label->position_);
+      const uint16_t dest_off = EncodeBranchOffset(label->position_, 0);
+      EmitIType(b, rs, rt, dest_off);
       label->LinkTo(position);
     }
   }
@@ -717,7 +715,8 @@
       EmitRegImmType(REGIMM, rs, b, dest_off);
     } else {
       const int position = buffer_.Size();
-      EmitRegImmType(REGIMM, rs, b, label->position_);
+      const uint16_t dest_off = EncodeBranchOffset(label->position_, 0);
+      EmitRegImmType(REGIMM, rs, b, dest_off);
       label->LinkTo(position);
     }
   }
diff --git a/runtime/vm/assembler_mips_test.cc b/runtime/vm/assembler_mips_test.cc
index cf122b4..4124ee0 100644
--- a/runtime/vm/assembler_mips_test.cc
+++ b/runtime/vm/assembler_mips_test.cc
@@ -989,6 +989,46 @@
 }
 
 
+ASSEMBLER_TEST_GENERATE(Label_link1, assembler) {
+  Label l;
+
+  __ bgez(ZR, &l);
+  __ bgez(ZR, &l);
+  __ bgez(ZR, &l);
+
+  __ LoadImmediate(V0, 1);
+  __ Bind(&l);
+  __ mov(V0, ZR);
+  __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(Label_link1, test) {
+  typedef int (*SimpleCode)();
+  EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(Label_link2, assembler) {
+  Label l;
+
+  __ beq(ZR, ZR, &l);
+  __ beq(ZR, ZR, &l);
+  __ beq(ZR, ZR, &l);
+
+  __ LoadImmediate(V0, 1);
+  __ Bind(&l);
+  __ mov(V0, ZR);
+  __ jr(RA);
+}
+
+
+ASSEMBLER_TEST_RUN(Label_link2, test) {
+  typedef int (*SimpleCode)();
+  EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry()));
+}
+
+
 ASSEMBLER_TEST_GENERATE(Jalr_delay, assembler) {
   __ mov(R2, RA);
   __ jalr(R2, RA);
diff --git a/runtime/vm/assembler_test.cc b/runtime/vm/assembler_test.cc
index 8b1c602..4071847 100644
--- a/runtime/vm/assembler_test.cc
+++ b/runtime/vm/assembler_test.cc
@@ -31,12 +31,10 @@
 
   EXPECT(old_array.raw() == grow_old_array.data());
   EXPECT(!Isolate::Current()->store_buffer_block()->Contains(
-      reinterpret_cast<uword>(grow_old_array.raw()) +
-      GrowableObjectArray::data_offset() - kHeapObjectTag));
+      reinterpret_cast<uword>(grow_old_array.raw())));
   EXPECT(old_array.raw() == grow_new_array.data());
   EXPECT(!Isolate::Current()->store_buffer_block()->Contains(
-      reinterpret_cast<uword>(grow_new_array.raw()) +
-      GrowableObjectArray::data_offset() - kHeapObjectTag));
+      reinterpret_cast<uword>(grow_new_array.raw())));
 
   // Store Smis into the old object.
   for (int i = -128; i < 128; i++) {
@@ -44,37 +42,32 @@
     test_code(ctx.raw(), smi.raw(), grow_old_array.raw());
     EXPECT(reinterpret_cast<RawArray*>(smi.raw()) == grow_old_array.data());
     EXPECT(!Isolate::Current()->store_buffer_block()->Contains(
-       reinterpret_cast<uword>(grow_old_array.raw()) +
-       GrowableObjectArray::data_offset() - kHeapObjectTag));
+       reinterpret_cast<uword>(grow_old_array.raw())));
   }
 
   // Store an old object into the old object.
   test_code(ctx.raw(), old_array.raw(), grow_old_array.raw());
   EXPECT(old_array.raw() == grow_old_array.data());
   EXPECT(!Isolate::Current()->store_buffer_block()->Contains(
-      reinterpret_cast<uword>(grow_old_array.raw()) +
-      GrowableObjectArray::data_offset() - kHeapObjectTag));
+      reinterpret_cast<uword>(grow_old_array.raw())));
 
   // Store a new object into the old object.
   test_code(ctx.raw(), new_array.raw(), grow_old_array.raw());
   EXPECT(new_array.raw() == grow_old_array.data());
   EXPECT(Isolate::Current()->store_buffer_block()->Contains(
-      reinterpret_cast<uword>(grow_old_array.raw()) +
-      GrowableObjectArray::data_offset() - kHeapObjectTag));
+      reinterpret_cast<uword>(grow_old_array.raw())));
 
   // Store a new object into the new object.
   test_code(ctx.raw(), new_array.raw(), grow_new_array.raw());
   EXPECT(new_array.raw() == grow_new_array.data());
   EXPECT(!Isolate::Current()->store_buffer_block()->Contains(
-      reinterpret_cast<uword>(grow_new_array.raw()) +
-      GrowableObjectArray::data_offset() - kHeapObjectTag));
+      reinterpret_cast<uword>(grow_new_array.raw())));
 
   // Store an old object into the new object.
   test_code(ctx.raw(), old_array.raw(), grow_new_array.raw());
   EXPECT(old_array.raw() == grow_new_array.data());
   EXPECT(!Isolate::Current()->store_buffer_block()->Contains(
-      reinterpret_cast<uword>(grow_new_array.raw()) +
-      GrowableObjectArray::data_offset() - kHeapObjectTag));
+      reinterpret_cast<uword>(grow_new_array.raw())));
 }
 
 #endif
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index c8e2e0b..ec43f5d 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -2079,7 +2079,9 @@
   }
   // A store buffer update is required.
   if (value != RAX) pushq(RAX);
-  leaq(RAX, dest);
+  if (object != RAX) {
+    movq(RAX, object);
+  }
   call(&StubCode::UpdateStoreBufferLabel());
   if (value != RAX) popq(RAX);
   Bind(&done);
diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc
index f7a8f8a..06527b7 100644
--- a/runtime/vm/bootstrap.cc
+++ b/runtime/vm/bootstrap.cc
@@ -43,7 +43,7 @@
 
 RawScript* Bootstrap::LoadCollectionScript(bool patch) {
   const char* url = patch ? "dart:collection-patch" : "dart:collection";
-  const char* source = patch ? collection_source_ : collection_source_;
+  const char* source = patch ? collection_patch_ : collection_source_;
   return LoadScript(url, source, patch);
 }
 
diff --git a/runtime/vm/bootstrap.h b/runtime/vm/bootstrap.h
index a638579..fdb616d 100644
--- a/runtime/vm/bootstrap.h
+++ b/runtime/vm/bootstrap.h
@@ -40,6 +40,7 @@
   static const char corelib_source_[];
   static const char corelib_patch_[];
   static const char collection_source_[];
+  static const char collection_patch_[];
   static const char collection_dev_source_[];
   static const char crypto_source_[];
   static const char isolate_source_[];
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index 6a0ad0f..4dbc3e8 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -17,6 +17,7 @@
   V(Object_noSuchMethod, 6)                                                    \
   V(Object_runtimeType, 1)                                                     \
   V(Object_instanceOf, 5)                                                      \
+  V(Object_as, 4)                                                              \
   V(Function_apply, 2)                                                         \
   V(InvocationMirror_invoke, 4)                                                \
   V(AbstractType_toString, 1)                                                  \
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index af2d1e8..b72a1c5 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -167,6 +167,7 @@
   if (FLAG_use_cha) {
     RemoveOptimizedCode(added_subclasses_to_cids);
   }
+  VerifyImplicitFieldOffsets();
   return retval;
 }
 
@@ -507,6 +508,7 @@
   ASSERT(arguments.Length() >= cls.NumTypeArguments());
   if (!cls.is_finalized()) {
     FinalizeTypeParameters(cls);
+    ResolveUpperBounds(cls);
   }
   AbstractType& super_type = AbstractType::Handle(cls.super_type());
   if (!super_type.IsNull()) {
@@ -574,7 +576,7 @@
     const AbstractTypeArguments& arguments,
     Error* bound_error) {
   if (!cls.is_finalized()) {
-    ResolveAndFinalizeUpperBounds(cls);
+    FinalizeUpperBounds(cls);
   }
   // Note that when finalizing a type, we need to verify the bounds in both
   // production mode and checked mode, because the finalized type may be written
@@ -607,37 +609,48 @@
       // Note that the bound may be malformed, in which case the bound check
       // will return an error and the bound check will be postponed to run time.
       // Note also that the bound may still be unfinalized.
-      if (!declared_bound.IsFinalized()) {
-        ASSERT(declared_bound.IsBeingFinalized());
-        // The bound refers to type parameters, creating a cycle; postpone
-        // bound check to run time, when the bound will be finalized.
-        // TODO(regis): Do we need to instantiate an uninstantiated bound here?
-        type_arg = BoundedType::New(type_arg, declared_bound, type_param);
-        arguments.SetTypeAt(offset + i, type_arg);
-        continue;
-      }
       if (declared_bound.IsInstantiated()) {
         instantiated_bound = declared_bound.raw();
       } else {
         instantiated_bound =
             declared_bound.InstantiateFrom(arguments, &malformed_error);
       }
+      if (!instantiated_bound.IsFinalized()) {
+        // The bound refers to type parameters, creating a cycle; postpone
+        // bound check to run time, when the bound will be finalized.
+        // The bound may not necessarily be 'IsBeingFinalized' yet, as is the
+        // case with a pair of type parameters of the same class referring to
+        // each other via their bounds.
+        type_arg = BoundedType::New(type_arg, instantiated_bound, type_param);
+        arguments.SetTypeAt(offset + i, type_arg);
+        continue;
+      }
       // TODO(regis): We could simplify this code if we could differentiate
       // between a failed bound check and a bound check that is undecidable at
       // compile time.
       // Shortcut the special case where we check a type parameter against its
       // declared upper bound.
+      bool below_bound = true;
       if (malformed_error.IsNull() &&
           (!type_arg.Equals(type_param) ||
            !instantiated_bound.Equals(declared_bound))) {
-        type_param.CheckBound(type_arg, instantiated_bound, &malformed_error);
+        // Pass NULL to prevent expensive and unnecessary error formatting in
+        // the case the bound check is postponed to run time.
+        below_bound = type_param.CheckBound(type_arg, instantiated_bound, NULL);
       }
-      if (!malformed_error.IsNull()) {
+      if (!malformed_error.IsNull() || !below_bound) {
         if (!type_arg.IsInstantiated() ||
             !instantiated_bound.IsInstantiated()) {
           type_arg = BoundedType::New(type_arg, instantiated_bound, type_param);
           arguments.SetTypeAt(offset + i, type_arg);
         } else if (bound_error->IsNull()) {
+          if (malformed_error.IsNull()) {
+            // Call CheckBound again to format error message.
+            type_param.CheckBound(type_arg,
+                                  instantiated_bound,
+                                  &malformed_error);
+          }
+          ASSERT(!malformed_error.IsNull());
           *bound_error = malformed_error.raw();
         }
       }
@@ -717,6 +730,7 @@
   Class& type_class = Class::Handle(parameterized_type.type_class());
   if (!type_class.is_finalized()) {
     FinalizeTypeParameters(type_class);
+    ResolveUpperBounds(type_class);
   }
 
   // Finalize the current type arguments of the type, which are still the
@@ -978,8 +992,27 @@
 }
 
 
-// Resolve and finalize the upper bounds of the type parameters of class cls.
-void ClassFinalizer::ResolveAndFinalizeUpperBounds(const Class& cls) {
+// Resolve the upper bounds of the type parameters of class cls.
+void ClassFinalizer::ResolveUpperBounds(const Class& cls) {
+  const intptr_t num_type_params = cls.NumTypeParameters();
+  TypeParameter& type_param = TypeParameter::Handle();
+  AbstractType& bound = AbstractType::Handle();
+  const AbstractTypeArguments& type_params =
+      AbstractTypeArguments::Handle(cls.type_parameters());
+  ASSERT((type_params.IsNull() && (num_type_params == 0)) ||
+         (type_params.Length() == num_type_params));
+  // In a first pass, resolve all bounds. This guarantees that finalization
+  // of mutually referencing bounds will not encounter an unresolved bound.
+  for (intptr_t i = 0; i < num_type_params; i++) {
+    type_param ^= type_params.TypeAt(i);
+    bound = type_param.bound();
+    ResolveType(cls, bound, kCanonicalize);
+  }
+}
+
+
+// Finalize the upper bounds of the type parameters of class cls.
+void ClassFinalizer::FinalizeUpperBounds(const Class& cls) {
   const intptr_t num_type_params = cls.NumTypeParameters();
   TypeParameter& type_param = TypeParameter::Handle();
   AbstractType& bound = AbstractType::Handle();
@@ -994,7 +1027,6 @@
       // A bound involved in F-bounded quantification may form a cycle.
       continue;
     }
-    ResolveType(cls, bound, kCanonicalize);
     bound = FinalizeType(cls, bound, kCanonicalize);
     type_param.set_bound(bound);
   }
@@ -1369,6 +1401,7 @@
   }
   // Finalize type parameters before finalizing the super type.
   FinalizeTypeParameters(cls);
+  ResolveUpperBounds(cls);
   // Finalize super type.
   AbstractType& super_type = AbstractType::Handle(cls.super_type());
   if (!super_type.IsNull()) {
@@ -1397,7 +1430,7 @@
     ASSERT(super_type.IsNull() || super_type.IsObjectType());
 
     // The type parameters of signature classes may have bounds.
-    ResolveAndFinalizeUpperBounds(cls);
+    FinalizeUpperBounds(cls);
 
     // Resolve and finalize the result and parameter types of the signature
     // function of this signature class.
@@ -1448,7 +1481,7 @@
   cls.Finalize();
   // Finalize bounds even if running in production mode, so that a snapshot
   // contains them.
-  ResolveAndFinalizeUpperBounds(cls);
+  FinalizeUpperBounds(cls);
   ResolveAndFinalizeMemberTypes(cls);
   // Run additional checks after all types are finalized.
   if (cls.is_const()) {
@@ -1941,4 +1974,58 @@
   ReportError(error);
 }
 
+
+void ClassFinalizer::VerifyImplicitFieldOffsets() {
+#ifdef DEBUG
+  const ClassTable& class_table = *(Isolate::Current()->class_table());
+  Class& cls = Class::Handle();
+  Array& fields_array = Array::Handle();
+  Field& field = Field::Handle();
+  String& name = String::Handle();
+  String& expected_name = String::Handle();
+
+  // First verify field offsets of all the TypedDataView classes.
+  for (intptr_t cid = kTypedDataInt8ArrayViewCid;
+       cid <= kTypedDataFloat32x4ArrayViewCid;
+       cid++) {
+    cls = class_table.At(cid);  // Get the TypedDataView class.
+    cls = cls.SuperClass();  // Get it's super class '_TypedListView'.
+    fields_array ^= cls.fields();
+    ASSERT(fields_array.Length() == TypedDataView::NumberOfFields());
+    field ^= fields_array.At(0);
+    ASSERT(field.Offset() == TypedDataView::data_offset());
+    name ^= field.name();
+    expected_name ^= String::New("_typeddata");
+    ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
+    field ^= fields_array.At(1);
+    ASSERT(field.Offset() == TypedDataView::offset_in_bytes_offset());
+    name ^= field.name();
+    ASSERT(name.Equals("offsetInBytes"));
+    field ^= fields_array.At(2);
+    ASSERT(field.Offset() == TypedDataView::length_offset());
+    name ^= field.name();
+    ASSERT(name.Equals("length"));
+  }
+
+  // Now verify field offsets of '_ByteDataView' class.
+  cls = class_table.At(kByteDataViewCid);
+  fields_array ^= cls.fields();
+  ASSERT(fields_array.Length() == TypedDataView::NumberOfFields());
+  field ^= fields_array.At(0);
+  ASSERT(field.Offset() == TypedDataView::data_offset());
+  name ^= field.name();
+  expected_name ^= String::New("_typeddata");
+  ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
+  field ^= fields_array.At(1);
+  ASSERT(field.Offset() == TypedDataView::offset_in_bytes_offset());
+  name ^= field.name();
+  expected_name ^= String::New("_offset");
+  ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
+  field ^= fields_array.At(2);
+  ASSERT(field.Offset() == TypedDataView::length_offset());
+  name ^= field.name();
+  ASSERT(name.Equals("length"));
+#endif
+}
+
 }  // namespace dart
diff --git a/runtime/vm/class_finalizer.h b/runtime/vm/class_finalizer.h
index e59e591..513d2f3 100644
--- a/runtime/vm/class_finalizer.h
+++ b/runtime/vm/class_finalizer.h
@@ -120,7 +120,8 @@
   static void ResolveType(const Class& cls,
                           const AbstractType& type,
                           FinalizationKind finalization);
-  static void ResolveAndFinalizeUpperBounds(const Class& cls);
+  static void ResolveUpperBounds(const Class& cls);
+  static void FinalizeUpperBounds(const Class& cls);
   static void ResolveAndFinalizeSignature(const Class& cls,
                                           const Function& function);
   static void ResolveAndFinalizeMemberTypes(const Class& cls);
@@ -138,6 +139,10 @@
                           intptr_t token_index,
                           const char* format, ...) PRINTF_ATTRIBUTE(3, 4);
   static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2);
+
+  // Verify implicit offsets recorded in the VM for direct access to fields of
+  // Dart instances (e.g: _TypedListView, _ByteDataView).
+  static void VerifyImplicitFieldOffsets();
 };
 
 }  // namespace dart
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index daafa597..4bbb77e 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1256,6 +1256,12 @@
       }
     }
   }
+  if (interrupt_bits & Isolate::kVmStatusInterrupt) {
+    Dart_IsolateInterruptCallback callback = isolate->VmStatsCallback();
+    if (callback) {
+      (*callback)();
+    }
+  }
 }
 
 
diff --git a/runtime/vm/code_generator_test.cc b/runtime/vm/code_generator_test.cc
index 27beef2..0f23d54 100644
--- a/runtime/vm/code_generator_test.cc
+++ b/runtime/vm/code_generator_test.cc
@@ -34,11 +34,6 @@
 CODEGEN_TEST_RUN(SmiReturnCodegen, Smi::New(3))
 
 
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
-
 CODEGEN_TEST2_GENERATE(SimpleStaticCallCodegen, function, test) {
   // Wrap the SmiReturnCodegen test above as a static function and call it.
   ArgumentListNode* no_arguments = new ArgumentListNode(kPos);
@@ -568,6 +563,4 @@
 
 #endif  // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
 
-#endif  // defined(TARGET_ARCH_IA32) || ..._ARCH_X64) || ..._ARCH_ARM)
-
 }  // namespace dart
diff --git a/runtime/vm/code_patcher_mips.cc b/runtime/vm/code_patcher_mips.cc
index a7ed7e0..1268dc7 100644
--- a/runtime/vm/code_patcher_mips.cc
+++ b/runtime/vm/code_patcher_mips.cc
@@ -7,6 +7,7 @@
 
 #include "vm/code_patcher.h"
 
+#include "vm/instructions.h"
 #include "vm/object.h"
 
 namespace dart {
@@ -14,8 +15,8 @@
 uword CodePatcher::GetStaticCallTargetAt(uword return_address,
                                          const Code& code) {
   ASSERT(code.ContainsInstructionAt(return_address));
-  UNIMPLEMENTED();
-  return 0;
+  CallPattern call(return_address, code);
+  return call.TargetAddress();
 }
 
 
@@ -23,7 +24,8 @@
                                     const Code& code,
                                     uword new_target) {
   ASSERT(code.ContainsInstructionAt(return_address));
-  UNIMPLEMENTED();
+  CallPattern call(return_address, code);
+  call.SetTargetAddress(new_target);
 }
 
 
@@ -45,13 +47,20 @@
                                      ICData* ic_data,
                                      Array* arguments_descriptor) {
   ASSERT(code.ContainsInstructionAt(return_address));
-  UNIMPLEMENTED();
-  return 0;
+  CallPattern call(return_address, code);
+  if (ic_data != NULL) {
+    *ic_data = call.IcData();
+  }
+  if (arguments_descriptor != NULL) {
+    *arguments_descriptor = call.ArgumentsDescriptor();
+  }
+  return call.TargetAddress();
 }
 
 
 intptr_t CodePatcher::InstanceCallSizeInBytes() {
-  UNIMPLEMENTED();
+  // The instance call instruction sequence has a variable size on MIPS.
+  UNREACHABLE();
   return 0;
 }
 
diff --git a/runtime/vm/code_patcher_mips_test.cc b/runtime/vm/code_patcher_mips_test.cc
index 79c9b63..9d0a681 100644
--- a/runtime/vm/code_patcher_mips_test.cc
+++ b/runtime/vm/code_patcher_mips_test.cc
@@ -45,12 +45,34 @@
 #define __ assembler->
 
 ASSEMBLER_TEST_GENERATE(IcDataAccess, assembler) {
-  UNIMPLEMENTED();
+  const String& class_name = String::Handle(Symbols::New("ownerClass"));
+  const Script& script = Script::Handle();
+  const Class& owner_class =
+      Class::Handle(Class::New(class_name, script, Scanner::kDummyTokenIndex));
+  const String& function_name =
+      String::ZoneHandle(Symbols::New("callerFunction"));
+  const Function& function = Function::ZoneHandle(
+      Function::New(function_name, RawFunction::kRegularFunction,
+                    true, false, false, false, owner_class, 0));
+
+  const String& target_name = String::Handle(String::New("targetFunction"));
+  const ICData& ic_data =
+      ICData::ZoneHandle(ICData::New(function, target_name, 15, 1));
+  const Array& arg_descriptor =
+      Array::ZoneHandle(ArgumentsDescriptor::New(1, Array::Handle()));
+
+  __ LoadObject(S4, arg_descriptor);
+  __ LoadObject(S5, ic_data);
+  ExternalLabel target_label(
+      "InlineCache", StubCode::OneArgCheckInlineCacheEntryPoint());
+  __ BranchLinkPatchable(&target_label);
+  __ Ret();
 }
 
 
 ASSEMBLER_TEST_RUN(IcDataAccess, test) {
-  uword return_address = test->entry() + CodePatcher::InstanceCallSizeInBytes();
+  uword return_address =
+      test->entry() + test->code().Size() - 2 * Instr::kInstrSize;
   ICData& ic_data = ICData::Handle();
   CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data, NULL);
   EXPECT_STREQ("targetFunction",
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index a0e412e..28b4c8e 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -264,6 +264,13 @@
         DEBUG_ASSERT(flow_graph->VerifyUseLists());
       }
 
+      if (FLAG_constant_propagation) {
+        // Constant propagation can use information from range analysis to
+        // find unreachable branch targets.
+        ConstantPropagator::OptimizeBranches(flow_graph);
+        DEBUG_ASSERT(flow_graph->VerifyUseLists());
+      }
+
       // The final canonicalization pass before the code generation.
       if (FLAG_propagate_types) {
         // Recompute types after code movement was done to ensure correct
diff --git a/runtime/vm/constants_mips.h b/runtime/vm/constants_mips.h
index 8b0a266..9bad858 100644
--- a/runtime/vm/constants_mips.h
+++ b/runtime/vm/constants_mips.h
@@ -322,6 +322,7 @@
       (SPECIAL << kOpcodeShift) | (BREAK << kFunctionShift);
   static const int32_t kNopInstruction = 0;
   static const int32_t kStopMessageCode = 1;
+  static const int32_t kRedirectCode = 2;
 
   // Get the raw instruction bits.
   inline int32_t InstructionBits() const {
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 1ef5060..8ad2e6b 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -80,12 +80,6 @@
   } while (0)
 
 
-void SetupErrorResult(Isolate* isolate, Dart_Handle* handle) {
-  *handle = Api::NewHandle(
-      isolate, Isolate::Current()->object_store()->sticky_error());
-}
-
-
 Dart_Handle Api::NewHandle(Isolate* isolate, RawObject* raw) {
   LocalHandles* local_handles = Api::TopScope(isolate)->local_handles();
   ASSERT(local_handles != NULL);
@@ -159,9 +153,8 @@
       isolate->object_store()->PreallocateObjects()) {
     return Api::Success(isolate);
   }
-  const Object& obj = Object::Handle(isolate->object_store()->sticky_error());
-  ASSERT(obj.IsError());
-  return Api::NewHandle(isolate, obj.raw());
+  ASSERT(isolate->object_store()->sticky_error() != Object::null());
+  return Api::NewHandle(isolate, isolate->object_store()->sticky_error());
 }
 
 
@@ -972,8 +965,7 @@
 
 DART_EXPORT Dart_Handle Dart_RunLoop() {
   Isolate* isolate = Isolate::Current();
-
-  DARTSCOPE(isolate);
+  CHECK_ISOLATE_SCOPE(isolate);
   CHECK_CALLBACK_STATE(isolate);
   Monitor monitor;
   MonitorLocker ml(&monitor);
@@ -990,12 +982,12 @@
       ml.Wait();
     }
   }
-  const Object& obj = Object::Handle(isolate->object_store()->sticky_error());
-  isolate->object_store()->clear_sticky_error();
-  if (obj.IsError()) {
-    return Api::NewHandle(isolate, obj.raw());
+  if (isolate->object_store()->sticky_error() != Object::null()) {
+    Dart_Handle error = Api::NewHandle(isolate,
+                                       isolate->object_store()->sticky_error());
+    isolate->object_store()->clear_sticky_error();
+    return error;
   }
-  ASSERT(obj.IsNull());
   if (FLAG_print_class_table) {
     isolate->class_table()->Print();
   }
@@ -1005,10 +997,11 @@
 
 DART_EXPORT Dart_Handle Dart_HandleMessage() {
   Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
+  CHECK_ISOLATE_SCOPE(isolate);
+  CHECK_CALLBACK_STATE(isolate);
   if (!isolate->message_handler()->HandleNextMessage()) {
-    Dart_Handle error =
-        Api::NewHandle(isolate, isolate->object_store()->sticky_error());
+    Dart_Handle error = Api::NewHandle(isolate,
+                                       isolate->object_store()->sticky_error());
     isolate->object_store()->clear_sticky_error();
     return error;
   }
@@ -2718,23 +2711,25 @@
     START_NO_CALLBACK_SCOPE(isolate);
     *data = obj.DataAddr(0);
   } else {
-    // typed data view object, set up some GC and API callback guards.
-    // TODO(asiva): Have to come up with a scheme to directly access
-    // the fields using offsets for a more efficient implementation.
-    Dart_Handle field_name = Dart_NewStringFromCString("length");
-    Dart_Handle field_value = Dart_GetField(object, field_name);
-    ASSERT(Api::IsSmi(field_value));
-    *len = Api::SmiValue(field_value);
-    field_name = Dart_NewStringFromCString("offsetInBytes");
-    field_value = Dart_GetField(object, field_name);
-    ASSERT(Api::IsSmi(field_value));
-    intptr_t offset_in_bytes = Api::SmiValue(field_value);
-    field_name = Dart_NewStringFromCString("_typeddata");
-    field_value = Dart_GetField(object, field_name);
-    const TypedData& obj = Api::UnwrapTypedDataHandle(isolate, field_value);
+    ASSERT(RawObject::IsTypedDataViewClassId(class_id));
+    const Instance& view_obj = Api::UnwrapInstanceHandle(isolate, object);
+    ASSERT(!view_obj.IsNull());
+    Smi& val = Smi::Handle();
+    val ^= TypedDataView::Length(view_obj);
+    *len = val.Value();
+    val ^= TypedDataView::OffsetInBytes(view_obj);
+    intptr_t offset_in_bytes = val.Value();
+    const Instance& obj = Instance::Handle(TypedDataView::Data(view_obj));
     isolate->IncrementNoGCScopeDepth();
     START_NO_CALLBACK_SCOPE(isolate);
-    *data = obj.DataAddr(offset_in_bytes);
+    if (TypedData::IsTypedData(obj)) {
+      const TypedData& data_obj = TypedData::Cast(obj);
+      *data = data_obj.DataAddr(offset_in_bytes);
+    } else {
+      ASSERT(ExternalTypedData::IsExternalTypedData(obj));
+      const ExternalTypedData& data_obj = ExternalTypedData::Cast(obj);
+      *data = data_obj.DataAddr(offset_in_bytes);
+    }
   }
   return Api::Success(isolate);
 }
diff --git a/runtime/vm/dart_api_impl.h b/runtime/vm/dart_api_impl.h
index b5e89da..b913df8 100644
--- a/runtime/vm/dart_api_impl.h
+++ b/runtime/vm/dart_api_impl.h
@@ -58,9 +58,6 @@
   HANDLESCOPE(__temp_isolate__);
 
 
-void SetupErrorResult(Dart_Handle* handle);
-
-
 class Api : AllStatic {
  public:
   // Creates a new local handle.
diff --git a/runtime/vm/dart_api_state.h b/runtime/vm/dart_api_state.h
index 9b27ecd..a20a940 100644
--- a/runtime/vm/dart_api_state.h
+++ b/runtime/vm/dart_api_state.h
@@ -573,10 +573,12 @@
     delayed_weak_reference_sets_ = reference_set;
   }
 
-  void UnwindScopes(uword sp) {
+  void UnwindScopes(uword stack_marker) {
+    // Unwind all scopes using the same stack_marker, i.e. all scopes allocated
+    // under the same top_exit_frame_info.
     while (top_scope_ != NULL &&
            top_scope_->stack_marker() != 0 &&
-           top_scope_->stack_marker() <= sp) {
+           top_scope_->stack_marker() == stack_marker) {
       ApiLocalScope* scope = top_scope_;
       top_scope_ = top_scope_->previous();
       delete scope;
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h
index 2d7cbe8..fd5f180 100644
--- a/runtime/vm/debugger.h
+++ b/runtime/vm/debugger.h
@@ -334,7 +334,7 @@
 
   void SyncBreakpoint(SourceBreakpoint* bpt);
 
-  DebuggerStackTrace* CollectStackTrace();
+  static DebuggerStackTrace* CollectStackTrace();
   void SignalBpResolved(SourceBreakpoint *bpt);
 
   bool IsDebuggable(const Function& func);
@@ -381,6 +381,7 @@
   static BreakpointHandler* bp_handler_;
   static EventHandler* event_handler_;
 
+  friend class Isolate;
   friend class SourceBreakpoint;
   DISALLOW_COPY_AND_ASSIGN(Debugger);
 };
diff --git a/runtime/vm/debugger_api_impl.cc b/runtime/vm/debugger_api_impl.cc
index 97ccf7c..84dc81e 100644
--- a/runtime/vm/debugger_api_impl.cc
+++ b/runtime/vm/debugger_api_impl.cc
@@ -222,6 +222,25 @@
 }
 
 
+DART_EXPORT Dart_Handle Dart_ActivationFrameGetLocation(
+                            Dart_ActivationFrame activation_frame,
+                            Dart_Handle* script_url,
+                            intptr_t* token_number) {
+  // TODO(hausner): Implement implement a way to recognize when there
+  // is no source code for the code in the frame.
+  Isolate* isolate = Isolate::Current();
+  DARTSCOPE(isolate);
+  CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
+  if (script_url != NULL) {
+    *script_url = Api::NewHandle(isolate, frame->SourceUrl());
+  }
+  if (token_number != NULL) {
+    *token_number = frame->TokenPos();
+  }
+  return Api::True(isolate);
+}
+
+
 DART_EXPORT Dart_Handle Dart_GetLocalVariables(
                             Dart_ActivationFrame activation_frame) {
   Isolate* isolate = Isolate::Current();
diff --git a/runtime/vm/disassembler_mips.cc b/runtime/vm/disassembler_mips.cc
index 0c30e3b..8233de7 100644
--- a/runtime/vm/disassembler_mips.cc
+++ b/runtime/vm/disassembler_mips.cc
@@ -332,10 +332,6 @@
       }
       break;
     }
-    case SUB: {
-      Format(instr, "sub 'rd, 'rs, 'rt");
-      break;
-    }
     case SUBU: {
       Format(instr, "subu 'rd, 'rs, 'rt");
       break;
diff --git a/runtime/vm/find_code_object_test.cc b/runtime/vm/find_code_object_test.cc
index 7bb1e9f..94fee57 100644
--- a/runtime/vm/find_code_object_test.cc
+++ b/runtime/vm/find_code_object_test.cc
@@ -13,16 +13,14 @@
 
 namespace dart {
 
-// Compiler only implemented on IA32, X64, and ARM.
-#if defined(TARGET_ARCH_IA32) ||                                               \
-    defined(TARGET_ARCH_X64) ||                                                \
-    defined(TARGET_ARCH_ARM)
-
 TEST_CASE(FindCodeObject) {
 #if defined(TARGET_ARCH_IA32)
   const int kLoopCount = 50000;
 #elif defined(TARGET_ARCH_X64)
   const int kLoopCount = 25000;
+#elif defined(TARGET_ARCH_MIPS)
+  // TODO(zra): Increase after we implement far branches on MIPS.
+  const int kLoopCount = 1818;
 #else
   const int kLoopCount = 20000;
 #endif
@@ -149,13 +147,19 @@
   code = function.CurrentCode();
   EXPECT(code.Size() > 16);
   pc = code.EntryPoint() + 16;
+#if defined(TARGET_ARCH_MIPS)
+  // MIPS can only Branch +/- 128KB
+  EXPECT(code.Size() > (PageSpace::kPageSize / 2));
+  EXPECT(Code::LookupCode(pc) == code.raw());
+  pc = code.EntryPoint() + (PageSpace::kPageSize / 4);
+  EXPECT(Code::LookupCode(pc) == code.raw());
+#else
   EXPECT(code.Size() > PageSpace::kPageSize);
   EXPECT(Code::LookupCode(pc) == code.raw());
   EXPECT(code.Size() > (1 * MB));
   pc = code.EntryPoint() + (1 * MB);
   EXPECT(Code::LookupCode(pc) == code.raw());
+#endif  // defined(TARGET_ARCH_MIPS)
 }
 
-#endif  // TARGET_ARCH_IA32 || TARGET_ARCH_X64 || TARGET_ARCH_ARM
-
 }  // namespace dart
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index 5024030..c1f8f32 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -643,7 +643,9 @@
 
 static Location::Kind RegisterKindForResult(Instruction* instr) {
   if ((instr->representation() == kUnboxedDouble) ||
-      (instr->representation() == kUnboxedMint)) {
+      (instr->representation() == kUnboxedMint) ||
+      (instr->representation() == kUnboxedFloat32x4) ||
+      (instr->representation() == kUnboxedUint32x4)) {
     return Location::kFpuRegister;
   } else {
     return Location::kRegister;
@@ -1596,15 +1598,25 @@
   if (register_kind_ == Location::kRegister) {
     range->set_spill_slot(Location::StackSlot(idx));
   } else {
-    // Double spill slots are essentially one (x64) or two (ia32) normal
+    // FPU register spill slots are essentially two (x64) or four (ia32) normal
     // word size spill slots.  We use the index of the slot with the lowest
-    // address as an index for the double spill slot. In terms of indexes
+    // address as an index for the FPU register spill slot. In terms of indexes
     // this relation is inverted: so we have to take the highest index.
-    const intptr_t slot_idx =
-        idx * kDoubleSpillSlotFactor + (kDoubleSpillSlotFactor - 1);
-    range->set_spill_slot(
-        Location::DoubleStackSlot(
-            cpu_spill_slot_count_ + slot_idx, range->representation()));
+    const intptr_t slot_idx = cpu_spill_slot_count_ +
+        idx * kFpuRegisterSpillFactor + (kFpuRegisterSpillFactor - 1);
+
+    Location location;
+    if (range->representation() == kUnboxedFloat32x4) {
+      location = Location::Float32x4StackSlot(slot_idx);
+    } else if (range->representation() == kUnboxedUint32x4) {
+      location = Location::Uint32x4StackSlot(slot_idx);
+    } else {
+      ASSERT((range->representation() == kUnboxedDouble) ||
+             (range->representation() == kUnboxedMint));
+      location = Location::DoubleStackSlot(slot_idx,
+                                           range->representation());
+    }
+    range->set_spill_slot(location);
   }
 
   spilled_.Add(range);
@@ -2523,7 +2535,7 @@
   GraphEntryInstr* entry = block_order_[0]->AsGraphEntry();
   ASSERT(entry != NULL);
   intptr_t double_spill_slot_count =
-      spill_slots_.length() * kDoubleSpillSlotFactor;
+      spill_slots_.length() * kFpuRegisterSpillFactor;
   entry->set_spill_slot_count(cpu_spill_slot_count_ + double_spill_slot_count);
 
   if (FLAG_print_ssa_liveranges) {
diff --git a/runtime/vm/flow_graph_allocator.h b/runtime/vm/flow_graph_allocator.h
index 526db56..5268c31 100644
--- a/runtime/vm/flow_graph_allocator.h
+++ b/runtime/vm/flow_graph_allocator.h
@@ -37,8 +37,8 @@
 
 class FlowGraphAllocator : public ValueObject {
  public:
-  // Number of stack slots needed for a double spill slot.
-  static const intptr_t kDoubleSpillSlotFactor = kDoubleSize / kWordSize;
+  // Number of stack slots needed for a fpu register spill slot.
+  static const intptr_t kFpuRegisterSpillFactor = kFpuRegisterSize / kWordSize;
 
   explicit FlowGraphAllocator(const FlowGraph& flow_graph);
 
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 2dcce7c..337eebe 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -1011,22 +1011,6 @@
 }
 
 
-void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) {
-  ASSERT(Token::IsTypeCastOperator(node->kind()));
-  const AbstractType& type = node->right()->AsTypeNode()->type();
-  ASSERT(type.IsFinalized());  // The type in a type cast may be malformed.
-  ValueGraphVisitor for_value(owner(), temp_index());
-  node->left()->Visit(&for_value);
-  const String& dst_name = String::ZoneHandle(
-      Symbols::New(Exceptions::kCastErrorDstName));
-  if (!CanSkipTypeCheck(node->token_pos(), for_value.value(), type, dst_name)) {
-    Append(for_value);
-    Do(BuildAssertAssignable(
-        node->token_pos(), for_value.value(), type, dst_name));
-  }
-}
-
-
 void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
   ASSERT(Token::IsTypeTestOperator(node->kind()));
   const AbstractType& type = node->right()->AsTypeNode()->type();
@@ -1107,14 +1091,31 @@
       PrivateCoreLibName(Symbols::_instanceOf()),
       node->kind(),
       arguments,
-      Array::ZoneHandle(),
+      Array::ZoneHandle(),  // No argument names.
       kNumArgsChecked);
   ReturnDefinition(call);
 }
 
 
+void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) {
+  ASSERT(Token::IsTypeCastOperator(node->kind()));
+  const AbstractType& type = node->right()->AsTypeNode()->type();
+  ASSERT(type.IsFinalized());  // The type in a type cast may be malformed.
+  ValueGraphVisitor for_value(owner(), temp_index());
+  node->left()->Visit(&for_value);
+  const String& dst_name = String::ZoneHandle(
+      Symbols::New(Exceptions::kCastErrorDstName));
+  if (!CanSkipTypeCheck(node->token_pos(), for_value.value(), type, dst_name)) {
+    Append(for_value);
+    Do(BuildAssertAssignable(
+        node->token_pos(), for_value.value(), type, dst_name));
+  }
+}
+
+
 void ValueGraphVisitor::BuildTypeCast(ComparisonNode* node) {
   ASSERT(Token::IsTypeCastOperator(node->kind()));
+  ASSERT(!node->right()->AsTypeNode()->type().IsNull());
   const AbstractType& type = node->right()->AsTypeNode()->type();
   ASSERT(type.IsFinalized());  // The type in a type cast may be malformed.
   ValueGraphVisitor for_value(owner(), temp_index());
@@ -1122,10 +1123,47 @@
   Append(for_value);
   const String& dst_name = String::ZoneHandle(
       Symbols::New(Exceptions::kCastErrorDstName));
-  ReturnValue(BuildAssignableValue(node->token_pos(),
-                                   for_value.value(),
-                                   type,
-                                   dst_name));
+  if (type.IsMalformed()) {
+    ReturnValue(BuildAssignableValue(node->token_pos(),
+                                     for_value.value(),
+                                     type,
+                                     dst_name));
+  } else {
+    if (CanSkipTypeCheck(node->token_pos(),
+                         for_value.value(),
+                         type,
+                         dst_name)) {
+      ReturnValue(for_value.value());
+      return;
+    }
+    PushArgumentInstr* push_left = PushArgument(for_value.value());
+    PushArgumentInstr* push_instantiator = NULL;
+    PushArgumentInstr* push_type_args = NULL;
+    if (type.IsInstantiated()) {
+      push_instantiator = PushArgument(BuildNullValue());
+      push_type_args = PushArgument(BuildNullValue());
+    } else {
+      BuildTypecheckPushArguments(node->token_pos(),
+                                  &push_instantiator,
+                                  &push_type_args);
+    }
+    ZoneGrowableArray<PushArgumentInstr*>* arguments =
+        new ZoneGrowableArray<PushArgumentInstr*>(4);
+    arguments->Add(push_left);
+    arguments->Add(push_instantiator);
+    arguments->Add(push_type_args);
+    Value* type_arg = Bind(new ConstantInstr(type));
+    arguments->Add(PushArgument(type_arg));
+    const intptr_t kNumArgsChecked = 1;
+    InstanceCallInstr* call = new InstanceCallInstr(
+        node->token_pos(),
+        PrivateCoreLibName(Symbols::_as()),
+        node->kind(),
+        arguments,
+        Array::ZoneHandle(),  // No argument names.
+        kNumArgsChecked);
+    ReturnDefinition(call);
+  }
 }
 
 
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 78a9460..825b381 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -318,12 +318,14 @@
     Do(definition);
   }
 
+ protected:
   // Returns true if the run-time type check can be eliminated.
   bool CanSkipTypeCheck(intptr_t token_pos,
                         Value* value,
                         const AbstractType& dst_type,
                         const String& dst_name);
 
+ private:
   // Shared global state.
   FlowGraphBuilder* owner_;
 
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 791412d..55add24 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -415,7 +415,8 @@
         //
         // FPU registers have the highest register number at the highest
         // address (i.e., first in the stackmap).
-        const intptr_t kFpuRegisterSpillFactor = kFpuRegisterSize / kWordSize;
+        const intptr_t kFpuRegisterSpillFactor =
+            FlowGraphAllocator::kFpuRegisterSpillFactor;
         for (intptr_t i = kNumberOfFpuRegisters - 1; i >= 0; --i) {
           FpuRegister reg = static_cast<FpuRegister>(i);
           if (regs->ContainsFpuRegister(reg)) {
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index ecbb548..db7e56a 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -19,6 +19,7 @@
 
 namespace dart {
 
+DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
 DECLARE_FLAG(int, optimization_counter_threshold);
 DECLARE_FLAG(bool, print_ast);
 DECLARE_FLAG(bool, print_scopes);
@@ -42,20 +43,42 @@
 
 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
                                              intptr_t stub_ix) {
-  UNIMPLEMENTED();
+  // Calls do not need stubs, they share a deoptimization trampoline.
+  ASSERT(reason() != kDeoptAtCall);
+  Assembler* assem = compiler->assembler();
+#define __ assem->
+  __ Comment("Deopt stub for id %"Pd"", deopt_id());
+  __ Bind(entry_label());
+  if (FLAG_trap_on_deoptimization) __ bkpt(0);
+
+  ASSERT(deoptimization_env() != NULL);
+
+  __ BranchLink(&StubCode::DeoptimizeLabel());
+  set_pc_offset(assem->CodeSize());
+#undef __
 }
 
 
 #define __ assembler()->
 
 
+// Fall through if bool_register contains null.
 void FlowGraphCompiler::GenerateBoolToJump(Register bool_register,
                                            Label* is_true,
                                            Label* is_false) {
-  UNIMPLEMENTED();
+  Label fall_through;
+  __ CompareImmediate(bool_register,
+                      reinterpret_cast<intptr_t>(Object::null()));
+  __ b(&fall_through, EQ);
+  __ CompareObject(bool_register, Bool::True());
+  __ b(is_true, EQ);
+  __ b(is_false);
+  __ Bind(&fall_through);
 }
 
 
+// R0: instance (must be preserved).
+// R1: instantiator type arguments (if used).
 RawSubtypeTestCache* FlowGraphCompiler::GenerateCallSubtypeTestStub(
     TypeTestStubKind test_kind,
     Register instance_reg,
@@ -63,8 +86,28 @@
     Register temp_reg,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
-  UNIMPLEMENTED();
-  return NULL;
+  ASSERT(instance_reg == R0);
+  ASSERT(temp_reg == kNoRegister);  // Unused on ARM.
+  const SubtypeTestCache& type_test_cache =
+      SubtypeTestCache::ZoneHandle(SubtypeTestCache::New());
+  __ LoadObject(R2, type_test_cache);
+  if (test_kind == kTestTypeOneArg) {
+    ASSERT(type_arguments_reg == kNoRegister);
+    __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+    __ BranchLink(&StubCode::Subtype1TestCacheLabel());
+  } else if (test_kind == kTestTypeTwoArgs) {
+    ASSERT(type_arguments_reg == kNoRegister);
+    __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+    __ BranchLink(&StubCode::Subtype2TestCacheLabel());
+  } else if (test_kind == kTestTypeThreeArgs) {
+    ASSERT(type_arguments_reg == R1);
+    __ BranchLink(&StubCode::Subtype3TestCacheLabel());
+  } else {
+    UNREACHABLE();
+  }
+  // Result is in R1: null -> not found, otherwise Bool::True or Bool::False.
+  GenerateBoolToJump(R1, is_instance_lbl, is_not_instance_lbl);
+  return type_test_cache.raw();
 }
 
 
@@ -155,13 +198,36 @@
 }
 
 
+// Uses SubtypeTestCache to store instance class and result.
+// R0: instance to test.
+// Clobbers R1-R5.
+// Immediate class test already done.
+// TODO(srdjan): Implement a quicker subtype check, as type test
+// arrays can grow too high, but they may be useful when optimizing
+// code (type-feedback).
 RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup(
     intptr_t token_pos,
     const Class& type_class,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
-  UNIMPLEMENTED();
-  return NULL;
+  __ Comment("Subtype1TestCacheLookup");
+  const Register kInstanceReg = R0;
+  __ LoadClass(R1, kInstanceReg, R2);
+  // R1: instance class.
+  // Check immediate superclass equality.
+  __ ldr(R2, FieldAddress(R1, Class::super_type_offset()));
+  __ ldr(R2, FieldAddress(R2, Type::type_class_offset()));
+  __ CompareObject(R2, type_class);
+  __ b(is_instance_lbl, EQ);
+
+  const Register kTypeArgumentsReg = kNoRegister;
+  const Register kTempReg = kNoRegister;
+  return GenerateCallSubtypeTestStub(kTestTypeOneArg,
+                                     kInstanceReg,
+                                     kTypeArgumentsReg,
+                                     kTempReg,
+                                     is_instance_lbl,
+                                     is_not_instance_lbl);
 }
 
 
@@ -834,7 +900,22 @@
                                             intptr_t deopt_id,
                                             const RuntimeEntry& entry,
                                             LocationSummary* locs) {
-  __ Unimplemented("call runtime");
+  __ CallRuntime(entry);
+  AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
+  RecordSafepoint(locs);
+  if (deopt_id != Isolate::kNoDeoptId) {
+    // Marks either the continuation point in unoptimized code or the
+    // deoptimization point in optimized code, after call.
+    if (is_optimizing()) {
+      AddDeoptIndexAtCall(deopt_id, token_pos);
+    } else {
+      // Add deoptimization continuation point after the call and before the
+      // arguments are removed.
+      AddCurrentDescriptor(PcDescriptors::kDeoptAfter,
+                           deopt_id,
+                           token_pos);
+    }
+  }
 }
 
 
@@ -908,7 +989,16 @@
 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
                                                   Register right,
                                                   bool needs_number_check) {
-  UNIMPLEMENTED();
+  if (needs_number_check) {
+    __ Push(left);
+    __ Push(right);
+    __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel());
+    // Stub returns result in flags (result of a cmpl, we need ZF computed).
+    __ Pop(right);
+    __ Pop(left);
+  } else {
+    __ cmp(left, ShifterOperand(right));
+  }
 }
 
 
@@ -1025,37 +1115,166 @@
 }
 
 
+#undef __
+#define __ compiler_->assembler()->
+
+
 void ParallelMoveResolver::EmitMove(int index) {
-  UNIMPLEMENTED();
+  MoveOperands* move = moves_[index];
+  const Location source = move->src();
+  const Location destination = move->dest();
+
+  if (source.IsRegister()) {
+    if (destination.IsRegister()) {
+      __ mov(destination.reg(), ShifterOperand(source.reg()));
+    } else {
+      ASSERT(destination.IsStackSlot());
+      __ str(source.reg(), destination.ToStackSlotAddress());
+    }
+  } else if (source.IsStackSlot()) {
+    if (destination.IsRegister()) {
+      __ ldr(destination.reg(), source.ToStackSlotAddress());
+    } else {
+      ASSERT(destination.IsStackSlot());
+      MoveMemoryToMemory(destination.ToStackSlotAddress(),
+                         source.ToStackSlotAddress());
+    }
+  } else if (source.IsFpuRegister()) {
+    if (destination.IsFpuRegister()) {
+      __ vmovd(destination.fpu_reg(), source.fpu_reg());
+    } else {
+      if (destination.IsDoubleStackSlot()) {
+        __ vstrd(source.fpu_reg(), destination.ToStackSlotAddress());
+      } else {
+        ASSERT(destination.IsFloat32x4StackSlot() ||
+               destination.IsUint32x4StackSlot());
+        UNIMPLEMENTED();
+      }
+    }
+  } else if (source.IsDoubleStackSlot()) {
+    if (destination.IsFpuRegister()) {
+      __ vldrd(destination.fpu_reg(), source.ToStackSlotAddress());
+    } else {
+      ASSERT(destination.IsDoubleStackSlot());
+      __ vldrd(FpuTMP, source.ToStackSlotAddress());
+      __ vstrd(FpuTMP, destination.ToStackSlotAddress());
+    }
+  } else if (source.IsFloat32x4StackSlot() || source.IsUint32x4StackSlot()) {
+    UNIMPLEMENTED();
+  } else {
+    ASSERT(source.IsConstant());
+    if (destination.IsRegister()) {
+      const Object& constant = source.constant();
+      __ LoadObject(destination.reg(), constant);
+    } else {
+      ASSERT(destination.IsStackSlot());
+      StoreObject(destination.ToStackSlotAddress(), source.constant());
+    }
+  }
+
+  move->Eliminate();
 }
 
 
 void ParallelMoveResolver::EmitSwap(int index) {
-  UNIMPLEMENTED();
+  MoveOperands* move = moves_[index];
+  const Location source = move->src();
+  const Location destination = move->dest();
+
+  if (source.IsRegister() && destination.IsRegister()) {
+    ASSERT(source.reg() != IP);
+    ASSERT(destination.reg() != IP);
+    __ mov(IP, ShifterOperand(source.reg()));
+    __ mov(source.reg(), ShifterOperand(destination.reg()));
+    __ mov(destination.reg(), ShifterOperand(IP));
+  } else if (source.IsRegister() && destination.IsStackSlot()) {
+    Exchange(source.reg(), destination.ToStackSlotAddress());
+  } else if (source.IsStackSlot() && destination.IsRegister()) {
+    Exchange(destination.reg(), source.ToStackSlotAddress());
+  } else if (source.IsStackSlot() && destination.IsStackSlot()) {
+    Exchange(destination.ToStackSlotAddress(), source.ToStackSlotAddress());
+  } else if (source.IsFpuRegister() && destination.IsFpuRegister()) {
+    __ vmovd(FpuTMP, source.fpu_reg());
+    __ vmovd(source.fpu_reg(), destination.fpu_reg());
+    __ vmovd(destination.fpu_reg(), FpuTMP);
+  } else if (source.IsFpuRegister() || destination.IsFpuRegister()) {
+    ASSERT(destination.IsDoubleStackSlot() ||
+           destination.IsFloat32x4StackSlot() ||
+           destination.IsUint32x4StackSlot() ||
+           source.IsDoubleStackSlot() ||
+           source.IsFloat32x4StackSlot() ||
+           source.IsUint32x4StackSlot());
+    bool double_width = destination.IsDoubleStackSlot() ||
+                        source.IsDoubleStackSlot();
+    DRegister reg = source.IsFpuRegister() ? source.fpu_reg()
+                                           : destination.fpu_reg();
+    const Address& slot_address = source.IsFpuRegister()
+        ? destination.ToStackSlotAddress()
+        : source.ToStackSlotAddress();
+
+    if (double_width) {
+      __ vldrd(FpuTMP, slot_address);
+      __ vstrd(reg, slot_address);
+      __ vmovd(reg, FpuTMP);
+    } else {
+      UNIMPLEMENTED();
+    }
+  } else {
+    UNREACHABLE();
+  }
+
+  // The swap of source and destination has executed a move from source to
+  // destination.
+  move->Eliminate();
+
+  // Any unperformed (including pending) move with a source of either
+  // this move's source or destination needs to have their source
+  // changed to reflect the state of affairs after the swap.
+  for (int i = 0; i < moves_.length(); ++i) {
+    const MoveOperands& other_move = *moves_[i];
+    if (other_move.Blocks(source)) {
+      moves_[i]->set_src(destination);
+    } else if (other_move.Blocks(destination)) {
+      moves_[i]->set_src(source);
+    }
+  }
 }
 
 
 void ParallelMoveResolver::MoveMemoryToMemory(const Address& dst,
                                               const Address& src) {
-  UNIMPLEMENTED();
+  __ ldr(IP, src);
+  __ str(IP, dst);
 }
 
 
 void ParallelMoveResolver::StoreObject(const Address& dst, const Object& obj) {
-  UNIMPLEMENTED();
+  __ LoadObject(IP, obj);
+  __ str(IP, dst);
 }
 
 
 void ParallelMoveResolver::Exchange(Register reg, const Address& mem) {
-  UNIMPLEMENTED();
+  ASSERT(reg != IP);
+  __ mov(IP, ShifterOperand(reg));
+  __ ldr(reg, mem);
+  __ str(IP, mem);
 }
 
 
 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
-  UNIMPLEMENTED();
+  // TODO(vegorov): allocate temporary registers for such moves.
+  __ Push(R0);
+  __ ldr(R0, mem1);
+  __ ldr(IP, mem2);
+  __ str(IP, mem1);
+  __ str(R0, mem2);
+  __ Pop(R0);
 }
 
 
+#undef __
+
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_ARM
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 37e3f3d..0113aeb 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1593,8 +1593,13 @@
       // to register moves.
       __ movaps(destination.fpu_reg(), source.fpu_reg());
     } else {
-      ASSERT(destination.IsDoubleStackSlot());
-      __ movsd(destination.ToStackSlotAddress(), source.fpu_reg());
+      if (destination.IsDoubleStackSlot()) {
+        __ movsd(destination.ToStackSlotAddress(), source.fpu_reg());
+      } else {
+        ASSERT(destination.IsFloat32x4StackSlot() ||
+               destination.IsUint32x4StackSlot());
+        __ movups(destination.ToStackSlotAddress(), source.fpu_reg());
+      }
     }
   } else if (source.IsDoubleStackSlot()) {
     if (destination.IsFpuRegister()) {
@@ -1604,6 +1609,15 @@
       __ movsd(XMM0, source.ToStackSlotAddress());
       __ movsd(destination.ToStackSlotAddress(), XMM0);
     }
+  } else if (source.IsFloat32x4StackSlot() || source.IsUint32x4StackSlot()) {
+    if (destination.IsFpuRegister()) {
+      __ movups(destination.fpu_reg(), source.ToStackSlotAddress());
+    } else {
+      ASSERT(destination.IsFloat32x4StackSlot() ||
+             destination.IsUint32x4StackSlot());
+      __ movups(XMM0, source.ToStackSlotAddress());
+      __ movups(destination.ToStackSlotAddress(), XMM0);
+    }
   } else {
     ASSERT(source.IsConstant());
     if (destination.IsRegister()) {
@@ -1641,15 +1655,27 @@
     __ movaps(source.fpu_reg(), destination.fpu_reg());
     __ movaps(destination.fpu_reg(), XMM0);
   } else if (source.IsFpuRegister() || destination.IsFpuRegister()) {
-    ASSERT(destination.IsDoubleStackSlot() || source.IsDoubleStackSlot());
+    ASSERT(destination.IsDoubleStackSlot() ||
+           destination.IsFloat32x4StackSlot() ||
+           destination.IsUint32x4StackSlot() ||
+           source.IsDoubleStackSlot() ||
+           source.IsFloat32x4StackSlot() ||
+           source.IsUint32x4StackSlot());
+    bool double_width = destination.IsDoubleStackSlot() ||
+                        source.IsDoubleStackSlot();
     XmmRegister reg = source.IsFpuRegister() ? source.fpu_reg()
                                              : destination.fpu_reg();
     const Address& slot_address = source.IsFpuRegister()
         ? destination.ToStackSlotAddress()
         : source.ToStackSlotAddress();
 
-    __ movsd(XMM0, slot_address);
-    __ movsd(slot_address, reg);
+    if (double_width) {
+      __ movsd(XMM0, slot_address);
+      __ movsd(slot_address, reg);
+    } else {
+      __ movups(XMM0, slot_address);
+      __ movups(slot_address, reg);
+    }
     __ movaps(reg, XMM0);
   } else {
     UNREACHABLE();
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 1a88c4d..778ffcd 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -23,6 +23,7 @@
 DECLARE_FLAG(bool, print_ast);
 DECLARE_FLAG(bool, print_scopes);
 DECLARE_FLAG(bool, enable_type_checks);
+DECLARE_FLAG(bool, eliminate_type_checks);
 
 
 FlowGraphCompiler::~FlowGraphCompiler() {
@@ -82,17 +83,75 @@
                                       const GrowableArray<intptr_t>& class_ids,
                                       Label* is_equal_lbl,
                                       Label* is_not_equal_lbl) {
-  UNIMPLEMENTED();
+  for (intptr_t i = 0; i < class_ids.length(); i++) {
+    __ LoadImmediate(TMP, class_ids[i]);
+    __ beq(class_id_reg, TMP, is_equal_lbl);
+  }
+  __ b(is_not_equal_lbl);
 }
 
 
+// Testing against an instantiated type with no arguments, without
+// SubtypeTestCache.
+// A0: instance being type checked (preserved).
+// Clobbers: T0, T1, T2
+// Returns true if there is a fallthrough.
 bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
     intptr_t token_pos,
     const AbstractType& type,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
-  UNIMPLEMENTED();
-  return false;
+  __ Comment("InstantiatedTypeNoArgumentsTest");
+  ASSERT(type.IsInstantiated());
+  const Class& type_class = Class::Handle(type.type_class());
+  ASSERT(!type_class.HasTypeArguments());
+
+  const Register kInstanceReg = A0;
+  __ andi(T0, A0, Immediate(kSmiTagMask));
+  // If instance is Smi, check directly.
+  const Class& smi_class = Class::Handle(Smi::Class());
+  if (smi_class.IsSubtypeOf(TypeArguments::Handle(),
+                            type_class,
+                            TypeArguments::Handle(),
+                            NULL)) {
+    __ beq(T0, ZR, is_instance_lbl);
+  } else {
+    __ beq(T0, ZR, is_not_instance_lbl);
+  }
+  // Compare if the classes are equal.
+  const Register kClassIdReg = T0;
+  __ LoadClassId(kClassIdReg, kInstanceReg);
+  __ LoadImmediate(T1, type_class.id());
+  __ beq(kClassIdReg, T1, is_instance_lbl);
+  // See ClassFinalizer::ResolveSuperTypeAndInterfaces for list of restricted
+  // interfaces.
+  // Bool interface can be implemented only by core class Bool.
+  if (type.IsBoolType()) {
+    __ LoadImmediate(T1, kBoolCid);
+    __ beq(kClassIdReg, T1, is_instance_lbl);
+    __ b(is_not_instance_lbl);
+    return false;
+  }
+  if (type.IsFunctionType()) {
+    // Check if instance is a closure.
+    __ LoadClassById(T1, kClassIdReg);
+    __ lw(T1, FieldAddress(T1, Class::signature_function_offset()));
+    __ LoadImmediate(T2, reinterpret_cast<int32_t>(Object::null()));
+    __ bne(T1, T2, is_instance_lbl);
+  }
+  // Custom checking for numbers (Smi, Mint, Bigint and Double).
+  // Note that instance is not Smi (checked above).
+  if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) {
+    GenerateNumberTypeCheck(
+        kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
+    return false;
+  }
+  if (type.IsStringType()) {
+    GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl);
+    return false;
+  }
+  // Otherwise fallthrough.
+  return true;
 }
 
 
@@ -116,13 +175,71 @@
 }
 
 
+// Inputs:
+// - A0: instance being type checked (preserved).
+// - A1: optional instantiator type arguments (preserved).
+// Returns:
+// - preserved instance in A0 and optional instantiator type arguments in A1.
+// Clobbers: T0, T1, T2
+// Note that this inlined code must be followed by the runtime_call code, as it
+// may fall through to it. Otherwise, this inline code will jump to the label
+// is_instance or to the label is_not_instance.
 RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof(
     intptr_t token_pos,
     const AbstractType& type,
     Label* is_instance_lbl,
     Label* is_not_instance_lbl) {
-  UNIMPLEMENTED();
-  return NULL;
+  __ Comment("InlineInstanceof");
+  if (type.IsVoidType()) {
+    // A non-null value is returned from a void function, which will result in a
+    // type error. A null value is handled prior to executing this inline code.
+    return SubtypeTestCache::null();
+  }
+  if (TypeCheckAsClassEquality(type)) {
+    const intptr_t type_cid = Class::Handle(type.type_class()).id();
+    const Register kInstanceReg = A0;
+    __ andi(T0, kInstanceReg, Immediate(kSmiTagMask));
+    if (type_cid == kSmiCid) {
+      __ beq(T0, ZR, is_instance_lbl);
+    } else {
+      __ beq(T0, ZR, is_not_instance_lbl);
+      __ LoadClassId(T0, kInstanceReg);
+      __ LoadImmediate(T1, type_cid);
+      __ beq(T0, T1, is_instance_lbl);
+    }
+    __ b(is_not_instance_lbl);
+    return SubtypeTestCache::null();
+  }
+  if (type.IsInstantiated()) {
+    const Class& type_class = Class::ZoneHandle(type.type_class());
+    // A Smi object cannot be the instance of a parameterized class.
+    // A class equality check is only applicable with a dst type of a
+    // non-parameterized class or with a raw dst type of a parameterized class.
+    if (type_class.HasTypeArguments()) {
+      return GenerateInstantiatedTypeWithArgumentsTest(token_pos,
+                                                       type,
+                                                       is_instance_lbl,
+                                                       is_not_instance_lbl);
+      // Fall through to runtime call.
+    }
+    const bool has_fall_through =
+        GenerateInstantiatedTypeNoArgumentsTest(token_pos,
+                                                type,
+                                                is_instance_lbl,
+                                                is_not_instance_lbl);
+    if (has_fall_through) {
+      // If test non-conclusive so far, try the inlined type-test cache.
+      // 'type' is known at compile time.
+      return GenerateSubtype1TestCacheLookup(
+          token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
+    } else {
+      return SubtypeTestCache::null();
+    }
+  }
+  return GenerateUninstantiatedTypeTest(token_pos,
+                                        type,
+                                        is_instance_lbl,
+                                        is_not_instance_lbl);
 }
 
 
@@ -135,12 +252,101 @@
 }
 
 
+// Optimize assignable type check by adding inlined tests for:
+// - NULL -> return NULL.
+// - Smi -> compile time subtype check (only if dst class is not parameterized).
+// - Class equality (only if class is not parameterized).
+// Inputs:
+// - A0: instance being type checked.
+// - A1: instantiator type arguments or raw_null.
+// - A2: instantiator or raw_null.
+// Returns:
+// - object in A0 for successful assignable check (or throws TypeError).
+// Clobbers: T0, T1, T2
+// Performance notes: positive checks must be quick, negative checks can be slow
+// as they throw an exception.
 void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
                                                  intptr_t deopt_id,
                                                  const AbstractType& dst_type,
                                                  const String& dst_name,
                                                  LocationSummary* locs) {
-  UNIMPLEMENTED();
+  ASSERT(token_pos >= 0);
+  ASSERT(!dst_type.IsNull());
+  ASSERT(dst_type.IsFinalized());
+  // Assignable check is skipped in FlowGraphBuilder, not here.
+  ASSERT(dst_type.IsMalformed() ||
+         (!dst_type.IsDynamicType() && !dst_type.IsObjectType()));
+  // Preserve instantiator and its type arguments.
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(A2, Address(SP, 1 * kWordSize));
+  __ sw(A1, Address(SP, 0 * kWordSize));
+  // A null object is always assignable and is returned as result.
+  Label is_assignable, runtime_call;
+  __ LoadImmediate(T0, reinterpret_cast<int32_t>(Object::null()));
+  __ beq(A0, T0, &is_assignable);
+
+  if (!FLAG_eliminate_type_checks) {
+    // If type checks are not eliminated during the graph building then
+    // a transition sentinel can be seen here.
+    __ LoadObject(T0, Object::transition_sentinel());
+    __ beq(A0, T0, &is_assignable);
+  }
+
+  // Generate throw new TypeError() if the type is malformed.
+  if (dst_type.IsMalformed()) {
+    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);
+    GenerateCallRuntime(token_pos,
+                        deopt_id,
+                        kMalformedTypeErrorRuntimeEntry,
+                        locs);
+    // We should never return here.
+    __ break_(0);
+
+    __ Bind(&is_assignable);  // For a null object.
+    // Restore instantiator and its type arguments.
+    __ lw(A1, Address(SP, 0 * kWordSize));
+    __ lw(A2, Address(SP, 1 * kWordSize));
+    __ addiu(SP, SP, Immediate(2 * kWordSize));
+    return;
+  }
+
+  // Generate inline type check, linking to runtime call if not assignable.
+  SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle();
+  test_cache = GenerateInlineInstanceof(token_pos, dst_type,
+                                        &is_assignable, &runtime_call);
+
+  __ Bind(&runtime_call);
+  // Load instantiator and its type arguments.
+  __ 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.
+  __ LoadObject(A0, test_cache);
+  __ Push(A0);
+  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);
+
+  __ Bind(&is_assignable);
+  // Restore instantiator and its type arguments.
+    __ lw(A1, Address(SP, 0 * kWordSize));
+    __ lw(A2, Address(SP, 1 * kWordSize));
+    __ addiu(SP, SP, Immediate(2 * kWordSize));
 }
 
 
@@ -166,8 +372,234 @@
 }
 
 
+// Input parameters:
+//   S4: arguments descriptor array.
 void FlowGraphCompiler::CopyParameters() {
-  UNIMPLEMENTED();
+  __ Comment("Copy parameters");
+  const Function& function = parsed_function().function();
+  LocalScope* scope = parsed_function().node_sequence()->scope();
+  const int num_fixed_params = function.num_fixed_parameters();
+  const int num_opt_pos_params = function.NumOptionalPositionalParameters();
+  const int num_opt_named_params = function.NumOptionalNamedParameters();
+  const int num_params =
+      num_fixed_params + num_opt_pos_params + num_opt_named_params;
+  ASSERT(function.NumParameters() == num_params);
+  ASSERT(parsed_function().first_parameter_index() == kFirstLocalSlotIndex);
+
+  // Check that min_num_pos_args <= num_pos_args <= max_num_pos_args,
+  // where num_pos_args is the number of positional arguments passed in.
+  const int min_num_pos_args = num_fixed_params;
+  const int max_num_pos_args = num_fixed_params + num_opt_pos_params;
+
+  __ lw(T2, FieldAddress(S4, ArgumentsDescriptor::positional_count_offset()));
+  // Check that min_num_pos_args <= num_pos_args.
+  Label wrong_num_arguments;
+  __ addiu(T3, T2, Immediate(-Smi::RawValue(min_num_pos_args)));
+  __ bltz(T3, &wrong_num_arguments);
+
+  // Check that num_pos_args <= max_num_pos_args.
+  __ addiu(T3, T2, Immediate(-Smi::RawValue(max_num_pos_args)));
+  __ bgtz(T3, &wrong_num_arguments);
+
+  // Copy positional arguments.
+  // Argument i passed at fp[kLastParamSlotIndex + num_args - 1 - i] is copied
+  // to fp[kFirstLocalSlotIndex - i].
+
+  __ lw(T1, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
+  // Since T1 and T2 are Smi, use LSL 1 instead of LSL 2.
+  // Let T1 point to the last passed positional argument, i.e. to
+  // fp[kLastParamSlotIndex + num_args - 1 - (num_pos_args - 1)].
+  __ subu(T1, T1, T2);
+  __ sll(T1, T1, 1);
+  __ addu(T1, FP, T1);
+  __ addiu(T1, T1, Immediate(kLastParamSlotIndex * kWordSize));
+
+  // Let T0 point to the last copied positional argument, i.e. to
+  // fp[kFirstLocalSlotIndex - (num_pos_args - 1)].
+  __ addiu(T0, FP, Immediate((kFirstLocalSlotIndex + 1) * kWordSize));
+  __ sll(T3, T2, 1);  // T2 is a Smi.
+  __ subu(T0, T0, T3);
+
+  Label loop, loop_condition;
+  __ b(&loop_condition);
+  __ delay_slot()->SmiUntag(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.
+  __ Bind(&loop);
+  __ addu(T4, T1, T2);
+  __ addu(T5, T0, T2);
+  __ lw(TMP, Address(T4));
+  __ sw(TMP, Address(T5));
+  __ Bind(&loop_condition);
+  __ addiu(T2, T2, Immediate(-kWordSize));
+  __ bgez(T2, &loop);
+
+  // Copy or initialize optional named arguments.
+  Label all_arguments_processed;
+  if (num_opt_named_params > 0) {
+    // Start by alphabetically sorting the names of the optional parameters.
+    LocalVariable** opt_param = new LocalVariable*[num_opt_named_params];
+    int* opt_param_position = new int[num_opt_named_params];
+    for (int pos = num_fixed_params; pos < num_params; pos++) {
+      LocalVariable* parameter = scope->VariableAt(pos);
+      const String& opt_param_name = parameter->name();
+      int i = pos - num_fixed_params;
+      while (--i >= 0) {
+        LocalVariable* param_i = opt_param[i];
+        const intptr_t result = opt_param_name.CompareTo(param_i->name());
+        ASSERT(result != 0);
+        if (result > 0) break;
+        opt_param[i + 1] = opt_param[i];
+        opt_param_position[i + 1] = opt_param_position[i];
+      }
+      opt_param[i + 1] = parameter;
+      opt_param_position[i + 1] = pos;
+    }
+    // Generate code handling each optional parameter in alphabetical order.
+    __ lw(T1, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
+    __ lw(T2, FieldAddress(S4, ArgumentsDescriptor::positional_count_offset()));
+    __ SmiUntag(T2);
+    // Let T1 point to the first passed argument, i.e. to
+    // fp[kLastParamSlotIndex + num_args - 1 - 0]; num_args (T1) is Smi.
+    __ sll(T3, T1, 1);
+    __ addu(T1, FP, T3);
+    __ addiu(T1, T1, Immediate((kLastParamSlotIndex - 1) * kWordSize));
+    // Let T0 point to the entry of the first named argument.
+    __ addiu(T0, S4, Immediate(
+        ArgumentsDescriptor::first_named_entry_offset() - kHeapObjectTag));
+    for (int i = 0; i < num_opt_named_params; i++) {
+      Label load_default_value, assign_optional_parameter;
+      const int param_pos = opt_param_position[i];
+      // Check if this named parameter was passed in.
+      // Load T3 with the name of the argument.
+      __ lw(T3, Address(T0, ArgumentsDescriptor::name_offset()));
+      ASSERT(opt_param[i]->name().IsSymbol());
+      __ LoadObject(T4, opt_param[i]->name());
+      __ bne(T3, T4, &load_default_value);
+
+      // Load T3 with passed-in argument at provided arg_pos, i.e. at
+      // fp[kLastParamSlotIndex + num_args - 1 - arg_pos].
+      __ lw(T3, Address(T0, ArgumentsDescriptor::position_offset()));
+      // T3 is arg_pos as Smi.
+      // Point to next named entry.
+      __ addiu(T0, T0, Immediate(ArgumentsDescriptor::named_entry_size()));
+      __ subu(T3, ZR, T3);
+      __ sll(T3, T3, 1);
+      __ addu(T3, T1, T3);
+      __ b(&assign_optional_parameter);
+      __ delay_slot()->lw(T3, Address(T3));
+
+      __ Bind(&load_default_value);
+      // Load T3 with default argument.
+      const Object& value = Object::ZoneHandle(
+          parsed_function().default_parameter_values().At(
+              param_pos - num_fixed_params));
+      __ LoadObject(T3, value);
+      __ Bind(&assign_optional_parameter);
+      // Assign T3 to fp[kFirstLocalSlotIndex - param_pos].
+      // 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.
+      const intptr_t computed_param_pos = kFirstLocalSlotIndex - param_pos;
+      __ sw(T3, Address(FP, computed_param_pos * kWordSize));
+    }
+    delete[] opt_param;
+    delete[] opt_param_position;
+    // Check that T0 now points to the null terminator in the array descriptor.
+    __ lw(T3, Address(T0));
+    __ LoadImmediate(T4, reinterpret_cast<int32_t>(Object::null()));
+    __ beq(T3, T4, &all_arguments_processed);
+  } else {
+    ASSERT(num_opt_pos_params > 0);
+    __ lw(T2,
+          FieldAddress(S4, ArgumentsDescriptor::positional_count_offset()));
+    __ SmiUntag(T2);
+    for (int i = 0; i < num_opt_pos_params; i++) {
+      Label next_parameter;
+      // Handle this optional positional parameter only if k or fewer positional
+      // arguments have been passed, where k is param_pos, the position of this
+      // optional parameter in the formal parameter list.
+      const int param_pos = num_fixed_params + i;
+      __ addiu(T3, T2, Immediate(-param_pos));
+      __ bgtz(T3, &next_parameter);
+      // Load T3 with default argument.
+      const Object& value = Object::ZoneHandle(
+          parsed_function().default_parameter_values().At(i));
+      __ LoadObject(T3, value);
+      // Assign T3 to fp[kFirstLocalSlotIndex - param_pos].
+      // 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.
+      const intptr_t computed_param_pos = kFirstLocalSlotIndex - param_pos;
+      __ sw(T3, Address(FP, computed_param_pos * kWordSize));
+      __ Bind(&next_parameter);
+    }
+    __ lw(T1, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
+    __ SmiUntag(T1);
+    // Check that T2 equals T1, i.e. no named arguments passed.
+    __ beq(T2, T2, &all_arguments_processed);
+  }
+
+  __ Bind(&wrong_num_arguments);
+  if (StackSize() != 0) {
+    // We need to unwind the space we reserved for locals and copied parameters.
+    // The NoSuchMethodFunction stub does not expect to see that area on the
+    // stack.
+    __ addiu(SP, SP, Immediate(StackSize() * kWordSize));
+  }
+  // The call below has an empty stackmap because we have just
+  // dropped the spill slots.
+  BitmapBuilder* empty_stack_bitmap = new BitmapBuilder();
+
+  // Invoke noSuchMethod function passing the original name of the function.
+  // If the function is a closure function, use "call" as the original name.
+  const String& name = String::Handle(
+      function.IsClosureFunction() ? Symbols::Call().raw() : function.name());
+  const int kNumArgsChecked = 1;
+  const ICData& ic_data = ICData::ZoneHandle(
+      ICData::New(function, name, Isolate::kNoDeoptId, kNumArgsChecked));
+  __ LoadObject(S5, ic_data);
+  // FP - 4 : saved PP, object pool pointer of caller.
+  // FP + 0 : previous frame pointer.
+  // FP + 4 : return address.
+  // FP + 8 : PC marker, for easy identification of RawInstruction obj.
+  // FP + 12: last argument (arg n-1).
+  // SP + 0 : saved PP.
+  // SP + 16 + 4*(n-1) : first argument (arg 0).
+  // S5 : ic-data.
+  // S4 : arguments descriptor array.
+  __ BranchLink(&StubCode::CallNoSuchMethodFunctionLabel());
+  if (is_optimizing()) {
+    stackmap_table_builder_->AddEntry(assembler()->CodeSize(),
+                                      empty_stack_bitmap,
+                                      0);  // No registers.
+  }
+  // The noSuchMethod call may return.
+  __ LeaveDartFrame();
+  __ Ret();
+
+  __ Bind(&all_arguments_processed);
+  // Nullify originally passed arguments only after they have been copied and
+  // checked, otherwise noSuchMethod would not see their original values.
+  // This step can be skipped in case we decide that formal parameters are
+  // implicitly final, since garbage collecting the unmodified value is not
+  // an issue anymore.
+
+  // S4 : arguments descriptor array.
+  __ lw(T2, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
+  __ SmiUntag(T2);
+
+  __ LoadImmediate(TMP, 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(TMP, Address(T3));
+  __ Bind(&null_args_loop_condition);
+  __ addiu(T2, T2, Immediate(-kWordSize));
+  __ bgez(T2, &null_args_loop);
 }
 
 
@@ -252,6 +684,7 @@
   __ EnterDartFrame((StackSize() * kWordSize));
 }
 
+
 // Input parameters:
 //   RA: return address.
 //   SP: address of last argument.
@@ -404,7 +837,9 @@
                                      const ExternalLabel* label,
                                      PcDescriptors::Kind kind,
                                      LocationSummary* locs) {
-  UNIMPLEMENTED();
+  __ BranchLinkPatchable(label);
+  AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
+  RecordSafepoint(locs);
 }
 
 
@@ -413,7 +848,20 @@
                                          const ExternalLabel* label,
                                          PcDescriptors::Kind kind,
                                          LocationSummary* locs) {
-  UNIMPLEMENTED();
+  __ BranchLinkPatchable(label);
+  AddCurrentDescriptor(kind, deopt_id, token_pos);
+  RecordSafepoint(locs);
+  // Marks either the continuation point in unoptimized code or the
+  // deoptimization point in optimized code, after call.
+  if (is_optimizing()) {
+    AddDeoptIndexAtCall(deopt_id, token_pos);
+  } else {
+    // Add deoptimization continuation point after the call and before the
+    // arguments are removed.
+    AddCurrentDescriptor(PcDescriptors::kDeoptAfter,
+                         deopt_id,
+                         token_pos);
+  }
 }
 
 
@@ -444,7 +892,14 @@
                                          intptr_t deopt_id,
                                          intptr_t token_pos,
                                          LocationSummary* locs) {
-  UNIMPLEMENTED();
+  __ LoadObject(S4, arguments_descriptor);
+  __ LoadObject(S5, ic_data);
+  GenerateDartCall(deopt_id,
+                   token_pos,
+                   target_label,
+                   PcDescriptors::kIcCall,
+                   locs);
+  __ Drop(argument_count);
 }
 
 
@@ -465,7 +920,16 @@
                                        intptr_t deopt_id,
                                        intptr_t token_pos,
                                        LocationSummary* locs) {
-  UNIMPLEMENTED();
+  __ 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.
+  GenerateDartCall(deopt_id,
+                   token_pos,
+                   &StubCode::CallStaticFunctionLabel(),
+                   PcDescriptors::kFuncCall,
+                   locs);
+  AddStaticCallTarget(function);
+  __ Drop(argument_count);
 }
 
 
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index bc5181d..b4da30b 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -1593,8 +1593,13 @@
       // to register moves.
       __ movaps(destination.fpu_reg(), source.fpu_reg());
     } else {
-      ASSERT(destination.IsDoubleStackSlot());
-      __ movsd(destination.ToStackSlotAddress(), source.fpu_reg());
+      if (destination.IsDoubleStackSlot()) {
+        __ movsd(destination.ToStackSlotAddress(), source.fpu_reg());
+      } else {
+        ASSERT(destination.IsFloat32x4StackSlot() ||
+               destination.IsUint32x4StackSlot());
+        __ movups(destination.ToStackSlotAddress(), source.fpu_reg());
+      }
     }
   } else if (source.IsDoubleStackSlot()) {
     if (destination.IsFpuRegister()) {
@@ -1604,6 +1609,15 @@
       __ movsd(XMM0, source.ToStackSlotAddress());
       __ movsd(destination.ToStackSlotAddress(), XMM0);
     }
+  } else if (source.IsFloat32x4StackSlot() || source.IsUint32x4StackSlot()) {
+    if (destination.IsFpuRegister()) {
+      __ movups(destination.fpu_reg(), source.ToStackSlotAddress());
+    } else {
+      ASSERT(destination.IsFloat32x4StackSlot() ||
+             destination.IsUint32x4StackSlot());
+      __ movups(XMM0, source.ToStackSlotAddress());
+      __ movups(destination.ToStackSlotAddress(), XMM0);
+    }
   } else {
     ASSERT(source.IsConstant());
     if (destination.IsRegister()) {
@@ -1641,15 +1655,27 @@
     __ movaps(source.fpu_reg(), destination.fpu_reg());
     __ movaps(destination.fpu_reg(), XMM0);
   } else if (source.IsFpuRegister() || destination.IsFpuRegister()) {
-    ASSERT(destination.IsDoubleStackSlot() || source.IsDoubleStackSlot());
+    ASSERT(destination.IsDoubleStackSlot() ||
+           destination.IsFloat32x4StackSlot() ||
+           destination.IsUint32x4StackSlot() ||
+           source.IsDoubleStackSlot() ||
+           source.IsFloat32x4StackSlot() ||
+           source.IsUint32x4StackSlot());
+    bool double_width = destination.IsDoubleStackSlot() ||
+                        source.IsDoubleStackSlot();
     XmmRegister reg = source.IsFpuRegister() ? source.fpu_reg()
                                              : destination.fpu_reg();
     Address slot_address = source.IsFpuRegister()
         ? destination.ToStackSlotAddress()
         : source.ToStackSlotAddress();
 
-    __ movsd(XMM0, slot_address);
-    __ movsd(slot_address, reg);
+    if (double_width) {
+      __ movsd(XMM0, slot_address);
+      __ movsd(slot_address, reg);
+    } else {
+      __ movups(XMM0, slot_address);
+      __ movups(slot_address, reg);
+    }
     __ movaps(reg, XMM0);
   } else {
     UNREACHABLE();
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 7df257b..bcd752c 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -21,6 +21,9 @@
 
 DEFINE_FLAG(bool, array_bounds_check_elimination, true,
     "Eliminate redundant bounds checks.");
+// TODO(srdjan): Enable/remove flag once it works.
+DEFINE_FLAG(bool, inline_getter_with_guarded_cid, false,
+    "Inline implict getter using guarded cid");
 DEFINE_FLAG(bool, load_cse, true, "Use redundant load elimination.");
 DEFINE_FLAG(int, max_polymorphic_checks, 4,
     "Maximum number of polymorphic check, otherwise it is megamorphic.");
@@ -38,13 +41,15 @@
 
 
 
+// Optimize instance calls using ICData.
 void FlowGraphOptimizer::ApplyICData() {
   VisitBlocks();
 }
 
 
+// Optimize instance calls using cid.
 // Attempts to convert an instance call (IC call) using propagated class-ids,
-// e.g., receiver class id.
+// e.g., receiver class id, guarded-cid.
 void FlowGraphOptimizer::ApplyClassIds() {
   ASSERT(current_iterator_ == NULL);
   for (intptr_t i = 0; i < block_order_.length(); ++i) {
@@ -1205,6 +1210,17 @@
   // can't deoptimize.
   call->RemoveEnvironment();
   ReplaceCall(call, load);
+
+  if (FLAG_inline_getter_with_guarded_cid) {
+    if (load->result_cid() != kDynamicCid) {
+      // Reset value types if guarded_cid was used.
+      for (Value::Iterator it(load->input_use_list());
+           !it.Done();
+           it.Advance()) {
+        it.Current()->SetReachingType(NULL);
+      }
+    }
+  }
 }
 
 
@@ -1835,6 +1851,46 @@
 }
 
 
+void FlowGraphOptimizer::ReplaceWithTypeCast(InstanceCallInstr* call) {
+  ASSERT(Token::IsTypeCastOperator(call->token_kind()));
+  Definition* left = call->ArgumentAt(0);
+  Definition* instantiator = call->ArgumentAt(1);
+  Definition* type_args = call->ArgumentAt(2);
+  const AbstractType& type =
+      AbstractType::Cast(call->ArgumentAt(3)->AsConstant()->value());
+  ASSERT(!type.IsMalformed());
+  const ICData& unary_checks =
+      ICData::ZoneHandle(call->ic_data()->AsUnaryClassChecks());
+  if (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks) {
+    Bool& as_bool = Bool::ZoneHandle(InstanceOfAsBool(unary_checks, type));
+    if (as_bool.raw() == Bool::True().raw()) {
+      AddReceiverCheck(call);
+      // Remove the original push arguments.
+      for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
+        PushArgumentInstr* push = call->PushArgumentAt(i);
+        push->ReplaceUsesWith(push->value()->definition());
+        push->RemoveFromGraph();
+      }
+      // Remove call, replace it with 'left'.
+      call->ReplaceUsesWith(left);
+      call->RemoveFromGraph();
+      return;
+    }
+  }
+  const String& dst_name = String::ZoneHandle(
+      Symbols::New(Exceptions::kCastErrorDstName));
+  AssertAssignableInstr* assert_as =
+      new AssertAssignableInstr(call->token_pos(),
+                                new Value(left),
+                                new Value(instantiator),
+                                new Value(type_args),
+                                type,
+                                dst_name);
+  assert_as->deopt_id_ = call->deopt_id();
+  ReplaceCall(call, assert_as);
+}
+
+
 // Tries to optimize instance call by replacing it with a faster instruction
 // (e.g, binary op, field load, ..).
 void FlowGraphOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
@@ -1849,6 +1905,11 @@
     return;
   }
 
+  if (Token::IsTypeCastOperator(op_kind)) {
+    ReplaceWithTypeCast(instr);
+    return;
+  }
+
   const ICData& unary_checks =
       ICData::ZoneHandle(instr->ic_data()->AsUnaryClassChecks());
 
@@ -2432,7 +2493,10 @@
                             branch->true_successor());
     // Mark true_constraint an artificial use of boundary. This ensures
     // that constraint's range is recalculated if boundary's range changes.
-    if (true_constraint != NULL) true_constraint->AddDependency(boundary);
+    if (true_constraint != NULL) {
+      true_constraint->AddDependency(boundary);
+      true_constraint->set_target(branch->true_successor());
+    }
 
     // Constrain definition with a negated condition at the false successor.
     ConstraintInstr* false_constraint =
@@ -2442,7 +2506,10 @@
             branch->false_successor());
     // Mark false_constraint an artificial use of boundary. This ensures
     // that constraint's range is recalculated if boundary's range changes.
-    if (false_constraint != NULL) false_constraint->AddDependency(boundary);
+    if (false_constraint != NULL) {
+      false_constraint->AddDependency(boundary);
+      false_constraint->set_target(branch->false_successor());
+    }
   }
 }
 
@@ -2479,18 +2546,16 @@
 void RangeAnalysis::InsertConstraints() {
   for (intptr_t i = 0; i < smi_checks_.length(); i++) {
     CheckSmiInstr* check = smi_checks_[i];
-    ConstraintInstr* constraint =
-        InsertConstraintFor(check->value()->definition(),
-                            Range::Unknown(),
-                            check);
-    if (constraint != NULL) {
-      InsertConstraintsFor(constraint);  // Constrain uses further.
-    }
+    InsertConstraintFor(check->value()->definition(), Range::Unknown(), check);
   }
 
   for (intptr_t i = 0; i < smi_values_.length(); i++) {
     InsertConstraintsFor(smi_values_[i]);
   }
+
+  for (intptr_t i = 0; i < constraints_.length(); i++) {
+    InsertConstraintsFor(constraints_[i]);
+  }
 }
 
 
@@ -3575,6 +3640,14 @@
 }
 
 
+void ConstantPropagator::OptimizeBranches(FlowGraph* graph) {
+  GrowableArray<BlockEntryInstr*> ignored;
+  ConstantPropagator cp(graph, ignored);
+  cp.VisitBranches();
+  cp.Transform();
+}
+
+
 void ConstantPropagator::SetReachable(BlockEntryInstr* block) {
   if (!reachable_->Contains(block->preorder_number())) {
     reachable_->Add(block->preorder_number());
@@ -4293,6 +4366,40 @@
 }
 
 
+void ConstantPropagator::VisitBranches() {
+  GraphEntryInstr* entry = graph_->graph_entry();
+  reachable_->Add(entry->preorder_number());
+  // TODO(fschneider): Handle CatchEntry.
+  reachable_->Add(entry->normal_entry()->preorder_number());
+  block_worklist_.Add(entry->normal_entry());
+
+  while (!block_worklist_.is_empty()) {
+    BlockEntryInstr* block = block_worklist_.RemoveLast();
+    Instruction* last = block->last_instruction();
+    if (last->IsGoto()) {
+      SetReachable(last->AsGoto()->successor());
+    } else if (last->IsBranch()) {
+      BranchInstr* branch = last->AsBranch();
+      // The current block must be reachable.
+      ASSERT(reachable_->Contains(branch->GetBlock()->preorder_number()));
+      if (branch->constant_target() != NULL) {
+        // Found constant target computed by range analysis.
+        if (branch->constant_target() == branch->true_successor()) {
+          SetReachable(branch->true_successor());
+        } else {
+          ASSERT(branch->constant_target() == branch->false_successor());
+          SetReachable(branch->false_successor());
+        }
+      } else {
+        // No new information: Assume both targets are reachable.
+        SetReachable(branch->true_successor());
+        SetReachable(branch->false_successor());
+      }
+    }
+  }
+}
+
+
 void ConstantPropagator::Transform() {
   if (FLAG_trace_constant_propagation) {
     OS::Print("\n==== Before constant propagation ====\n");
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index a0cad62..03d623d 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -80,6 +80,7 @@
 
   bool TryInlineInstanceMethod(InstanceCallInstr* call);
   void ReplaceWithInstanceOf(InstanceCallInstr* instr);
+  void ReplaceWithTypeCast(InstanceCallInstr* instr);
 
   LoadIndexedInstr* BuildStringCodeUnitAt(InstanceCallInstr* call,
                                           intptr_t cid);
@@ -213,11 +214,16 @@
 
   static void Optimize(FlowGraph* graph);
 
+  // Only visit branches to optimize away unreachable blocks discovered
+  // by range analysis.
+  static void OptimizeBranches(FlowGraph* graph);
+
   // Used to initialize the abstract value of definitions.
   static RawObject* Unknown() { return Object::transition_sentinel().raw(); }
 
  private:
   void Analyze();
+  void VisitBranches();
   void Transform();
 
   void SetReachable(BlockEntryInstr* block);
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index 822c51f..35d6c62 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -128,7 +128,7 @@
         vm_heap_(Dart::vm_isolate()->heap()),
         page_space_(page_space),
         marking_stack_(marking_stack),
-        update_store_buffers_(false) {
+        visiting_old_object_(NULL) {
     ASSERT(heap_ != vm_heap_);
   }
 
@@ -159,7 +159,10 @@
     }
   }
 
-  void set_update_store_buffers(bool val) { update_store_buffers_ = val; }
+  void VisitingOldObject(RawObject* obj) {
+    ASSERT((obj == NULL) || obj->IsOldObject());
+    visiting_old_object_ = obj;
+  }
 
  private:
   void MarkAndPush(RawObject* raw_obj) {
@@ -202,9 +205,10 @@
     // Skip over new objects, but verify consistency of heap while at it.
     if (raw_obj->IsNewObject()) {
       // TODO(iposva): Add consistency check.
-      if (update_store_buffers_) {
+      if (visiting_old_object_ != NULL) {
         ASSERT(p != NULL);
-        isolate()->store_buffer()->AddPointer(reinterpret_cast<uword>(p));
+        isolate()->store_buffer()->AddPointer(
+            reinterpret_cast<uword>(visiting_old_object_));
       }
       return;
     }
@@ -216,9 +220,9 @@
   Heap* vm_heap_;
   PageSpace* page_space_;
   MarkingStack* marking_stack_;
+  RawObject* visiting_old_object_;
   typedef std::multimap<RawObject*, RawWeakProperty*> DelaySet;
   DelaySet delay_set_;
-  bool update_store_buffers_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(MarkingVisitor);
 };
@@ -348,9 +352,9 @@
 
 void GCMarker::DrainMarkingStack(Isolate* isolate,
                                  MarkingVisitor* visitor) {
-  visitor->set_update_store_buffers(true);
   while (!visitor->marking_stack()->IsEmpty()) {
     RawObject* raw_obj = visitor->marking_stack()->Pop();
+    visitor->VisitingOldObject(raw_obj);
     if (raw_obj->GetClassId() != kWeakPropertyCid) {
       raw_obj->VisitPointers(visitor);
     } else {
@@ -358,7 +362,7 @@
       ProcessWeakProperty(raw_weak, visitor);
     }
   }
-  visitor->set_update_store_buffers(false);
+  visitor->VisitingOldObject(NULL);
 }
 
 
diff --git a/runtime/vm/instructions_mips.cc b/runtime/vm/instructions_mips.cc
index a0bc6d4..69e99c2 100644
--- a/runtime/vm/instructions_mips.cc
+++ b/runtime/vm/instructions_mips.cc
@@ -150,7 +150,11 @@
 
 
 void CallPattern::SetTargetAddress(uword target_address) const {
-  UNIMPLEMENTED();
+  ASSERT(Utils::IsAligned(target_address, 4));
+  // The address is stored in the object array as a RawSmi.
+  const Smi& smi = Smi::Handle(reinterpret_cast<RawSmi*>(target_address));
+  object_pool_.SetAt(target_address_pool_index_, smi);
+  // No need to flush the instruction cache, since the code is not modified.
 }
 
 
@@ -158,19 +162,37 @@
 
 
 bool JumpPattern::IsValid() const {
-  UNIMPLEMENTED();
-  return false;
+  Instr* lui = Instr::At(pc_ + (0 * Instr::kInstrSize));
+  Instr* ori = Instr::At(pc_ + (1 * Instr::kInstrSize));
+  Instr* jr = Instr::At(pc_ + (2 * Instr::kInstrSize));
+  Instr* nop = Instr::At(pc_ + (3 * Instr::kInstrSize));
+  return (lui->OpcodeField() == LUI) &&
+         (ori->OpcodeField() == ORI) &&
+         (jr->OpcodeField() == SPECIAL) &&
+         (jr->FunctionField() == JR) &&
+         (nop->InstructionBits() == Instr::kNopInstruction);
 }
 
 
 uword JumpPattern::TargetAddress() const {
-  UNIMPLEMENTED();
-  return 0;
+  Instr* lui = Instr::At(pc_ + (0 * Instr::kInstrSize));
+  Instr* ori = Instr::At(pc_ + (1 * Instr::kInstrSize));
+  const uint16_t target_lo = ori->UImmField();
+  const uint16_t target_hi = lui->UImmField();
+  return (target_hi << 16) | target_lo;
 }
 
 
 void JumpPattern::SetTargetAddress(uword target_address) const {
-  UNIMPLEMENTED();
+  Instr* lui = Instr::At(pc_ + (0 * Instr::kInstrSize));
+  Instr* ori = Instr::At(pc_ + (1 * Instr::kInstrSize));
+  const int32_t lui_bits = lui->InstructionBits();
+  const int32_t ori_bits = ori->InstructionBits();
+  const uint16_t target_lo = target_address & 0xffff;
+  const uint16_t target_hi = target_address >> 16;
+
+  lui->SetInstructionBits((lui_bits & 0xffff0000) | target_hi);
+  ori->SetInstructionBits((ori_bits & 0xffff0000) | target_lo);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/instructions_mips.h b/runtime/vm/instructions_mips.h
index 4035a3b..ed16b16 100644
--- a/runtime/vm/instructions_mips.h
+++ b/runtime/vm/instructions_mips.h
@@ -46,7 +46,8 @@
  public:
   explicit JumpPattern(uword pc);
 
-  static const int kLengthInBytes = 3*Instr::kInstrSize;
+  // lui; ori; jr; nop (in delay slot) = 4.
+  static const int kLengthInBytes = 4*Instr::kInstrSize;
 
   int pattern_length_in_bytes() const {
     return kLengthInBytes;
diff --git a/runtime/vm/instructions_mips_test.cc b/runtime/vm/instructions_mips_test.cc
index cd3a226..4add9ef 100644
--- a/runtime/vm/instructions_mips_test.cc
+++ b/runtime/vm/instructions_mips_test.cc
@@ -33,7 +33,8 @@
 
 
 ASSEMBLER_TEST_GENERATE(Jump, assembler) {
-  UNIMPLEMENTED();
+  __ BranchPatchable(&StubCode::InstanceFunctionLookupLabel());
+  __ BranchPatchable(&StubCode::AllocateArrayLabel());
 }
 
 
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 259419d..292d6aa 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -28,6 +28,7 @@
 DECLARE_FLAG(bool, eliminate_type_checks);
 DECLARE_FLAG(int, max_polymorphic_checks);
 DECLARE_FLAG(bool, trace_optimization);
+DECLARE_FLAG(bool, trace_constant_propagation);
 
 Definition::Definition()
     : range_(NULL),
@@ -528,11 +529,6 @@
     while (next != NULL) {
       current = next;
       current->set_definition(other);
-      // Do not discard some useful inferred types.
-      // TODO(srdjan): Enable once checked mode issues investigated.
-      // if (current->Type() == this->Type()) {
-      //   current->SetReachingType(NULL);
-      // }
       next = current->next_use();
     }
 
@@ -608,7 +604,8 @@
 BranchInstr::BranchInstr(ComparisonInstr* comparison, bool is_checked)
     : comparison_(comparison),
       is_checked_(is_checked),
-      constrained_type_(NULL) {
+      constrained_type_(NULL),
+      constant_target_(NULL) {
   for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) {
     comparison->InputAt(i)->set_instruction(this);
   }
@@ -1957,6 +1954,28 @@
   }
 
   range_ = new Range(min, max);
+
+  // Mark branches that generate unsatisfiable constraints as constant.
+  if (target() != NULL && range_->IsUnsatisfiable()) {
+    BranchInstr* branch =
+        target()->PredecessorAt(0)->last_instruction()->AsBranch();
+    if (target() == branch->true_successor()) {
+      // True unreachable.
+      if (FLAG_trace_constant_propagation) {
+        OS::Print("Range analysis: True unreachable (B%"Pd")\n",
+                  branch->true_successor()->block_id());
+      }
+      branch->set_constant_target(branch->false_successor());
+    } else {
+      ASSERT(target() == branch->false_successor());
+      // False unreachable.
+      if (FLAG_trace_constant_propagation) {
+        OS::Print("Range analysis: False unreachable (B%"Pd")\n",
+                  branch->false_successor()->block_id());
+      }
+      branch->set_constant_target(branch->true_successor());
+    }
+  }
 }
 
 
@@ -2192,6 +2211,19 @@
 }
 
 
+bool Range::IsUnsatisfiable() const {
+  // Constant case: For example [0, -1].
+  if (Range::ConstantMin(this).value() > Range::ConstantMax(this).value()) {
+    return true;
+  }
+  // Symbol case: For example [v+1, v].
+  if (DependOnSameSymbol(min(), max()) && min().offset() > max().offset()) {
+    return true;
+  }
+  return false;
+}
+
+
 bool CheckArrayBoundInstr::IsFixedLengthArrayType(intptr_t cid) {
   return LoadFieldInstr::IsFixedLengthArrayCid(cid);
 }
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index e489a26..ac497ff 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -466,7 +466,7 @@
   M(AllocateObjectWithBoundsCheck)                                             \
   M(LoadField)                                                                 \
   M(StoreVMField)                                                              \
-  M(LoadUntagged)                                                          \
+  M(LoadUntagged)                                                              \
   M(InstantiateTypeArguments)                                                  \
   M(ExtractConstructorTypeArguments)                                           \
   M(ExtractConstructorInstantiator)                                            \
@@ -1825,6 +1825,14 @@
     return constrained_type_;
   }
 
+  void set_constant_target(TargetEntryInstr* target) {
+    ASSERT(target == true_successor() || target == false_successor());
+    constant_target_ = target;
+  }
+  TargetEntryInstr* constant_target() const {
+    return constant_target_;
+  }
+
  private:
   virtual void RawSetInputAt(intptr_t i, Value* value);
 
@@ -1833,6 +1841,8 @@
 
   ConstrainedCompileType* constrained_type_;
 
+  TargetEntryInstr* constant_target_;
+
   DISALLOW_COPY_AND_ASSIGN(BranchInstr);
 };
 
@@ -2029,12 +2039,12 @@
     return min_.Equals(other->min_) && max_.Equals(other->max_);
   }
 
-  static RangeBoundary ConstantMin(Range* range) {
+  static RangeBoundary ConstantMin(const Range* range) {
     if (range == NULL) return RangeBoundary::MinSmi();
     return range->min().LowerBound().Clamp();
   }
 
-  static RangeBoundary ConstantMax(Range* range) {
+  static RangeBoundary ConstantMax(const Range* range) {
     if (range == NULL) return RangeBoundary::MaxSmi();
     return range->max().UpperBound().Clamp();
   }
@@ -2042,6 +2052,8 @@
   // Inclusive.
   bool IsWithin(intptr_t min_int, intptr_t max_int) const;
 
+  bool IsUnsatisfiable() const;
+
  private:
   RangeBoundary min_;
   RangeBoundary max_;
@@ -2051,7 +2063,8 @@
 class ConstraintInstr : public TemplateDefinition<2> {
  public:
   ConstraintInstr(Value* value, Range* constraint)
-      : constraint_(constraint) {
+      : constraint_(constraint),
+        target_(NULL) {
     SetInputAt(0, value);
   }
 
@@ -2085,12 +2098,23 @@
     SetInputAt(1, val);
   }
 
+  // Constraints for branches have their target block stored in order
+  // to find the the comparsion that generated the constraint:
+  // target->predecessor->last_instruction->comparison.
+  void set_target(TargetEntryInstr* target) {
+    target_ = target;
+  }
+  TargetEntryInstr* target() const {
+    return target_;
+  }
+
  private:
   Value* dependency() {
     return inputs_[1];
   }
 
   Range* constraint_;
+  TargetEntryInstr* target_;
 
   DISALLOW_COPY_AND_ASSIGN(ConstraintInstr);
 };
@@ -2315,6 +2339,7 @@
            Token::IsPrefixOperator(token_kind) ||
            Token::IsIndexOperator(token_kind) ||
            Token::IsTypeTestOperator(token_kind) ||
+           Token::IsTypeCastOperator(token_kind) ||
            token_kind == Token::kGET ||
            token_kind == Token::kSET ||
            token_kind == Token::kILLEGAL);
@@ -2814,11 +2839,6 @@
     SetInputAt(1, value);
   }
 
-  void SetDeoptId(intptr_t deopt_id) {
-    ASSERT(CanDeoptimize());
-    deopt_id_ = deopt_id;
-  }
-
   DECLARE_INSTRUCTION(StoreInstanceField)
   virtual CompileType* ComputeInitialType() const;
 
@@ -3344,6 +3364,7 @@
   intptr_t offset_in_bytes() const { return offset_in_bytes_; }
   const AbstractType& type() const { return type_; }
   void set_result_cid(intptr_t value) { result_cid_ = value; }
+  intptr_t result_cid() const { return result_cid_; }
 
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index ed7e3d0..69f9178 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -167,13 +167,47 @@
 
 
 LocationSummary* AssertBooleanInstr::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(R0));
+  locs->set_out(Location::RegisterLocation(R0));
+  return locs;
+}
+
+
+static void EmitAssertBoolean(Register reg,
+                              intptr_t token_pos,
+                              intptr_t deopt_id,
+                              LocationSummary* locs,
+                              FlowGraphCompiler* compiler) {
+  // Check that the type of the value is allowed in conditional context.
+  // Call the runtime if the object is not bool::true or bool::false.
+  ASSERT(locs->always_calls());
+  Label done;
+  __ CompareObject(reg, Bool::True());
+  __ b(&done, EQ);
+  __ CompareObject(reg, Bool::False());
+  __ b(&done, EQ);
+
+  __ Push(reg);  // Push the source object.
+  compiler->GenerateCallRuntime(token_pos,
+                                deopt_id,
+                                kConditionTypeErrorRuntimeEntry,
+                                locs);
+  // We should never return here.
+  __ bkpt(0);
+  __ Bind(&done);
 }
 
 
 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register obj = locs()->in(0).reg();
+  Register result = locs()->out().reg();
+
+  EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler);
+  ASSERT(obj == result);
 }
 
 
@@ -188,37 +222,501 @@
 }
 
 
+static Condition TokenKindToSmiCondition(Token::Kind kind) {
+  switch (kind) {
+    case Token::kEQ: return EQ;
+    case Token::kNE: return NE;
+    case Token::kLT: return LT;
+    case Token::kGT: return GT;
+    case Token::kLTE: return LE;
+    case Token::kGTE: return GE;
+    default:
+      UNREACHABLE();
+      return VS;
+  }
+}
+
+
 LocationSummary* EqualityCompareInstr::MakeLocationSummary() const {
+  const intptr_t kNumInputs = 2;
+  const bool is_checked_strict_equal =
+      HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
+  if (receiver_class_id() == kMintCid) {
+    const intptr_t kNumTemps = 1;
+    LocationSummary* locs =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    locs->set_in(0, Location::RequiresFpuRegister());
+    locs->set_in(1, Location::RequiresFpuRegister());
+    locs->set_temp(0, Location::RequiresRegister());
+    locs->set_out(Location::RequiresRegister());
+    return locs;
+  }
+  if (receiver_class_id() == kDoubleCid) {
+    const intptr_t kNumTemps = 0;
+    LocationSummary* locs =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    locs->set_in(0, Location::RequiresFpuRegister());
+    locs->set_in(1, Location::RequiresFpuRegister());
+    locs->set_out(Location::RequiresRegister());
+    return locs;
+  }
+  if (receiver_class_id() == kSmiCid) {
+    const intptr_t kNumTemps = 0;
+    LocationSummary* locs =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    locs->set_in(0, Location::RegisterOrConstant(left()));
+    // Only one input can be a constant operand. The case of two constant
+    // operands should be handled by constant propagation.
+    locs->set_in(1, locs->in(0).IsConstant()
+                        ? Location::RequiresRegister()
+                        : Location::RegisterOrConstant(right()));
+    locs->set_out(Location::RequiresRegister());
+    return locs;
+  }
+  if (is_checked_strict_equal) {
+    const intptr_t kNumTemps = 1;
+    LocationSummary* locs =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    locs->set_in(0, Location::RequiresRegister());
+    locs->set_in(1, Location::RequiresRegister());
+    locs->set_temp(0, Location::RequiresRegister());
+    locs->set_out(Location::RequiresRegister());
+    return locs;
+  }
+  if (IsPolymorphic()) {
+    const intptr_t kNumTemps = 1;
+    LocationSummary* locs =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+    UNIMPLEMENTED();  // TODO(regis): Verify register allocation.
+    return locs;
+  }
+  const intptr_t kNumTemps = 1;
+  LocationSummary* locs =
+      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_out(Location::RegisterLocation(R0));
+  return locs;
+}
+
+
+// R1: left.
+// R0: right.
+// Uses R6 to load ic_call_data.
+static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler,
+                                       intptr_t deopt_id,
+                                       intptr_t token_pos,
+                                       Token::Kind kind,
+                                       LocationSummary* locs,
+                                       const ICData& original_ic_data) {
+  if (!compiler->is_optimizing()) {
+    compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore,
+                                   deopt_id,
+                                   token_pos);
+  }
+  const int kNumberOfArguments = 2;
+  const Array& kNoArgumentNames = Array::Handle();
+  const int kNumArgumentsChecked = 2;
+
+  Label check_identity;
+  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  __ cmp(R1, ShifterOperand(IP));
+  __ b(&check_identity, EQ);
+  __ cmp(R0, ShifterOperand(IP));
+  __ b(&check_identity, EQ);
+
+  ICData& equality_ic_data = ICData::ZoneHandle();
+  if (compiler->is_optimizing() && FLAG_propagate_ic_data) {
+    ASSERT(!original_ic_data.IsNull());
+    if (original_ic_data.NumberOfChecks() == 0) {
+      // IC call for reoptimization populates original ICData.
+      equality_ic_data = original_ic_data.raw();
+    } else {
+      // Megamorphic call.
+      equality_ic_data = original_ic_data.AsUnaryClassChecks();
+    }
+  } else {
+    equality_ic_data = ICData::New(compiler->parsed_function().function(),
+                                   Symbols::EqualOperator(),
+                                   deopt_id,
+                                   kNumArgumentsChecked);
+  }
+  __ PushList((1 << R0) | (1 << R1));
+  compiler->GenerateInstanceCall(deopt_id,
+                                 token_pos,
+                                 kNumberOfArguments,
+                                 kNoArgumentNames,
+                                 locs,
+                                 equality_ic_data);
+  Label check_ne;
+  __ b(&check_ne);
+
+  __ Bind(&check_identity);
+  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());
+    if (kind == Token::kNE) {
+      // Skip not-equal result conversion.
+      __ b(&equality_done);
+    }
+  } else {
+    // 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.
+    __ LoadObject(ic_data_reg, equality_ic_data);
+    // Pass left in R1 and right in R0.
+    compiler->GenerateCall(token_pos,
+                           &StubCode::EqualityWithNullArgLabel(),
+                           PcDescriptors::kOther,
+                           locs);
+  }
+  __ 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);
+  }
+  __ Bind(&equality_done);
+}
+
+
+static void LoadValueCid(FlowGraphCompiler* compiler,
+                         Register value_cid_reg,
+                         Register value_reg,
+                         Label* value_is_smi = NULL) {
+  Label done;
+  if (value_is_smi == NULL) {
+    __ mov(value_cid_reg, ShifterOperand(kSmiCid));
+  }
+  __ tst(value_reg, ShifterOperand(kSmiTagMask));
+  if (value_is_smi == NULL) {
+    __ b(&done, EQ);
+  } else {
+    __ b(value_is_smi, EQ);
+  }
+  __ LoadClassId(value_cid_reg, value_reg);
+  __ Bind(&done);
+}
+
+
+// Emit code when ICData's targets are all Object == (which is ===).
+static void EmitCheckedStrictEqual(FlowGraphCompiler* compiler,
+                                   const ICData& ic_data,
+                                   const LocationSummary& locs,
+                                   Token::Kind kind,
+                                   BranchInstr* branch,
+                                   intptr_t deopt_id) {
   UNIMPLEMENTED();
-  return NULL;
+}
+
+
+// First test if receiver is NULL, in which case === is applied.
+// If type feedback was provided (lists of <class-id, target>), do a
+// type by type check (either === or static call to the operator.
+static void EmitGenericEqualityCompare(FlowGraphCompiler* compiler,
+                                       LocationSummary* locs,
+                                       Token::Kind kind,
+                                       BranchInstr* branch,
+                                       const ICData& ic_data,
+                                       intptr_t deopt_id,
+                                       intptr_t token_pos) {
+  UNIMPLEMENTED();
+}
+
+
+static void EmitSmiComparisonOp(FlowGraphCompiler* compiler,
+                                const LocationSummary& locs,
+                                Token::Kind kind,
+                                BranchInstr* branch) {
+  Location left = locs.in(0);
+  Location right = locs.in(1);
+  ASSERT(!left.IsConstant() || !right.IsConstant());
+
+  Condition true_condition = TokenKindToSmiCondition(kind);
+
+  if (left.IsConstant()) {
+    __ CompareObject(right.reg(), left.constant());
+    true_condition = FlowGraphCompiler::FlipCondition(true_condition);
+  } else if (right.IsConstant()) {
+    __ CompareObject(left.reg(), right.constant());
+  } else {
+    __ cmp(left.reg(), ShifterOperand(right.reg()));
+  }
+
+  if (branch != NULL) {
+    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);
+  }
+}
+
+
+static void EmitUnboxedMintEqualityOp(FlowGraphCompiler* compiler,
+                                      const LocationSummary& locs,
+                                      Token::Kind kind,
+                                      BranchInstr* branch) {
+  UNIMPLEMENTED();
+}
+
+
+static void EmitUnboxedMintComparisonOp(FlowGraphCompiler* compiler,
+                                        const LocationSummary& locs,
+                                        Token::Kind kind,
+                                        BranchInstr* branch) {
+  UNIMPLEMENTED();
+}
+
+
+static void EmitDoubleComparisonOp(FlowGraphCompiler* compiler,
+                                   const LocationSummary& locs,
+                                   Token::Kind kind,
+                                   BranchInstr* branch) {
+  UNIMPLEMENTED();
 }
 
 
 void EqualityCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
+  BranchInstr* kNoBranch = NULL;
+  if (receiver_class_id() == kSmiCid) {
+    EmitSmiComparisonOp(compiler, *locs(), kind(), kNoBranch);
+    return;
+  }
+  if (receiver_class_id() == kMintCid) {
+    EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch);
+    return;
+  }
+  if (receiver_class_id() == kDoubleCid) {
+    EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch);
+    return;
+  }
+  const bool is_checked_strict_equal =
+      HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
+  if (is_checked_strict_equal) {
+    EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch,
+                           deopt_id());
+    return;
+  }
+  if (IsPolymorphic()) {
+    EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(),
+                               deopt_id(), token_pos());
+    return;
+  }
+  Register left = locs()->in(0).reg();
+  Register right = locs()->in(1).reg();
+  ASSERT(left == R1);
+  ASSERT(right == R0);
+  EmitEqualityAsInstanceCall(compiler,
+                             deopt_id(),
+                             token_pos(),
+                             kind(),
+                             locs(),
+                             *ic_data());
+  ASSERT(locs()->out().reg() == R0);
 }
 
 
 void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
                                           BranchInstr* branch) {
-  UNIMPLEMENTED();
+  ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
+  if (receiver_class_id() == kSmiCid) {
+    // Deoptimizes if both arguments not Smi.
+    EmitSmiComparisonOp(compiler, *locs(), kind(), branch);
+    return;
+  }
+  if (receiver_class_id() == kMintCid) {
+    EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch);
+    return;
+  }
+  if (receiver_class_id() == kDoubleCid) {
+    EmitDoubleComparisonOp(compiler, *locs(), kind(), branch);
+    return;
+  }
+  const bool is_checked_strict_equal =
+      HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
+  if (is_checked_strict_equal) {
+    EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch,
+                           deopt_id());
+    return;
+  }
+  if (IsPolymorphic()) {
+    EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(),
+                               deopt_id(), token_pos());
+    return;
+  }
+  Register left = locs()->in(0).reg();
+  Register right = locs()->in(1).reg();
+  ASSERT(left == R1);
+  ASSERT(right == R0);
+  EmitEqualityAsInstanceCall(compiler,
+                             deopt_id(),
+                             token_pos(),
+                             Token::kEQ,  // kNE reverse occurs at branch.
+                             locs(),
+                             *ic_data());
+  if (branch->is_checked()) {
+    EmitAssertBoolean(R0, token_pos(), deopt_id(), locs(), compiler);
+  }
+  Condition branch_condition = (kind() == Token::kNE) ? NE : EQ;
+  __ CompareObject(R0, Bool::True());
+  branch->EmitBranchOnCondition(compiler, branch_condition);
 }
 
 
 LocationSummary* RelationalOpInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  const intptr_t kNumTemps = 0;
+  if (operands_class_id() == kMintCid) {
+    const intptr_t kNumTemps = 2;
+    LocationSummary* locs =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    locs->set_in(0, Location::RequiresFpuRegister());
+    locs->set_in(1, Location::RequiresFpuRegister());
+    locs->set_temp(0, Location::RequiresRegister());
+    locs->set_temp(1, Location::RequiresRegister());
+    locs->set_out(Location::RequiresRegister());
+    return locs;
+  }
+  if (operands_class_id() == kDoubleCid) {
+    LocationSummary* summary =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    summary->set_in(0, Location::RequiresFpuRegister());
+    summary->set_in(1, Location::RequiresFpuRegister());
+    summary->set_out(Location::RequiresRegister());
+    return summary;
+  } else if (operands_class_id() == kSmiCid) {
+    LocationSummary* summary =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    summary->set_in(0, Location::RegisterOrConstant(left()));
+    // Only one input can be a constant operand. The case of two constant
+    // operands should be handled by constant propagation.
+    summary->set_in(1, summary->in(0).IsConstant()
+                           ? Location::RequiresRegister()
+                           : Location::RegisterOrConstant(right()));
+    summary->set_out(Location::RequiresRegister());
+    return summary;
+  }
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  // Pick arbitrary fixed input registers because this is a call.
+  locs->set_in(0, Location::RegisterLocation(R0));
+  locs->set_in(1, Location::RegisterLocation(R1));
+  locs->set_out(Location::RegisterLocation(R0));
+  return locs;
 }
 
 
 void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  if (operands_class_id() == kSmiCid) {
+    EmitSmiComparisonOp(compiler, *locs(), kind(), NULL);
+    return;
+  }
+  if (operands_class_id() == kMintCid) {
+    EmitUnboxedMintComparisonOp(compiler, *locs(), kind(), NULL);
+    return;
+  }
+  if (operands_class_id() == kDoubleCid) {
+    EmitDoubleComparisonOp(compiler, *locs(), kind(), NULL);
+    return;
+  }
+
+  // Push arguments for the call.
+  // TODO(fschneider): Split this instruction into different types to avoid
+  // explicitly pushing arguments to the call here.
+  Register left = locs()->in(0).reg();
+  Register right = locs()->in(1).reg();
+  __ Push(left);
+  __ Push(right);
+  if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
+    Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptRelationalOp);
+    // Load class into R2. Since this is a call, any register except
+    // the fixed input registers would be ok.
+    ASSERT((left != R2) && (right != R2));
+    const intptr_t kNumArguments = 2;
+    LoadValueCid(compiler, R2, left);
+    compiler->EmitTestAndCall(ICData::Handle(ic_data()->AsUnaryClassChecks()),
+                              R2,  // Class id register.
+                              kNumArguments,
+                              Array::Handle(),  // No named arguments.
+                              deopt,  // Deoptimize target.
+                              deopt_id(),
+                              token_pos(),
+                              locs());
+    return;
+  }
+  const String& function_name =
+      String::ZoneHandle(Symbols::New(Token::Str(kind())));
+  if (!compiler->is_optimizing()) {
+    compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore,
+                                   deopt_id(),
+                                   token_pos());
+  }
+  const intptr_t kNumArguments = 2;
+  const intptr_t kNumArgsChecked = 2;  // Type-feedback.
+  ICData& relational_ic_data = ICData::ZoneHandle(ic_data()->raw());
+  if (compiler->is_optimizing() && FLAG_propagate_ic_data) {
+    ASSERT(!ic_data()->IsNull());
+    if (ic_data()->NumberOfChecks() == 0) {
+      // IC call for reoptimization populates original ICData.
+      relational_ic_data = ic_data()->raw();
+    } else {
+      // Megamorphic call.
+      relational_ic_data = ic_data()->AsUnaryClassChecks();
+    }
+  } else {
+    relational_ic_data = ICData::New(compiler->parsed_function().function(),
+                                     function_name,
+                                     deopt_id(),
+                                     kNumArgsChecked);
+  }
+  compiler->GenerateInstanceCall(deopt_id(),
+                                 token_pos(),
+                                 kNumArguments,
+                                 Array::ZoneHandle(),  // No optional arguments.
+                                 locs(),
+                                 relational_ic_data);
 }
 
 
 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
                                        BranchInstr* branch) {
-  UNIMPLEMENTED();
+  if (operands_class_id() == kSmiCid) {
+    EmitSmiComparisonOp(compiler, *locs(), kind(), branch);
+    return;
+  }
+  if (operands_class_id() == kMintCid) {
+    EmitUnboxedMintComparisonOp(compiler, *locs(), kind(), branch);
+    return;
+  }
+  if (operands_class_id() == kDoubleCid) {
+    EmitDoubleComparisonOp(compiler, *locs(), kind(), branch);
+    return;
+  }
+  EmitNativeCode(compiler);
+  __ CompareObject(R0, Bool::True());
+  branch->EmitBranchOnCondition(compiler, EQ);
 }
 
 
@@ -542,13 +1040,194 @@
 
 
 LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 2;
+  if (op_kind() == Token::kTRUNCDIV) {
+    UNIMPLEMENTED();
+    return NULL;
+  } else {
+    const intptr_t kNumTemps = 0;
+    LocationSummary* summary =
+        new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
+    summary->set_in(0, Location::RequiresRegister());
+    summary->set_in(1, Location::RegisterOrSmiConstant(right()));
+    // We make use of 3-operand instructions by not requiring result register
+    // to be identical to first input register as on Intel.
+    summary->set_out(Location::RequiresRegister());
+    return summary;
+  }
 }
 
 
 void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  if (op_kind() == Token::kSHL) {
+    UNIMPLEMENTED();
+    return;
+  }
+
+  ASSERT(!is_truncating());
+  Register left = locs()->in(0).reg();
+  Register result = locs()->out().reg();
+  Label* deopt = NULL;
+  if (CanDeoptimize()) {
+    deopt  = compiler->AddDeoptStub(deopt_id(), kDeoptBinarySmiOp);
+  }
+
+  if (locs()->in(1).IsConstant()) {
+    const Object& constant = locs()->in(1).constant();
+    ASSERT(constant.IsSmi());
+    int32_t imm = reinterpret_cast<int32_t>(constant.raw());
+    switch (op_kind()) {
+      case Token::kSUB: {
+        imm = -imm;  // TODO(regis): What if deopt != NULL && imm == 0x80000000?
+        // Fall through.
+      }
+      case Token::kADD: {
+        if (deopt == NULL) {
+          __ AddImmediate(result, left, imm);
+        } else {
+          __ AddImmediateSetFlags(result, left, imm);
+          __ b(deopt, VS);
+        }
+        break;
+      }
+      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));
+        } else {
+          __ LoadImmediate(IP, value);
+          __ mul(result, left, IP);
+        }
+        if (deopt != NULL) {
+          UNIMPLEMENTED();
+        }
+        break;
+      }
+      case Token::kTRUNCDIV: {
+        UNIMPLEMENTED();
+        break;
+      }
+      case Token::kBIT_AND: {
+        // No overflow check.
+        ShifterOperand shifter_op;
+        if (ShifterOperand::CanHold(imm, &shifter_op)) {
+          __ and_(result, left, shifter_op);
+        } else {
+          // TODO(regis): Try to use bic.
+          __ LoadImmediate(IP, imm);
+          __ and_(result, left, ShifterOperand(IP));
+        }
+        break;
+      }
+      case Token::kBIT_OR: {
+        // No overflow check.
+        ShifterOperand shifter_op;
+        if (ShifterOperand::CanHold(imm, &shifter_op)) {
+          __ orr(result, left, shifter_op);
+        } else {
+          // TODO(regis): Try to use orn.
+          __ LoadImmediate(IP, imm);
+          __ orr(result, left, ShifterOperand(IP));
+        }
+        break;
+      }
+      case Token::kBIT_XOR: {
+        // No overflow check.
+        ShifterOperand shifter_op;
+        if (ShifterOperand::CanHold(imm, &shifter_op)) {
+          __ eor(result, left, shifter_op);
+        } else {
+          __ LoadImmediate(IP, imm);
+          __ eor(result, left, ShifterOperand(IP));
+        }
+        break;
+      }
+      case Token::kSHR: {
+        UNIMPLEMENTED();
+        break;
+      }
+
+      default:
+        UNREACHABLE();
+        break;
+    }
+    return;
+  }
+
+  Register right = locs()->in(1).reg();
+  switch (op_kind()) {
+    case Token::kADD: {
+      if (deopt == NULL) {
+        __ add(result, left, ShifterOperand(right));
+      } else {
+        __ adds(result, left, ShifterOperand(right));
+        __ b(deopt, VS);
+      }
+      break;
+    }
+    case Token::kSUB: {
+      if (deopt == NULL) {
+        __ sub(result, left, ShifterOperand(right));
+      } else {
+        __ subs(result, left, ShifterOperand(right));
+        __ b(deopt, VS);
+      }
+      break;
+    }
+    case Token::kMUL: {
+      __ SmiUntag(left);
+      __ mul(result, left, right);
+      if (deopt != NULL) {
+        UNIMPLEMENTED();
+      }
+      break;
+    }
+    case Token::kBIT_AND: {
+      // No overflow check.
+      __ and_(result, left, ShifterOperand(right));
+      break;
+    }
+    case Token::kBIT_OR: {
+      // No overflow check.
+      __ orr(result, left, ShifterOperand(right));
+      break;
+    }
+    case Token::kBIT_XOR: {
+      // No overflow check.
+      __ eor(result, left, ShifterOperand(right));
+      break;
+    }
+    case Token::kTRUNCDIV: {
+      UNIMPLEMENTED();
+      break;
+    }
+    case Token::kSHR: {
+      UNIMPLEMENTED();
+      break;
+    }
+    case Token::kDIV: {
+      // Dispatches to 'Double./'.
+      // TODO(srdjan): Implement as conversion to double and double division.
+      UNREACHABLE();
+      break;
+    }
+    case Token::kMOD: {
+      // TODO(srdjan): Implement.
+      UNREACHABLE();
+      break;
+    }
+    case Token::kOR:
+    case Token::kAND: {
+      // Flow graph builder has dissected this operation to guarantee correct
+      // behavior (short-circuit evaluation).
+      UNREACHABLE();
+      break;
+    }
+    default:
+      UNREACHABLE();
+      break;
+  }
 }
 
 
@@ -674,13 +1353,44 @@
 
 
 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return MakeCallSummary();
 }
 
 
 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
+                                        kDeoptPolymorphicInstanceCallTestFail);
+  if (ic_data().NumberOfChecks() == 0) {
+    __ b(deopt);
+    return;
+  }
+  ASSERT(ic_data().num_args_tested() == 1);
+  if (!with_checks()) {
+    ASSERT(ic_data().HasOneTarget());
+    const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0));
+    compiler->GenerateStaticCall(instance_call()->deopt_id(),
+                                 instance_call()->token_pos(),
+                                 target,
+                                 instance_call()->ArgumentCount(),
+                                 instance_call()->argument_names(),
+                                 locs());
+    return;
+  }
+
+  // Load receiver into R0.
+  __ ldr(R0, Address(SP, (instance_call()->ArgumentCount() - 1) * kWordSize));
+
+  LoadValueCid(compiler, R2, R0,
+               (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt);
+
+  compiler->EmitTestAndCall(ic_data(),
+                            R2,  // Class id register.
+                            instance_call()->ArgumentCount(),
+                            instance_call()->argument_names(),
+                            deopt,
+                            instance_call()->deopt_id(),
+                            instance_call()->token_pos(),
+                            locs());
 }
 
 
@@ -691,7 +1401,7 @@
 
 
 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  comparison()->EmitBranchCode(compiler, this);
 }
 
 
@@ -707,13 +1417,21 @@
 
 
 LocationSummary* CheckSmiInstr::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());
+  return summary;
 }
 
 
 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register value = locs()->in(0).reg();
+  Label* deopt = compiler->AddDeoptStub(deopt_id(),
+                                        kDeoptCheckSmi);
+  __ tst(value, ShifterOperand(kSmiTagMask));
+  __ b(deopt, NE);
 }
 
 
@@ -807,25 +1525,77 @@
 
 
 LocationSummary* GotoInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return new LocationSummary(0, 0, LocationSummary::kNoCall);
 }
 
 
 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  // Add deoptimization descriptor for deoptimizing instructions
+  // that may be inserted before this instruction.
+  if (!compiler->is_optimizing()) {
+    compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore,
+                                   GetDeoptId(),
+                                   0);  // No token position.
+  }
+
+  if (HasParallelMove()) {
+    compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
+  }
+
+  // We can fall through if the successor is the next block in the list.
+  // Otherwise, we need a jump.
+  if (!compiler->CanFallThroughTo(successor())) {
+    __ b(compiler->GetJumpLabel(successor()));
+  }
+}
+
+
+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) {
-  UNIMPLEMENTED();
+  if (value && !compiler->CanFallThroughTo(true_successor())) {
+    __ b(compiler->GetJumpLabel(true_successor()));
+  } else if (!value && !compiler->CanFallThroughTo(false_successor())) {
+    __ b(compiler->GetJumpLabel(false_successor()));
+  }
 }
 
 
 void ControlInstruction::EmitBranchOnCondition(FlowGraphCompiler* compiler,
                                                Condition true_condition) {
-  UNIMPLEMENTED();
+  if (compiler->CanFallThroughTo(false_successor())) {
+    // If the next block is the false successor we will fall through to it.
+    __ b(compiler->GetJumpLabel(true_successor()), true_condition);
+  } else {
+    // If the next block is the true successor we negate comparison and fall
+    // through to it.
+    Condition false_condition = NegateCondition(true_condition);
+    __ b(compiler->GetJumpLabel(false_successor()), false_condition);
+
+    // Fall through or jump to the true successor.
+    if (!compiler->CanFallThroughTo(true_successor())) {
+      __ b(compiler->GetJumpLabel(true_successor()));
+    }
+  }
 }
 
 
@@ -841,19 +1611,85 @@
 
 
 LocationSummary* StrictCompareInstr::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::RegisterOrConstant(left()));
+  locs->set_in(1, Location::RegisterOrConstant(right()));
+  locs->set_out(Location::RequiresRegister());
+  return locs;
 }
 
 
+// Special code for numbers (compare values instead of references.)
 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
+  Location left = locs()->in(0);
+  Location right = locs()->in(1);
+  if (left.IsConstant() && right.IsConstant()) {
+    // TODO(vegorov): should be eliminated earlier by constant propagation.
+    const bool result = (kind() == Token::kEQ_STRICT) ?
+        left.constant().raw() == right.constant().raw() :
+        left.constant().raw() != right.constant().raw();
+    __ LoadObject(locs()->out().reg(), result ? Bool::True() : Bool::False());
+    return;
+  }
+  if (left.IsConstant()) {
+    compiler->EmitEqualityRegConstCompare(right.reg(),
+                                          left.constant(),
+                                          needs_number_check());
+  } else if (right.IsConstant()) {
+    compiler->EmitEqualityRegConstCompare(left.reg(),
+                                          right.constant(),
+                                          needs_number_check());
+  } else {
+    compiler->EmitEqualityRegRegCompare(left.reg(),
+                                       right.reg(),
+                                       needs_number_check());
+  }
+
+  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);
 }
 
 
 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
                                         BranchInstr* branch) {
-  UNIMPLEMENTED();
+  ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
+  Location left = locs()->in(0);
+  Location right = locs()->in(1);
+  if (left.IsConstant() && right.IsConstant()) {
+    // TODO(vegorov): should be eliminated earlier by constant propagation.
+    const bool result = (kind() == Token::kEQ_STRICT) ?
+        left.constant().raw() == right.constant().raw() :
+        left.constant().raw() != right.constant().raw();
+    branch->EmitBranchOnValue(compiler, result);
+    return;
+  }
+  if (left.IsConstant()) {
+    compiler->EmitEqualityRegConstCompare(right.reg(),
+                                          left.constant(),
+                                          needs_number_check());
+  } else if (right.IsConstant()) {
+    compiler->EmitEqualityRegConstCompare(left.reg(),
+                                          right.constant(),
+                                          needs_number_check());
+  } else {
+    compiler->EmitEqualityRegRegCompare(left.reg(),
+                                        right.reg(),
+                                        needs_number_check());
+  }
+
+  Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE;
+  branch->EmitBranchOnCondition(compiler, true_condition);
 }
 
 
@@ -896,13 +1732,19 @@
 
 
 LocationSummary* AllocateObjectInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return MakeCallSummary();
 }
 
 
 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  const Class& cls = Class::ZoneHandle(constructor().Owner());
+  const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls));
+  const ExternalLabel label(cls.ToCString(), stub.EntryPoint());
+  compiler->GenerateCall(token_pos(),
+                         &label,
+                         PcDescriptors::kOther,
+                         locs());
+  __ Drop(ArgumentCount());  // Discard arguments.
 }
 
 
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index f5f21ef..50f3dc8 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -254,7 +254,7 @@
     case Token::kLT: return LESS;
     case Token::kGT: return GREATER;
     case Token::kLTE: return LESS_EQUAL;
-    case Token::kGTE: return  GREATER_EQUAL;
+    case Token::kGTE: return GREATER_EQUAL;
     default:
       UNREACHABLE();
       return OVERFLOW;
@@ -408,11 +408,10 @@
   }
   __ Bind(&check_ne);
   if (kind == Token::kNE) {
-    Label false_label, true_label, done;
+    Label true_label, done;
     // Negate the condition: true label returns false and vice versa.
     __ CompareObject(EAX, Bool::True());
     __ j(EQUAL, &true_label, Assembler::kNearJump);
-    __ Bind(&false_label);
     __ LoadObject(EAX, Bool::True());
     __ jmp(&done, Assembler::kNearJump);
     __ Bind(&true_label);
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 6adbda5..c912b09 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -23,20 +23,40 @@
 DECLARE_FLAG(int, optimization_counter_threshold);
 DECLARE_FLAG(bool, propagate_ic_data);
 
+// Generic summary for call instructions that have all arguments pushed
+// on the stack and return the result in a fixed register V0.
 LocationSummary* Instruction::MakeCallSummary() {
-  UNIMPLEMENTED();
-  return NULL;
+  LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall);
+  result->set_out(Location::RegisterLocation(V0));
+  return result;
 }
 
 
 LocationSummary* PushArgumentInstr::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::AnyOrConstant(value()));
+  return locs;
 }
 
 
 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
+  // where PushArgument is handled by BindInstr::EmitNativeCode.
+  if (compiler->is_optimizing()) {
+    Location value = locs()->in(0);
+    if (value.IsRegister()) {
+      __ Push(value.reg());
+    } else if (value.IsConstant()) {
+      __ PushObject(value.constant());
+    } else {
+      ASSERT(value.IsStackSlot());
+      __ lw(TMP, value.ToStackSlotAddress());
+      __ Push(TMP);
+    }
+  }
 }
 
 
@@ -94,24 +114,30 @@
 
 
 LocationSummary* LoadLocalInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(0,
+                               Location::RequiresRegister(),
+                               LocationSummary::kNoCall);
 }
 
 
 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register result = locs()->out().reg();
+  __ lw(result, Address(FP, local().index() * kWordSize));
 }
 
 
 LocationSummary* StoreLocalInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  return LocationSummary::Make(1,
+                               Location::SameAsFirstInput(),
+                               LocationSummary::kNoCall);
 }
 
 
 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  Register value = locs()->in(0).reg();
+  Register result = locs()->out().reg();
+  ASSERT(result == value);  // Assert that register assignment is correct.
+  __ sw(value, Address(FP, local().index() * kWordSize));
 }
 
 
@@ -132,8 +158,15 @@
 
 
 LocationSummary* AssertAssignableInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 3;
+  const intptr_t kNumTemps = 0;
+  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_out(Location::RegisterLocation(A0));
+  return summary;
 }
 
 
@@ -194,13 +227,47 @@
 
 
 LocationSummary* NativeCallInstr::MakeLocationSummary() const {
-  UNIMPLEMENTED();
-  return NULL;
+  const intptr_t kNumInputs = 0;
+  const intptr_t kNumTemps = 3;
+  LocationSummary* locs =
+      new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+  locs->set_temp(0, Location::RegisterLocation(A1));
+  locs->set_temp(1, Location::RegisterLocation(A2));
+  locs->set_temp(2, Location::RegisterLocation(T5));
+  locs->set_out(Location::RegisterLocation(V0));
+  return locs;
 }
 
 
 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  UNIMPLEMENTED();
+  ASSERT(locs()->temp(0).reg() == A1);
+  ASSERT(locs()->temp(1).reg() == A2);
+  ASSERT(locs()->temp(2).reg() == T5);
+  Register result = locs()->out().reg();
+
+  // Push the result place holder initialized to NULL.
+  __ PushObject(Object::ZoneHandle());
+  // Pass a pointer to the first argument in A2.
+  if (!function().HasOptionalParameters()) {
+    __ addiu(A2, FP, Immediate((kLastParamSlotIndex +
+                                function().NumParameters() - 1) * kWordSize));
+  } else {
+    __ addiu(A2, FP, Immediate(kFirstLocalSlotIndex * kWordSize));
+  }
+  // Compute the effective address. When running under the simulator,
+  // this is a redirection address that forces the simulator to call
+  // into the runtime system.
+  uword entry = reinterpret_cast<uword>(native_c_function());
+#if defined(USING_SIMULATOR)
+  entry = Simulator::RedirectExternalReference(entry, Simulator::kNativeCall);
+#endif
+  __ LoadImmediate(T5, entry);
+  __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function()));
+  compiler->GenerateCall(token_pos(),
+                         &StubCode::CallNativeCFunctionLabel(),
+                         PcDescriptors::kOther,
+                         locs());
+  __ Pop(result);
 }
 
 
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index cc87b81..3edf1ed 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -262,7 +262,7 @@
     case Token::kLT: return LESS;
     case Token::kGT: return GREATER;
     case Token::kLTE: return LESS_EQUAL;
-    case Token::kGTE: return  GREATER_EQUAL;
+    case Token::kGTE: return GREATER_EQUAL;
     default:
       UNREACHABLE();
       return OVERFLOW;
@@ -406,11 +406,10 @@
   }
   __ Bind(&check_ne);
   if (kind == Token::kNE) {
-    Label false_label, true_label, done;
+    Label true_label, done;
     // Negate the condition: true label returns false and vice versa.
     __ CompareObject(RAX, Bool::True());
     __ j(EQUAL, &true_label, Assembler::kNearJump);
-    __ Bind(&false_label);
     __ LoadObject(RAX, Bool::True());
     __ jmp(&done, Assembler::kNearJump);
     __ Bind(&true_label);
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index f5a2eb9..fc32498 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -209,29 +209,29 @@
     // Check if it's dynamic.
     // For now handle only TypeArguments and bail out if InstantiatedTypeArgs.
     __ CompareClassId(EBX, kTypeArgumentsCid, EAX);
-    __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+    __ j(NOT_EQUAL, &fall_through);
     // Get type at index 0.
     __ movl(EAX, FieldAddress(EBX, TypeArguments::type_at_offset(0)));
     __ CompareObject(EAX, Type::ZoneHandle(Type::DynamicType()));
     __ j(EQUAL,  &checked_ok, Assembler::kNearJump);
     // Check for int and num.
     __ testl(EDI, Immediate(kSmiTagMask));  // Value is Smi?
-    __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi value.
+    __ j(NOT_ZERO, &fall_through);  // Non-smi value.
     __ CompareObject(EAX, Type::ZoneHandle(Type::IntType()));
     __ j(EQUAL,  &checked_ok, Assembler::kNearJump);
     __ CompareObject(EAX, Type::ZoneHandle(Type::Number()));
-    __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+    __ j(NOT_EQUAL, &fall_through);
     __ Bind(&checked_ok);
   }
   __ movl(EBX, Address(ESP, + 2 * kWordSize));  // Index.
   __ testl(EBX, Immediate(kSmiTagMask));
   // Index not Smi.
-  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
+  __ j(NOT_ZERO, &fall_through);
   __ movl(EAX, Address(ESP, + 3 * kWordSize));  // Array.
   // Range check.
   __ cmpl(EBX, FieldAddress(EAX, Array::length_offset()));
   // Runtime throws exception.
-  __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(ABOVE_EQUAL, &fall_through);
   // Note that EBX is Smi, i.e, times 2.
   ASSERT(kSmiTagShift == 1);
   // Destroy ECX as we will not continue in the function.
@@ -271,7 +271,7 @@
   // EAX: potential new backing array object start.
   // EBX: potential next object start.
   __ cmpl(EBX, Address::Absolute(heap->EndAddress()));
-  __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(ABOVE_EQUAL, &fall_through);
 
   // Successfully allocated the object(s), now update top to point to
   // next object start and initialize the object.
@@ -366,11 +366,11 @@
   __ movl(EBX, Address(ESP, + 2 * kWordSize));  // Index.
   __ movl(EAX, Address(ESP, + 3 * kWordSize));  // GrowableArray.
   __ testl(EBX, Immediate(kSmiTagMask));
-  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi index.
+  __ j(NOT_ZERO, &fall_through);  // Non-smi index.
   // Range check using _length field.
   __ cmpl(EBX, FieldAddress(EAX, GrowableObjectArray::length_offset()));
   // Runtime throws exception.
-  __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(ABOVE_EQUAL, &fall_through);
   __ movl(EAX, FieldAddress(EAX, GrowableObjectArray::data_offset()));  // data.
   __ movl(EDI, Address(ESP, + 1 * kWordSize));  // Value.
   // Note that EBX is Smi, i.e, times 2.
@@ -412,9 +412,9 @@
   __ movl(EBX, Address(ESP, + 1 * kWordSize));  // Data.
   // Check that data is an ObjectArray.
   __ testl(EBX, Immediate(kSmiTagMask));
-  __ j(ZERO, &fall_through, Assembler::kNearJump);  // Data is Smi.
+  __ j(ZERO, &fall_through);  // Data is Smi.
   __ CompareClassId(EBX, kArrayCid, EAX);
-  __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(NOT_EQUAL, &fall_through);
   __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Growable array.
   __ StoreIntoObject(EAX,
                      FieldAddress(EAX, GrowableObjectArray::data_offset()),
@@ -439,7 +439,7 @@
   // EDI: data.
   // Compare length with capacity.
   __ cmpl(EBX, FieldAddress(EDI, Array::length_offset()));
-  __ j(EQUAL, &fall_through, Assembler::kNearJump);  // Must grow data.
+  __ j(EQUAL, &fall_through);  // Must grow data.
   const Immediate& value_one =
       Immediate(reinterpret_cast<int32_t>(Smi::New(1)));
   // len = len + 1;
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index daa95c0..231eacc 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -181,11 +181,11 @@
   __ movq(RAX, Address(RSP, + 3 * kWordSize));  // Array.
   Label fall_through;
   __ testq(RCX, Immediate(kSmiTagMask));
-  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
+  __ j(NOT_ZERO, &fall_through);
   // Range check.
   __ cmpq(RCX, FieldAddress(RAX, Array::length_offset()));
   // Runtime throws exception.
-  __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(ABOVE_EQUAL, &fall_through);
   // Note that RBX is Smi, i.e, times 2.
   ASSERT(kSmiTagShift == 1);
   // Destroy RCX as we will not continue in the function.
@@ -321,11 +321,11 @@
   __ movq(RAX, Address(RSP, + 3 * kWordSize));  // GrowableArray.
   Label fall_through;
   __ testq(RCX, Immediate(kSmiTagMask));
-  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi index.
+  __ j(NOT_ZERO, &fall_through);  // Non-smi index.
   // Range check using _length field.
   __ cmpq(RCX, FieldAddress(RAX, GrowableObjectArray::length_offset()));
   // Runtime throws exception.
-  __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(ABOVE_EQUAL, &fall_through);
   __ movq(RAX, FieldAddress(RAX, GrowableObjectArray::data_offset()));  // data.
   // Note that RCX is Smi, i.e, times 4.
   ASSERT(kSmiTagShift == 1);
@@ -365,9 +365,9 @@
   Label fall_through;
   __ movq(RBX, Address(RSP, + 1 * kWordSize));  /// Data.
   __ testq(RBX, Immediate(kSmiTagMask));
-  __ j(ZERO, &fall_through, Assembler::kNearJump);  // Data is Smi.
+  __ j(ZERO, &fall_through);  // Data is Smi.
   __ CompareClassId(RBX, kArrayCid);
-  __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(NOT_EQUAL, &fall_through);
   __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Growable array.
   __ StoreIntoObject(RAX,
                      FieldAddress(RAX, GrowableObjectArray::data_offset()),
@@ -392,7 +392,7 @@
   // RDX: data.
   // Compare length with capacity.
   __ cmpq(RCX, FieldAddress(RDX, Array::length_offset()));
-  __ j(EQUAL, &fall_through, Assembler::kNearJump);  // Must grow data.
+  __ j(EQUAL, &fall_through);  // Must grow data.
   const Immediate& value_one =
       Immediate(reinterpret_cast<int64_t>(Smi::New(1)));
   // len = len + 1;
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 74cf19c..c5e68536 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -6,6 +6,7 @@
 
 #include "include/dart_api.h"
 #include "platform/assert.h"
+#include "platform/json.h"
 #include "lib/mirrors.h"
 #include "vm/code_observers.h"
 #include "vm/compiler_stats.h"
@@ -342,7 +343,9 @@
       deopt_fpu_registers_copy_(NULL),
       deopt_frame_copy_(NULL),
       deopt_frame_copy_size_(0),
-      deferred_objects_(NULL) {
+      deferred_objects_(NULL),
+      stacktrace_(NULL),
+      stack_frame_index_(-1) {
 }
 
 
@@ -635,6 +638,7 @@
 Dart_FileOpenCallback Isolate::file_open_callback_ = NULL;
 Dart_FileWriteCallback Isolate::file_write_callback_ = NULL;
 Dart_FileCloseCallback Isolate::file_close_callback_ = NULL;
+Dart_IsolateInterruptCallback Isolate::vmstats_callback_ = NULL;
 
 
 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
@@ -689,60 +693,189 @@
 }
 
 
+static Monitor* status_sync = NULL;
+
+
+bool Isolate::FetchStacktrace() {
+  Isolate* isolate = Isolate::Current();
+  MonitorLocker ml(status_sync);
+  DebuggerStackTrace* stack = Debugger::CollectStackTrace();
+  TextBuffer buffer(256);
+  buffer.Printf("{ \"handle\": \"0x%"Px64"\", \"stacktrace\": [ ",
+                reinterpret_cast<int64_t>(isolate));
+  intptr_t n_frames = stack->Length();
+  String& url = String::Handle();
+  String& function = String::Handle();
+  for (int i = 0; i < n_frames; i++) {
+    if (i > 0) {
+      buffer.Printf(", ");
+    }
+    ActivationFrame* frame = stack->ActivationFrameAt(i);
+    url ^= frame->SourceUrl();
+    function ^= frame->function().UserVisibleName();
+    buffer.Printf("{ \"url\": \"%s\", ", url.ToCString());
+    buffer.Printf("\"line\": %"Pd", ", frame->LineNumber());
+    buffer.Printf("\"function\": \"%s\", ", function.ToCString());
+
+    const Code& code = frame->code();
+    buffer.Printf("\"code\": { ");
+    buffer.Printf("\"alive\": %s, ", code.is_alive() ? "false" : "true");
+    buffer.Printf("\"optimized\": %s }}",
+        code.is_optimized() ? "false" : "true");
+  }
+  buffer.Printf("]}");
+  isolate->stacktrace_ = strndup(buffer.buf(), buffer.length());
+  ml.Notify();
+  return true;
+}
+
+
+bool Isolate::FetchStackFrameDetails() {
+  Isolate* isolate = Isolate::Current();
+  ASSERT(isolate->stack_frame_index_ >= 0);
+  MonitorLocker ml(status_sync);
+  DebuggerStackTrace* stack = Debugger::CollectStackTrace();
+  intptr_t frame_index = isolate->stack_frame_index_;
+  if (frame_index >= stack->Length()) {
+    // Frame no longer available.
+    return NULL;
+  }
+  ActivationFrame* frame = stack->ActivationFrameAt(frame_index);
+  TextBuffer buffer(256);
+  buffer.Printf("{ \"handle\": \"0x%"Px64"\", \"frame_index\": %"Pd", ",
+       reinterpret_cast<int64_t>(isolate), frame_index);
+
+  const Code& code = frame->code();
+  buffer.Printf("\"code\": { \"size\": %"Pd", ", code.Size());
+  buffer.Printf("\"alive\": %s, ", code.is_alive() ? "false" : "true");
+  buffer.Printf("\"optimized\": %s }, ",
+      code.is_optimized() ? "false" : "true");
+  // TODO(tball): add compilation stats (time, etc.), when available.
+
+  buffer.Printf("\"local_vars\": [ ");
+  intptr_t n_local_vars = frame->NumLocalVariables();
+  String& var_name = String::Handle();
+  Instance& value = Instance::Handle();
+  for (int i = 0; i < n_local_vars; i++) {
+    if (i > 0) {
+      buffer.Printf(", ");
+    }
+    intptr_t token_pos, end_pos;
+    frame->VariableAt(i, &var_name, &token_pos, &end_pos, &value);
+    buffer.Printf(
+        "{ \"name\": \"%s\", \"pos\": %"Pd", \"end_pos\": %"Pd", "
+        "\"value\": \"%s\" }",
+        var_name.ToCString(), token_pos, end_pos, value.ToCString());
+  }
+  buffer.Printf("]}");
+  isolate->stacktrace_ = strndup(buffer.buf(), buffer.length());
+  ml.Notify();
+  return true;
+}
+
+
+char* Isolate::DoStacktraceInterrupt(Dart_IsolateInterruptCallback cb) {
+  ASSERT(stacktrace_ == NULL);
+  SetVmStatsCallback(cb);
+  if (status_sync == NULL) {
+    status_sync = new Monitor();
+  }
+  ScheduleInterrupts(Isolate::kVmStatusInterrupt);
+  {
+    MonitorLocker ml(status_sync);
+    if (stacktrace_ == NULL) {  // It may already be available.
+      ml.Wait();
+    }
+  }
+  SetVmStatsCallback(NULL);
+  ASSERT(stacktrace_ != NULL);
+  // result is freed by VmStats::WebServer().
+  char* result = stacktrace_;
+  stacktrace_ = NULL;
+  return result;
+}
+
+
+char* Isolate::GetStatusStacktrace() {
+  return DoStacktraceInterrupt(&FetchStacktrace);
+}
+
+char* Isolate::GetStatusStackFrame(intptr_t index) {
+  ASSERT(index >= 0);
+  stack_frame_index_ = index;
+  char* result = DoStacktraceInterrupt(&FetchStackFrameDetails);
+  stack_frame_index_ = -1;
+  return result;
+}
+
+
+// Returns the isolate's general detail information.
+char* Isolate::GetStatusDetails() {
+  const char* format = "{\n"
+      "  \"handle\": \"0x%"Px64"\",\n"
+      "  \"name\": \"%s\",\n"
+      "  \"port\": %"Pd",\n"
+      "  \"starttime\": %"Pd",\n"
+      "  \"stacklimit\": %"Pd",\n"
+      "  \"newspace\": {\n"
+      "    \"used\": %"Pd",\n"
+      "    \"capacity\": %"Pd"\n"
+      "  },\n"
+      "  \"oldspace\": {\n"
+      "    \"used\": %"Pd",\n"
+      "    \"capacity\": %"Pd"\n"
+      "  }\n"
+      "}";
+  char buffer[300];
+  int64_t address = reinterpret_cast<int64_t>(this);
+  int n = OS::SNPrint(buffer, 300, format, address, name(), main_port(),
+                      (start_time() / 1000L), saved_stack_limit(),
+                      heap()->Used(Heap::kNew) / KB,
+                      heap()->Capacity(Heap::kNew) / KB,
+                      heap()->Used(Heap::kOld) / KB,
+                      heap()->Capacity(Heap::kOld) / KB);
+  ASSERT(n < 300);
+  return strdup(buffer);
+}
+
+
 char* Isolate::GetStatus(const char* request) {
   char* p = const_cast<char*>(request);
   const char* service_type = "/isolate/";
-  ASSERT(strncmp(p, service_type, strlen(service_type)) == 0);
+  ASSERT(!strncmp(p, service_type, strlen(service_type)));
   p += strlen(service_type);
 
   // Extract isolate handle.
   int64_t addr;
   OS::StringToInt64(p, &addr);
+  // TODO(tball): add validity check when issue 9600 is fixed.
   Isolate* isolate = reinterpret_cast<Isolate*>(addr);
-  Heap* heap = isolate->heap();
+  p += strcspn(p, "/");
 
-  char buffer[256];
-  int64_t port = isolate->main_port();
-  int64_t start_time = (isolate->start_time() / 1000L);
-#if defined(TARGET_ARCH_X64)
-  const char* format = "{\n"
-      "  \"name\": \"%s\",\n"
-      "  \"port\": %ld,\n"
-      "  \"starttime\": %ld,\n"
-      "  \"stacklimit\": %ld,\n"
-      "  \"newspace\": {\n"
-      "    \"used\": %ld,\n"
-      "    \"capacity\": %ld\n"
-      "  },\n"
-      "  \"oldspace\": {\n"
-      "    \"used\": %ld,\n"
-      "    \"capacity\": %ld\n"
-      "  }\n"
-      "}";
-#else
-  const char* format = "{\n"
-      "  \"name\": \"%s\",\n"
-      "  \"port\": %lld,\n"
-      "  \"starttime\": %lld,\n"
-      "  \"stacklimit\": %d,\n"
-      "  \"newspace\": {\n"
-      "    \"used\": %d,\n"
-      "    \"capacity\": %d\n"
-      "  },\n"
-      "  \"oldspace\": {\n"
-      "    \"used\": %d,\n"
-      "    \"capacity\": %d\n"
-      "  }\n"
-      "}";
-#endif
-  int n = OS::SNPrint(buffer, 256, format, isolate->name(), port, start_time,
-                      isolate->saved_stack_limit(),
-                      heap->Used(Heap::kNew) / KB,
-                      heap->Capacity(Heap::kNew) / KB,
-                      heap->Used(Heap::kOld) / KB,
-                      heap->Capacity(Heap::kOld) / KB);
-  ASSERT(n < 256);
-  return strdup(buffer);
+  // Query "/isolate/<handle>".
+  if (strlen(p) == 0) {
+    return isolate->GetStatusDetails();
+  }
+
+  // Query "/isolate/<handle>/stacktrace"
+  if (!strcmp(p, "/stacktrace")) {
+    return isolate->GetStatusStacktrace();
+  }
+
+  // Query "/isolate/<handle>/stacktrace/<frame-index>"
+  const char* stacktrace_query = "/stacktrace/";
+  int64_t frame_index = -1;
+  if (!strncmp(p, stacktrace_query, strlen(stacktrace_query))) {
+    p += strlen(stacktrace_query);
+    OS::StringToInt64(p, &frame_index);
+    if (frame_index >= 0) {
+      return isolate->GetStatusStackFrame(frame_index);
+    }
+  }
+
+  // TODO(tball): "/isolate/<handle>/stacktrace/<frame-index>"/disassemble"
+
+  return NULL;  // Unimplemented query.
 }
 
 }  // namespace dart
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 9dcea6b..c2e1523 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -262,11 +262,13 @@
     kApiInterrupt = 0x1,      // An interrupt from Dart_InterruptIsolate.
     kMessageInterrupt = 0x2,  // An interrupt to process an out of band message.
     kStoreBufferInterrupt = 0x4,  // An interrupt to process the store buffer.
+    kVmStatusInterrupt = 0x8,     // An interrupt to process a status request.
 
     kInterruptsMask =
         kApiInterrupt |
         kMessageInterrupt |
-        kStoreBufferInterrupt,
+        kStoreBufferInterrupt |
+        kVmStatusInterrupt,
   };
 
   void ScheduleInterrupts(uword interrupt_bits);
@@ -320,6 +322,13 @@
     return interrupt_callback_;
   }
 
+  static void SetVmStatsCallback(Dart_IsolateInterruptCallback cb) {
+    vmstats_callback_ = cb;
+  }
+  static Dart_IsolateInterruptCallback VmStatsCallback() {
+    return vmstats_callback_;
+  }
+
   static void SetUnhandledExceptionCallback(
       Dart_IsolateUnhandledExceptionCallback cb) {
     unhandled_exception_callback_ = cb;
@@ -419,6 +428,13 @@
   void BuildName(const char* name_prefix);
   void PrintInvokedFunctions();
 
+  static bool FetchStacktrace();
+  static bool FetchStackFrameDetails();
+  char* GetStatusDetails();
+  char* GetStatusStacktrace();
+  char* GetStatusStackFrame(intptr_t index);
+  char* DoStacktraceInterrupt(Dart_IsolateInterruptCallback cb);
+
   static ThreadLocalKey isolate_key;
   StoreBufferBlock store_buffer_block_;
   StoreBuffer store_buffer_;
@@ -457,6 +473,10 @@
   intptr_t deopt_frame_copy_size_;
   DeferredObject* deferred_objects_;
 
+  // Status support.
+  char* stacktrace_;
+  intptr_t stack_frame_index_;
+
   static Dart_IsolateCreateCallback create_callback_;
   static Dart_IsolateInterruptCallback interrupt_callback_;
   static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_;
@@ -464,6 +484,7 @@
   static Dart_FileOpenCallback file_open_callback_;
   static Dart_FileWriteCallback file_write_callback_;
   static Dart_FileCloseCallback file_close_callback_;
+  static Dart_IsolateInterruptCallback vmstats_callback_;
 
   DISALLOW_COPY_AND_ASSIGN(Isolate);
 };
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h
index f76ea9d..031a290 100644
--- a/runtime/vm/locations.h
+++ b/runtime/vm/locations.h
@@ -271,8 +271,8 @@
     return kind() == kDoubleStackSlot;
   }
 
-  static Location Float32x4StackSlot(intptr_t stack_index, Representation rep) {
-    uword payload = make_stack_index_payload(stack_index, rep);
+  static Location Float32x4StackSlot(intptr_t stack_index) {
+    uword payload = make_stack_index_payload(stack_index, kUnboxedFloat32x4);
     Location loc(kFloat32x4StackSlot, payload);
     // Ensure that sign is preserved.
     ASSERT(loc.stack_index() == stack_index);
@@ -283,8 +283,8 @@
     return kind() == kFloat32x4StackSlot;
   }
 
-  static Location Uint32x4StackSlot(intptr_t stack_index, Representation rep) {
-    uword payload = make_stack_index_payload(stack_index, rep);
+  static Location Uint32x4StackSlot(intptr_t stack_index) {
+    uword payload = make_stack_index_payload(stack_index, kUnboxedUint32x4);
     Location loc(kUint32x4StackSlot, payload);
     // Ensure that sign is preserved.
     ASSERT(loc.stack_index() == stack_index);
diff --git a/runtime/vm/longjump.cc b/runtime/vm/longjump.cc
index df5d475..c07f029 100644
--- a/runtime/vm/longjump.cc
+++ b/runtime/vm/longjump.cc
@@ -11,6 +11,7 @@
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/os.h"
+#include "vm/simulator.h"
 
 namespace dart {
 
@@ -25,8 +26,12 @@
   // assumes the stack grows from high to low.
   Isolate* isolate = Isolate::Current();
   uword jumpbuf_addr = reinterpret_cast<uword>(this);
-  return (isolate->top_exit_frame_info() == 0 ||
-          jumpbuf_addr < isolate->top_exit_frame_info());
+#if defined(USING_SIMULATOR)
+  uword top_exit_frame_info = isolate->simulator()->top_exit_frame_info();
+#else
+  uword top_exit_frame_info = isolate->top_exit_frame_info();
+#endif
+  return ((top_exit_frame_info == 0) || (jumpbuf_addr < top_exit_frame_info));
 }
 
 
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index af061fc..45a0147 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -125,6 +125,8 @@
 // (Library, class name, method name)
 #define INVISIBLE_LIST(V)                                                      \
   V(CoreLibrary, Object, _noSuchMethod)                                        \
+  V(CoreLibrary, Object, _as)                                                  \
+  V(CoreLibrary, Object, _instanceOf)                                          \
   V(CoreLibrary, _ObjectArray, _ObjectArray.)                                  \
   V(CoreLibrary, AssertionErrorImplementation, _throwNew)                      \
   V(CoreLibrary, TypeErrorImplementation, _throwNew)                           \
@@ -994,7 +996,7 @@
   INIT_LIBRARY(Core, core, true);
 
   INIT_LIBRARY(Async, async, true);
-  INIT_LIBRARY(Collection, collection, false);
+  INIT_LIBRARY(Collection, collection, true);
   INIT_LIBRARY(CollectionDev, collection_dev, false);
   INIT_LIBRARY(Crypto, crypto, false);
   INIT_LIBRARY(Isolate, isolate, true);
@@ -1201,20 +1203,26 @@
 
 class StoreBufferUpdateVisitor : public ObjectPointerVisitor {
  public:
-  explicit StoreBufferUpdateVisitor(Isolate* isolate) :
-      ObjectPointerVisitor(isolate) { }
+  explicit StoreBufferUpdateVisitor(Isolate* isolate, RawObject* obj) :
+      ObjectPointerVisitor(isolate), old_obj_(obj) {
+    ASSERT(old_obj_->IsOldObject());
+  }
 
   void VisitPointers(RawObject** first, RawObject** last) {
     for (RawObject** curr = first; curr <= last; ++curr) {
       RawObject* raw_obj = *curr;
       if (raw_obj->IsHeapObject() && raw_obj->IsNewObject()) {
-        uword ptr = reinterpret_cast<uword>(curr);
+        uword ptr = reinterpret_cast<uword>(old_obj_);
         isolate()->store_buffer()->AddPointer(ptr);
+        // Remembered this object. There is no need to continue searching.
+        return;
       }
     }
   }
 
  private:
+  RawObject* old_obj_;
+
   DISALLOW_COPY_AND_ASSIGN(StoreBufferUpdateVisitor);
 };
 
@@ -1237,7 +1245,7 @@
   NoGCScope no_gc;
   memmove(raw_obj->ptr(), src.raw()->ptr(), size);
   if (space == Heap::kOld) {
-    StoreBufferUpdateVisitor visitor(Isolate::Current());
+    StoreBufferUpdateVisitor visitor(Isolate::Current(), raw_obj);
     raw_obj->VisitPointers(&visitor);
   }
   return raw_obj;
@@ -2853,7 +2861,7 @@
     // substituted by the instantiator's type argument vector without checking
     // the upper bound.
     const AbstractType& bound = AbstractType::Handle(type_param.bound());
-    ASSERT(bound.IsFinalized());
+    ASSERT(bound.IsResolved());
     if (!bound.IsObjectType() && !bound.IsDynamicType()) {
       return false;
     }
@@ -9255,8 +9263,8 @@
 bool AbstractType::TypeTest(TypeTestKind test_kind,
                             const AbstractType& other,
                             Error* malformed_error) const {
-  ASSERT(IsFinalized());
-  ASSERT(other.IsFinalized());
+  ASSERT(IsResolved());
+  ASSERT(other.IsResolved());
   // In case the type checked in a type test is malformed, the code generator
   // may compile a throw instead of a run time call performing the type check.
   // However, in checked mode, a function type may include malformed result type
@@ -9293,13 +9301,10 @@
   // The same rule applies when checking the upper bound of a still
   // uninstantiated type at compile time. Returning false will defer the test
   // to run time.
-  // We may think that some cases can be decided at compile time.
+  // There are however some cases can be decided at compile time.
   // For example, with class A<K, V extends K>, new A<T, T> called from within
   // a class B<T> will never require a run time bound check, even if T is
   // uninstantiated at compile time.
-  // However, this is not true, because bounds are ignored in production mode,
-  // and even if we are running in checked mode, we may generate a snapshot
-  // that will be executed in production mode.
   if (IsTypeParameter()) {
     const TypeParameter& type_param = TypeParameter::Cast(*this);
     if (other.IsTypeParameter()) {
@@ -9308,6 +9313,10 @@
         return true;
       }
     }
+    const AbstractType& bound = AbstractType::Handle(type_param.bound());
+    if (bound.IsMoreSpecificThan(other, malformed_error)) {
+      return true;
+    }
     return false;  // TODO(regis): We should return "maybe after instantiation".
   }
   if (other.IsTypeParameter()) {
@@ -9524,7 +9533,7 @@
 RawAbstractType* Type::InstantiateFrom(
     const AbstractTypeArguments& instantiator_type_arguments,
     Error* malformed_error) const {
-  ASSERT(IsFinalized());
+  ASSERT(IsResolved());
   ASSERT(!IsInstantiated());
   // Return the uninstantiated type unchanged if malformed. No copy needed.
   if (IsMalformed()) {
@@ -9556,13 +9565,16 @@
     return false;
   }
   const Type& other_type = Type::Cast(other);
-  ASSERT(IsFinalized() && other_type.IsFinalized());
+  ASSERT(IsResolved() && other_type.IsResolved());
   if (IsMalformed() || other_type.IsMalformed()) {
     return false;
   }
   if (type_class() != other_type.type_class()) {
     return false;
   }
+  if (!IsFinalized() || !other_type.IsFinalized()) {
+    return false;
+  }
   return AbstractTypeArguments::AreEqual(
       AbstractTypeArguments::Handle(arguments()),
       AbstractTypeArguments::Handle(other_type.arguments()));
@@ -9772,49 +9784,60 @@
   if (instantiator_type_arguments.IsNull()) {
     return Type::DynamicType();
   }
-  // Bound checks should never appear in the instantiator type arguments.
-  ASSERT(!AbstractType::Handle(
-      instantiator_type_arguments.TypeAt(index())).IsBoundedType());
-  return instantiator_type_arguments.TypeAt(index());
+  // Bound checks may appear in the instantiator type arguments, as is the case
+  // with a pair of type parameters of the same class referring to each other
+  // via their bounds.
+  AbstractType& type_arg = AbstractType::Handle(
+      instantiator_type_arguments.TypeAt(index()));
+  if (type_arg.IsBoundedType()) {
+    const BoundedType& bounded_type = BoundedType::Cast(type_arg);
+    ASSERT(!bounded_type.IsInstantiated());
+    ASSERT(AbstractType::Handle(bounded_type.bound()).IsInstantiated());
+    type_arg = bounded_type.InstantiateFrom(AbstractTypeArguments::Handle(),
+                                            malformed_error);
+  }
+  return type_arg.raw();
 }
 
 
-void TypeParameter::CheckBound(const AbstractType& bounded_type,
+bool TypeParameter::CheckBound(const AbstractType& bounded_type,
                                const AbstractType& upper_bound,
                                Error* malformed_error) const {
-  ASSERT(malformed_error->IsNull());
+  ASSERT((malformed_error == NULL) || malformed_error->IsNull());
   ASSERT(bounded_type.IsFinalized());
   ASSERT(upper_bound.IsFinalized());
   ASSERT(!bounded_type.IsMalformed());
-  if (bounded_type.IsSubtypeOf(upper_bound, malformed_error) ||
-      !malformed_error->IsNull()) {
-    return;
+  if (bounded_type.IsSubtypeOf(upper_bound, malformed_error)) {
+    return true;
   }
-  // Report the bound error.
-  const String& bounded_type_name = String::Handle(
-      bounded_type.UserVisibleName());
-  const String& upper_bound_name = String::Handle(
-      upper_bound.UserVisibleName());
-  const AbstractType& declared_bound = AbstractType::Handle(bound());
-  const String& declared_bound_name = String::Handle(
-      declared_bound.UserVisibleName());
-  const String& type_param_name = String::Handle(UserVisibleName());
-  const Class& cls = Class::Handle(parameterized_class());
-  const String& class_name = String::Handle(cls.Name());
-  const Script& script = Script::Handle(cls.script());
-  // Since the bound may have been canonicalized, its token index is
-  // meaningless, therefore use the token index of this type parameter.
-  *malformed_error = FormatError(
-      *malformed_error,
-      script,
-      token_pos(),
-      "type parameter '%s' of class '%s' must extend bound '%s', "
-      "but type argument '%s' is not a subtype of '%s'\n",
-      type_param_name.ToCString(),
-      class_name.ToCString(),
-      declared_bound_name.ToCString(),
-      bounded_type_name.ToCString(),
-      upper_bound_name.ToCString());
+  if ((malformed_error != NULL) && malformed_error->IsNull()) {
+    // Report the bound error.
+    const String& bounded_type_name = String::Handle(
+        bounded_type.UserVisibleName());
+    const String& upper_bound_name = String::Handle(
+        upper_bound.UserVisibleName());
+    const AbstractType& declared_bound = AbstractType::Handle(bound());
+    const String& declared_bound_name = String::Handle(
+        declared_bound.UserVisibleName());
+    const String& type_param_name = String::Handle(UserVisibleName());
+    const Class& cls = Class::Handle(parameterized_class());
+    const String& class_name = String::Handle(cls.Name());
+    const Script& script = Script::Handle(cls.script());
+    // Since the bound may have been canonicalized, its token index is
+    // meaningless, therefore use the token index of this type parameter.
+    *malformed_error = FormatError(
+        *malformed_error,
+        script,
+        token_pos(),
+        "type parameter '%s' of class '%s' must extend bound '%s', "
+        "but type argument '%s' is not a subtype of '%s'\n",
+        type_param_name.ToCString(),
+        class_name.ToCString(),
+        declared_bound_name.ToCString(),
+        bounded_type_name.ToCString(),
+        upper_bound_name.ToCString());
+  }
+  return false;
 }
 
 
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index b470924..6d73f43 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -432,7 +432,7 @@
     // Filter stores based on source and target.
     if (!value->IsHeapObject()) return;
     if (value->IsNewObject() && raw()->IsOldObject()) {
-      uword ptr = reinterpret_cast<uword>(addr);
+      uword ptr = reinterpret_cast<uword>(raw());
       Isolate::Current()->store_buffer()->AddPointer(ptr);
     }
   }
@@ -3432,6 +3432,7 @@
   HEAP_OBJECT_IMPLEMENTATION(Instance, Object);
   friend class Class;
   friend class Closure;
+  friend class TypedDataView;
 };
 
 
@@ -3681,7 +3682,9 @@
   void set_index(intptr_t value) const;
   RawAbstractType* bound() const { return raw_ptr()->bound_; }
   void set_bound(const AbstractType& value) const;
-  void CheckBound(const AbstractType& bounded_type,
+  // Returns true if bounded_type is below upper_bound, otherwise return false
+  // and set malformed_error if not NULL.
+  bool CheckBound(const AbstractType& bounded_type,
                   const AbstractType& upper_bound,
                   Error* malformed_error) const;
   virtual intptr_t token_pos() const { return raw_ptr()->token_pos_; }
@@ -4930,7 +4933,7 @@
     // Filter stores based on source and target.
     if (!value->IsHeapObject()) return;
     if (value->IsNewObject() && data()->IsOldObject()) {
-      uword ptr = reinterpret_cast<uword>(addr);
+      uword ptr = reinterpret_cast<uword>(data());
       Isolate::Current()->store_buffer()->AddPointer(ptr);
     }
   }
@@ -5090,6 +5093,12 @@
                    intptr_t src_offset_in_bytes,
                    intptr_t length_in_bytes);
 
+  static bool IsTypedData(const Instance& obj) {
+    ASSERT(!obj.IsNull());
+    intptr_t cid = obj.raw()->GetClassId();
+    return RawObject::IsTypedDataClassId(cid);
+  }
+
  protected:
   void SetLength(intptr_t value) const {
     raw_ptr()->length_ = Smi::New(value);
@@ -5101,6 +5110,7 @@
   FINAL_HEAP_OBJECT_IMPLEMENTATION(TypedData, Instance);
   friend class Class;
   friend class ExternalTypedData;
+  friend class TypedDataView;
 };
 
 
@@ -5185,6 +5195,12 @@
                    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();
+    return RawObject::IsExternalTypedDataClassId(cid);
+  }
+
  protected:
   void SetLength(intptr_t value) const {
     raw_ptr()->length_ = Smi::New(value);
@@ -5204,6 +5220,71 @@
 };
 
 
+class TypedDataView : public AllStatic {
+ public:
+  static intptr_t ElementSizeInBytes(const Instance& view_obj) {
+    ASSERT(!view_obj.IsNull());
+    intptr_t cid = view_obj.raw()->GetClassId();
+    return ElementSizeInBytes(cid);
+  }
+
+  static RawInstance* Data(const Instance& view_obj) {
+    ASSERT(!view_obj.IsNull());
+    return *reinterpret_cast<RawInstance**>(view_obj.raw_ptr() + kDataOffset);
+  }
+
+  static RawSmi* OffsetInBytes(const Instance& view_obj) {
+    ASSERT(!view_obj.IsNull());
+    return *reinterpret_cast<RawSmi**>(
+        view_obj.raw_ptr() + kOffsetInBytesOffset);
+  }
+
+  static RawSmi* Length(const Instance& view_obj) {
+    ASSERT(!view_obj.IsNull());
+    return *reinterpret_cast<RawSmi**>(view_obj.raw_ptr() + kLengthOffset);
+  }
+
+  static bool IsExternalTypedDataView(const Instance& view_obj) {
+    const Instance& data = Instance::Handle(Data(view_obj));
+    intptr_t cid = data.raw()->GetClassId();
+    ASSERT(RawObject::IsTypedDataClassId(cid) ||
+           RawObject::IsExternalTypedDataClassId(cid));
+    return RawObject::IsExternalTypedDataClassId(cid);
+  }
+
+  static intptr_t NumberOfFields() {
+    return (kLengthOffset - kTypeArguments);
+  }
+
+  static intptr_t data_offset() {
+    return kWordSize * kDataOffset;
+  }
+
+  static intptr_t offset_in_bytes_offset() {
+    return kWordSize * kOffsetInBytesOffset;
+  }
+
+  static intptr_t length_offset() {
+    return kWordSize * kLengthOffset;
+  }
+
+  static intptr_t ElementSizeInBytes(intptr_t class_id) {
+    ASSERT(RawObject::IsTypedDataViewClassId(class_id));
+    return (class_id == kByteDataViewCid) ?
+        TypedData::element_size[kTypedDataInt8ArrayCid] :
+        TypedData::element_size[class_id - kTypedDataInt8ArrayViewCid];
+  }
+
+ private:
+  enum {
+    kTypeArguments = 1,
+    kDataOffset = 2,
+    kOffsetInBytesOffset = 3,
+    kLengthOffset = 4,
+  };
+};
+
+
 // DartFunction represents the abstract Dart class 'Function'.
 class DartFunction : public Instance {
  private:
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 4f96041..59fb1ec 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -430,6 +430,7 @@
   friend class SnapshotWriter;
   friend class String;
   friend class TypedData;
+  friend class TypedDataView;
 
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject);
diff --git a/runtime/vm/runtime_entry_mips.cc b/runtime/vm/runtime_entry_mips.cc
index 4d5a0d2..622f24f 100644
--- a/runtime/vm/runtime_entry_mips.cc
+++ b/runtime/vm/runtime_entry_mips.cc
@@ -7,10 +7,41 @@
 
 #include "vm/runtime_entry.h"
 
+#include "vm/assembler.h"
+#include "vm/simulator.h"
+#include "vm/stub_code.h"
+
 namespace dart {
 
+#define __ assembler->
+
+
+// Generate code to call into the stub which will call the runtime
+// function. Input for the stub is as follows:
+//   SP : points to the arguments and return value array.
+//   S5 : address of the runtime function to call.
+//   S4 : number of arguments to the call.
 void RuntimeEntry::Call(Assembler* assembler) const {
-  UNIMPLEMENTED();
+  // Compute the effective address. When running under the simulator,
+  // this is a redirection address that forces the simulator to call
+  // into the runtime system.
+  uword entry = GetEntryPoint();
+#if defined(USING_SIMULATOR)
+  // Redirection to leaf runtime calls supports a maximum of 4 arguments passed
+  // in registers.
+  ASSERT(!is_leaf() || (argument_count() <= 4));
+  Simulator::CallKind call_kind =
+      is_leaf() ? Simulator::kLeafRuntimeCall : Simulator::kRuntimeCall;
+  entry = Simulator::RedirectExternalReference(entry, call_kind);
+#endif
+  if (is_leaf()) {
+    ExternalLabel label(name(), entry);
+    __ BranchLink(&label);
+  } else {
+    __ LoadImmediate(S5, entry);
+    __ LoadImmediate(S4, argument_count());
+    __ BranchLink(&StubCode::CallToRuntimeLabel());
+  }
 }
 
 }  // namespace dart
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 79470e2..0c1a5a2 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -75,10 +75,8 @@
         delayed_weak_stack_(),
         growth_policy_(PageSpace::kControlGrowth),
         bytes_promoted_(0),
-#ifdef DEBUG
-        in_scavenge_pointer_(false),
-#endif
-        visiting_old_pointers_(false) { }
+        visiting_old_object_(NULL),
+        in_scavenge_pointer_(false) { }
 
   void VisitPointers(RawObject** first, RawObject** last) {
     for (RawObject** current = first; current <= last; current++) {
@@ -90,7 +88,10 @@
     return &delayed_weak_stack_;
   }
 
-  bool* VisitingOldPointersAddr() { return &visiting_old_pointers_; }
+  void VisitingOldObject(RawObject* obj) {
+    ASSERT((obj == NULL) || obj->IsOldObject());
+    visiting_old_object_ = obj;
+  }
 
   void DelayWeakProperty(RawWeakProperty* raw_weak) {
     RawObject* raw_key = raw_weak->ptr()->key_;
@@ -122,7 +123,8 @@
     ASSERT(heap_->Contains(ptr));
     // If the newly written object is not a new object, drop it immediately.
     if (!obj->IsNewObject()) return;
-    isolate()->store_buffer()->AddPointer(ptr);
+    isolate()->store_buffer()->AddPointer(
+        reinterpret_cast<uword>(visiting_old_object_));
   }
 
   void ScavengePointer(RawObject** p) {
@@ -239,7 +241,7 @@
     RawObject* new_obj = RawObject::FromAddr(new_addr);
     *p = new_obj;
     // Update the store buffer as needed.
-    if (visiting_old_pointers_) {
+    if (visiting_old_object_ != NULL) {
       UpdateStoreBuffer(p, new_obj);
     }
   }
@@ -254,11 +256,8 @@
   // TODO(cshapiro): use this value to compute survival statistics for
   // new space growth policy.
   intptr_t bytes_promoted_;
-
-#ifdef DEBUG
+  RawObject* visiting_old_object_;
   bool in_scavenge_pointer_;
-#endif
-  bool visiting_old_pointers_;
 
   DISALLOW_COPY_AND_ASSIGN(ScavengerVisitor);
 };
@@ -393,11 +392,9 @@
 void Scavenger::IterateStoreBuffers(Isolate* isolate,
                                     ScavengerVisitor* visitor) {
   // Iterating through the store buffers.
-  BoolScope bs(visitor->VisitingOldPointersAddr(), true);
   // Grab the deduplication sets out of the store buffer.
   StoreBuffer::DedupSet* pending = isolate->store_buffer()->DedupSets();
   intptr_t entries = 0;
-  intptr_t duplicates = 0;
   while (pending != NULL) {
     StoreBuffer::DedupSet* next = pending->next();
     HashSet* set = pending->set();
@@ -406,17 +403,10 @@
     intptr_t handled = 0;
     entries += count;
     for (intptr_t i = 0; i < size; i++) {
-      RawObject** pointer = reinterpret_cast<RawObject**>(set->At(i));
-      if (pointer != NULL) {
-        RawObject* value = *pointer;
-        // Skip entries that have been overwritten with Smis.
-        if (value->IsHeapObject()) {
-          if (from_->Contains(RawObject::ToAddr(value))) {
-            visitor->VisitPointer(pointer);
-          } else {
-            duplicates++;
-          }
-        }
+      RawObject* raw_object = reinterpret_cast<RawObject*>(set->At(i));
+      if (raw_object != NULL) {
+        visitor->VisitingOldObject(raw_object);
+        raw_object->VisitPointers(visitor);
         handled++;
         if (handled == count) {
           break;
@@ -427,24 +417,18 @@
     pending = next;
   }
   heap_->RecordData(kStoreBufferEntries, entries);
-  heap_->RecordData(kStoreBufferDuplicates, duplicates);
   StoreBufferBlock* block = isolate->store_buffer_block();
   entries = block->Count();
-  duplicates = 0;
   for (intptr_t i = 0; i < entries; i++) {
-    RawObject** pointer = reinterpret_cast<RawObject**>(block->At(i));
-    RawObject* value = *pointer;
-    if (value->IsHeapObject()) {
-      if (from_->Contains(RawObject::ToAddr(value))) {
-        visitor->VisitPointer(pointer);
-      } else {
-        duplicates++;
-      }
-    }
+    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);
-  heap_->RecordData(kStoreBufferBlockDuplicates, duplicates);
+  // Done iterating through old objects remembered in the store buffers.
+  visitor->VisitingOldObject(NULL);
 }
 
 
@@ -563,14 +547,15 @@
       }
     }
     {
-      BoolScope bs(visitor->VisitingOldPointersAddr(), true);
       while (PromotedStackHasMore()) {
         RawObject* raw_object = RawObject::FromAddr(PopFromPromotedStack());
         // Resolve or copy all objects referred to by the current object. This
         // can potentially push more objects on this stack as well as add more
         // objects to be resolved in the to space.
+        visitor->VisitingOldObject(raw_object);
         raw_object->VisitPointers(visitor);
       }
+      visitor->VisitingOldObject(NULL);
     }
     while (!delayed_weak_stack->is_empty()) {
       // Pop the delayed weak object from the stack and visit its pointers.
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h
index 81f4c3b..0ce70d6 100644
--- a/runtime/vm/scavenger.h
+++ b/runtime/vm/scavenger.h
@@ -105,9 +105,7 @@
     kIterateWeaks = 3,
     // Data
     kStoreBufferEntries = 0,
-    kStoreBufferDuplicates = 1,
-    kStoreBufferBlockEntries = 2,
-    kStoreBufferBlockDuplicates = 3
+    kStoreBufferBlockEntries = 1
   };
 
   uword FirstObjectStart() const { return to_->start() | object_alignment_; }
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index be561d0..d027df8 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -496,6 +496,7 @@
 #undef XSTR
 }
 
+
 char* SimulatorDebugger::ReadLine(const char* prompt) {
   char* result = NULL;
   char line_buf[256];
@@ -627,6 +628,7 @@
   break_pc_ = NULL;
   break_instr_ = 0;
   last_setjmp_buffer_ = NULL;
+  top_exit_frame_info_ = 0;
 
   // Setup architecture state.
   // All registers are initialized to zero to start with.
@@ -1335,6 +1337,15 @@
         if (FLAG_trace_sim) {
           OS::Print("Call to host function at 0x%"Pd"\n", external);
         }
+
+        if (redirection->call_kind() != kLeafRuntimeCall) {
+          // The top_exit_frame_info of the current isolate points to the top of
+          // the simulator stack.
+          ASSERT((StackTop() - Isolate::Current()->top_exit_frame_info()) <
+                 Isolate::GetSpecifiedStackSize());
+          // Set the top_exit_frame_info of this simulator to the native stack.
+          set_top_exit_frame_info(reinterpret_cast<uword>(&buffer));
+        }
         if (redirection->call_kind() == kRuntimeCall) {
           NativeArguments arguments;
           ASSERT(sizeof(NativeArguments) == 4*kWordSize);
@@ -1364,6 +1375,7 @@
           target(arguments);
           set_register(R0, icount_);  // Zap result register from void function.
         }
+        set_top_exit_frame_info(0);
 
         // Zap caller-saved registers, since the actual runtime call could have
         // used them.
@@ -2865,10 +2877,7 @@
   }
   ASSERT(buf != NULL);
 
-  // Clean up stack memory of C++ frames.
-  // TODO(regis): Revisit.
-  // isolate->PrepareForUnwinding(reinterpret_cast<uword>(buf));
-  // isolate->ChangeStateToGeneratedCode();
+  // The caller has already cleaned up the stack memory of C++ frames.
   set_register(kExceptionObjectReg, bit_cast<int32_t>(object.raw()));
   buf->Longjmp();
 }
diff --git a/runtime/vm/simulator_arm.h b/runtime/vm/simulator_arm.h
index 651f825..71ae8d2 100644
--- a/runtime/vm/simulator_arm.h
+++ b/runtime/vm/simulator_arm.h
@@ -16,7 +16,6 @@
 #error Do not include simulator_arm.h directly; use simulator.h.
 #endif
 
-#include "vm/allocation.h"
 #include "vm/constants_arm.h"
 #include "vm/object.h"
 
@@ -55,8 +54,11 @@
   // Accessor to the internal simulator stack top.
   uword StackTop() const;
 
-  // Executes ARM instructions until the PC reaches end_sim_pc.
-  void Execute();
+  // The isolate's top_exit_frame_info refers to a Dart frame in the simulator
+  // stack. The simulator's top_exit_frame_info refers to a C++ frame in the
+  // native stack.
+  uword top_exit_frame_info() const { return top_exit_frame_info_; }
+  void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; }
 
   // Call on program start.
   static void InitOnce();
@@ -119,6 +121,7 @@
   int icount_;
   static int32_t flag_stop_sim_at_;
   SimulatorSetjmpBuffer* last_setjmp_buffer_;
+  uword top_exit_frame_info_;
 
   // Registered breakpoints.
   Instr* break_pc_;
@@ -219,6 +222,9 @@
   // Executes one instruction.
   void InstructionDecode(Instr* instr);
 
+  // Executes ARM instructions until the PC reaches kEndSimulatingPC.
+  void Execute();
+
   // Longjmp support for exceptions.
   SimulatorSetjmpBuffer* last_setjmp_buffer() {
     return last_setjmp_buffer_;
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index d78a1e1..41a1f4d 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -2,6 +2,10 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+#include <math.h>  // for isnan.
+#include <setjmp.h>
+#include <stdlib.h>
+
 #include "vm/globals.h"
 #if defined(TARGET_ARCH_MIPS)
 
@@ -13,9 +17,12 @@
 #include "vm/assembler.h"
 #include "vm/constants_mips.h"
 #include "vm/disassembler.h"
+#include "vm/native_arguments.h"
+#include "vm/thread.h"
 
 namespace dart {
 
+DEFINE_FLAG(bool, trace_sim, false, "Trace simulator execution.");
 DEFINE_FLAG(int, stop_sim_at, 0, "Address to stop simulator at.");
 
 
@@ -26,6 +33,46 @@
 #define SScanF sscanf  // NOLINT
 
 
+// SimulatorSetjmpBuffer are linked together, and the last created one
+// is referenced by the Simulator. When an exception is thrown, the exception
+// runtime looks at where to jump and finds the corresponding
+// SimulatorSetjmpBuffer based on the stack pointer of the exception handler.
+// The runtime then does a Longjmp on that buffer to return to the simulator.
+class SimulatorSetjmpBuffer {
+ public:
+  int Setjmp() { return setjmp(buffer_); }
+  void Longjmp() {
+    // "This" is now the last setjmp buffer.
+    simulator_->set_last_setjmp_buffer(this);
+    longjmp(buffer_, 1);
+  }
+
+  explicit SimulatorSetjmpBuffer(Simulator* sim) {
+    simulator_ = sim;
+    link_ = sim->last_setjmp_buffer();
+    sim->set_last_setjmp_buffer(this);
+    sp_ = sim->get_register(SP);
+  }
+
+  ~SimulatorSetjmpBuffer() {
+    ASSERT(simulator_->last_setjmp_buffer() == this);
+    simulator_->set_last_setjmp_buffer(link_);
+  }
+
+  SimulatorSetjmpBuffer* link() { return link_; }
+
+  int32_t sp() { return sp_; }
+
+ private:
+  int32_t sp_;
+  Simulator* simulator_;
+  SimulatorSetjmpBuffer* link_;
+  jmp_buf buffer_;
+
+  friend class Simulator;
+};
+
+
 // The SimulatorDebugger class is used by the simulator while debugging
 // simulated MIPS code.
 class SimulatorDebugger {
@@ -242,7 +289,11 @@
   while (!done) {
     if (last_pc != sim_->get_pc()) {
       last_pc = sim_->get_pc();
-      Disassembler::Disassemble(last_pc, last_pc + Instr::kInstrSize);
+      if (Simulator::IsIllegalAddress(last_pc)) {
+        OS::Print("pc is out of bounds: 0x%"Px"\n", last_pc);
+      } else {
+        Disassembler::Disassemble(last_pc, last_pc + Instr::kInstrSize);
+      }
     }
     char* line = ReadLine("sim> ");
     if (line == NULL) {
@@ -489,6 +540,8 @@
   delay_slot_ = false;
   break_pc_ = NULL;
   break_instr_ = 0;
+  last_setjmp_buffer_ = NULL;
+  top_exit_frame_info_ = 0;
 
   // Setup architecture state.
   // All registers are initialized to zero to start with.
@@ -499,10 +552,16 @@
   // The sp is initialized to point to the bottom (high address) of the
   // allocated stack area.
   registers_[SP] = StackTop();
+
+  // All double-precision registers are initialized to zero.
+  for (int i = 0; i < kNumberOfFRegisters; i++) {
+    fregisters_[i] = 0.0;
+  }
 }
 
 
 Simulator::~Simulator() {
+  delete[] stack_;
   Isolate* isolate = Isolate::Current();
   if (isolate != NULL) {
     isolate->set_simulator(NULL);
@@ -510,6 +569,68 @@
 }
 
 
+// When the generated code calls an external reference we need to catch that in
+// the simulator.  The external reference will be a function compiled for the
+// host architecture.  We need to call that function instead of trying to
+// execute it with the simulator.  We do that by redirecting the external
+// reference to a break instruction with code 2 that is handled by
+// the simulator.  We write the original destination of the jump just at a known
+// offset from the break instruction so the simulator knows what to call.
+class Redirection {
+ public:
+  uword address_of_break_instruction() {
+    return reinterpret_cast<uword>(&break_instruction_);
+  }
+
+  uword external_function() const { return external_function_; }
+
+  Simulator::CallKind call_kind() const { return call_kind_; }
+
+  static Redirection* Get(uword external_function,
+                          Simulator::CallKind call_kind) {
+    Redirection* current;
+    for (current = list_; current != NULL; current = current->next_) {
+      if (current->external_function_ == external_function) return current;
+    }
+    return new Redirection(external_function, call_kind);
+  }
+
+  static Redirection* FromBreakInstruction(Instr* break_instruction) {
+    char* addr_of_break = reinterpret_cast<char*>(break_instruction);
+    char* addr_of_redirection =
+        addr_of_break - OFFSET_OF(Redirection, break_instruction_);
+    return reinterpret_cast<Redirection*>(addr_of_redirection);
+  }
+
+ private:
+  static const int32_t kRedirectInstruction =
+    Instr::kBreakPointInstruction | (Instr::kRedirectCode << kBreakCodeShift);
+
+  Redirection(uword external_function, Simulator::CallKind call_kind)
+      : external_function_(external_function),
+        call_kind_(call_kind),
+        break_instruction_(kRedirectInstruction),
+        next_(list_) {
+    list_ = this;
+  }
+
+  uword external_function_;
+  Simulator::CallKind call_kind_;
+  uint32_t break_instruction_;
+  Redirection* next_;
+  static Redirection* list_;
+};
+
+
+Redirection* Redirection::list_ = NULL;
+
+
+uword Simulator::RedirectExternalReference(uword function, CallKind call_kind) {
+  Redirection* redirection = Redirection::Get(function, call_kind);
+  return redirection->address_of_break_instruction();
+}
+
+
 // Get the active Simulator for the current isolate.
 Simulator* Simulator::Current() {
   Simulator* simulator = Isolate::Current()->simulator();
@@ -691,6 +812,112 @@
 }
 
 
+// Calls into the Dart runtime are based on this interface.
+typedef void (*SimulatorRuntimeCall)(NativeArguments arguments);
+
+// Calls to leaf Dart runtime functions are based on this interface.
+typedef int32_t (*SimulatorLeafRuntimeCall)(
+    int32_t r0, int32_t r1, int32_t r2, int32_t r3);
+
+// Calls to native Dart functions are based on this interface.
+typedef void (*SimulatorNativeCall)(NativeArguments* arguments);
+
+
+void Simulator::DoBreak(Instr *instr) {
+  ASSERT(instr->OpcodeField() == SPECIAL);
+  ASSERT(instr->FunctionField() == BREAK);
+  if (instr->BreakCodeField() == Instr::kStopMessageCode) {
+    SimulatorDebugger dbg(this);
+    const char* message = *reinterpret_cast<const char**>(
+        reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
+    set_pc(get_pc() + Instr::kInstrSize);
+    dbg.Stop(instr, message);
+  } else if (instr->BreakCodeField() == Instr::kRedirectCode) {
+    SimulatorSetjmpBuffer buffer(this);
+
+    if (!setjmp(buffer.buffer_)) {
+      int32_t saved_ra = get_register(RA);
+      Redirection* redirection = Redirection::FromBreakInstruction(instr);
+      uword external = redirection->external_function();
+      if (FLAG_trace_sim) {
+        OS::Print("Call to host function at 0x%"Pd"\n", external);
+      }
+
+      if (redirection->call_kind() != kLeafRuntimeCall) {
+        // The top_exit_frame_info of the current isolate points to the top of
+        // the simulator stack.
+        ASSERT((StackTop() - Isolate::Current()->top_exit_frame_info()) <
+               Isolate::GetSpecifiedStackSize());
+        // Set the top_exit_frame_info of this simulator to the native stack.
+        set_top_exit_frame_info(reinterpret_cast<uword>(&buffer));
+      }
+      if (redirection->call_kind() == kRuntimeCall) {
+        NativeArguments arguments;
+        ASSERT(sizeof(NativeArguments) == 4*kWordSize);
+        arguments.isolate_ = reinterpret_cast<Isolate*>(get_register(A0));
+        arguments.argc_tag_ = get_register(A1);
+        arguments.argv_ = reinterpret_cast<RawObject*(*)[]>(get_register(A2));
+        arguments.retval_ = reinterpret_cast<RawObject**>(get_register(A3));
+        SimulatorRuntimeCall target =
+            reinterpret_cast<SimulatorRuntimeCall>(external);
+        target(arguments);
+        set_register(V0, icount_);  // Zap result register from void function.
+      } else if (redirection->call_kind() == kLeafRuntimeCall) {
+        int32_t a0 = get_register(A0);
+        int32_t a1 = get_register(A1);
+        int32_t a2 = get_register(A2);
+        int32_t a3 = get_register(A3);
+        SimulatorLeafRuntimeCall target =
+            reinterpret_cast<SimulatorLeafRuntimeCall>(external);
+        a0 = target(a0, a1, a2, a3);
+        set_register(V0, a0);  // Set returned result from function.
+      } else {
+        ASSERT(redirection->call_kind() == kNativeCall);
+        NativeArguments* arguments;
+        arguments = reinterpret_cast<NativeArguments*>(get_register(A0));
+        SimulatorNativeCall target =
+            reinterpret_cast<SimulatorNativeCall>(external);
+        target(arguments);
+        set_register(V0, icount_);  // Zap result register from void function.
+      }
+      set_top_exit_frame_info(0);
+
+      // Zap caller-saved registers, since the actual runtime call could have
+      // used them.
+      set_register(T0, icount_);
+      set_register(T1, icount_);
+      set_register(T2, icount_);
+      set_register(T3, icount_);
+      set_register(T4, icount_);
+      set_register(T5, icount_);
+      set_register(T6, icount_);
+      set_register(T7, icount_);
+      set_register(T8, icount_);
+      set_register(T9, icount_);
+
+      set_register(A0, icount_);
+      set_register(A1, icount_);
+      set_register(A2, icount_);
+      set_register(A3, icount_);
+      set_register(TMP, icount_);
+      set_register(RA, icount_);
+
+      // Zap floating point registers.
+      double zap_dvalue = static_cast<double>(icount_);
+      for (int i = F0; i <= F31; i++) {
+        set_fregister(static_cast<FRegister>(i), zap_dvalue);
+      }
+
+      // Return. Subtract to account for pc_ increment after return.
+      set_pc(saved_ra - Instr::kInstrSize);
+    }
+  } else {
+    SimulatorDebugger dbg(this);
+    dbg.Stop(instr, "breakpoint");
+  }
+}
+
+
 void Simulator::DecodeSpecial(Instr* instr) {
   ASSERT(instr->OpcodeField() == SPECIAL);
   switch (instr->FunctionField()) {
@@ -711,16 +938,7 @@
       break;
     }
     case BREAK: {
-      if (instr->BreakCodeField() == Instr::kStopMessageCode) {
-        SimulatorDebugger dbg(this);
-        const char* message = *reinterpret_cast<const char**>(
-            reinterpret_cast<intptr_t>(instr) - Instr::kInstrSize);
-        set_pc(get_pc() + Instr::kInstrSize);
-        dbg.Stop(instr, message);
-      } else {
-        SimulatorDebugger dbg(this);
-        dbg.Stop(instr, "breakpoint");
-      }
+      DoBreak(instr);
       break;
     }
     case DIV: {
@@ -770,10 +988,10 @@
       ASSERT(instr->RsField() != instr->RdField());
       ASSERT(!delay_slot_);
       // Format(instr, "jalr'hint 'rd, rs");
+      set_register(instr->RdField(), pc_ + 2*Instr::kInstrSize);
       uword next_pc = get_register(instr->RsField());
       ExecuteDelaySlot();
       // Set return address to be the instruction after the delay slot.
-      set_register(instr->RdField(), pc_ + Instr::kInstrSize);
       pc_ = next_pc - Instr::kInstrSize;  // Account for regular PC increment.
       break;
     }
@@ -1065,6 +1283,12 @@
 
 
 void Simulator::InstructionDecode(Instr* instr) {
+  if (FLAG_trace_sim) {
+    const uword start = reinterpret_cast<uword>(instr);
+    const uword end = start + Instr::kInstrSize;
+    Disassembler::Disassemble(start, end);
+  }
+
   switch (instr->OpcodeField()) {
     case SPECIAL: {
       DecodeSpecial(instr);
diff --git a/runtime/vm/simulator_mips.h b/runtime/vm/simulator_mips.h
index 6e6997f..f5695fb 100644
--- a/runtime/vm/simulator_mips.h
+++ b/runtime/vm/simulator_mips.h
@@ -20,6 +20,9 @@
 
 namespace dart {
 
+class Isolate;
+class SimulatorSetjmpBuffer;
+
 class Simulator {
  public:
   static const uword kSimulatorStackUnderflowSize = 64;
@@ -52,6 +55,12 @@
   // Accessor to the internal simulator stack top.
   uword StackTop() const;
 
+  // The isolate's top_exit_frame_info refers to a Dart frame in the simulator
+  // stack. The simulator's top_exit_frame_info refers to a C++ frame in the
+  // native stack.
+  uword top_exit_frame_info() const { return top_exit_frame_info_; }
+  void set_top_exit_frame_info(uword value) { top_exit_frame_info_ = value; }
+
   // Call on program start.
   static void InitOnce();
 
@@ -64,6 +73,14 @@
                int32_t parameter2,
                int32_t parameter3);
 
+  // Runtime and native call support.
+  enum CallKind {
+    kRuntimeCall,
+    kLeafRuntimeCall,
+    kNativeCall
+  };
+  static uword RedirectExternalReference(uword function, CallKind call_kind);
+
  private:
   // A pc value used to signal the simulator to stop execution.  Generally
   // the ra is set to this value on transition from native C code to
@@ -83,6 +100,8 @@
   char* stack_;
   int icount_;
   bool delay_slot_;
+  SimulatorSetjmpBuffer* last_setjmp_buffer_;
+  uword top_exit_frame_info_;
 
   // Registered breakpoints.
   Instr* break_pc_;
@@ -120,6 +139,8 @@
   inline void WriteW(uword addr, int value, Instr* instr);
 
   void DoBranch(Instr* instr, bool taken, bool likely);
+  void DoBreak(Instr *instr);
+
   void DecodeSpecial(Instr* instr);
   void DecodeSpecial2(Instr* instr);
   void DecodeRegImm(Instr* instr);
@@ -128,7 +149,16 @@
   void Execute();
   void ExecuteDelaySlot();
 
+  // Longjmp support for exceptions.
+  SimulatorSetjmpBuffer* last_setjmp_buffer() {
+    return last_setjmp_buffer_;
+  }
+  void set_last_setjmp_buffer(SimulatorSetjmpBuffer* buffer) {
+    last_setjmp_buffer_ = buffer;
+  }
+
   friend class SimulatorDebugger;
+  friend class SimulatorSetjmpBuffer;
 };
 
 }  // namespace dart
diff --git a/runtime/vm/stack_frame_mips.cc b/runtime/vm/stack_frame_mips.cc
index b15de57..a4a94f2 100644
--- a/runtime/vm/stack_frame_mips.cc
+++ b/runtime/vm/stack_frame_mips.cc
@@ -9,27 +9,28 @@
 
 namespace dart {
 
+static const int kPcAddressOffsetFromSp = -2 * kWordSize;
+static const int kEntrypointMarkerOffsetFromFp = 2 * kWordSize;
+static const int kSpOffsetFromPreviousFp = 3 * kWordSize;
+
+
 intptr_t StackFrame::PcAddressOffsetFromSp() {
-  UNIMPLEMENTED();
-  return 0;
+  return kPcAddressOffsetFromSp;
 }
 
 
 intptr_t StackFrame::EntrypointMarkerOffsetFromFp() {
-  UNIMPLEMENTED();
-  return 0;
+  return kEntrypointMarkerOffsetFromFp;
 }
 
 
 uword StackFrame::GetCallerFp() const {
-  UNIMPLEMENTED();
-  return 0;
+  return *(reinterpret_cast<uword*>(fp()));
 }
 
 
 uword StackFrame::GetCallerSp() const {
-  UNIMPLEMENTED();
-  return 0;
+  return fp() + kSpOffsetFromPreviousFp;
 }
 
 
@@ -46,7 +47,9 @@
 
 
 void StackFrameIterator::SetupLastExitFrameData() {
-  UNIMPLEMENTED();
+  Isolate* current = Isolate::Current();
+  uword exit_marker = current->top_exit_frame_info();
+  frames_.fp_ = exit_marker;
 }
 
 
diff --git a/runtime/vm/store_buffer.cc b/runtime/vm/store_buffer.cc
index 9e00f24..ebfd64a 100644
--- a/runtime/vm/store_buffer.cc
+++ b/runtime/vm/store_buffer.cc
@@ -64,6 +64,7 @@
 void StoreBuffer::AddPointer(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.
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 6ad9611..4be2161 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -8,6 +8,7 @@
 #include "vm/assembler.h"
 #include "vm/code_generator.h"
 #include "vm/dart_entry.h"
+#include "vm/flow_graph_compiler.h"
 #include "vm/instructions.h"
 #include "vm/stack_frame.h"
 #include "vm/stub_code.h"
@@ -16,6 +17,13 @@
 
 namespace dart {
 
+DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects.");
+DEFINE_FLAG(bool, use_slow_path, false,
+    "Set to true for debugging & verifying the slow paths.");
+DECLARE_FLAG(int, optimization_counter_threshold);
+DECLARE_FLAG(bool, trace_optimized_ic_calls);
+
+
 // Input parameters:
 //   LR : return address.
 //   SP : address of last argument in argument array.
@@ -353,9 +361,168 @@
 }
 
 
+// Called for inline allocation of objects.
+// Input parameters:
+//   LR : return address.
+//   SP + 4 : type arguments object (only if class is parameterized).
+//   SP + 0 : type arguments of instantiator (only if class is parameterized).
 void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
                                               const Class& cls) {
-  __ Unimplemented("AllocateObject stub");
+  // The generated code is different if the class is parameterized.
+  const bool is_cls_parameterized =
+      cls.type_arguments_field_offset() != Class::kNoTypeArguments;
+  // kInlineInstanceSize is a constant used as a threshold for determining
+  // when the object initialization should be done as a loop or as
+  // straight line code.
+  const int kInlineInstanceSize = 12;
+  const intptr_t instance_size = cls.instance_size();
+  ASSERT(instance_size > 0);
+  const intptr_t type_args_size = InstantiatedTypeArguments::InstanceSize();
+  if (FLAG_inline_alloc &&
+      PageSpace::IsPageAllocatableSize(instance_size + type_args_size)) {
+    Label slow_case;
+    Heap* heap = Isolate::Current()->heap();
+    __ LoadImmediate(R5, heap->TopAddress());
+    __ ldr(R2, Address(R5, 0));
+    __ AddImmediate(R3, R2, instance_size);
+    if (is_cls_parameterized) {
+      __ ldm(IA, SP, (1 << R0) | (1 << R1));
+      __ mov(R4, ShifterOperand(R3));
+      // A new InstantiatedTypeArguments object only needs to be allocated if
+      // the instantiator is provided (not kNoInstantiator, but may be null).
+      __ CompareImmediate(R0, Smi::RawValue(StubCode::kNoInstantiator));
+      __ AddImmediate(R3, type_args_size, NE);
+      // R4: potential new object end and, if R4 != R3, potential new
+      // InstantiatedTypeArguments object start.
+    }
+    // Check if the allocation fits into the remaining space.
+    // R2: potential new object start.
+    // R3: potential next object start.
+    if (FLAG_use_slow_path) {
+      __ b(&slow_case);
+    } else {
+      __ LoadImmediate(IP, heap->EndAddress());
+      __ cmp(R3, ShifterOperand(IP));
+      __ b(&slow_case, CS);  // Branch if unsigned higher or equal.
+    }
+
+    // Successfully allocated the object(s), now update top to point to
+    // next object start and initialize the object.
+    __ str(R3, Address(R5, 0));
+
+    if (is_cls_parameterized) {
+      // Initialize the type arguments field in the object.
+      // R2: new object start.
+      // R4: potential new object end and, if R4 != R3, potential new
+      // InstantiatedTypeArguments object start.
+      // R3: next object start.
+      Label type_arguments_ready;
+      __ cmp(R4, ShifterOperand(R3));
+      __ b(&type_arguments_ready, EQ);
+      // Initialize InstantiatedTypeArguments object at R4.
+      __ str(R1, Address(R4,
+          InstantiatedTypeArguments::uninstantiated_type_arguments_offset()));
+      __ str(R0, Address(R4,
+          InstantiatedTypeArguments::instantiator_type_arguments_offset()));
+      const Class& ita_cls =
+          Class::ZoneHandle(Object::instantiated_type_arguments_class());
+      // Set the tags.
+      uword tags = 0;
+      tags = RawObject::SizeTag::update(type_args_size, tags);
+      tags = RawObject::ClassIdTag::update(ita_cls.id(), tags);
+      __ LoadImmediate(R0, tags);
+      __ str(R0, Address(R4, Instance::tags_offset()));
+      // Set the new InstantiatedTypeArguments object (R4) as the type
+      // arguments (R1) of the new object (R2).
+      __ add(R1, R4, ShifterOperand(kHeapObjectTag));
+      // Set R3 to new object end.
+      __ mov(R3, ShifterOperand(R4));
+      __ Bind(&type_arguments_ready);
+      // R2: new object.
+      // R1: new object type arguments.
+    }
+
+    // R2: new object start.
+    // R3: next object start.
+    // R1: new object type arguments (if is_cls_parameterized).
+    // Set the tags.
+    uword tags = 0;
+    tags = RawObject::SizeTag::update(instance_size, tags);
+    ASSERT(cls.id() != kIllegalCid);
+    tags = RawObject::ClassIdTag::update(cls.id(), tags);
+    __ LoadImmediate(R0, tags);
+    __ str(R0, Address(R2, Instance::tags_offset()));
+
+    // Initialize the remaining words of the object.
+    __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+
+    // R0: raw null.
+    // R2: new object start.
+    // R3: next object start.
+    // R1: new object type arguments (if is_cls_parameterized).
+    // First try inlining the initialization without a loop.
+    if (instance_size < (kInlineInstanceSize * kWordSize)) {
+      // Check if the object contains any non-header fields.
+      // Small objects are initialized using a consecutive set of writes.
+      for (intptr_t current_offset = sizeof(RawObject);
+           current_offset < instance_size;
+           current_offset += kWordSize) {
+        __ StoreToOffset(kStoreWord, R0, R2, current_offset);
+      }
+    } else {
+      __ add(R4, R2, ShifterOperand(sizeof(RawObject)));
+      // Loop until the whole object is initialized.
+      // R0: raw null.
+      // R2: new object.
+      // R3: next object start.
+      // R4: next word to be initialized.
+      // R1: new object type arguments (if is_cls_parameterized).
+      Label init_loop;
+      Label done;
+      __ Bind(&init_loop);
+      __ cmp(R4, ShifterOperand(R3));
+      __ b(&done, CS);
+      __ str(R0, Address(R4, 0));
+      __ AddImmediate(R4, kWordSize);
+      __ b(&init_loop);
+      __ Bind(&done);
+    }
+    if (is_cls_parameterized) {
+      // R1: new object type arguments.
+      // Set the type arguments in the new object.
+      __ StoreToOffset(kStoreWord, R1, R2, cls.type_arguments_field_offset());
+    }
+    // Done allocating and initializing the instance.
+    // R2: new object still missing its heap tag.
+    __ add(R0, R2, ShifterOperand(kHeapObjectTag));
+    __ Ret();
+
+    __ Bind(&slow_case);
+  }
+  if (is_cls_parameterized) {
+    __ ldm(IA, SP, (1 << R0) | (1 << R1));
+  }
+  // Create a stub frame as we are pushing some objects on the stack before
+  // calling into the runtime.
+  __ EnterStubFrame(true);  // Uses pool pointer to pass cls to runtime.
+  __ LoadImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
+  __ Push(R2);  // Setup space on stack for return value.
+  __ PushObject(cls);  // Push class of object to be allocated.
+  if (is_cls_parameterized) {
+    // Push type arguments of object to be allocated and of instantiator.
+    __ PushList((1 << R0) | (1 << R1));
+  } else {
+    // Push null type arguments and kNoInstantiator.
+    __ LoadImmediate(R1, Smi::RawValue(StubCode::kNoInstantiator));
+    __ PushList((1 << R1) | (1 << R2));
+  }
+  __ CallRuntime(kAllocateObjectRuntimeEntry);  // Allocate object.
+  __ Drop(3);  // Pop arguments.
+  __ Pop(R0);  // Pop result (newly allocated object).
+  // R0: new object
+  // Restore the frame pointer.
+  __ LeaveStubFrame(true);
+  __ Ret();
 }
 
 
@@ -375,30 +542,221 @@
 }
 
 
+// Loads function into 'temp_reg'.
 void StubCode::GenerateUsageCounterIncrement(Assembler* assembler,
                                              Register temp_reg) {
-  __ Unimplemented("UsageCounterIncrement stub");
+  Register ic_reg = R5;
+  Register func_reg = temp_reg;
+  ASSERT(temp_reg == R6);
+  __ ldr(func_reg, FieldAddress(ic_reg, ICData::function_offset()));
+  __ ldr(R7, FieldAddress(func_reg, Function::usage_counter_offset()));
+  Label is_hot;
+  if (FlowGraphCompiler::CanOptimize()) {
+    ASSERT(FLAG_optimization_counter_threshold > 1);
+    // The usage_counter is always less than FLAG_optimization_counter_threshold
+    // except when the function gets optimized.
+    __ CompareImmediate(R7, FLAG_optimization_counter_threshold);
+    __ b(&is_hot, EQ);
+    // 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);
 }
 
 
+// Generate inline cache check for 'num_args'.
+//  LR: return address
+//  R5: Inline cache data object.
+//  R4: Arguments descriptor array.
+// Control flow:
+// - If receiver is null -> jump to IC miss.
+// - If receiver is Smi -> load Smi class.
+// - If receiver is not-Smi -> load receiver's class.
+// - Check if 'num_args' (including receiver) match any IC data group.
+// - Match found -> jump to target.
+// - Match not found -> jump to IC miss.
 void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler,
                                                  intptr_t num_args) {
-  __ Unimplemented("NArgsCheckInlineCache stub");
+  ASSERT(num_args > 0);
+#if defined(DEBUG)
+  { Label ok;
+    // Check that the IC data array has NumberOfArgumentsChecked() == num_args.
+    // 'num_args_tested' is stored as an untagged int.
+    __ ldr(R6, FieldAddress(R5, ICData::num_args_tested_offset()));
+    __ CompareImmediate(R6, num_args);
+    __ b(&ok, EQ);
+    __ Stop("Incorrect stub for IC data");
+    __ Bind(&ok);
+  }
+#endif  // DEBUG
+
+  // Preserve return address, since LR is needed for subroutine call.
+  __ mov(R8, ShifterOperand(LR));
+  // Loop that checks if there is an IC data match.
+  Label loop, update, test, found, get_class_id_as_smi;
+  // 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, R6, Array::data_offset() - kHeapObjectTag);
+  // R6: points directly to the first ic data array element.
+
+  // Get the receiver's class ID (first read number of arguments from
+  // arguments descriptor array and then access the receiver from the stack).
+  __ ldr(R7, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
+  __ sub(R7, R7, ShifterOperand(Smi::RawValue(1)));
+  __ ldr(R0, Address(SP, R7, LSL, 1));  // R7 (argument_count - 1) is smi.
+  __ bl(&get_class_id_as_smi);
+  // R7: argument_count - 1 (smi).
+  // R0: receiver's class ID (smi).
+  __ ldr(R1, Address(R6, 0));  // First class id (smi) to check.
+  __ b(&test);
+
+  __ Bind(&loop);
+  for (int i = 0; i < num_args; i++) {
+    if (i > 0) {
+      // If not the first, load the next argument's class ID.
+      __ AddImmediate(R0, R7, Smi::RawValue(-i));
+      __ ldr(R0, Address(SP, R0, LSL, 1));
+      __ bl(&get_class_id_as_smi);
+      // R0: next argument class ID (smi).
+      __ LoadFromOffset(kLoadWord, R1, R6, i * kWordSize);
+      // R1: next class ID to check (smi).
+    }
+    __ cmp(R0, ShifterOperand(R1));  // Class id match?
+    if (i < (num_args - 1)) {
+      __ b(&update, NE);  // Continue.
+    } else {
+      // Last check, all checks before matched.
+      __ mov(LR, ShifterOperand(R8), EQ);  // Restore return address if found.
+      __ b(&found, EQ);  // Break.
+    }
+  }
+  __ Bind(&update);
+  // Reload receiver class ID.  It has not been destroyed when num_args == 1.
+  if (num_args > 1) {
+    __ ldr(R0, Address(SP, R7, LSL, 1));
+    __ bl(&get_class_id_as_smi);
+  }
+
+  const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
+  __ AddImmediate(R6, entry_size);  // Next entry.
+  __ ldr(R1, Address(R6, 0));  // Next class ID.
+
+  __ Bind(&test);
+  __ CompareImmediate(R1, Smi::RawValue(kIllegalCid));  // Done?
+  __ b(&loop, NE);
+
+  // IC miss.
+  // Restore return address.
+  __ mov(LR, ShifterOperand(R8));
+
+  // Compute address of arguments (first read number of arguments from
+  // arguments descriptor array and then compute address on the stack).
+  // R7: argument_count - 1 (smi).
+  __ add(R7, SP, ShifterOperand(R7, LSL, 1));  // R7 is Smi.
+  // R7: address of receiver.
+  // 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 IC data object and arguments descriptor array and
+  // setup space on stack for result (target code object).
+  __ PushList((1 << R0) | (1 << R4) | (1 << R5));
+  // Push call arguments.
+  for (intptr_t i = 0; i < num_args; i++) {
+    __ LoadFromOffset(kLoadWord, IP, R7, -i * kWordSize);
+    __ Push(IP);
+  }
+  // Pass IC data object and arguments descriptor array.
+  __ PushList((1 << R4) | (1 << R5));
+
+  if (num_args == 1) {
+    __ CallRuntime(kInlineCacheMissHandlerOneArgRuntimeEntry);
+  } else if (num_args == 2) {
+    __ CallRuntime(kInlineCacheMissHandlerTwoArgsRuntimeEntry);
+  } else if (num_args == 3) {
+    __ CallRuntime(kInlineCacheMissHandlerThreeArgsRuntimeEntry);
+  } else {
+    UNIMPLEMENTED();
+  }
+  // Remove the call arguments pushed earlier, including the IC data object
+  // and the arguments descriptor array.
+  __ Drop(num_args + 2);
+  // Pop returned code object into R0 (null if not found).
+  // Restore arguments descriptor array and IC data array.
+  __ PopList((1 << R0) | (1 << R4) | (1 << R5));
+  __ LeaveStubFrame();
+  Label call_target_function;
+  __ CompareImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ b(&call_target_function, NE);
+  // NoSuchMethod or closure.
+  // Mark IC call that it may be a closure call that does not collect
+  // type feedback.
+  __ mov(IP, ShifterOperand(1));
+  __ strb(IP, FieldAddress(R5, ICData::is_closure_call_offset()));
+  __ Branch(&StubCode::InstanceFunctionLookupLabel());
+
+  __ Bind(&found);
+  // R6: Pointer to an IC data check group.
+  const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize;
+  const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
+  __ LoadFromOffset(kLoadWord, R0, R6, target_offset);
+  __ LoadFromOffset(kLoadWord, R1, R6, count_offset);
+  __ adds(R1, R1, ShifterOperand(Smi::RawValue(1)));
+  __ StoreToOffset(kStoreWord, R1, R6, count_offset);
+  __ b(&call_target_function, VC);  // No overflow.
+  __ LoadImmediate(R1, Smi::RawValue(Smi::kMaxValue));
+  __ StoreToOffset(kStoreWord, R1, R6, count_offset);
+
+  __ Bind(&call_target_function);
+  // R0: Target function.
+  __ ldr(R0, FieldAddress(R0, Function::code_offset()));
+  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
+  __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ bx(R0);
+
+  // Instance in R0, return its class-id in R0 as Smi.
+  __ Bind(&get_class_id_as_smi);
+  Label not_smi;
+  // Test if Smi -> load Smi class for comparison.
+  __ tst(R0, ShifterOperand(kSmiTagMask));
+  __ mov(R0, ShifterOperand(Smi::RawValue(kSmiCid)), EQ);
+  __ bx(LR, EQ);
+  __ LoadClassId(R0, R0);
+  __ SmiTag(R0);
+  __ bx(LR);
 }
 
 
+// Use inline cache data array to invoke the target or continue in inline
+// cache miss handler. Stub for 1-argument check (receiver class).
+//  LR: Return address.
+//  R5: Inline cache data object.
+//  R4: Arguments descriptor array.
+// Inline cache data object structure:
+// 0: function-name
+// 1: N, number of arguments checked.
+// 2 .. (length - 1): group of checks, each check containing:
+//   - N classes.
+//   - 1 target function.
 void StubCode::GenerateOneArgCheckInlineCacheStub(Assembler* assembler) {
-  __ Unimplemented("GenerateOneArgCheckInlineCacheStub stub");
+  GenerateUsageCounterIncrement(assembler, R6);
+  GenerateNArgsCheckInlineCacheStub(assembler, 1);
 }
 
 
 void StubCode::GenerateTwoArgsCheckInlineCacheStub(Assembler* assembler) {
-  __ Unimplemented("GenerateTwoArgsCheckInlineCacheStub stub");
+  GenerateUsageCounterIncrement(assembler, R6);
+  GenerateNArgsCheckInlineCacheStub(assembler, 2);
 }
 
 
 void StubCode::GenerateThreeArgsCheckInlineCacheStub(Assembler* assembler) {
-  __ Unimplemented("GenerateThreeArgsCheckInlineCacheStub stub");
+  GenerateUsageCounterIncrement(assembler, R6);
+  GenerateNArgsCheckInlineCacheStub(assembler, 3);
 }
 
 
@@ -448,18 +806,108 @@
 }
 
 
+// Used to check class and type arguments. Arguments passed in registers:
+// LR: return address.
+// R0: instance (must be preserved).
+// R1: instantiator type arguments or NULL.
+// R2: cache array.
+// Result in R1: null -> not found, otherwise result (true or false).
+static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) {
+  ASSERT((1 <= n) && (n <= 3));
+  if (n > 1) {
+    // Get instance type arguments.
+    __ LoadClass(R3, R0, R4);
+    // Compute instance type arguments into R4.
+    Label has_no_type_arguments;
+    __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null()));
+    __ ldr(R5, FieldAddress(R3,
+        Class::type_arguments_field_offset_in_words_offset()));
+    __ CompareImmediate(R5, Class::kNoTypeArguments);
+    __ b(&has_no_type_arguments, EQ);
+    __ add(R5, R0, ShifterOperand(R5, LSL, 2));
+    __ ldr(R4, FieldAddress(R5, 0));
+    __ Bind(&has_no_type_arguments);
+  }
+  __ LoadClassId(R3, R0);
+  // R0: instance.
+  // R1: instantiator type arguments or NULL.
+  // R2: SubtypeTestCache.
+  // R3: instance class id.
+  // R4: instance type arguments (null if none), used only if n > 1.
+  __ ldr(R2, FieldAddress(R2, SubtypeTestCache::cache_offset()));
+  __ AddImmediate(R2, Array::data_offset() - kHeapObjectTag);
+
+  Label loop, found, not_found, next_iteration;
+  // R2: Entry start.
+  // R3: instance class id.
+  // R4: instance type arguments.
+  __ SmiTag(R3);
+  __ Bind(&loop);
+  __ ldr(R5, Address(R2, kWordSize * SubtypeTestCache::kInstanceClassId));
+  __ CompareImmediate(R5, reinterpret_cast<intptr_t>(Object::null()));
+  __ b(&not_found, EQ);
+  __ cmp(R5, ShifterOperand(R3));
+  if (n == 1) {
+    __ b(&found, EQ);
+  } else {
+    __ b(&next_iteration, NE);
+    __ ldr(R5,
+           Address(R2, kWordSize * SubtypeTestCache::kInstanceTypeArguments));
+    __ cmp(R5, ShifterOperand(R4));
+    if (n == 2) {
+      __ b(&found, EQ);
+    } else {
+      __ b(&next_iteration, NE);
+      __ ldr(R5, Address(R2, kWordSize *
+                             SubtypeTestCache::kInstantiatorTypeArguments));
+      __ cmp(R5, ShifterOperand(R1));
+      __ b(&found, EQ);
+    }
+  }
+  __ Bind(&next_iteration);
+  __ AddImmediate(R2, kWordSize * SubtypeTestCache::kTestEntryLength);
+  __ b(&loop);
+  // Fall through to not found.
+  __ Bind(&not_found);
+  __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+  __ Ret();
+
+  __ Bind(&found);
+  __ ldr(R1, Address(R2, kWordSize * SubtypeTestCache::kTestResult));
+  __ Ret();
+}
+
+
+// Used to check class and type arguments. Arguments passed in registers:
+// LR: return address.
+// R0: instance (must be preserved).
+// R1: instantiator type arguments or NULL.
+// R2: cache array.
+// Result in R1: null -> not found, otherwise result (true or false).
 void StubCode::GenerateSubtype1TestCacheStub(Assembler* assembler) {
-  __ Unimplemented("Subtype1TestCache Stub");
+  GenerateSubtypeNTestCacheStub(assembler, 1);
 }
 
 
+// Used to check class and type arguments. Arguments passed in registers:
+// LR: return address.
+// R0: instance (must be preserved).
+// R1: instantiator type arguments or NULL.
+// R2: cache array.
+// Result in R1: null -> not found, otherwise result (true or false).
 void StubCode::GenerateSubtype2TestCacheStub(Assembler* assembler) {
-  __ Unimplemented("Subtype2TestCache Stub");
+  GenerateSubtypeNTestCacheStub(assembler, 2);
 }
 
 
+// Used to check class and type arguments. Arguments passed in registers:
+// LR: return address.
+// R0: instance (must be preserved).
+// R1: instantiator type arguments or NULL.
+// R2: cache array.
+// Result in R1: null -> not found, otherwise result (true or false).
 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) {
-  __ Unimplemented("Subtype3TestCache Stub");
+  GenerateSubtypeNTestCacheStub(assembler, 3);
 }
 
 
@@ -485,17 +933,114 @@
 
 
 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
-  __ Unimplemented("EqualityWithNullArg stub");
+  __ Unimplemented("EqualityWithNullArg Stub");
 }
 
 
+// Calls to the runtime to optimize the given function.
+// R6: function to be reoptimized.
+// R4: argument descriptor (preserved).
 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
-  __ Unimplemented("OptimizeFunction stub");
+  __ EnterStubFrame();
+  __ Push(R4);
+  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  __ Push(IP);  // Setup space on stack for return value.
+  __ Push(R6);
+  __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
+  __ Pop(R0);  // Discard argument.
+  __ Pop(R0);  // Get Code object
+  __ Pop(R4);  // Restore argument descriptor.
+  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
+  __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LeaveStubFrame();
+  __ bx(R0);
+  __ bkpt(0);
 }
 
 
+DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
+                           BigintCompare,
+                           RawBigint* left,
+                           RawBigint* right);
+
+
+// Does identical check (object references are equal or not equal) with special
+// checks for boxed numbers.
+// LR: return address.
+// SP + 4: left operand.
+// SP + 0: right operand.
+// Return Zero condition flag set if equal.
+// 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) {
-  __ Unimplemented("IdenticalWithNumberCheck stub");
+  const Register temp = R2;
+  const Register left = R1;
+  const Register right = R0;
+  // Preserve left, right and temp.
+  __ PushList((1 << R0) | (1 << R1) | (1 << R2));
+  // TOS + 4: left argument.
+  // TOS + 3: right argument.
+  // TOS + 2: saved temp
+  // TOS + 1: saved left
+  // TOS + 0: saved right
+  __ ldr(left, Address(SP, 4 * kWordSize));
+  __ ldr(right, Address(SP, 3 * kWordSize));
+  Label reference_compare, done, check_mint, check_bigint;
+  // If any of the arguments is Smi do reference compare.
+  __ tst(left, ShifterOperand(kSmiTagMask));
+  __ b(&reference_compare, EQ);
+  __ tst(right, ShifterOperand(kSmiTagMask));
+  __ b(&reference_compare, EQ);
+
+  // Value compare for two doubles.
+  __ CompareClassId(left, kDoubleCid, temp);
+  __ b(&check_mint, NE);
+  __ CompareClassId(right, kDoubleCid, temp);
+  __ b(&done, NE);
+
+  // Double values bitwise compare.
+  __ ldr(temp, FieldAddress(left, Double::value_offset() + 0 * kWordSize));
+  __ ldr(IP, FieldAddress(right, Double::value_offset() + 0 * kWordSize));
+  __ cmp(temp, ShifterOperand(IP));
+  __ b(&done, NE);
+  __ ldr(temp, FieldAddress(left, Double::value_offset() + 1 * kWordSize));
+  __ ldr(IP, FieldAddress(right, Double::value_offset() + 1 * kWordSize));
+  __ cmp(temp, ShifterOperand(IP));
+  __ b(&done);
+
+  __ Bind(&check_mint);
+  __ CompareClassId(left, kMintCid, temp);
+  __ b(&check_bigint, NE);
+  __ CompareClassId(right, kMintCid, temp);
+  __ b(&done, NE);
+  __ ldr(temp, FieldAddress(left, Mint::value_offset() + 0 * kWordSize));
+  __ ldr(IP, FieldAddress(right, Mint::value_offset() + 0 * kWordSize));
+  __ cmp(temp, ShifterOperand(IP));
+  __ b(&done, NE);
+  __ ldr(temp, FieldAddress(left, Mint::value_offset() + 1 * kWordSize));
+  __ ldr(IP, FieldAddress(right, Mint::value_offset() + 1 * kWordSize));
+  __ cmp(temp, ShifterOperand(IP));
+  __ b(&done);
+
+  __ Bind(&check_bigint);
+  __ CompareClassId(left, kBigintCid, temp);
+  __ b(&reference_compare, NE);
+  __ CompareClassId(right, kBigintCid, temp);
+  __ b(&done, NE);
+  __ EnterStubFrame(0);
+  __ ReserveAlignedFrameSpace(2 * kWordSize);
+  __ stm(IA, SP,  (1 << R0) | (1 << R1));
+  __ CallRuntime(kBigintCompareRuntimeEntry);
+  // Result in R0, 0 means equal.
+  __ LeaveStubFrame();
+  __ cmp(R0, ShifterOperand(0));
+  __ b(&done);
+
+  __ Bind(&reference_compare);
+  __ cmp(left, ShifterOperand(right));
+  __ Bind(&done);
+  __ PopList((1 << R0) | (1 << R1) | (1 << R2));
+  __ Ret();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 3e5a567..1a48f6b 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -1101,7 +1101,6 @@
     // EAX: new object start.
     // EBX: next object start.
     // EDI: new object type arguments (if is_cls_parameterized).
-    __ LoadObject(EDX, cls);  // Load class of object to be allocated.
     // Set the tags.
     uword tags = 0;
     tags = RawObject::SizeTag::update(instance_size, tags);
@@ -1115,7 +1114,6 @@
 
     // EAX: new object start.
     // EBX: next object start.
-    // EDX: class of the object to be allocated.
     // EDI: new object type arguments (if is_cls_parameterized).
     // First try inlining the initialization without a loop.
     if (instance_size < (kInlineInstanceSize * kWordSize)) {
@@ -1640,7 +1638,6 @@
 }
 
 
-
 // Use inline cache data array to invoke the target or continue in inline
 // cache miss handler. Stub for 1-argument check (receiver class).
 //  EDI: function which counter needs to be incremented.
@@ -2017,7 +2014,7 @@
 }
 
 
-// Calls to runtime to ooptimized give function
+// Calls to the runtime to optimize the given function.
 // EDI: function to be reoptimized.
 // EDX: argument descriptor (preserved).
 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index 9cb6525..01e9876 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -16,8 +16,82 @@
 
 namespace dart {
 
+// Input parameters:
+//   RA : return address.
+//   SP : address of last argument in argument array.
+//   SP + 4*S4 - 4 : address of first argument in argument array.
+//   SP + 4*S4 : address of return value.
+//   S5 : address of the runtime function to call.
+//   S4 : number of arguments to the call.
 void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
-  __ Unimplemented("CallToRuntime stub");
+  const intptr_t isolate_offset = NativeArguments::isolate_offset();
+  const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
+  const intptr_t argv_offset = NativeArguments::argv_offset();
+  const intptr_t retval_offset = NativeArguments::retval_offset();
+
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(RA, Address(SP, 1 * kWordSize));
+  __ sw(FP, Address(SP, 0 * kWordSize));
+  __ mov(FP, SP);
+
+  // Load current Isolate pointer from Context structure into R0.
+  __ lw(A0, FieldAddress(CTX, Context::isolate_offset()));
+
+  // Save exit frame information to enable stack walking as we are about
+  // to transition to Dart VM C++ code.
+  __ sw(SP, Address(A0, Isolate::top_exit_frame_info_offset()));
+
+  // Save current Context pointer into Isolate structure.
+  __ sw(CTX, Address(A0, Isolate::top_context_offset()));
+
+  // Cache Isolate pointer into CTX while executing runtime code.
+  __ mov(CTX, A0);
+
+  // Reserve space for arguments and align frame before entering C++ world.
+  // NativeArguments are passed in registers.
+  ASSERT(sizeof(NativeArguments) == 4 * kWordSize);
+  __ ReserveAlignedFrameSpace(0);
+
+  // Pass NativeArguments structure by value and call runtime.
+  // Registers A0, A1, A2, and A3 are used.
+
+  ASSERT(isolate_offset == 0 * kWordSize);
+  // Set isolate in NativeArgs: A0 already contains CTX.
+
+  // There are no runtime calls to closures, so we do not need to set the tag
+  // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_.
+  ASSERT(argc_tag_offset == 1 * kWordSize);
+  __ mov(A1, S4);  // Set argc in NativeArguments.
+
+  ASSERT(argv_offset == 2 * kWordSize);
+  __ sll(A2, S4, 2);
+  __ addu(A2, FP, A2);  // Compute argv.
+  __ addiu(A2, A2, Immediate(kWordSize));  // Set argv in NativeArguments.
+
+  ASSERT(retval_offset == 3 * kWordSize);
+  __ addiu(A3, A2, Immediate(kWordSize));  // Retval is next to 1st argument.
+
+  // Call runtime or redirection via simulator.
+  __ jalr(S5);
+
+  // Reset exit frame information in Isolate structure.
+  __ sw(ZR, Address(CTX, Isolate::top_exit_frame_info_offset()));
+
+  // Load Context pointer from Isolate structure into A2.
+  __ lw(A2, Address(CTX, Isolate::top_context_offset()));
+
+  // Reset Context pointer in Isolate structure.
+  __ LoadImmediate(A3, reinterpret_cast<intptr_t>(Object::null()));
+  __ sw(A3, Address(CTX, Isolate::top_context_offset()));
+
+  // Cache Context pointer into CTX while executing Dart code.
+  __ mov(CTX, A2);
+
+  __ mov(SP, FP);
+  __ lw(RA, Address(SP, 1 * kWordSize));
+  __ lw(FP, Address(SP, 0 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  __ Ret();
 }
 
 
@@ -26,13 +100,118 @@
 }
 
 
+// Input parameters:
+//   RA : return address.
+//   SP : address of return value.
+//   T5 : address of the native function to call.
+//   A2 : address of first argument in argument array.
+//   A1 : argc_tag including number of arguments and function kind.
 void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) {
-  __ Unimplemented("CallNativeCFunction stub");
+  const intptr_t isolate_offset = NativeArguments::isolate_offset();
+  const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
+  const intptr_t argv_offset = NativeArguments::argv_offset();
+  const intptr_t retval_offset = NativeArguments::retval_offset();
+
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(RA, Address(SP, 1 * kWordSize));
+  __ sw(FP, Address(SP, 0 * kWordSize));
+  __ mov(FP, SP);
+
+  // Load current Isolate pointer from Context structure into A0.
+  __ lw(A0, FieldAddress(CTX, Context::isolate_offset()));
+
+  // Save exit frame information to enable stack walking as we are about
+  // to transition to native code.
+  __ sw(SP, Address(A0, Isolate::top_exit_frame_info_offset()));
+
+  // Save current Context pointer into Isolate structure.
+  __ sw(CTX, Address(A0, Isolate::top_context_offset()));
+
+  // Cache Isolate pointer into CTX while executing native code.
+  __ mov(CTX, A0);
+
+  // Reserve space for the native arguments structure passed on the stack (the
+  // outgoing pointer parameter to the native arguments structure is passed in
+  // R0) and align frame before entering the C++ world.
+  __ ReserveAlignedFrameSpace(sizeof(NativeArguments));
+
+  // Initialize NativeArguments structure and call native function.
+  // Registers A0, A1, A2, and A3 are used.
+
+  ASSERT(isolate_offset == 0 * kWordSize);
+  // Set isolate in NativeArgs: A0 already contains CTX.
+
+  // There are no native calls to closures, so we do not need to set the tag
+  // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_.
+  ASSERT(argc_tag_offset == 1 * kWordSize);
+  // Set argc in NativeArguments: T1 already contains argc.
+
+  ASSERT(argv_offset == 2 * kWordSize);
+  // Set argv in NativeArguments: T2 already contains argv.
+
+  ASSERT(retval_offset == 3 * kWordSize);
+  __ addiu(A3, FP, Immediate(2 * kWordSize));  // Set retval in NativeArgs.
+
+  // TODO(regis): Should we pass the structure by value as in runtime calls?
+  // It would require changing Dart API for native functions.
+  // For now, space is reserved on the stack and we pass a pointer to it.
+  __ addiu(SP, SP, Immediate(-4 * kWordSize));
+  __ sw(A3, Address(SP, 3 * kWordSize));
+  __ sw(A2, Address(SP, 2 * kWordSize));
+  __ sw(A1, Address(SP, 1 * kWordSize));
+  __ sw(A0, Address(SP, 0 * kWordSize));
+
+  __ mov(A0, SP);  // Pass the pointer to the NativeArguments.
+
+  // Call native function or redirection via simulator.
+  __ jalr(T5);
+
+  // Reset exit frame information in Isolate structure.
+  __ LoadImmediate(A2, 0);
+  __ sw(A2, Address(CTX, Isolate::top_exit_frame_info_offset()));
+
+  // Load Context pointer from Isolate structure into R2.
+  __ lw(A2, Address(CTX, Isolate::top_context_offset()));
+
+  // Reset Context pointer in Isolate structure.
+  __ LoadImmediate(A3, reinterpret_cast<intptr_t>(Object::null()));
+  __ sw(A3, Address(CTX, Isolate::top_context_offset()));
+
+  // Cache Context pointer into CTX while executing Dart code.
+  __ mov(CTX, A2);
+
+  __ mov(SP, FP);
+  __ lw(RA, Address(SP, 1 * kWordSize));
+  __ lw(FP, Address(SP, 0 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+  __ Ret();
 }
 
 
+// Input parameters:
+//   S4: arguments descriptor array.
 void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
-  __ Unimplemented("CallStaticFunction stub");
+  __ EnterStubFrame();
+  // Setup space on stack for return value and preserve arguments descriptor.
+  __ LoadImmediate(V0, reinterpret_cast<intptr_t>(Object::null()));
+
+  __ addiu(SP, SP, Immediate(-2 * kWordSize));
+  __ sw(S4, Address(SP, 1 * kWordSize));
+  __ sw(V0, Address(SP, 0 * kWordSize));
+
+  __ CallRuntime(kPatchStaticCallRuntimeEntry);
+
+  // Get Code object result and restore arguments descriptor array.
+  __ lw(V0, Address(SP, 0 * kWordSize));
+  __ lw(S4, Address(SP, 1 * kWordSize));
+  __ addiu(SP, SP, Immediate(2 * kWordSize));
+
+  // Remove the stub frame as we are about to jump to the dart function.
+  __ LeaveStubFrame();
+
+  __ lw(V0, FieldAddress(V0, Code::instructions_offset()));
+  __ addiu(V0, V0, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ jr(V0);
 }
 
 
@@ -154,7 +333,6 @@
 
   __ Bind(&done_push_arguments);
 
-
   // Call the Dart code entrypoint.
   __ jalr(A0);  // S4 is the arguments descriptor array.
 
diff --git a/runtime/vm/stub_code_mips_test.cc b/runtime/vm/stub_code_mips_test.cc
index df573cb..bbe5744 100644
--- a/runtime/vm/stub_code_mips_test.cc
+++ b/runtime/vm/stub_code_mips_test.cc
@@ -39,7 +39,23 @@
 // Test calls to stub code which calls into the runtime.
 static void GenerateCallToCallRuntimeStub(Assembler* assembler,
                                           int value1, int value2) {
-  UNIMPLEMENTED();
+  const int argc = 2;
+  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
+  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+  const Object& result = Object::ZoneHandle();
+  const Context& context = Context::ZoneHandle(Context::New(0, Heap::kOld));
+  ASSERT(context.isolate() == Isolate::Current());
+  __ EnterDartFrame(0);
+  __ LoadObject(CTX, context);
+  __ PushObject(result);  // Push Null object for return value.
+  __ PushObject(smi1);  // Push argument 1 smi1.
+  __ PushObject(smi2);  // Push argument 2 smi2.
+  ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
+  __ CallRuntime(kTestSmiSubRuntimeEntry);  // Call SmiSub runtime func.
+  __ addiu(SP, SP, Immediate(argc * kWordSize));
+  __ Pop(V0);  // Pop return value from return slot.
+  __ LeaveDartFrame();
+  __ Ret();
 }
 
 
@@ -64,7 +80,15 @@
 static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
                                               int value1,
                                               int value2) {
-  UNIMPLEMENTED();
+  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
+  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+  __ EnterDartFrame(0);
+  __ ReserveAlignedFrameSpace(0);
+  __ LoadObject(A0, smi1);  // Set up argument 1 smi1.
+  __ LoadObject(A1, smi2);  // Set up argument 2 smi2.
+  __ CallRuntime(kTestLeafSmiAddRuntimeEntry);  // Call SmiAdd runtime func.
+  __ LeaveDartFrame();
+  __ Ret();  // Return value is in R0.
 }
 
 
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 80f0f96..90d3b82 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -1087,7 +1087,6 @@
     // RAX: new object start.
     // RBX: next object start.
     // RDI: new object type arguments (if is_cls_parameterized).
-    __ LoadObject(RDX, cls);  // Load class of object to be allocated.
     // Set the tags.
     uword tags = 0;
     tags = RawObject::SizeTag::update(instance_size, tags);
@@ -1101,7 +1100,6 @@
 
     // RAX: new object start.
     // RBX: next object start.
-    // RDX: class of the object to be allocated.
     // RDI: new object type arguments (if is_cls_parameterized).
     // First try inlining the initialization without a loop.
     if (instance_size < (kInlineInstanceSize * kWordSize)) {
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index 1844670..a3d62b9 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -226,6 +226,7 @@
   V(TwoNewlines, "\n\n")                                                       \
   V(TwoSpaces, "  ")                                                           \
   V(_instanceOf, "_instanceOf")                                                \
+  V(_as, "_as")                                                                \
   V(PrivateGetterPrefix, "get:_")                                              \
   V(PrivateSetterPrefix, "set:_")                                              \
   V(_New, "_new")                                                              \
diff --git a/runtime/vm/vm.gypi b/runtime/vm/vm.gypi
index fb09047..1cd4c5f 100644
--- a/runtime/vm/vm.gypi
+++ b/runtime/vm/vm.gypi
@@ -10,6 +10,7 @@
     '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',
     'crypto_cc_file': '<(SHARED_INTERMEDIATE_DIR)/crypto_gen.cc',
     'math_cc_file': '<(SHARED_INTERMEDIATE_DIR)/math_gen.cc',
@@ -95,6 +96,7 @@
         'generate_corelib_cc_file',
         'generate_corelib_patch_cc_file',
         'generate_collection_cc_file',
+        'generate_collection_patch_cc_file',
         'generate_collection_dev_cc_file',
         'generate_crypto_cc_file',
         'generate_math_cc_file',
@@ -112,6 +114,7 @@
       ],
       'includes': [
         '../lib/async_sources.gypi',
+        '../lib/collection_sources.gypi',
         '../lib/lib_sources.gypi',
         '../lib/isolate_sources.gypi',
         '../lib/math_sources.gypi',
@@ -126,6 +129,7 @@
         '<(corelib_cc_file)',
         '<(corelib_patch_cc_file)',
         '<(collection_cc_file)',
+        '<(collection_patch_cc_file)',
         '<(collection_dev_cc_file)',
         '<(crypto_cc_file)',
         '<(math_cc_file)',
@@ -150,6 +154,7 @@
       'type': 'static_library',
       'includes': [
         '../lib/async_sources.gypi',
+        '../lib/collection_sources.gypi',
         '../lib/lib_sources.gypi',
         '../lib/isolate_sources.gypi',
         '../lib/math_sources.gypi',
@@ -763,6 +768,44 @@
       ]
     },
     {
+      'target_name': 'generate_collection_patch_cc_file',
+      'type': 'none',
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/collection_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_collection_patch_cc',
+          'inputs': [
+            '../tools/create_string_literal.py',
+            '<(builtin_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(collection_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/create_string_literal.py',
+            '--output', '<(collection_patch_cc_file)',
+            '--input_cc', '<(builtin_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::collection_patch_',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(collection_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
       'target_name': 'generate_isolate_patch_cc_file',
       'type': 'none',
       'includes': [
diff --git a/sdk/bin/dart2js_developer.bat b/sdk/bin/dart2js_developer.bat
index 97ab204..c4a2959 100644
--- a/sdk/bin/dart2js_developer.bat
+++ b/sdk/bin/dart2js_developer.bat
@@ -6,4 +6,5 @@
 setlocal
 set DART2JS_DEVELOPER_MODE=1
 call "%~dp0dart2js.bat" %*
-endlocal
\ No newline at end of file
+endlocal
+exit /b %errorlevel%
diff --git a/sdk/lib/_collection_dev/iterable.dart b/sdk/lib/_collection_dev/iterable.dart
index 25515a9..e8a6a95 100644
--- a/sdk/lib/_collection_dev/iterable.dart
+++ b/sdk/lib/_collection_dev/iterable.dart
@@ -200,6 +200,10 @@
   Iterable map(f(E element)) => new MappedListIterable(this, f);
 
   reduce(var initialValue, combine(var previousValue, E element)) {
+    return fold(initialValue, combine);
+  }
+
+  fold(var initialValue, combine(var previousValue, E element)) {
     var value = initialValue;
     int length = this.length;
     for (int i = 0; i < length; i++) {
@@ -670,6 +674,10 @@
   Iterable map(f(E element)) => const EmptyIterable();
 
   reduce(var initialValue, combine(var previousValue, E element)) {
+    return fold(initialValue, combine);
+  }
+
+  fold(var initialValue, combine(var previousValue, E element)) {
     return initialValue;
   }
 
diff --git a/sdk/lib/_collection_dev/list.dart b/sdk/lib/_collection_dev/list.dart
index 01c7e8a..1e40785 100644
--- a/sdk/lib/_collection_dev/list.dart
+++ b/sdk/lib/_collection_dev/list.dart
@@ -5,24 +5,324 @@
 part of dart._collection.dev;
 
 /**
- * Class implementing the read-operations on [List].
+ * Base implementation of a [List] class.
  *
- * Implements all read-only operations, except [:operator[]:] and [:length:],
- * in terms of those two operations.
+ * This class can be used as a mixin.
+ *
+ * This implements all read operations using only the `length` and
+ * `operator[]` members. It implements write operations using those and
+ * `length=` and `operator[]=`
+ *
+ * A fixed-length list should mix this class in, and the [FixedLengthListMixin]
+ * as well, in that order, to overwrite the methods that modify the length.
+ *
+ * An unmodifiable list should mix [UnmodifiableListMixin] on top of this
+ * mixin to prevent all modifications.
  */
-abstract class ListBase<E> extends ListIterable<E> implements List<E> {
-  // List interface.
-  int get length;
-  E operator[](int index);
+abstract class ListMixin<E> implements List<E> {
+  // Iterable interface.
+  Iterator<E> get iterator => new ListIterator<E>(this);
+
+  E elementAt(int index) => this[index];
+
+  void forEach(void action(E element)) {
+    int length = this.length;
+    for (int i = 0; i < length; i++) {
+      action(this[i]);
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+  }
+
+  bool get isEmpty => length == 0;
+
+  E get first {
+    if (length == 0) throw new StateError("No elements");
+    return this[0];
+  }
+
+  E get last {
+    if (length == 0) throw new StateError("No elements");
+    return this[length - 1];
+  }
+
+  E get single {
+    if (length == 0) throw new StateError("No elements");
+    if (length > 1) throw new StateError("Too many elements");
+    return this[0];
+  }
+
+  bool contains(E element) {
+    int length = this.length;
+    for (int i = 0; i < length; i++) {
+      if (this[i] == element) return true;
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    return false;
+  }
+
+  bool every(bool test(E element)) {
+    int length = this.length;
+    for (int i = 0; i < length; i++) {
+      if (!test(this[i])) return false;
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    return true;
+  }
+
+  bool any(bool test(E element)) {
+    int length = this.length;
+    for (int i = 0; i < length; i++) {
+      if (test(this[i])) return true;
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    return false;
+  }
+
+  E firstWhere(bool test(E element), { E orElse() }) {
+    int length = this.length;
+    for (int i = 0; i < length; i++) {
+      E element = this[i];
+      if (test(element)) return element;
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    if (orElse != null) return orElse();
+    throw new StateError("No matching element");
+  }
+
+  E lastWhere(bool test(E element), { E orElse() }) {
+    int length = this.length;
+    for (int i = length - 1; i >= 0; i--) {
+      E element = this[i];
+      if (test(element)) return element;
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    if (orElse != null) return orElse();
+    throw new StateError("No matching element");
+  }
+
+  E singleWhere(bool test(E element)) {
+    int length = this.length;
+    E match = null;
+    bool matchFound = false;
+    for (int i = 0; i < length; i++) {
+      E element = this[i];
+      if (test(element)) {
+        if (matchFound) {
+          throw new StateError("More than one matching element");
+        }
+        matchFound = true;
+        match = element;
+      }
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    if (matchFound) return match;
+    throw new StateError("No matching element");
+  }
+
+  E min([int compare(E a, E b)]) {
+    if (length == 0) return null;
+    if (compare == null) {
+      var defaultCompare = Comparable.compare;
+      compare = defaultCompare;
+    }
+    E min = this[0];
+    int length = this.length;
+    for (int i = 1; i < length; i++) {
+      E element = this[i];
+      if (compare(min, element) > 0) {
+        min = element;
+      }
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    return min;
+  }
+
+  E max([int compare(E a, E b)]) {
+    if (length == 0) return null;
+    if (compare == null) {
+      var defaultCompare = Comparable.compare;
+      compare = defaultCompare;
+    }
+    E max = this[0];
+    int length = this.length;
+    for (int i = 1; i < length; i++) {
+      E element = this[i];
+      if (compare(max, element) < 0) {
+        max = element;
+      }
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    return max;
+  }
+
+  String join([String separator]) {
+    int length = this.length;
+    if (separator != null && !separator.isEmpty) {
+      if (length == 0) return "";
+      String first = "${this[0]}";
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+      StringBuffer buffer = new StringBuffer(first);
+      for (int i = 1; i < length; i++) {
+        buffer.write(separator);
+        buffer.write("${this[i]}");
+        if (length != this.length) {
+          throw new ConcurrentModificationError(this);
+        }
+      }
+      return buffer.toString();
+    } else {
+      StringBuffer buffer = new StringBuffer();
+      for (int i = 0; i < length; i++) {
+        buffer.write("${this[i]}");
+        if (length != this.length) {
+          throw new ConcurrentModificationError(this);
+        }
+      }
+      return buffer.toString();
+    }
+  }
+
+  Iterable<E> where(bool test(E element)) => new WhereIterable<E>(this, test);
+
+  Iterable map(f(E element)) => new MappedListIterable(this, f);
+
+  reduce(var initialValue, combine(var previousValue, E element)) {
+    return fold(initialValue, combine);
+  }
+
+  fold(var initialValue, combine(var previousValue, E element)) {
+    var value = initialValue;
+    int length = this.length;
+    for (int i = 0; i < length; i++) {
+      value = combine(value, this[i]);
+      if (length != this.length) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+    return value;
+  }
+
+  Iterable<E> skip(int count) => new SubListIterable(this, count, null);
+
+  Iterable<E> skipWhile(bool test(E element)) {
+    return new SkipWhileIterable<E>(this, test);
+  }
+
+  Iterable<E> take(int count) => new SubListIterable(this, 0, count);
+
+  Iterable<E> takeWhile(bool test(E element)) {
+    return new TakeWhileIterable<E>(this, test);
+  }
+
+  List<E> toList({ bool growable: true }) {
+    List<E> result;
+    if (growable) {
+      result = new List<E>()..length = length;
+    } else {
+      result = new List<E>(length);
+    }
+    for (int i = 0; i < length; i++) {
+      result[i] = this[i];
+    }
+    return result;
+  }
+
+  Set<E> toSet() {
+    Set<E> result = new Set<E>();
+    for (int i = 0; i < length; i++) {
+      result.add(this[i]);
+    }
+    return result;
+  }
 
   // Collection interface.
-  // Implement in a fully mutable specialized class if necessary.
-  // The fixed-length and unmodifiable lists throw on all members
-  // of the collection interface.
+  void add(E element) {
+    this[this.length++] = element;
+  }
 
-  // Iterable interface.
-  E elementAt(int index) {
-    return this[index];
+  void addAll(Iterable<E> iterable) {
+    for (E element in iterable) {
+      this[this.length++] = element;
+    }
+  }
+
+  void remove(Object element) {
+    for (int i = 0; i < this.length; i++) {
+      if (this[i] == element) {
+        this.setRange(i, this.length - i - 1, this, i + 1);
+        this.length -= 1;
+        return;
+      }
+    }
+  }
+
+  void removeAll(Iterable<Object> elements) {
+    if (elements is! Set) {
+      elements = elements.toSet();
+    }
+    _filter(this, elements.contains, false);
+  }
+
+
+  void retainAll(Iterable<E> iterable) {
+    if (elements is! Set) {
+      elements = elements.toSet();
+    }
+    _filter(this, elements.contains, true);
+  }
+
+  void removeWhere(bool test(E element)) {
+    _filter(this, test, false);
+  }
+
+  void retainWhere(bool test(E element)) {
+    _filter(this, test, true);
+  }
+
+  static void _filter(List source,
+                      bool test(var element),
+                      bool retainMatching) {
+    List retained = [];
+    int length = source.length;
+    for (int i = 0; i < length; i++) {
+      var element = source[i];
+      if (test(element) == retainMatching) {
+        retained.add(element);
+      }
+      if (length != source.length) {
+        throw new ConcurrentModificationError(source);
+      }
+    }
+    if (retained.length != source.length) {
+      source.setRange(0, retained.length, retained);
+      source.length = retained.length;
+    }
+  }
+
+  // List interface.
+
+  void sort([Comparator<E> compare]) {
+    Sort.sort(this, compare);
   }
 
   Map<int, E> asMap() {
@@ -47,38 +347,112 @@
 
   List<E> getRange(int start, int length) => sublist(start, start + length);
 
-  int indexOf(E element, [int start = 0]) {
-    return Arrays.indexOf(this, element, start, this.length);
+  void insertRange(int start, int length, [E initialValue]) {
+    if (start < 0 || start > this.length) {
+      throw new RangeError.range(start, 0, this.length);
+    }
+    int oldLength = this.length;
+    int moveLength = oldLength - start;
+    this.length += length;
+    if (moveLength > 0) {
+      this.setRange(start + length, moveLength, this, start);
+    }
+    for (int i = 0; i < length; i++) {
+      this[start + i] = initialValue;
+    }
   }
 
-  int lastIndexOf(E element, [int start = null]) {
-    if (start == null) start = length - 1;
-    return Arrays.lastIndexOf(this, element, start);
+  void removeRange(int start, int length) {
+    if (start < 0 || start > this.length) {
+      throw new RangeError.range(start, 0, this.length);
+    }
+    if (length < 0 || start + length > this.length) {
+      throw new RangeError.range(length, 0, this.length - start);
+    }
+    int end = start + length;
+    setRange(start, this.length - end, this, end);
+    this.length -= length;
+  }
+
+  void clearRange(int start, int length, [E fill]) {
+    for (int i = 0; i < length; i++) {
+      this[start + i] = fill;
+    }
+  }
+
+  void setRange(int start, int length, List<E> from, [int startFrom]) {
+    if (start < 0 || start > this.length) {
+      throw new RangeError.range(start, 0, this.length);
+    }
+    if (length < 0 || start + length > this.length) {
+      throw new RangeError.range(length, 0, this.length - start);
+    }
+    if (startFrom == null) {
+      startFrom = 0;
+    }
+    if (startFrom < 0 || startFrom + length > from.length) {
+      throw new RangeError.range(startFrom, 0, from.length - length);
+    }
+    if (startFrom < start) {
+      // Copy backwards to ensure correct copy if [from] is this.
+      for (int i = length - 1; i >= 0; i--) {
+        this[start + i] = from[startFrom + i];
+      }
+    } else {
+      for (int i = 0; i < length; i++) {
+        this[start + i] = from[startFrom + i];
+      }
+    }
+  }
+
+  int indexOf(E element, [int startIndex = 0]) {
+    if (startIndex >= this.length) {
+      return -1;
+    }
+    if (startIndex < 0) {
+      startIndex = 0;
+    }
+    for (int i = startIndex; i < this.length; i++) {
+      if (this[i] == element) {
+        return i;
+      }
+    }
+    return -1;
+  }
+
+  /**
+   * Returns the last index in the list [a] of the given [element], starting
+   * the search at index [startIndex] to 0.
+   * Returns -1 if [element] is not found.
+   */
+  int lastIndexOf(E element, [int startIndex]) {
+    if (startIndex == null) {
+      startIndex = this.length - 1;
+    } else {
+      if (startIndex < 0) {
+        return -1;
+      }
+      if (startIndex >= a.length) {
+        startIndex = a.length - 1;
+      }
+    }
+    for (int i = startIndex; i >= 0; i--) {
+      if (this[i] == element) {
+        return i;
+      }
+    }
+    return -1;
   }
 
   Iterable<E> get reversed => new ReversedListIterable(this);
 }
 
 /**
- * Abstract class implementing the non-length changing operations of [List].
+ * Mixin that throws on the length changing operations of [List].
  *
- * All modifications are performed using [[]=].
+ * Intended to mix-in on top of [ListMixin] for fixed-length lists.
  */
-abstract class FixedLengthListBase<E> extends ListBase<E> {
-  void operator[]=(int index, E value);
-
-  void sort([Comparator<E> compare]) {
-    Sort.sort(this, compare);
-  }
-
-  void setRange(int start, int length, List<E> from, [int startFrom]) {
-    if (length < 0) throw new ArgumentError("length: $length");
-    if (startFrom == null) startFrom = 0;
-    for (int i = 0; i < length; i++) {
-      this[start + i] = from[startFrom + i];
-    }
-  }
-
+abstract class FixedLengthListMixin<E>  {
   void set length(int newLength) {
     throw new UnsupportedError(
         "Cannot change the length of a fixed-length list");
@@ -89,11 +463,6 @@
         "Cannot add to a fixed-length list");
   }
 
-  void addLast(E value) {
-    throw new UnsupportedError(
-        "Cannot add to a fixed-length list");
-  }
-
   void insert(int index, E value) {
     throw new UnsupportedError(
         "Cannot add to a fixed-length list");
@@ -156,9 +525,13 @@
 }
 
 /**
- * An unmodifiable [List].
+ * Mixin for an unmodifiable [List] class.
+ *
+ * This overrides all mutating methods with methods that throw.
+ * This mixin is intended to be mixed in on top of [ListMixin] on
+ * unmodifiable lists.
  */
-abstract class UnmodifiableListBase<E> extends ListBase<E> {
+abstract class UnmodifiableListMixin<E> {
 
   void operator []=(int index, E value) {
     throw new UnsupportedError(
@@ -175,11 +548,6 @@
         "Cannot add to an unmodifiable list");
   }
 
-  void addLast(E value) {
-    throw new UnsupportedError(
-        "Cannot add to an unmodifiable list");
-  }
-
   E insert(int index, E value) {
     throw new UnsupportedError(
         "Cannot add to an unmodifiable list");
@@ -251,7 +619,34 @@
   }
 }
 
-/** An empty fixed-length list. */
+
+/**
+ * Abstract implementation of a list.
+ *
+ * All operations are defined in terms of `length`, `operator[]`,
+ * `operator[]=` and `length=`, which need to be implemented.
+ */
+abstract class ListBase<E> extends ListMixin<E> implements List<E> {}
+
+/**
+ * Abstract implementation of a fixed-length list.
+ *
+ * All operations are defined in terms of `length`, `operator[]` and
+ * `operator[]=`, which need to be implemented.
+ */
+abstract class FixedLengthListBase<E> extends ListBase<E>
+                                      with FixedLengthListMixin<E> {}
+
+/**
+ * Abstract implementation of an unmodifiable list.
+ *
+ * All operations are defined in terms of `length` and `operator[]`,
+ * which need to be implemented.
+ */
+abstract class UnmodifiableListBase<E> extends ListBase<E>
+                                       with UnmodifiableListMixin<E> {}
+
+/** An empty fixed-length (and therefore unmodifiable) list. */
 class EmptyList<E> extends FixedLengthListBase<E> {
   int get length => 0;
   E operator[](int index) { throw new RangeError.value(index); }
diff --git a/sdk/lib/_internal/compiler/implementation/apiimpl.dart b/sdk/lib/_internal/compiler/implementation/apiimpl.dart
index de0dcf9..b3de769 100644
--- a/sdk/lib/_internal/compiler/implementation/apiimpl.dart
+++ b/sdk/lib/_internal/compiler/implementation/apiimpl.dart
@@ -33,7 +33,8 @@
       : this.options = options,
         this.allowedLibraryCategories = getAllowedLibraryCategories(options),
         super(
-            tracer: new ssa.HTracer(),
+            tracer: new ssa.HTracer(
+                ssa.GENERATE_SSA_TRACE ? outputProvider('dart', 'cfg') : null),
             outputProvider: outputProvider,
             enableTypeAssertions: hasOption(options, '--enable-checked-mode'),
             enableUserAssertions: hasOption(options, '--enable-checked-mode'),
diff --git a/sdk/lib/_internal/compiler/implementation/closure.dart b/sdk/lib/_internal/compiler/implementation/closure.dart
index dbfd5b8..aa17a00 100644
--- a/sdk/lib/_internal/compiler/implementation/closure.dart
+++ b/sdk/lib/_internal/compiler/implementation/closure.dart
@@ -405,6 +405,11 @@
   visitIdentifier(Identifier node) {
     if (node.isThis()) {
       useLocal(closureData.thisElement);
+    } else {
+      Element element = elements[node];
+      if (element != null && element.kind == ElementKind.TYPE_VARIABLE) {
+        useLocal(closureData.thisElement);
+      }
     }
     node.visitChildren(this);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/code_buffer.dart b/sdk/lib/_internal/compiler/implementation/code_buffer.dart
index 69fab9ae..4c0a1fe 100644
--- a/sdk/lib/_internal/compiler/implementation/code_buffer.dart
+++ b/sdk/lib/_internal/compiler/implementation/code_buffer.dart
@@ -37,9 +37,19 @@
     return this;
   }
 
-  CodeBuffer writeAll(Iterable<Object> objects) {
-    for (var object in objects) {
-      write(object);
+  CodeBuffer writeAll(Iterable<Object> objects, [String separator = ""]) {
+    Iterator iterator = objects.iterator;
+    if (!iterator.moveNext()) return this;
+    if (separator == "") {
+      do {
+        write(iterator.current);
+      } while (iterator.moveNext());
+    } else {
+      buffer.write(iterator.current);
+      while (iterator.moveNext()) {
+        write(separator);
+        write(iterator.current);
+      }
     }
     return this;
   }
diff --git a/sdk/lib/_internal/compiler/implementation/dart2js.dart b/sdk/lib/_internal/compiler/implementation/dart2js.dart
index 284607b..af7befd 100644
--- a/sdk/lib/_internal/compiler/implementation/dart2js.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart2js.dart
@@ -463,7 +463,6 @@
     reported as errors or warnings.
 
   --categories=<categories>
-
     A comma separated list of allowed library categories.  The default
     is "Client".  Possible categories can be seen by providing an
     unsupported category, for example, --categories=help.  To enable
diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 0a3b141..8e9bf31 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -1530,7 +1530,7 @@
   Element lookupSuperSelector(Selector selector) {
     return internalLookupSelector(selector, true);
   }
-  
+
   Element internalLookupSelector(Selector selector, bool isSuperLookup) {
     SourceString name = selector.name;
     bool isPrivate = name.isPrivate();
@@ -1583,24 +1583,25 @@
    */
   bool isShadowedByField(Element fieldMember) {
     assert(fieldMember.isField());
-    // Note that we cannot use [lookupMember] or [lookupSuperMember] since it
-    // will not do the right thing for private elements.
-    ClassElement lookupClass = this;
-    LibraryElement memberLibrary = fieldMember.getLibrary();
-    if (fieldMember.name.isPrivate()) {
-      // We find a super class in the same library as the field. This way the
-      // lookupMember will work.
-      while (lookupClass.getLibrary() != memberLibrary) {
-        lookupClass = lookupClass.superclass;
-      }
-    }
     SourceString fieldName = fieldMember.name;
-    while (true) {
-      Element foundMember = lookupClass.lookupMember(fieldName);
-      if (foundMember == fieldMember) return false;
-      if (foundMember.isField()) return true;
-      lookupClass = foundMember.getEnclosingClass().superclass;
+    bool isPrivate = fieldName.isPrivate();
+    LibraryElement memberLibrary = fieldMember.getLibrary();
+    ClassElement lookupClass = this;
+    while (lookupClass != null) {
+      Element foundMember = lookupClass.lookupLocalMember(fieldName);
+      if (foundMember != null) {
+        if (foundMember == fieldMember) return false;
+        if (foundMember.isField()) {
+          if (!isPrivate || memberLibrary == foundMember.getLibrary()) {
+            // Private fields can only be shadowed by a field declared
+            // in the same library.
+            return true;
+          }
+        }
+      }
+      lookupClass = lookupClass.superclass;
     }
+    return false;
   }
 
   Element validateConstructorLookupResults(Selector selector,
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 17ddd90..2902003 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -634,6 +634,13 @@
   final Map<Element, jsAst.Expression> generatedBailoutCode =
       new Map<Element, jsAst.Expression>();
 
+  /**
+   * Keep track of which function elements are simple enough to be
+   * inlined in callers.
+   */
+  final Map<FunctionElement, bool> canBeInlined =
+      new Map<FunctionElement, bool>();
+
   ClassElement jsInterceptorClass;
   ClassElement jsStringClass;
   ClassElement jsArrayClass;
@@ -665,6 +672,13 @@
   Element getInterceptorMethod;
   Element interceptedNames;
 
+  // TODO(9577): Make it so that these are not needed when there are no native
+  // classes.
+  Element dispatchPropertyName;
+  Element getNativeInterceptorMethod;
+  Element setNativeInterceptorMethod;
+  Element defineNativeMethodsFinishMethod;
+
   bool seenAnyClass = false;
 
   final Namer namer;
@@ -838,6 +852,14 @@
         compiler.findInterceptor(const SourceString('getInterceptor'));
     interceptedNames =
         compiler.findInterceptor(const SourceString('interceptedNames'));
+    dispatchPropertyName =
+        compiler.findInterceptor(const SourceString('dispatchPropertyName'));
+    getNativeInterceptorMethod =
+        compiler.findInterceptor(const SourceString('getNativeInterceptor'));
+    setNativeInterceptorMethod =
+        compiler.findInterceptor(const SourceString('setNativeInterceptor'));
+    defineNativeMethodsFinishMethod =
+        compiler.findHelper(const SourceString('defineNativeMethodsFinish'));
     List<ClassElement> classes = [
       jsInterceptorClass =
           compiler.findInterceptor(const SourceString('Interceptor')),
@@ -980,6 +1002,13 @@
     if (!seenAnyClass) {
       initializeNoSuchMethod();
       seenAnyClass = true;
+      if (enqueuer.isResolutionQueue) {
+        // TODO(9577): Make it so that these are not needed when there are no
+        // native classes.
+        enqueuer.registerStaticUse(getNativeInterceptorMethod);
+        enqueuer.registerStaticUse(setNativeInterceptorMethod);
+        enqueuer.registerStaticUse(defineNativeMethodsFinishMethod);
+      }
     }
 
     // Register any helper that will be needed by the backend.
@@ -1049,6 +1078,15 @@
     }
   }
 
+  void registerUseInterceptor(Enqueuer enqueuer) {
+    assert(!enqueuer.isResolutionQueue);
+    // TODO(9577): Make it so that these are not needed when there are no native
+    // classes.
+    enqueuer.registerStaticUse(getNativeInterceptorMethod);
+    enqueuer.registerStaticUse(setNativeInterceptorMethod);
+    enqueuer.registerStaticUse(defineNativeMethodsFinishMethod);
+  }
+
   JavaScriptItemCompilationContext createItemCompilationContext() {
     return new JavaScriptItemCompilationContext();
   }
@@ -1196,7 +1234,7 @@
       if (argument == null) return;
       if (argument.element.isTypeVariable()) {
         ClassElement enclosing = argument.element.getEnclosingClass();
-        assert(enclosing == enclosingElement.getEnclosingClass());
+        assert(enclosing == enclosingElement.getEnclosingClass().declaration);
         rti.registerRtiDependency(annotation.element, enclosing);
       } else if (argument is InterfaceType) {
         InterfaceType type = argument;
@@ -1220,7 +1258,8 @@
   }
 
   bool needsRti(ClassElement cls) {
-    return rti.classesNeedingRti.contains(cls) || compiler.enabledRuntimeType;
+    return rti.classesNeedingRti.contains(cls.declaration)
+        || compiler.enabledRuntimeType;
   }
 
   bool isDefaultNoSuchMethodImplementation(Element element) {
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index d4df75d..4d32c89 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -1247,8 +1247,17 @@
     /// Classes that are not instantiated and native classes need a holder
     /// object for their checks, because there will be no class defined for
     /// them.
+
+    // TODO(9556): Get rid of holders.
+    //
+    //  - For primitive classes, use the interceptors (e.g JSInt).
+    //
+    //  - For uninstantiated classes, define the class anyway.  It will not need
+    //    fields or a constructor, or any methods, so the class definition will
+    //    be smaller than a holder.
+
     bool needsHolder(ClassElement cls) {
-      return !neededClasses.contains(cls) || cls.isNative() ||
+      return !neededClasses.contains(cls) ||
         rti.isJsNative(cls);
     }
 
@@ -1468,15 +1477,18 @@
     /* Do nothing. */
   }
 
-  void emitClassFields(ClassElement classElement,
+  /// Returns `true` if fields added.
+  bool emitClassFields(ClassElement classElement,
                        ClassBuilder builder,
-                       { String superClass: "",
+                       { String superClass,
                          bool classIsNative: false }) {
     String separator = '';
     StringBuffer buffer = new StringBuffer();
-    if (!classIsNative) {
+    if (superClass != null) {
       buffer.write('$superClass;');
     }
+    int bufferClassLength = buffer.length;
+
     visitClassFields(classElement, (Element member,
                                     String name,
                                     String accessorName,
@@ -1533,10 +1545,10 @@
       }
     });
 
+    bool fieldsAdded = buffer.length > bufferClassLength;
     String compactClassData = buffer.toString();
-    if (compactClassData.length > 0) {
-      builder.addProperty('', js.string(compactClassData));
-    }
+    builder.addProperty('', js.string(compactClassData));
+    return fieldsAdded;
   }
 
   void emitClassGettersSetters(ClassElement classElement,
@@ -1694,12 +1706,12 @@
     // [Function] and needs checks for all typedefs that are used in is-checks.
     if (checkedClasses.contains(compiler.functionClass) ||
         !checkedTypedefs.isEmpty) {
-      FunctionElement call = cls.lookupLocalMember(Compiler.CALL_OPERATOR_NAME);
+      Element call = cls.lookupLocalMember(Compiler.CALL_OPERATOR_NAME);
       if (call == null) {
         // If [cls] is a closure, it has a synthetic call operator method.
         call = cls.lookupBackendMember(Compiler.CALL_OPERATOR_NAME);
       }
-      if (call != null) {
+      if (call != null && call.isFunction()) {
         generateInterfacesIsTests(compiler.functionClass,
                                   emitIsTest,
                                   emitSubstitution,
@@ -2146,7 +2158,10 @@
       for (VariableElement element in Elements.sortedByPosition(lazyFields)) {
         assert(backend.generatedBailoutCode[element] == null);
         jsAst.Expression code = backend.generatedCode[element];
-        assert(code != null);
+        // The code is null if we ended up not needing the lazily
+        // initialized field after all because of constant folding
+        // before code generation.
+        if (code == null) continue;
         // The code only computes the initial value. We build the lazy-check
         // here:
         //   lazyInitializer(prototype, 'name', fieldName, getterName, initial);
@@ -2503,6 +2518,7 @@
     bool hasNull = false;
     bool hasNumber = false;
     bool hasString = false;
+    bool hasNative = false;
     for (ClassElement cls in classes) {
       if (cls == backend.jsArrayClass ||
           cls == backend.jsMutableArrayClass ||
@@ -2519,6 +2535,7 @@
         // TODO(sra): The set of classes includes classes mixed-in to
         // interceptor classes.
         // assert(cls == compiler.objectClass || cls.isNative());
+        if (cls.isNative()) hasNative = true;
       }
     }
     if (hasDouble) {
@@ -2526,6 +2543,13 @@
     }
     if (hasInt) hasNumber = true;
 
+    if (classes == backend.interceptedClasses) {
+      // I.e. this is the general interceptor.
+      // TODO(9556): Remove 'holders'.  The general interceptor is used on type
+      // checks and needs to handle 'native' classes for 'holders'.
+      hasNative = true;
+    }
+
     jsAst.Block block = new jsAst.Block.empty();
 
     if (hasNumber) {
@@ -2557,11 +2581,11 @@
     if (hasNull) {
       block.statements.add(buildInterceptorCheck(backend.jsNullClass));
     } else {
-      // Returning "undefined" here will provoke a JavaScript
+      // Returning "undefined" or "null" here will provoke a JavaScript
       // TypeError which is later identified as a null-error by
       // [unwrapException] in js_helper.dart.
       block.statements.add(js.if_('receiver == null',
-                                  js.return_(js.undefined())));
+                                  js.return_(js['receiver'])));
     }
     if (hasFunction) {
       block.statements.add(buildInterceptorCheck(backend.jsFunctionClass));
@@ -2574,7 +2598,40 @@
     if (hasArray) {
       block.statements.add(buildInterceptorCheck(backend.jsArrayClass));
     }
-    block.statements.add(js.return_(js['receiver']));
+
+    if (hasNative) {
+      block.statements.add(
+          js.if_(
+              js['(typeof receiver) != "object"'],
+              js.return_(js['receiver'])));
+
+      // if (receiver instanceof $.Object) return receiver;
+      // return $.getNativeInterceptor(receiver);
+      block.statements.add(
+          js.if_(
+              new jsAst.Binary(
+                  "instanceof",
+                  js['receiver'],
+                  js[namer.isolateAccess(compiler.objectClass)]),
+              js.return_(js['receiver'])));
+
+      // TODO(sra): Fold this 'Object' check into the `getNativeInterceptor`
+      // check by patching `Object.prototype` with a special hook function.
+      // TODO(9556): This test is needed in plain non-browser code because
+      // 'holders' are not Dart classes.
+      block.statements.add(
+          js.if_(
+              js['Object.getPrototypeOf(receiver) === Object.prototype'],
+              buildReturnInterceptor(backend.jsInterceptorClass)));
+
+      block.statements.add(
+          js.return_(
+              js[namer.isolateAccess(backend.getNativeInterceptorMethod)](
+                  ['receiver'])));
+
+    } else {
+      block.statements.add(js.return_(js['receiver']));
+    }
 
     buffer.write(jsAst.prettyPrint(
         js[isolateProperties][key].assign(js.fun(['receiver'], block)),
@@ -2899,21 +2956,12 @@
         mainBuffer.add('var $classesCollector$_=$_{}$N$n');
       }
 
-      // Emit native classes on [nativeBuffer].  As a side-effect,
-      // this will produce "bound closures" in [boundClosures].  The
-      // bound closures are JS AST nodes that add properties to $$
-      // [classesCollector].  The bound closures are not emitted until
-      // we have emitted all other classes (native or not).
-      final CodeBuffer nativeBuffer = new CodeBuffer();
-      if (!nativeClasses.isEmpty) {
-        addComment('Native classes', nativeBuffer);
-        for (ClassElement element in nativeClasses) {
-          nativeEmitter.generateNativeClass(element);
-        }
-      }
-      nativeEmitter.assembleCode(nativeBuffer);
+      // As a side-effect, emitting classes will produce "bound closures" in
+      // [boundClosures].  The bound closures are JS AST nodes that add
+      // properties to $$ [classesCollector].  The bound closures are not
+      // emitted until we have emitted all other classes (native or not).
 
-      // Might also create boundClosures.
+      // Might create boundClosures.
       if (!regularClasses.isEmpty) {
         addComment('Classes', mainBuffer);
         for (ClassElement element in regularClasses) {
@@ -2921,7 +2969,19 @@
         }
       }
 
-      // Might also create boundClosures.
+      // Emit native classes on [nativeBuffer].
+      // Might create boundClosures.
+      final CodeBuffer nativeBuffer = new CodeBuffer();
+      if (!nativeClasses.isEmpty) {
+        addComment('Native classes', nativeBuffer);
+        for (ClassElement element in nativeClasses) {
+          nativeEmitter.generateNativeClass(element, mainBuffer);
+        }
+      }
+      nativeEmitter.finishGenerateNativeClasses();
+      nativeEmitter.assembleCode(nativeBuffer);
+
+      // Might create boundClosures.
       if (!deferredClasses.isEmpty) {
         emitDeferredPreambleWhenEmpty(deferredBuffer);
         deferredBuffer.add('\$\$$_=$_{}$N');
@@ -2967,6 +3027,9 @@
       emitGetInterceptorMethods(mainBuffer);
       emitLazilyInitializedStaticFields(mainBuffer);
 
+      mainBuffer.add(nativeBuffer);
+
+
       isolateProperties = isolatePropertiesName;
       // The following code should not use the short-hand for the
       // initialStatics.
@@ -2976,8 +3039,6 @@
       mainBuffer.add('var ${namer.CURRENT_ISOLATE}$_='
                      '${_}new ${namer.isolateName}()$N');
 
-      mainBuffer.add(nativeBuffer);
-
       emitMain(mainBuffer);
       emitInitFunction(mainBuffer);
       compiler.assembledCode = mainBuffer.getText();
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 4d27f89..41ec3e8 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
@@ -28,12 +28,13 @@
   }
 
 
-  void emitClassFields(ClassElement classElement,
+  bool emitClassFields(ClassElement classElement,
                        ClassBuilder builder,
                        { String superClass: "",
                          bool classIsNative: false }) {
     // Class fields are dynamically generated so they have to be
     // emitted using getters and setters instead.
+    return false;
   }
 
   void emitClassConstructor(ClassElement classElement, ClassBuilder builder) {
@@ -55,7 +56,11 @@
       fields.add(name);
     });
     String constructorName = namer.safeName(classElement.name.slowToString());
-    builder.addProperty('', buildConstructor(constructorName, fields));
+    if (classElement.isNative()) {
+      builder.addProperty('', buildUnusedConstructor(constructorName));
+    } else {
+      builder.addProperty('', buildConstructor(constructorName, fields));
+    }
   }
 
   List get defineClassFunction {
@@ -81,6 +86,13 @@
             (name) => js['this.$name = $name']).toList()));
   }
 
+  jsAst.Expression buildUnusedConstructor(String mangledName) {
+    String message = 'Called unused constructor';
+    return new jsAst.NamedFunction(
+        new jsAst.VariableDeclaration(mangledName),
+        js.fun([], new jsAst.Throw(js.string(message))));
+}
+
   jsAst.FunctionDeclaration get generateAccessorFunction {
     String message =
         'Internal error: no dynamic generation of accessors allowed.';
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 838c7a8..2c4a38f 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
@@ -22,12 +22,6 @@
   // Caches the direct native subtypes of a native class.
   Map<ClassElement, List<ClassElement>> directSubtypes;
 
-  // Caches the native methods that are overridden by a native class.
-  // Note that the method that overrides does not have to be native:
-  // it's the overridden method that must make sure it will dispatch
-  // to its subclass if it sees an instance whose class is a subclass.
-  Set<FunctionElement> overriddenMethods;
-
   // Caches the methods that have a native body.
   Set<FunctionElement> nativeMethods;
 
@@ -41,7 +35,6 @@
         nativeClasses = new Set<ClassElement>(),
         subtypes = new Map<ClassElement, List<ClassElement>>(),
         directSubtypes = new Map<ClassElement, List<ClassElement>>(),
-        overriddenMethods = new Set<FunctionElement>(),
         nativeMethods = new Set<FunctionElement>(),
         nativeBuffer = new CodeBuffer();
 
@@ -58,6 +51,12 @@
     return backend.namer.isolateAccess(element);
   }
 
+  String get dynamicFunctionTableName {
+    Element element = compiler.findHelper(
+        const SourceString('dynamicFunctionTable'));
+    return backend.namer.isolateAccess(element);
+  }
+
   String get dynamicSetMetadataName {
     Element element = compiler.findHelper(
         const SourceString('dynamicSetMetadata'));
@@ -88,26 +87,28 @@
     return backend.namer.isolateAccess(element);
   }
 
-  String get defineNativeClassName
-      => '${backend.namer.CURRENT_ISOLATE}.\$defineNativeClass';
+  String get dispatchPropertyNameVariable {
+    Element element = compiler.findInterceptor(
+        const SourceString('dispatchPropertyName'));
+    return backend.namer.isolateAccess(element);
+  }
 
-  String get defineNativeClassFunction {
-    return """
-function(cls, desc) {
-  var fields = desc[''];
-  var fields_array = fields ? fields.split(',') : [];
-  for (var i = 0; i < fields_array.length; i++) {
-    ${emitter.currentGenerateAccessorName}(fields_array[i], desc);
+  String get defineNativeMethodsName {
+    Element element = compiler.findHelper(
+        const SourceString('defineNativeMethods'));
+    return backend.namer.isolateAccess(element);
   }
-  var hasOwnProperty = Object.prototype.hasOwnProperty;
-  for (var method in desc) {
-    if (method) {
-      if (hasOwnProperty.call(desc, method)) {
-        $dynamicName(method)[cls] = desc[method];
-      }
-    }
+
+  String get defineNativeMethodsNonleafName {
+    Element element = compiler.findHelper(
+        const SourceString('defineNativeMethodsNonleaf'));
+    return backend.namer.isolateAccess(element);
   }
-}""";
+
+  String get defineNativeMethodsFinishName {
+    Element element = compiler.findHelper(
+        const SourceString('defineNativeMethodsFinish'));
+    return backend.namer.isolateAccess(element);
   }
 
   bool isNativeGlobal(String quotedName) {
@@ -124,23 +125,59 @@
     }
   }
 
-  void generateNativeClass(ClassElement classElement) {
+  void generateNativeClass(ClassElement classElement, CodeBuffer mainBuffer) {
     assert(!classElement.hasBackendMembers);
     nativeClasses.add(classElement);
 
+    ClassElement superclass = classElement.superclass;
+    assert(superclass != null);
+    // Fix superclass.  TODO(sra): make native classes inherit from Interceptor.
+    if (superclass == compiler.objectClass) {
+      superclass = backend.jsInterceptorClass;
+    }
+
+    String superName = backend.namer.getName(superclass);
+
     ClassBuilder builder = new ClassBuilder();
-    emitter.emitClassFields(classElement, builder, classIsNative: true);
+    emitter.emitClassConstructor(classElement, builder);
+    emitter.emitSuper(superName, builder);
+    bool hasFields = emitter.emitClassFields(classElement, builder,
+        classIsNative: true,
+        superClass: superName);
     emitter.emitClassGettersSetters(classElement, builder);
     emitter.emitInstanceMembers(classElement, builder);
 
     // An empty native class may be omitted since the superclass methods can be
     // located via the dispatch metadata.
-    if (builder.properties.isEmpty) return;
+    // TODO(sra): Also need to check there are no subclasses that will reference
+    // this class.
+    // bool hasOnlyGeneratedFields = builder.properties.length == 1;
+    // if (hasOnlyGeneratedFields == 1 && !hasFields) return;
 
+    // Define interceptor class for [classElement].
+    String className = backend.namer.getName(classElement);
+    jsAst.Expression init =
+        js[emitter.classesCollector][className].assign(
+            builder.toObjectInitializer());
+    mainBuffer.write(jsAst.prettyPrint(init, compiler));
+    mainBuffer.write('$N$n');
+
+    emitter.needsDefineClass = true;
+
+    // Define dispatch for [classElement].
     String nativeTag = toNativeTag(classElement);
+    String definer = directSubtypes[classElement] == null
+        ? defineNativeMethodsName
+        : defineNativeMethodsNonleafName;
+
+    // TODO(sra): Fix DOM generation.  There is a missing proto in the picture
+    // the DOM gives of the proto chain.  We might need an annotation.
+    if (nativeTag == 'HTMLElement') definer = defineNativeMethodsNonleafName;
+
     jsAst.Expression definition =
-        js[defineNativeClassName](
-            [js.string(nativeTag), builder.toObjectInitializer()]);
+        js[definer](
+            [js.string(nativeTag),
+             js[backend.namer.isolateAccess(classElement)]]);
 
     nativeBuffer.add(jsAst.prettyPrint(definition, compiler));
     nativeBuffer.add('$N$n');
@@ -148,6 +185,16 @@
     classesWithDynamicDispatch.add(classElement);
   }
 
+  void finishGenerateNativeClasses() {
+    // TODO(sra): Put specialized version of getNativeMethods on
+    // `Object.prototype` to avoid checking in `getInterceptor` and
+    // specializations.
+
+    // jsAst.Expression call = js[defineNativeMethodsFinishName]([]);
+    // nativeBuffer.add(jsAst.prettyPrint(call, compiler));
+    // nativeBuffer.add('$N$n');
+  }
+
   List<ClassElement> getDirectSubclasses(ClassElement cls) {
     List<ClassElement> result = directSubtypes[cls];
     return result == null ? const<ClassElement>[] : result;
@@ -237,51 +284,9 @@
     }
     statements.add(new jsAst.Return(receiver[target](arguments)));
 
-    if (!overriddenMethods.contains(member)) {
-      // Call the method directly.
-      return statements;
-    } else {
-      return <jsAst.Statement>[
-          generateMethodBodyWithPrototypeCheck(
-              invocationName, new jsAst.Block(statements), stubParameters)];
-    }
+    return statements;
   }
 
-  // If a method is overridden, we must check if the prototype of 'this' has the
-  // method available. Otherwise, we may end up calling the method from the
-  // super class. If the method is not available, we make a direct call to
-  // Object.prototype.$methodName.  This method will patch the prototype of
-  // 'this' to the real method.
-  jsAst.Statement generateMethodBodyWithPrototypeCheck(
-      String methodName,
-      jsAst.Statement body,
-      List<jsAst.Parameter> parameters) {
-    return js.if_(
-        js['(Object.getPrototypeOf(this)).hasOwnProperty("$methodName")'],
-        body,
-        js.return_(
-            js['Object.prototype.$methodName.call'](
-                <jsAst.Expression>[js['this']]..addAll(
-                    parameters.map((param) => js[param.name])))));
-  }
-
-  jsAst.Block generateMethodBodyWithPrototypeCheckForElement(
-      FunctionElement element,
-      jsAst.Block body,
-      List<jsAst.Parameter> parameters) {
-    ElementKind kind = element.kind;
-    if (kind != ElementKind.FUNCTION &&
-        kind != ElementKind.GETTER &&
-        kind != ElementKind.SETTER) {
-      compiler.internalError("unexpected kind: '$kind'", element: element);
-    }
-
-    String methodName = backend.namer.getName(element);
-    return new jsAst.Block(
-        [generateMethodBodyWithPrototypeCheck(methodName, body, parameters)]);
-  }
-
-
   void emitDynamicDispatchMetadata() {
     if (classesWithDynamicDispatch.isEmpty) return;
     int length = classesWithDynamicDispatch.length;
@@ -499,8 +504,6 @@
 
     if (!nativeClasses.isEmpty) {
       emitDynamicDispatchMetadata();
-      targetBuffer.add('$defineNativeClassName = '
-                       '$defineNativeClassFunction$N$n');
 
       // In order to have the toString method on every native class,
       // we must patch the JS Object prototype with a helper method.
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
index 51be7e5..d23b1e4 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
@@ -59,6 +59,7 @@
     // (2) dependencies of classes in (1),
     // (3) subclasses of (2) and (3).
     void potentiallyAddForRti(ClassElement cls) {
+      assert(invariant(cls, cls.isDeclaration));
       if (cls.typeVariables.isEmpty) return;
       if (classesNeedingRti.contains(cls)) return;
       classesNeedingRti.add(cls);
diff --git a/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
new file mode 100644
index 0000000..da51828
--- /dev/null
+++ b/sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart
@@ -0,0 +1,643 @@
+// 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.
+
+// Patch file for dart:collection classes.
+import 'dart:_foreign_helper' show JS;
+
+patch class HashMap<K, V> {
+  int _length = 0;
+
+  // The hash map contents is divided into three parts: one part for
+  // string keys, one for numeric keys, and one for the rest. String
+  // and numeric keys map directly to their values, but the rest of
+  // the entries are stored in bucket lists of the form:
+  //
+  //    [key-0, value-0, key-1, value-1, ...]
+  //
+  // where all keys in the same bucket share the same hash code.
+  var _strings;
+  var _nums;
+  var _rest;
+
+  // When iterating over the hash map, it is very convenient to have a
+  // list of all the keys. We cache that on the instance and clear the
+  // the cache whenever the key set changes. This is also used to
+  // guard against concurrent modifications.
+  List _keys;
+
+  patch HashMap();
+
+  patch int get length => _length;
+  patch bool get isEmpty => _length == 0;
+
+  patch Iterable<K> get keys {
+    return new HashMapKeyIterable<K>(this);
+  }
+
+  patch Iterable<V> get values {
+    return keys.map((each) => this[each]);
+  }
+
+  patch bool containsKey(K key) {
+    if (_isStringKey(key)) {
+      var strings = _strings;
+      return (strings == null) ? false : _hasTableEntry(strings, key);
+    } else if (_isNumericKey(key)) {
+      var nums = _nums;
+      return (nums == null) ? false : _hasTableEntry(nums, key);
+    } else {
+      var rest = _rest;
+      if (rest == null) return false;
+      var bucket = _getBucket(rest, key);
+      return _findBucketIndex(bucket, key) >= 0;
+    }
+  }
+
+  patch bool containsValue(V value) {
+    return _computeKeys().any((each) => this[each] == value);
+  }
+
+  patch void addAll(Map<K, V> other) {
+    other.forEach((K key, V value) {
+      this[key] = value;
+    });
+  }
+
+  patch V operator[](K key) {
+    if (_isStringKey(key)) {
+      var strings = _strings;
+      return (strings == null) ? null : _getTableEntry(strings, key);
+    } else if (_isNumericKey(key)) {
+      var nums = _nums;
+      return (nums == null) ? null : _getTableEntry(nums, key);
+    } else {
+      var rest = _rest;
+      if (rest == null) return null;
+      var bucket = _getBucket(rest, key);
+      int index = _findBucketIndex(bucket, key);
+      return (index < 0) ? null : JS('var', '#[#]', bucket, index + 1);
+    }
+  }
+
+  patch void operator[]=(K key, V value) {
+    if (_isStringKey(key)) {
+      var strings = _strings;
+      if (strings == null) _strings = strings = _newHashTable();
+      _addHashTableEntry(strings, key, value);
+    } else if (_isNumericKey(key)) {
+      var nums = _nums;
+      if (nums == null) _nums = nums = _newHashTable();
+      _addHashTableEntry(nums, key, value);
+    } else {
+      var rest = _rest;
+      if (rest == null) _rest = rest = _newHashTable();
+      var hash = _computeHashCode(key);
+      var bucket = JS('var', '#[#]', rest, hash);
+      if (bucket == null) {
+        _setTableEntry(rest, hash, JS('var', '[#, #]', key, value));
+        _length++;
+        _keys = null;
+      } else {
+        int index = _findBucketIndex(bucket, key);
+        if (index >= 0) {
+          JS('void', '#[#] = #', bucket, index + 1, value);
+        } else {
+          JS('void', '#.push(#, #)', bucket, key, value);
+          _length++;
+          _keys = null;
+        }
+      }
+    }
+  }
+
+  patch V putIfAbsent(K key, V ifAbsent()) {
+    if (containsKey(key)) return this[key];
+    V value = ifAbsent();
+    this[key] = value;
+    return value;
+  }
+
+  patch V remove(K key) {
+    if (_isStringKey(key)) {
+      return _removeHashTableEntry(_strings, key);
+    } else if (_isNumericKey(key)) {
+      return _removeHashTableEntry(_nums, key);
+    } else {
+      var rest = _rest;
+      if (rest == null) return null;
+      var bucket = _getBucket(rest, key);
+      int index = _findBucketIndex(bucket, key);
+      if (index < 0) return null;
+      // TODO(kasperl): Consider getting rid of the bucket list when
+      // the length reaches zero.
+      _length--;
+      _keys = null;
+      // Use splice to remove the two [key, value] elements at the
+      // index and return the value.
+      return JS('var', '#.splice(#, 2)[1]', bucket, index);
+    }
+  }
+
+  patch void clear() {
+    if (_length > 0) {
+      _strings = _nums = _rest = _keys = null;
+      _length = 0;
+    }
+  }
+
+  patch void forEach(void action(K key, V value)) {
+    List keys = _computeKeys();
+    for (int i = 0, length = keys.length; i < length; i++) {
+      var key = JS('var', '#[#]', keys, i);
+      action(key, this[key]);
+      if (JS('bool', '# !== #', keys, _keys)) {
+        throw new ConcurrentModificationError(this);
+      }
+    }
+  }
+
+  List _computeKeys() {
+    if (_keys != null) return _keys;
+    List result = new List(_length);
+    int index = 0;
+
+    // Add all string keys to the list.
+    var strings = _strings;
+    if (strings != null) {
+      var names = JS('var', 'Object.getOwnPropertyNames(#)', strings);
+      int entries = JS('int', '#.length', names);
+      for (int i = 0; i < entries; i++) {
+        String key = JS('String', '#[#]', names, i);
+        JS('void', '#[#] = #', result, index, key);
+        index++;
+      }
+    }
+
+    // Add all numeric keys to the list.
+    var nums = _nums;
+    if (nums != null) {
+      var names = JS('var', 'Object.getOwnPropertyNames(#)', nums);
+      int entries = JS('int', '#.length', names);
+      for (int i = 0; i < entries; i++) {
+        // Object.getOwnPropertyNames returns a list of strings, so we
+        // have to convert the keys back to numbers (+).
+        num key = JS('num', '+#[#]', names, i);
+        JS('void', '#[#] = #', result, index, key);
+        index++;
+      }
+    }
+
+    // Add all the remaining keys to the list.
+    var rest = _rest;
+    if (rest != null) {
+      var names = JS('var', 'Object.getOwnPropertyNames(#)', rest);
+      int entries = JS('int', '#.length', names);
+      for (int i = 0; i < entries; i++) {
+        var key = JS('String', '#[#]', names, i);
+        var bucket = JS('var', '#[#]', rest, key);
+        int length = JS('int', '#.length', bucket);
+        for (int i = 0; i < length; i += 2) {
+          var key = JS('var', '#[#]', bucket, i);
+          JS('void', '#[#] = #', result, index, key);
+          index++;
+        }
+      }
+    }
+    assert(index == _length);
+    return _keys = result;
+  }
+
+  void _addHashTableEntry(var table, K key, V value) {
+    if (!_hasTableEntry(table, key)) {
+      _length++;
+      _keys = null;
+    }
+    _setTableEntry(table, key, value);
+  }
+
+  V _removeHashTableEntry(var table, K key) {
+    if (table != null && _hasTableEntry(table, key)) {
+      V value = _getTableEntry(table, key);
+      _deleteTableEntry(table, key);
+      _length--;
+      _keys = null;
+      return value;
+    } else {
+      return null;
+    }
+  }
+
+  static bool _isStringKey(var key) {
+    return key is String && key != '__proto__';
+  }
+
+  static bool _isNumericKey(var key) {
+    // Only treat unsigned 30-bit integers as numeric keys. This way,
+    // we avoid converting them to strings when we use them as keys in
+    // the JavaScript hash table object.
+    return key is num && JS('bool', '(# & 0x3ffffff) === #', key, key);
+  }
+
+  static int _computeHashCode(var key) {
+    // We force the hash codes to be unsigned 30-bit integers to avoid
+    // issues with problematic keys like '__proto__'. Another option
+    // would be to throw an exception if the hash code isn't a number.
+    return JS('int', '# & 0x3ffffff', key.hashCode);
+  }
+
+  static bool _hasTableEntry(var table, var key) {
+    var entry = JS('var', '#[#]', table, key);
+    // We take care to only store non-null entries in the table, so we
+    // can check if the table has an entry for the given key with a
+    // simple null check.
+    return entry != null;
+  }
+
+  static _getTableEntry(var table, var key) {
+    var entry = JS('var', '#[#]', table, key);
+    // We store the table itself as the entry to signal that it really
+    // is a null value, so we have to map back to null here.
+    return JS('bool', '# === #', entry, table) ? null : entry;
+  }
+
+  static void _setTableEntry(var table, var key, var value) {
+    // 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);
+  }
+
+  static void _deleteTableEntry(var table, var key) {
+    JS('void', 'delete #[#]', table, key);
+  }
+
+  static List _getBucket(var table, var key) {
+    var hash = _computeHashCode(key);
+    return JS('var', '#[#]', table, hash);
+  }
+
+  static int _findBucketIndex(var bucket, var key) {
+    if (bucket == null) return -1;
+    int length = JS('int', '#.length', bucket);
+    for (int i = 0; i < length; i += 2) {
+      if (JS('var', '#[#]', bucket, i) == key) return i;
+    }
+    return -1;
+  }
+
+  static _newHashTable() {
+    // Create a new JavaScript object to be used as a hash table. Use
+    // Object.create to avoid the properties on Object.prototype
+    // showing up as entries.
+    var table = JS('var', 'Object.create(null)');
+    // Attempt to force the hash table into 'dictionary' mode by
+    // adding a property to it and deleting it again.
+    var temporaryKey = '<non-identifier-key>';
+    _setTableEntry(table, temporaryKey, table);
+    _deleteTableEntry(table, temporaryKey);
+    return table;
+  }
+}
+
+class HashMapKeyIterable<E> extends Iterable<E> {
+  final _map;
+  HashMapKeyIterable(this._map);
+
+  int get length => _map._length;
+  bool get isEmpty => _map._length == 0;
+
+  Iterator<E> get iterator {
+    return new HashMapKeyIterator<E>(_map, _map._computeKeys());
+  }
+
+  bool contains(E element) {
+    return _map.containsKey(element);
+  }
+
+  void forEach(void f(E element)) {
+    List keys = _map._computeKeys();
+    for (int i = 0, length = JS('int', '#.length', keys); i < length; i++) {
+      f(JS('var', '#[#]', keys, i));
+      if (JS('bool', '# !== #', keys, _map._keys)) {
+        throw new ConcurrentModificationError(_map);
+      }
+    }
+  }
+}
+
+class HashMapKeyIterator<E> implements Iterator<E> {
+  final _map;
+  final List _keys;
+  int _offset = 0;
+  E _current;
+
+  HashMapKeyIterator(this._map, this._keys);
+
+  E get current => _current;
+
+  bool moveNext() {
+    var keys = _keys;
+    int offset = _offset;
+    if (JS('bool', '# !== #', keys, _map._keys)) {
+      throw new ConcurrentModificationError(_map);
+    } else if (offset >= JS('int', '#.length', keys)) {
+      _current = null;
+      return false;
+    } else {
+      _current = JS('var', '#[#]', keys, offset);
+      // TODO(kasperl): For now, we have to tell the type inferrer to
+      // treat the result of doing offset + 1 as an int. Otherwise, we
+      // get unnecessary bailout code.
+      _offset = JS('int', '#', offset + 1);
+      return true;
+    }
+  }
+}
+
+patch class HashSet<E> {
+  int _length = 0;
+
+  // The hash set contents is divided into three parts: one part for
+  // string elements, one for numeric elements, and one for the
+  // rest. String and numeric elements map directly to a sentinel
+  // value, but the rest of the entries are stored in bucket lists of
+  // the form:
+  //
+  //    [element-0, element-1, element-2, ...]
+  //
+  // where all elements in the same bucket share the same hash code.
+  var _strings;
+  var _nums;
+  var _rest;
+
+  // When iterating over the hash set, it is very convenient to have a
+  // list of all the elements. We cache that on the instance and clear
+  // the the cache whenever the set changes. This is also used to
+  // guard against concurrent modifications.
+  List _elements;
+
+  patch HashSet();
+
+  // Iterable.
+  patch Iterator<E> get iterator {
+    return new HashSetIterator<E>(this, _computeElements());
+  }
+
+  patch int get length => _length;
+  patch bool get isEmpty => _length == 0;
+
+  patch bool contains(Object object) {
+    if (_isStringElement(object)) {
+      var strings = _strings;
+      return (strings == null) ? false : _hasTableEntry(strings, object);
+    } else if (_isNumericElement(object)) {
+      var nums = _nums;
+      return (nums == null) ? false : _hasTableEntry(nums, object);
+    } else {
+      var rest = _rest;
+      if (rest == null) return false;
+      var bucket = _getBucket(rest, object);
+      return _findBucketIndex(bucket, object) >= 0;
+    }
+  }
+
+  // Collection.
+  patch void add(E element) {
+    if (_isStringElement(element)) {
+      var strings = _strings;
+      if (strings == null) _strings = strings = _newHashTable();
+      _addHashTableEntry(strings, element);
+    } else if (_isNumericElement(element)) {
+      var nums = _nums;
+      if (nums == null) _nums = nums = _newHashTable();
+      _addHashTableEntry(nums, element);
+    } else {
+      var rest = _rest;
+      if (rest == null) _rest = rest = _newHashTable();
+      var hash = _computeHashCode(element);
+      var bucket = JS('var', '#[#]', rest, hash);
+      if (bucket == null) {
+        _setTableEntry(rest, hash, JS('var', '[#]', element));
+      } else {
+        int index = _findBucketIndex(bucket, element);
+        if (index >= 0) return;
+        JS('void', '#.push(#)', bucket, element);
+      }
+      _length++;
+      _elements = null;
+    }
+  }
+
+  patch void addAll(Iterable<E> objects) {
+    for (E each in objects) {
+      add(each);
+    }
+  }
+
+  patch bool remove(Object object) {
+    if (_isStringElement(object)) {
+      return _removeHashTableEntry(_strings, object);
+    } else if (_isNumericElement(object)) {
+      return _removeHashTableEntry(_nums, object);
+    } else {
+      var rest = _rest;
+      if (rest == null) return false;
+      var bucket = _getBucket(rest, object);
+      int index = _findBucketIndex(bucket, object);
+      if (index < 0) return false;
+      // TODO(kasperl): Consider getting rid of the bucket list when
+      // the length reaches zero.
+      _length--;
+      _elements = null;
+      // TODO(kasperl): It would probably be faster to move the
+      // element to the end and reduce the length of the bucket list.
+      JS('void', '#.splice(#, 1)', bucket, index);
+      return true;
+    }
+  }
+
+  patch void removeAll(Iterable objectsToRemove) {
+    for (var each in objectsToRemove) {
+      remove(each);
+    }
+  }
+
+  patch void removeWhere(bool test(E element)) {
+    removeAll(_computeElements().where(test));
+  }
+
+  patch void retainWhere(bool test(E element)) {
+    removeAll(_computeElements().where((E element) => !test(element)));
+  }
+
+  patch void clear() {
+    if (_length > 0) {
+      _strings = _nums = _rest = _elements = null;
+      _length = 0;
+    }
+  }
+
+  List _computeElements() {
+    if (_elements != null) return _elements;
+    List result = new List(_length);
+    int index = 0;
+
+    // Add all string elements to the list.
+    var strings = _strings;
+    if (strings != null) {
+      var names = JS('var', 'Object.getOwnPropertyNames(#)', strings);
+      int entries = JS('int', '#.length', names);
+      for (int i = 0; i < entries; i++) {
+        String element = JS('String', '#[#]', names, i);
+        JS('void', '#[#] = #', result, index, element);
+        index++;
+      }
+    }
+
+    // Add all numeric elements to the list.
+    var nums = _nums;
+    if (nums != null) {
+      var names = JS('var', 'Object.getOwnPropertyNames(#)', nums);
+      int entries = JS('int', '#.length', names);
+      for (int i = 0; i < entries; i++) {
+        // Object.getOwnPropertyNames returns a list of strings, so we
+        // have to convert the elements back to numbers (+).
+        num element = JS('num', '+#[#]', names, i);
+        JS('void', '#[#] = #', result, index, element);
+        index++;
+      }
+    }
+
+    // Add all the remaining elements to the list.
+    var rest = _rest;
+    if (rest != null) {
+      var names = JS('var', 'Object.getOwnPropertyNames(#)', rest);
+      int entries = JS('int', '#.length', names);
+      for (int i = 0; i < entries; i++) {
+        var entry = JS('String', '#[#]', names, i);
+        var bucket = JS('var', '#[#]', rest, entry);
+        int length = JS('int', '#.length', bucket);
+        for (int i = 0; i < length; i++) {
+          JS('void', '#[#] = #[#]', result, index, bucket, i);
+          index++;
+        }
+      }
+    }
+    assert(index == _length);
+    return _elements = result;
+  }
+
+  void _addHashTableEntry(var table, E element) {
+    if (_hasTableEntry(table, element)) return;
+    _setTableEntry(table, element, 0);
+    _length++;
+    _elements = null;
+  }
+
+  bool _removeHashTableEntry(var table, E element) {
+    if (table != null && _hasTableEntry(table, element)) {
+      _deleteTableEntry(table, element);
+      _length--;
+      _elements = null;
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  static bool _isStringElement(var element) {
+    return element is String && element != '__proto__';
+  }
+
+  static bool _isNumericElement(var element) {
+    // Only treat unsigned 30-bit integers as numeric elements. This
+    // way, we avoid converting them to strings when we use them as
+    // keys in the JavaScript hash table object.
+    return element is num &&
+        JS('bool', '(# & 0x3ffffff) === #', element, element);
+  }
+
+  static int _computeHashCode(var element) {
+    // We force the hash codes to be unsigned 30-bit integers to avoid
+    // issues with problematic elements like '__proto__'. Another
+    // option would be to throw an exception if the hash code isn't a
+    // number.
+    return JS('int', '# & 0x3ffffff', element.hashCode);
+  }
+
+  static bool _hasTableEntry(var table, var key) {
+    var entry = JS('var', '#[#]', table, key);
+    // We take care to only store non-null entries in the table, so we
+    // can check if the table has an entry for the given key with a
+    // simple null check.
+    return entry != null;
+  }
+
+  static void _setTableEntry(var table, var key, var value) {
+    assert(value != null);
+    JS('void', '#[#] = #', table, key, value);
+  }
+
+  static void _deleteTableEntry(var table, var key) {
+    JS('void', 'delete #[#]', table, key);
+  }
+
+  static List _getBucket(var table, var element) {
+    var hash = _computeHashCode(element);
+    return JS('var', '#[#]', table, hash);
+  }
+
+  static int _findBucketIndex(var bucket, var element) {
+    if (bucket == null) return -1;
+    int length = JS('int', '#.length', bucket);
+    for (int i = 0; i < length; i++) {
+      if (JS('var', '#[#]', bucket, i) == element) return i;
+    }
+    return -1;
+  }
+
+  static _newHashTable() {
+    // Create a new JavaScript object to be used as a hash table. Use
+    // Object.create to avoid the properties on Object.prototype
+    // showing up as entries.
+    var table = JS('var', 'Object.create(null)');
+    // Attempt to force the hash table into 'dictionary' mode by
+    // adding a property to it and deleting it again.
+    var temporaryKey = '<non-identifier-key>';
+    _setTableEntry(table, temporaryKey, table);
+    _deleteTableEntry(table, temporaryKey);
+    return table;
+  }
+}
+
+// TODO(kasperl): Share this code with HashMapKeyIterator<E>?
+class HashSetIterator<E> implements Iterator<E> {
+  final _set;
+  final List _elements;
+  int _offset = 0;
+  E _current;
+
+  HashSetIterator(this._set, this._elements);
+
+  E get current => _current;
+
+  bool moveNext() {
+    var elements = _elements;
+    int offset = _offset;
+    if (JS('bool', '# !== #', elements, _set._elements)) {
+      throw new ConcurrentModificationError(_set);
+    } else if (offset >= JS('int', '#.length', elements)) {
+      _current = null;
+      return false;
+    } else {
+      _current = JS('var', '#[#]', elements, offset);
+      // TODO(kasperl): For now, we have to tell the type inferrer to
+      // treat the result of doing offset + 1 as an int. Otherwise, we
+      // get unnecessary bailout code.
+      _offset = JS('int', '#', offset + 1);
+      return true;
+    }
+  }
+}
diff --git a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
index f7e21aa..ec45708 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
@@ -3,7 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 // Patch file for dart:core classes.
-
 import 'dart:_interceptors';
 import 'dart:_js_helper' show checkNull,
                               getRuntimeTypeString,
diff --git a/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart b/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
index 42f19ba..70c46ec 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
@@ -41,6 +41,34 @@
 }
 
 /**
+ * The name of the property used on native classes and `Object.prototype` to get
+ * the interceptor for a native class instance.
+ * TODO(sra): The value should be initialized on isolate startup to a
+ * cryptographic hash to prevent collisions.
+ */
+var dispatchPropertyName = '_zzyzx';
+
+/**
+ * Returns the interceptor for a native class instance. Used by
+ * [getInterceptor].
+ */
+getNativeInterceptor(object) {
+  // This is a magic method: the compiler replaces it with a runtime generated
+  // function
+  //
+  //     function(object){return object._zzyzx();}
+  //
+  // where _zzyzx is replaced with the actual [dispatchPropertyName].
+  //
+  // The body is the CSP compliant version.
+  return JS('', '#[#]()', object, dispatchPropertyName);
+}
+
+setNativeInterceptor(prototype, function) {
+  JS('', '#[#]=#', prototype, dispatchPropertyName, function);
+}
+
+/**
  * If [InvocationMirror.invokeOn] is being used, this variable
  * contains a JavaScript array with the names of methods that are
  * intercepted.
diff --git a/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
index 736bf5d..6cd1b50 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/io_patch.dart
@@ -165,6 +165,9 @@
   patch static _setExitCode(int status) {
     throw new UnsupportedError("ProcessUtils._setExitCode");
   }
+  patch static _sleep(int millis) {
+    throw new UnsupportedError("ProcessUtils._sleep");
+  }
 }
 
 patch class Process {
diff --git a/sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart
index aa01bd2..3016e78 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart
@@ -506,7 +506,7 @@
         Function entryPoint = _getJSFunctionFromName(msg['functionName']);
         var replyTo = _deserializeMessage(msg['replyTo']);
         var context = new _IsolateContext();
-        _globalState.topEventLoop.enqueue(context, function() {
+        _globalState.topEventLoop.enqueue(context, () {
           _startIsolate(entryPoint, replyTo);
         }, 'worker-start');
         // Make sure we always have a current context in this worker.
@@ -650,7 +650,7 @@
     // TODO(eub): support IE9 using an iframe -- Dart issue 1702.
     if (uri != null) throw new UnsupportedError(
             "Currently spawnUri is not supported without web workers.");
-    _globalState.topEventLoop.enqueue(new _IsolateContext(), function() {
+    _globalState.topEventLoop.enqueue(new _IsolateContext(), () {
       final func = _getJSFunctionFromName(functionName);
       _startIsolate(func, replyPort);
     }, 'nonworker start');
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
index ef4aecd..c57c15b 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
@@ -84,11 +84,6 @@
     }
   }
 
-  void addLast(E value) {
-    checkGrowable(this, 'addLast');
-    JS('void', r'#.push(#)', this, value);
-  }
-
   void clear() {
     length = 0;
   }
@@ -130,6 +125,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  fold(initialValue, combine(previousValue, E element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   E firstWhere(bool test(E value), {E orElse()}) {
     return IterableMixinWorkaround.firstWhere(this, test, orElse);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index a3a59aa..badbb4d 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -12,11 +12,11 @@
                                    JS_DART_OBJECT_CONSTRUCTOR,
                                    JS_OPERATOR_IS_PREFIX,
                                    JS_OPERATOR_AS_PREFIX,
-                                   JS_HAS_EQUALS,
-                                   RAW_DART_FUNCTION_REF,
-                                   UNINTERCEPTED;
+                                   RAW_DART_FUNCTION_REF;
 import 'dart:_interceptors' show getInterceptor,
                                  interceptedNames,
+                                 dispatchPropertyName,
+                                 Interceptor,
                                  JSIndexable;
 
 part 'constant_map.dart';
@@ -1134,7 +1134,7 @@
 callTypeCheck(value, property) {
   if (value == null) return value;
   if ((identical(JS('String', 'typeof #', value), 'object'))
-      && JS('bool', '#[#]()', value, property)) {
+      && JS('bool', '#[#]()', getInterceptor(value), property)) {
     return value;
   }
   propertyTypeError(value, property);
@@ -1148,7 +1148,7 @@
 callTypeCast(value, property) {
   if (value == null
       || ((JS('bool', 'typeof # === "object"', value))
-          && JS('bool', '#[#]()', value, property))) {
+          && JS('bool', '#[#]()', getInterceptor(value), property))) {
     return value;
   }
   propertyTypeCastError(value, property);
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
index 559ccfb..d84a6a2 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
@@ -112,13 +112,20 @@
                   bool native) {
   if (object == null) return false;
   var arguments = getRuntimeTypeInfo(object);
-  if (isJsArray(object)) {
-    object = getInterceptor(object);
-  }
-  bool isSubclass = native ? call(object, isField) : getField(object, isField);
+  // Interceptor is needed for JSArray and native classes.
+  // TODO(sra): It could be a more specialized interceptor since [object] is not
+  // `null` or a primitive.
+  // TODO(9586): Move type info for static functions onto an interceptor.
+  var interceptor = isJsFunction(object) ? object : getInterceptor(object);
+  bool isSubclass = native
+      ? call(interceptor, isField)
+      : getField(interceptor, isField);
   // When we read the field and it is not there, [isSubclass] will be [:null:].
   if (isSubclass == null || !isSubclass) return false;
-  var substitution = native ? call(object, asField) : getField(object, asField);
+  // Should the asField function be passed the receiver?
+  var substitution = native
+      ? call(interceptor, asField)
+      : getField(interceptor, asField);
   return checkArguments(substitution, arguments, checks);
 }
 
@@ -168,7 +175,8 @@
   // overwrite o with the interceptor below.
   var rti = getRuntimeTypeInfo(o);
   // Check for native objects and use the interceptor instead of the object.
-  o = getInterceptor(o);
+  // TODO(9586): Move type info for static functions onto an interceptor.
+  o = isJsFunction(o) ? o : getInterceptor(o);
   // We can use the object as its own type representation because we install
   // the subtype flags and the substitution on the prototype, so they are
   // properties of the object in JS.
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
index 57e2c45..395f970 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
@@ -165,7 +165,7 @@
     return stringLastIndexOfUnchecked(this, other, start);
   }
 
-  bool contains(String other, [int startIndex = 0]) {
+  bool contains(Pattern other, [int startIndex = 0]) {
     checkNull(other);
     return stringContainsUnchecked(this, other, startIndex);
   }
diff --git a/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
index db9229a..43e02e8 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/native_helper.dart
@@ -272,7 +272,15 @@
        name);
   } else {
     var proto = JS('var', 'Object.getPrototypeOf(#)', obj);
-    if (!callHasOwnProperty(hasOwnPropertyFunction, proto, name)) {
+    // Patch the method onto the prototype to avoid repeating the lookup.  We
+    // expect that there is nothing called [name] on the immediate prototype,
+    // except it is OK to patch over the dispatch hook on `Object.prototype`.
+    // What this means is we are calling method [name] on a plain JavaScript
+    // Object.  If the patched method needs to access the dispatch hook (for
+    // example, a check against being called from a yet-to-be-patched subclass),
+    // it gets the hook from [dynamicDispatchTable].
+    if (!callHasOwnProperty(hasOwnPropertyFunction, proto, name) ||
+        JS('bool', '# === Object.prototype', proto)) {
       defineProperty(proto, name, method);
     }
   }
@@ -309,7 +317,7 @@
 // in native_emitter.dart (see dynamicName).  In order to avoid the class names
 // clashing with the method names on Object.prototype (needed for native
 // objects) we must always use hasOwnProperty.
-var lookupDynamicClass(var hasOwnPropertyFunction,
+lookupDynamicClass(var hasOwnPropertyFunction,
                        var methods,
                        String className) {
   return callHasOwnProperty(hasOwnPropertyFunction, methods, className) ?
@@ -334,20 +342,19 @@
  *
  */
 dynamicFunction(name) {
-  var f = JS('var', 'Object.prototype[#]', name);
+  var table = dynamicFunctionTable;
+  if (table == null) {
+    dynamicFunctionTable = table = JS('=Object', '{}');
+  }
+
+  var f = JS('var', '#[#]', table, name);
   if (f != null && JS('bool', '!!#.methods', f)) {
     return JS('var', '#.methods', f);
   }
 
   // TODO(ngeoffray): We could make this a map if the code we
   // generate plays well with a Dart map.
-  var methods = JS('var', '{}');
-  // If there is a method attached to the Dart Object class, use it as
-  // the method to call in case no method is registered for that type.
-  var dartMethod = getPropertyFromPrototype(const Object(), name);
-  // Take the method from the Dart Object class if we didn't find it yet and it
-  // is there.
-  if (dartMethod != null) propertySet(methods, 'Object', dartMethod);
+  var methods = JS('=Object', '{}');
 
   var bind = JS('var',
       'function() {'
@@ -356,11 +363,98 @@
     DART_CLOSURE_TO_JS(dynamicBind), name, methods);
 
   JS('void', '#.methods = #', bind, methods);
+  // Install dispatch function on `Object.prototype`, so that `x.name()` will
+  // initially enter the dispatch code for any object.
   defineProperty(JS('var', 'Object.prototype'), name, bind);
+  // Install dispatch function in table, so it can be called without relying on
+  // patching on the line above.
+  defineProperty(table, name, bind);
   return methods;
 }
 
 /**
+ * Table of dispatch _bind_ functions created by [dynamicFunction].
+ *
+ *  methodName -> dispatchFunction
+ */
+var dynamicFunctionTable;
+
+
+/**
+ * Associates a tag of a leaf native class (with no subclasses) with the
+ * interceptor for that class.  Called from generated code.
+ */
+void defineNativeMethods(String tag, interceptorClass) {
+  var methods = JS('', '#.prototype', interceptorClass);
+  var method = dispatchPropertyName;
+  JS('void', '#[#]=#', dynamicFunction(method), tag,
+      _unguardedConstantJSFunction(methods));
+}
+
+/**
+ * Associates a tag of a native class with subclasses with the interceptor for
+ * that class.  Called from generated code.
+ */
+void defineNativeMethodsNonleaf(String tag, interceptorClass) {
+  var methods = JS('', '#.prototype', interceptorClass);
+  var method = dispatchPropertyName;
+  JS('void', '#[#]=#', dynamicFunction(method), tag,
+      _guardedConstantJSFunction(method, methods));
+}
+
+void defineNativeMethodsFinish() {
+  // Replace dispatch hook on Object.prototype with one that returns an
+  // interceptor for JavaScript objects.  This avoids needing a test in every
+  // interceptor, and prioritizes the performance of known native classes over
+  // unknown.
+  JS('void', 'Object.prototype[#]=#', dispatchPropertyName,
+      _guardedConstantJSFunctionForObject(dispatchPropertyName,
+          JS('', 'Object.getPrototypeOf(#)', const Interceptor())));
+}
+
+/**
+ * Returns a JavaScript function that returns [value].
+ */
+_unguardedConstantJSFunction(var value) {
+  return JS('', 'function(){return #}', value);
+}
+
+/**
+ * Returns a JavaScript function that returns [value] when called from a patched
+ * prototype, and calls the dispatch hook when called from an unpatched
+ * prototype.
+ */
+_guardedConstantJSFunction(String name, var value) {
+  return JS('',
+      'function(){'
+        'if(Object.getPrototypeOf(this).hasOwnProperty(#))'
+          'return #;'
+        'return #(#,this);'
+      '}',
+      name,
+      value,
+      RAW_DART_FUNCTION_REF(_redispatchGetNativeInterceptorHook), name);
+}
+
+_redispatchGetNativeInterceptorHook(name, receiver) {
+  return JS('', '#[#].call(#)', dynamicFunctionTable, name, receiver);
+}
+
+_guardedConstantJSFunctionForObject(String name, var value) {
+  var objectPrototype = JS('', 'Object.prototype');
+  return JS('',
+      'function(){'
+        'if (Object.getPrototypeOf(this) === #)'
+          'return #;'
+        'return #(#,this);'
+      '}',
+      objectPrototype,
+      value,
+      RAW_DART_FUNCTION_REF(_redispatchGetNativeInterceptorHook), name);
+}
+
+
+/**
  * This class encodes the class hierarchy when we need it for dynamic
  * dispatch.
  */
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart
index 569fd7e..70114423 100644
--- a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart
@@ -12,10 +12,10 @@
 import '../../compiler.dart' as api;
 import '../elements/elements.dart';
 import '../resolution/resolution.dart' show ResolverTask, ResolverVisitor;
-import '../apiimpl.dart' show Compiler;
+import '../apiimpl.dart' as apiimpl;
 import '../scanner/scannerlib.dart' hide SourceString;
 import '../ssa/ssa.dart';
-import '../dart2jslib.dart' hide Compiler;
+import '../dart2jslib.dart';
 import '../dart_types.dart';
 import '../filenames.dart';
 import '../source_file.dart';
@@ -229,21 +229,19 @@
  * 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}) {
-  Uri cwd = getCurrentDirectory();
-  SourceFileProvider provider = new SourceFileProvider();
-  if (diagnosticHandler == null) {
-    diagnosticHandler =
-        new FormattingDiagnosticHandler(provider).diagnosticHandler;
+// 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>[]]) {
+  if (!libraryRoot.path.endsWith("/")) {
+    throw new ArgumentError("libraryRoot must end with a /");
   }
-  Uri libraryUri = cwd.resolve('${libraryRoot}/');
-  Uri packageUri = null;
-  if (packageRoot != null) {
-    packageUri = cwd.resolve('${packageRoot}/');
+  if (packageRoot != null && !packageRoot.path.endsWith("/")) {
+    throw new ArgumentError("packageRoot must end with a /");
   }
   options = new List<String>.from(options);
   options.add('--analyze-only');
@@ -260,17 +258,11 @@
     diagnosticHandler(uri, begin, end, message, kind);
   }
 
-  // TODO(johnniwinther): Extract the following as an [analyze] method in
-  // [:compiler/compiler.dart:].
-  Compiler compiler = new Compiler(provider.readStringFromUri,
-                                   null,
-                                   internalDiagnosticHandler,
-                                   libraryUri, packageUri, options);
-  List<Uri> librariesUri = <Uri>[];
-  for (Path library in libraries) {
-    librariesUri.add(cwd.resolve(library.toString()));
-  }
-  compiler.librariesToAnalyzeWhenRun = librariesUri;
+  Compiler compiler = new apiimpl.Compiler(inputProvider,
+                                           null,
+                                           internalDiagnosticHandler,
+                                           libraryRoot, packageRoot, options);
+  compiler.librariesToAnalyzeWhenRun = libraries;
   bool success = compiler.run(null);
   if (success && !compilationFailed) {
     return new Future<MirrorSystem>.immediate(
@@ -281,6 +273,36 @@
   }
 }
 
+/**
+ * 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('${libraryRoot}/');
+  Uri packageUri = null;
+  if (packageRoot != null) {
+    packageUri = cwd.resolve('${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
 //------------------------------------------------------------------------------
@@ -327,6 +349,15 @@
     assert (_element != null);
   }
 
+  /**
+   * Returns the element to be used to determine the begin token of this
+   * declaration and the metadata associated with this declaration.
+   *
+   * This indirection is needed to use the [VariableListElement] as the location
+   * for type and metadata information on a [VariableElement].
+   */
+  Element get _beginElement => _element;
+
   String get simpleName => _element.name.slowToString();
 
   String get displayName => simpleName;
@@ -337,9 +368,9 @@
    */
   Token getBeginToken() {
     // TODO(johnniwinther): Avoid calling [parseNode].
-    Node node = _element.parseNode(mirrors.compiler);
+    Node node = _beginElement.parseNode(mirrors.compiler);
     if (node == null) {
-      return _element.position();
+      return _beginElement.position();
     }
     return node.getBeginToken();
   }
@@ -362,8 +393,8 @@
    * metadata annotations.
    */
   Token getFirstToken() {
-    if (!_element.metadata.isEmpty) {
-      for (MetadataAnnotation metadata in _element.metadata) {
+    if (!_beginElement.metadata.isEmpty) {
+      for (MetadataAnnotation metadata in _beginElement.metadata) {
         if (metadata.beginToken != null) {
           return metadata.beginToken;
         }
@@ -721,6 +752,8 @@
                          this.isNamed)
     : super(system, element);
 
+  Element get _beginElement => _variableElement.variables;
+
   DeclarationMirror get owner => _method;
 
   VariableElement get _variableElement => _element;
@@ -767,9 +800,12 @@
   FieldParameterElement get _fieldParameterElement => _element;
 
   TypeMirror get type {
-    if (_fieldParameterElement.variables.cachedNode.type != null) {
+    VariableListElement variables = _fieldParameterElement.variables;
+    VariableDefinitions node = variables.parseNode(mirrors.compiler);
+    if (node.type != null) {
       return super.type;
     }
+    // Use the field type for initializing formals with no type annotation.
     return _convertTypeToTypeMirror(mirrors,
       _fieldParameterElement.fieldElement.computeType(mirrors.compiler),
       mirrors.compiler.types.dynamicType,
@@ -1473,6 +1509,8 @@
         this._variable = variable,
         super(objectMirror.mirrors, variable);
 
+  Element get _beginElement => _variable.variables;
+
   String get qualifiedName
       => '${owner.qualifiedName}.$simpleName';
 
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
index c2d6007..cec6c29 100644
--- a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
@@ -17,6 +17,7 @@
   /**
    * Returns an unmodifiable map of all libraries in this mirror system.
    */
+  // TODO(johnniwinther): Change to Map<Uri, LibraryMirror>.
   Map<String, LibraryMirror> get libraries;
 
   /**
diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart
index 00415f0..26abc95 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -377,6 +377,13 @@
     staticUse(const SourceString('toStringForNativeObject'));
     staticUse(const SourceString('hashCodeForNativeObject'));
     staticUse(const SourceString('convertDartClosureToJS'));
+    staticUse(const SourceString('defineNativeMethods'));
+    staticUse(const SourceString('defineNativeMethodsNonleaf'));
+    // TODO(9577): Registering `defineNativeMethodsFinish` seems redundant with
+    // respect to the registering in the backend. When the backend registering
+    // is removed as part of fixing Issue 9577, this can be the sole place
+    // registering this methods.
+    staticUse(const SourceString('defineNativeMethodsFinish'));
 
     addNativeExceptions();
   }
@@ -483,6 +490,7 @@
       || libraryName == 'dart:indexed_db'
       || libraryName == 'dart:svg'
       || libraryName == 'dart:web_audio'
+      || libraryName == 'dart:web_gl'
       || libraryName == 'dart:web_sql') {
     library.canUseNative = true;
   }
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index affa364..9eed786 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -496,13 +496,17 @@
     }
   }
 
-  void beginLoopHeader(Node node, HBasicBlock loopEntry) {
+  /**
+   * Create phis at the loop entry for local variables (ready for the values
+   * from the back edge).  Populate the phis with the current values.
+   */
+  void beginLoopHeader(HBasicBlock loopEntry) {
     // Create a copy because we modify the map while iterating over it.
-    Map<Element, HInstruction> saved =
+    Map<Element, HInstruction> savedDirectLocals =
         new LinkedHashMap<Element, HInstruction>.from(directLocals);
 
     // Create phis for all elements in the definitions environment.
-    saved.forEach((Element element, HInstruction instruction) {
+    savedDirectLocals.forEach((Element element, HInstruction instruction) {
       if (isAccessedDirectly(element)) {
         // We know 'this' cannot be modified.
         if (!identical(element, closureData.thisElement)) {
@@ -539,6 +543,10 @@
     }
   }
 
+  /**
+   * Goes through the phis created in beginLoopHeader entry and adds the
+   * input from the back edge (from the current value of directLocals) to them.
+   */
   void endLoop(HBasicBlock loopEntry) {
     // If the loop has an aborting body, we don't update the loop
     // phis.
@@ -586,15 +594,16 @@
   }
 
   /**
-   * The current localsHandler is not used for its values, only for its
-   * declared variables. This is a way to exclude local values from the
-   * result when they are no longer in scope.
-   * Returns the new LocalsHandler to use (may not be [this]).
+   * When control flow merges, this method can be used to merge several
+   * localsHandlers into a new one using phis.  The new localsHandler is
+   * returned.  Unless it is also in the list, the current localsHandler is not
+   * used for its values, only for its declared variables. This is a way to
+   * exclude local values from the result when they are no longer in scope.
    */
-  LocalsHandler mergeMultiple(List<LocalsHandler> locals,
+  LocalsHandler mergeMultiple(List<LocalsHandler> localsHandlers,
                               HBasicBlock joinBlock) {
-    assert(locals.length > 0);
-    if (locals.length == 1) return locals[0];
+    assert(localsHandlers.length > 0);
+    if (localsHandlers.length == 1) return localsHandlers[0];
     Map<Element, HInstruction> joinedLocals =
         new LinkedHashMap<Element,HInstruction>();
     HInstruction thisValue = null;
@@ -610,8 +619,8 @@
         thisValue = instruction;
       }
     });
-    for (LocalsHandler local in locals) {
-      local.directLocals.forEach((Element element, HInstruction instruction) {
+    for (LocalsHandler handler in localsHandlers) {
+      handler.directLocals.forEach((Element element, HInstruction instruction) {
         HPhi phi = joinedLocals[element];
         if (phi != null) {
           phi.addInput(instruction);
@@ -816,7 +825,7 @@
   }
 
   static const MAX_INLINING_DEPTH = 3;
-  static const MAX_INLINING_SOURCE_SIZE = 128;
+  static const MAX_INLINING_NODES = 46;
   List<InliningState> inliningStack;
   Element returnElement;
   DartType returnType;
@@ -1096,21 +1105,27 @@
     for (int i = 0; i < inliningStack.length; i++) {
       if (inliningStack[i].function == element) return false;
     }
+
     PartialFunctionElement function = element;
-    int sourceSize =
-        function.endToken.charOffset - function.beginToken.charOffset;
-    if (sourceSize > MAX_INLINING_SOURCE_SIZE) return false;
+    if (function == backend.getInterceptorMethod) return false;
+    bool canBeInlined = backend.canBeInlined[function];
+    if (canBeInlined == false) return false;
     if (!selector.applies(function, compiler)) return false;
+
     FunctionExpression functionExpression = function.parseNode(compiler);
     TreeElements newElements =
         compiler.enqueuer.resolution.getCachedElements(function);
     if (newElements == null) {
       compiler.internalError("Element not resolved: $function");
     }
-    if (!InlineWeeder.canBeInlined(functionExpression, newElements)) {
-      return false;
+
+    if (canBeInlined == null) {
+      canBeInlined = InlineWeeder.canBeInlined(functionExpression, newElements);
+      backend.canBeInlined[function] = canBeInlined;
+      if (!canBeInlined) return false;
     }
 
+    assert(canBeInlined);
     InliningState state = enterInlinedMethod(
         function, selector, arguments, currentNode);
     inlinedFrom(element, () {
@@ -1335,7 +1350,9 @@
               // closure to class mapper.
               compiler.closureToClassMapper.computeClosureToClassMapping(
                   member, node, elements);
+              sourceElementStack.add(member);
               right.accept(this);
+              sourceElementStack.removeLast();
               elements = savedElements;
               value = pop();
             }
@@ -1728,7 +1745,7 @@
            'length': sourceFile.text.length});
     }
     return location;
-}
+  }
 
   void visit(Node node) {
     if (node != null) node.accept(this);
@@ -1774,37 +1791,56 @@
     previousBlock.addSuccessor(loopEntry);
     open(loopEntry);
 
-    localsHandler.beginLoopHeader(node, loopEntry);
+    localsHandler.beginLoopHeader(loopEntry);
     return jumpHandler;
   }
 
   /**
    * Ends the loop:
-   * - creates a new block and adds it as successor to the [branchBlock].
+   * - creates a new block and adds it as successor to the [branchBlock] and
+   *   any blocks that end in break.
    * - opens the new block (setting as [current]).
    * - notifies the locals handler that we're exiting a loop.
+   * [savedLocals] are the locals from the end of the loop condition.
+   * [branchBlock] is the exit (branching) block of the condition.  For the
+   * while and for loops this is at the top of the loop.  For do-while it is
+   * the end of the body.  It is null for degenerate do-while loops that have
+   * no back edge because they abort (throw/return/break in the body and have
+   * no continues).
    */
   void endLoop(HBasicBlock loopEntry,
                HBasicBlock branchBlock,
                JumpHandler jumpHandler,
                LocalsHandler savedLocals) {
-    if (branchBlock == null && !jumpHandler.hasAnyBreak()) return;
-
     HBasicBlock loopExitBlock = addNewBlock();
-    assert(branchBlock == null || branchBlock.successors.length == 1);
-    List<LocalsHandler> breakLocals = <LocalsHandler>[];
+    List<LocalsHandler> breakHandlers = <LocalsHandler>[];
+    // Collect data for the successors and the phis at each break.
     jumpHandler.forEachBreak((HBreak breakInstruction, LocalsHandler locals) {
       breakInstruction.block.addSuccessor(loopExitBlock);
-      breakLocals.add(locals);
+      breakHandlers.add(locals);
     });
+    // The exit block is a successor of the loop condition if it is reached.
+    // We don't add the successor in the case of a while/for loop that aborts
+    // because the caller of endLoop will be wiring up a special empty else
+    // block instead.
     if (branchBlock != null) {
       branchBlock.addSuccessor(loopExitBlock);
     }
-    open(loopExitBlock);
+    // Update the phis at the loop entry with the current values of locals.
     localsHandler.endLoop(loopEntry);
-    if (!breakLocals.isEmpty) {
-      breakLocals.add(savedLocals);
-      localsHandler = savedLocals.mergeMultiple(breakLocals, loopExitBlock);
+
+    // Start generating code for the exit block.
+    open(loopExitBlock);
+
+    // Create a new localsHandler for the loopExitBlock with the correct phis.
+    if (!breakHandlers.isEmpty) {
+      if (branchBlock != null) {
+        // Add the values of the locals at the end of the condition block to
+        // the phis.  These are the values that flow to the exit if the
+        // condition fails.
+        breakHandlers.add(savedLocals);
+      }
+      localsHandler = savedLocals.mergeMultiple(breakHandlers, loopExitBlock);
     } else {
       localsHandler = savedLocals;
     }
@@ -1862,6 +1898,9 @@
     SubExpression conditionExpression =
         new SubExpression(conditionBlock, conditionExitBlock);
 
+    // Save the values of the local variables at the end of the condition
+    // block.  These are the values that will flow to the loop exit if the
+    // condition fails.
     LocalsHandler savedLocals = new LocalsHandler.from(localsHandler);
 
     // The body.
@@ -1878,30 +1917,30 @@
 
     SubExpression updateGraph;
 
-    // Check that the loop has at least one back-edge.
-    if (jumpHandler.hasAnyContinue() || bodyBlock != null) {
+    bool loopIsDegenerate = !jumpHandler.hasAnyContinue() && bodyBlock == null;
+    if (!loopIsDegenerate) {
       // Update.
       // We create an update block, even when we are in a while loop. There the
       // update block is the jump-target for continue statements. We could avoid
       // the creation if there is no continue, but for now we always create it.
       HBasicBlock updateBlock = addNewBlock();
 
-      List<LocalsHandler> continueLocals = <LocalsHandler>[];
+      List<LocalsHandler> continueHandlers = <LocalsHandler>[];
       jumpHandler.forEachContinue((HContinue instruction,
                                    LocalsHandler locals) {
         instruction.block.addSuccessor(updateBlock);
-        continueLocals.add(locals);
+        continueHandlers.add(locals);
       });
 
 
       if (bodyBlock != null) {
-        continueLocals.add(localsHandler);
+        continueHandlers.add(localsHandler);
         bodyBlock.addSuccessor(updateBlock);
       }
 
       open(updateBlock);
       localsHandler =
-          continueLocals[0].mergeMultiple(continueLocals, updateBlock);
+          continueHandlers[0].mergeMultiple(continueHandlers, updateBlock);
 
       HLabeledBlockInformation labelInfo;
       List<LabelElement> labels = jumpHandler.labels();
@@ -1930,10 +1969,9 @@
       // The back-edge completing the cycle.
       updateEndBlock.addSuccessor(conditionBlock);
       updateGraph = new SubExpression(updateBlock, updateEndBlock);
-    }
 
-    if (jumpHandler.hasAnyContinue() || bodyBlock != null) {
       endLoop(conditionBlock, conditionExitBlock, jumpHandler, savedLocals);
+
       conditionBlock.postProcessLoopHeader();
       HLoopBlockInformation info =
           new HLoopBlockInformation(
@@ -1950,7 +1988,8 @@
       startBlock.setBlockFlow(info, current);
       loopInfo.loopBlockInformation = info;
     } else {
-      // There is no back edge for the loop, so we turn the code into:
+      // The body of the for/while loop always aborts, so there is no back edge.
+      // We turn the code into:
       // if (condition) {
       //   body;
       // } else {
@@ -1962,12 +2001,10 @@
       HBasicBlock elseBlock = addNewBlock();
       open(elseBlock);
       close(new HGoto());
-      endLoop(conditionBlock, null, jumpHandler, savedLocals);
+      // Pass the elseBlock as the branchBlock, because that's the block we go
+      // to just before leaving the 'loop'.
+      endLoop(conditionBlock, elseBlock, jumpHandler, savedLocals);
 
-      // [endLoop] will not create an exit block if there are no
-      // breaks.
-      if (current == null) open(addNewBlock());
-      elseBlock.addSuccessor(current);
       SubGraph elseGraph = new SubGraph(elseBlock, elseBlock);
       // Remove the loop information attached to the header.
       conditionBlock.loopInformation = null;
@@ -1980,13 +2017,13 @@
       conditionExitBlock.remove(conditionExitBlock.last);
       HIfBlockInformation info =
           new HIfBlockInformation(
-            wrapExpressionGraph(conditionExpression),
-            wrapStatementGraph(bodyGraph),
-            wrapStatementGraph(elseGraph));
+              wrapExpressionGraph(conditionExpression),
+              wrapStatementGraph(bodyGraph),
+              wrapStatementGraph(elseGraph));
 
-      conditionBlock.setBlockFlow(info, current);
-      HIf ifBlock = conditionBlock.last;
-      ifBlock.blockInformation = conditionBlock.blockFlow;
+      conditionExitBlock.setBlockFlow(info, current);
+      HIf ifBlock = conditionExitBlock.last;
+      ifBlock.blockInformation = conditionExitBlock.blockFlow;
 
       // If the body has any break, attach a synthesized label to the
       // if block.
@@ -2091,25 +2128,25 @@
     }
 
     SubExpression conditionExpression;
-    HBasicBlock conditionEndBlock;
-    if (!isAbortingBody || hasContinues) {
+    bool loopIsDegenerate = isAbortingBody && !hasContinues;
+    if (!loopIsDegenerate) {
       HBasicBlock conditionBlock = addNewBlock();
 
-      List<LocalsHandler> continueLocals = <LocalsHandler>[];
+      List<LocalsHandler> continueHandlers = <LocalsHandler>[];
       jumpHandler.forEachContinue((HContinue instruction,
                                    LocalsHandler locals) {
         instruction.block.addSuccessor(conditionBlock);
-        continueLocals.add(locals);
+        continueHandlers.add(locals);
       });
 
       if (!isAbortingBody) {
         bodyExitBlock.addSuccessor(conditionBlock);
       }
 
-      if (!continueLocals.isEmpty) {
-        if (!isAbortingBody) continueLocals.add(localsHandler);
+      if (!continueHandlers.isEmpty) {
+        if (!isAbortingBody) continueHandlers.add(localsHandler);
         localsHandler =
-            savedLocals.mergeMultiple(continueLocals, conditionBlock);
+            savedLocals.mergeMultiple(continueHandlers, conditionBlock);
         SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock);
         List<LabelElement> labels = jumpHandler.labels();
         HSubGraphBlockInformation bodyInfo =
@@ -2129,7 +2166,7 @@
       visit(node.condition);
       assert(!isAborted());
       HInstruction conditionInstruction = popBoolified();
-      conditionEndBlock = close(
+      HBasicBlock conditionEndBlock = close(
           new HLoopBranch(conditionInstruction, HLoopBranch.DO_WHILE_LOOP));
 
       HBasicBlock avoidCriticalEdge = addNewBlock();
@@ -2140,10 +2177,9 @@
 
       conditionExpression =
           new SubExpression(conditionBlock, conditionEndBlock);
-    }
 
-    endLoop(loopEntryBlock, conditionEndBlock, jumpHandler, localsHandler);
-    if (!isAbortingBody || hasContinues) {
+      endLoop(loopEntryBlock, conditionEndBlock, jumpHandler, localsHandler);
+
       loopEntryBlock.postProcessLoopHeader();
       SubGraph bodyGraph = new SubGraph(loopEntryBlock, bodyExitBlock);
       HLoopBlockInformation loopBlockInfo =
@@ -2160,13 +2196,17 @@
       loopEntryBlock.setBlockFlow(loopBlockInfo, current);
       loopInfo.loopBlockInformation = loopBlockInfo;
     } else {
-      // If the loop has no back edge, we remove the loop information
-      // on the header.
+      // Since the loop has no back edge, we remove the loop information on the
+      // header.
       loopEntryBlock.loopInformation = null;
 
-      // If the body of the loop has any break, we attach a
-      // synthesized label to the body.
       if (jumpHandler.hasAnyBreak()) {
+        // Null branchBlock because the body of the do-while loop always aborts,
+        // so we never get to the condition.
+        endLoop(loopEntryBlock, null, jumpHandler, localsHandler);
+
+        // Since the body of the loop has a break, we attach a synthesized label
+        // to the body.
         SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock);
         TargetElement target = elements[node];
         LabelElement label = target.addLabel(null, 'loop');
@@ -4069,18 +4109,18 @@
     SubGraph bodyGraph = new SubGraph(entryBlock, lastOpenedBlock);
 
     HBasicBlock joinBlock = graph.addNewBlock();
-    List<LocalsHandler> breakLocals = <LocalsHandler>[];
+    List<LocalsHandler> breakHandlers = <LocalsHandler>[];
     handler.forEachBreak((HBreak breakInstruction, LocalsHandler locals) {
       breakInstruction.block.addSuccessor(joinBlock);
-      breakLocals.add(locals);
+      breakHandlers.add(locals);
     });
-    bool hasBreak = breakLocals.length > 0;
+    bool hasBreak = breakHandlers.length > 0;
     if (!isAborted()) {
       goto(current, joinBlock);
-      breakLocals.add(localsHandler);
+      breakHandlers.add(localsHandler);
     }
     open(joinBlock);
-    localsHandler = beforeLocals.mergeMultiple(breakLocals, joinBlock);
+    localsHandler = beforeLocals.mergeMultiple(breakHandlers, joinBlock);
 
     if (hasBreak) {
       // There was at least one reachable break, so the label is needed.
@@ -4143,25 +4183,25 @@
 
     // Create merge block for break targets.
     HBasicBlock joinBlock = new HBasicBlock();
-    List<LocalsHandler> caseLocals = <LocalsHandler>[];
+    List<LocalsHandler> caseHandlers = <LocalsHandler>[];
     jumpHandler.forEachBreak((HBreak instruction, LocalsHandler locals) {
       instruction.block.addSuccessor(joinBlock);
-      caseLocals.add(locals);
+      caseHandlers.add(locals);
     });
     if (!isAborted()) {
       // The current flow is only aborted if the switch has a default that
       // aborts (all previous cases must abort, and if there is no default,
       // it's possible to miss all the cases).
-      caseLocals.add(localsHandler);
+      caseHandlers.add(localsHandler);
       goto(current, joinBlock);
     }
-    if (caseLocals.length != 0) {
+    if (caseHandlers.length != 0) {
       graph.addBlock(joinBlock);
       open(joinBlock);
-      if (caseLocals.length == 1) {
-        localsHandler = caseLocals[0];
+      if (caseHandlers.length == 1) {
+        localsHandler = caseHandlers[0];
       } else {
-        localsHandler = savedLocals.mergeMultiple(caseLocals, joinBlock);
+        localsHandler = savedLocals.mergeMultiple(caseHandlers, joinBlock);
       }
     } else {
       // The joinblock is not used.
@@ -4282,36 +4322,36 @@
     // Add a join-block if necessary.
     // We create [joinBlock] early, and then go through the cases that might
     // want to jump to it. In each case, if we add [joinBlock] as a successor
-    // of another block, we also add an element to [caseLocals] that is used
+    // of another block, we also add an element to [caseHandlers] that is used
     // to create the phis in [joinBlock].
-    // If we never jump to the join block, [caseLocals] will stay empty, and
+    // If we never jump to the join block, [caseHandlers] will stay empty, and
     // the join block is never added to the graph.
     HBasicBlock joinBlock = new HBasicBlock();
-    List<LocalsHandler> caseLocals = <LocalsHandler>[];
+    List<LocalsHandler> caseHandlers = <LocalsHandler>[];
     jumpHandler.forEachBreak((HBreak instruction, LocalsHandler locals) {
       instruction.block.addSuccessor(joinBlock);
-      caseLocals.add(locals);
+      caseHandlers.add(locals);
     });
     if (!isAborted()) {
       current.close(new HGoto());
       lastOpenedBlock.addSuccessor(joinBlock);
-      caseLocals.add(localsHandler);
+      caseHandlers.add(localsHandler);
     }
     if (!hasDefault) {
       // The current flow is only aborted if the switch has a default that
       // aborts (all previous cases must abort, and if there is no default,
       // it's possible to miss all the cases).
       expressionEnd.addSuccessor(joinBlock);
-      caseLocals.add(savedLocals);
+      caseHandlers.add(savedLocals);
     }
-    assert(caseLocals.length == joinBlock.predecessors.length);
-    if (caseLocals.length != 0) {
+    assert(caseHandlers.length == joinBlock.predecessors.length);
+    if (caseHandlers.length != 0) {
       graph.addBlock(joinBlock);
       open(joinBlock);
-      if (caseLocals.length == 1) {
-        localsHandler = caseLocals[0];
+      if (caseHandlers.length == 1) {
+        localsHandler = caseHandlers[0];
       } else {
-        localsHandler = savedLocals.mergeMultiple(caseLocals, joinBlock);
+        localsHandler = savedLocals.mergeMultiple(caseHandlers, joinBlock);
       }
     } else {
       // The joinblock is not used.
@@ -4785,8 +4825,10 @@
  */
 class InlineWeeder extends Visitor {
   final TreeElements elements;
+
   bool seenReturn = false;
   bool tooDifficult = false;
+  int nodeCount = 0;
 
   InlineWeeder(this.elements);
 
@@ -4798,11 +4840,21 @@
     return true;
   }
 
+  bool registerNode() {
+    if (nodeCount++ > SsaBuilder.MAX_INLINING_NODES) {
+      tooDifficult = true;
+      return false;
+    } else {
+      return true;
+    }
+  }
+
   void visit(Node node) {
     node.accept(this);
   }
 
   void visitNode(Node node) {
+    if (!registerNode()) return;
     if (seenReturn) {
       tooDifficult = true;
     } else {
@@ -4811,14 +4863,17 @@
   }
 
   void visitFunctionExpression(Node node) {
+    if (!registerNode()) return;
     tooDifficult = true;
   }
 
   void visitFunctionDeclaration(Node node) {
+    if (!registerNode()) return;
     tooDifficult = true;
   }
 
   void visitSend(Send node) {
+    if (!registerNode()) return;
     if (node.isParameterCheck) {
       tooDifficult = true;
       return;
@@ -4827,11 +4882,13 @@
   }
 
   visitLoop(Node node) {
+    if (!registerNode()) return;
     node.visitChildren(this);
     if (seenReturn) tooDifficult = true;
   }
 
   void visitReturn(Return node) {
+    if (!registerNode()) return;
     if (seenReturn
         || identical(node.getBeginToken().stringValue, 'native')
         || node.isRedirectingFactoryBody) {
@@ -4843,10 +4900,12 @@
   }
 
   void visitTryStatement(Node node) {
+    if (!registerNode()) return;
     tooDifficult = true;
   }
 
   void visitThrow(Node node) {
+    if (!registerNode()) return;
     tooDifficult = true;
   }
 }
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index af3528c..42f055a 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -68,24 +68,7 @@
       codegen.visitGraph(graph);
 
       FunctionElement element = work.element;
-      js.Block body;
-      ClassElement enclosingClass = element.getEnclosingClass();
-
-      if (element.isInstanceMember()
-          && enclosingClass.isNative()
-          && native.isOverriddenMethod(
-              element, enclosingClass, nativeEmitter)) {
-        // Record that this method is overridden. In case of optional
-        // arguments, the emitter will generate stubs to handle them,
-        // and needs to know if the method is overridden.
-        nativeEmitter.overriddenMethods.add(element);
-        body = nativeEmitter.generateMethodBodyWithPrototypeCheckForElement(
-                  element, codegen.body, codegen.parameters);
-      } else {
-        body = codegen.body;
-      }
-
-      return buildJavaScriptFunction(element, codegen.parameters, body);
+      return buildJavaScriptFunction(element, codegen.parameters, codegen.body);
     });
   }
 
@@ -1500,6 +1483,7 @@
     use(node.receiver);
     List<js.Expression> arguments = <js.Expression>[pop()];
     push(jsPropertyCall(isolate, name, arguments), node);
+    backend.registerUseInterceptor(world);
   }
 
   visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
@@ -1529,30 +1513,12 @@
         } else if (target == backend.jsStringConcat) {
           push(new js.Binary('+', object, arguments[0]), node);
           return;
-        } else if (target.isNative()
-                   && !compiler.enableTypeAssertions
-                   && target.isFunction()) {
-          // Enable direct calls to a native method only if we don't
-          // run in checked mode, where the Dart version may have
-          // type annotations on parameters and return type that it
-          // should check.
-          // Also check that the parameters are not functions: it's
-          // the callee that will translate them to JS functions.
-          // TODO(ngeoffray): There are some cases where we could
-          // still inline in checked mode if we know the arguments
-          // have the right type. And we could do the closure
-          // conversion as well as the return type annotation check.
-          bool canInlineNativeCall = true;
-          FunctionElement function = target;
-          function.computeSignature(compiler).forEachParameter((Element element) {
-            DartType type = element.computeType(compiler).unalias(compiler);
-            if (type is FunctionType) {
-              canInlineNativeCall = false;
-            }
-          });
-          if (canInlineNativeCall) {
-            methodName = target.fixedBackendName();
-          }
+        } else if (target.isNative() && target.isFunction()
+                   && !node.isInterceptedCall) {
+          // A direct (i.e. non-interceptor) native call is the result of
+          // optimization.  The optimization ensures any type checks or
+          // conversions have been satisified.
+          methodName = target.fixedBackendName();
         }
       }
     }
@@ -1577,6 +1543,7 @@
     } else {
       registerMethodInvoke(node);
     }
+    backend.registerUseInterceptor(world);
   }
 
   Selector getOptimizedSelectorFor(HInvokeDynamic node, Selector selector) {
@@ -2245,6 +2212,36 @@
     world.registerIsCheck(type, work.resolutionTree);
     Element element = type.element;
     use(input);
+
+    // Hack in interceptor.  Ideally the interceptor would occur at the
+    // instruction level to allow optimizations, and checks would be broken into
+    // several smaller tests.
+    String interceptorName =
+        backend.namer.getName(backend.getInterceptorMethod);
+
+    var isolate = new js.VariableUse(backend.namer.CURRENT_ISOLATE);
+    List<js.Expression> arguments = <js.Expression>[pop()];
+    push(jsPropertyCall(isolate, interceptorName, arguments));
+    backend.registerUseInterceptor(world);
+
+    // TODO(9586): If a static function can have the type, the type info is
+    // sitting on the function.  So generate:
+    //
+    //   (typeof x == "function" ? x : getInterceptor(x)).$isFoo
+    //
+    if (type.unalias(compiler) is FunctionType) {
+      js.Expression whenNotFunction = pop();
+      use(input);
+      js.Expression whenFunction = pop();
+      use(input);
+      push(new js.Conditional(
+          new js.Binary('==',
+              new js.Prefix("typeof", pop()),
+              js.string('function')),
+          whenFunction,
+          whenNotFunction));
+    }
+
     js.PropertyAccess field =
         new js.PropertyAccess.field(pop(), backend.namer.operatorIs(element));
     if (backend.emitter.nativeEmitter.requiresNativeIsCheck(element)) {
@@ -2256,6 +2253,7 @@
       // If the result is not negated, put another '!' in front.
       if (!negative) push(new js.Prefix('!', pop()));
     }
+
   }
 
   void handleNumberOrStringSupertypeCheck(HInstruction input, DartType type) {
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index e6cfe3c..c1b9796 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -544,6 +544,8 @@
   }
 
   void addPhi(HPhi phi) {
+    assert(phi.inputs.length == 0 || phi.inputs.length == predecessors.length);
+    assert(phi.block == null);
     phis.internalAddAfter(phis.last, phi);
     phi.notifyAddedToBlock(this);
   }
@@ -1931,6 +1933,7 @@
   void addInput(HInstruction input) {
     assert(isInBasicBlock());
     inputs.add(input);
+    assert(inputs.length <= block.predecessors.length);
     input.usedBy.add(this);
   }
 
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index ec9c47d..a44058c 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -335,17 +335,81 @@
     // TODO(ngeoffray): Also fold if it's a getter or variable.
     if (element != null && element.isFunction()) {
       FunctionElement method = element;
-      FunctionSignature parameters = method.computeSignature(compiler);
-      // TODO(ngeoffray): If the method has optional parameters,
-      // we should pass the default values.
-      if (parameters.optionalParameterCount == 0
-          || parameters.parameterCount == node.selector.argumentCount) {
-        node.element = element;
+
+      if (method.isNative()) {
+        HInstruction folded = tryInlineNativeMethod(node, method);
+        if (folded != null) return folded;
+      } else {
+        // TODO(ngeoffray): If the method has optional parameters,
+        // we should pass the default values.
+        FunctionSignature parameters = method.computeSignature(compiler);
+        if (parameters.optionalParameterCount == 0
+            || parameters.parameterCount == node.selector.argumentCount) {
+          node.element = element;
+        }
       }
     }
     return node;
   }
 
+  HInstruction tryInlineNativeMethod(HInvokeDynamicMethod node,
+                                     FunctionElement method) {
+    // Enable direct calls to a native method only if we don't run in checked
+    // mode, where the Dart version may have type annotations on parameters and
+    // return type that it should check.
+    // Also check that the parameters are not functions: it's the callee that
+    // will translate them to JS functions.
+    //
+    // TODO(ngeoffray): There are some cases where we could still inline in
+    // checked mode if we know the arguments have the right type. And we could
+    // do the closure conversion as well as the return type annotation check.
+
+    if (!node.isInterceptedCall) return null;
+
+    // TODO(sra): Check for legacy methods with bodies in the native strings.
+    //   foo() native 'return something';
+    // They should not be used.
+
+    FunctionSignature signature = method.computeSignature(compiler);
+    if (signature.optionalParametersAreNamed) return null;
+
+    // Return types on native methods don't need to be checked, since the
+    // declaration has to be truthful.
+
+    // The call site might omit optional arguments. The inlined code must
+    // preserve the number of arguments, so check only the actual arguments.
+
+    List<HInstruction> inputs = node.inputs.sublist(1);
+    int inputPosition = 0;
+    bool canInline = true;
+    signature.forEachParameter((Element element) {
+      if (inputPosition < inputs.length && canInline) {
+        HInstruction input = inputs[inputPosition++];
+        DartType type = element.computeType(compiler).unalias(compiler);
+        if (type is FunctionType) {
+          canInline = false;
+        }
+        if (compiler.enableTypeAssertions) {
+          // TODO(sra): Check if [input] is guaranteed to pass the parameter
+          // type check.  Consider using a strengthened type check to avoid
+          // passing `null` to primitive types since the native methods usually
+          // have non-nullable primitive parameter types.
+          canInline = false;
+        }
+      }
+    });
+
+    if (!canInline) return null;
+
+    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;
+    return result;
+  }
+
   HInstruction visitIntegerCheck(HIntegerCheck node) {
     HInstruction value = node.value;
     if (value.isInteger()) return value;
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart b/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
index 57545f9..ca58e8f 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/tracer.dart
@@ -4,7 +4,8 @@
 
 library tracer;
 
-import 'dart:io';
+import 'dart:async' show EventSink;
+
 import 'ssa.dart';
 import '../js_backend/js_backend.dart';
 import '../dart2jslib.dart';
@@ -15,17 +16,14 @@
 class HTracer extends HGraphVisitor implements Tracer {
   JavaScriptItemCompilationContext context;
   int indent = 0;
-  final RandomAccessFile output;
+  final EventSink<String> output;
   final bool enabled = GENERATE_SSA_TRACE;
   bool traceActive = false;
 
-  HTracer([String path = "dart.cfg"])
-      : output = GENERATE_SSA_TRACE
-          ? new File(path).openSync(mode: FileMode.WRITE)
-          : null;
+  HTracer(this.output);
 
   void close() {
-    if (enabled) output.closeSync();
+    if (enabled) output.close();
   }
 
   void traceCompilation(String methodName,
@@ -156,7 +154,7 @@
   }
 
   void add(String string) {
-    output.writeStringSync(string);
+    output.add(string);
   }
 
   void addIndent() {
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/validate.dart b/sdk/lib/_internal/compiler/implementation/ssa/validate.dart
index 5e9598e..8d98afe 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/validate.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/validate.dart
@@ -92,6 +92,7 @@
     // corresponding predecessor block. Note that a block dominates
     // itself.
     block.forEachPhi((HPhi phi) {
+      assert(phi.inputs.length <= block.predecessors.length);
       for (int i = 0; i < phi.inputs.length; i++) {
         HInstruction input = phi.inputs[i];
         if (!input.block.dominates(block.predecessors[i])) {
diff --git a/sdk/lib/_internal/compiler/samples/leap/leap_server.dart b/sdk/lib/_internal/compiler/samples/leap/leap_server.dart
index e4f2811..d898f59 100644
--- a/sdk/lib/_internal/compiler/samples/leap/leap_server.dart
+++ b/sdk/lib/_internal/compiler/samples/leap/leap_server.dart
@@ -10,24 +10,41 @@
   HttpRequest request;
   HttpResponse response;
 
-  static const String LEAP_LANDING_PAGE = 'samples/leap/index.html';
+  static const String CONTENT_TYPE = HttpHeaders.CONTENT_TYPE;
+
+  static const String LEAP_LANDING_PAGE =
+      'sdk/lib/_internal/compiler/samples/leap/index.html';
 
   static String landingPage = LEAP_LANDING_PAGE;
 
   Conversation(this.request, this.response);
 
-  onClosed() {
+  onClosed(_) {
     if (response.statusCode == HttpStatus.OK) return;
-    print('Request for ${request.path} ${response.statusCode}');
+    print('Request for ${request.uri} ${response.statusCode}');
+  }
+
+  setUpErrorHandler() {
+    // TODO(ahe): When https://codereview.chromium.org/13467004/ lands
+    // apply the following changes:
+    // 1. Inline this method in [handle].
+    // 2. Delete this method.
+    // 3. Call response.close() instead of calling [done].
+    // 4. Delete this [done].
+    response.done
+      ..then(onClosed)
+      ..catchError(onError);
   }
 
   done() {
-    response.outputStream.close();
-    onClosed();
+    setUpErrorHandler();
+    response.close();
   }
 
-  notFound() {
+  notFound(path) {
     response.statusCode = HttpStatus.NOT_FOUND;
+    response.write(htmlInfo('Not Found',
+                            'The file "$path" could not be found.'));
     done();
   }
 
@@ -38,27 +55,54 @@
   }
 
   handle() {
-    String path = request.path;
+    String path = request.uri.path;
     if (path == '/') return redirect('/$landingPage');
     if (path == '/favicon.ico') {
       path = '/sdk/lib/_internal/dartdoc/static/favicon.ico';
     }
-    if (path.contains('..') || path.contains('%')) return notFound();
+    if (path.contains('..') || path.contains('%')) return notFound(path);
     var f = new File("./$path");
     f.exists().then((bool exists) {
-      if (!exists) return notFound();
-      if (path.endsWith('.dart')) {
-        response.headers.add(HttpHeaders.CONTENT_TYPE, "application/dart");
+      if (!exists) return notFound(path);
+      if (path.endsWith('.html')) {
+        response.headers.set(CONTENT_TYPE, 'text/html');
+      } else if (path.endsWith('.dart')) {
+        response.headers.set(CONTENT_TYPE, 'application/dart');
+      } else if (path.endsWith('.js')) {
+        response.headers.set(CONTENT_TYPE, 'application/javascript');
       } else if (path.endsWith('.ico')) {
-        response.headers.add(HttpHeaders.CONTENT_TYPE, "image/x-icon");
+        response.headers.set(CONTENT_TYPE, 'image/x-icon');
       }
-      f.openInputStream().pipe(response.outputStream);
-      onClosed();
+      setUpErrorHandler();
+      f.openRead().pipe(response);
     });
   }
 
-  static onRequest(HttpRequest request, HttpResponse response) {
-    new Conversation(request, response).handle();
+  static onRequest(HttpRequest request) {
+    new Conversation(request, request.response).handle();
+  }
+
+  static onError(AsyncError e) {
+    if (e.error is HttpParserException) {
+      print('Error: ${e.error.message}');
+    } else {
+      print('Error: ${e.error}');
+    }
+  }
+
+  String htmlInfo(String title, String text) {
+    return """
+<!DOCTYPE html>
+<html lang='en'>
+<head>
+<title>$title</title>
+</head>
+<body>
+<h1>$title</h1>
+<p>$text</p>
+</body>
+</html>
+""";
   }
 }
 
@@ -67,10 +111,12 @@
   if (arguments.length > 0) {
     Conversation.landingPage = arguments[0];
   }
-  var server = new HttpServer();
   var host = '127.0.0.1';
-  var port = 8080;
-  server.listen(host, port);
-  print('HTTP server started on http://$host:$port/');
-  server.defaultRequestHandler = Conversation.onRequest;
+  HttpServer.bind(host, 0).then((HttpServer server) {
+    print('HTTP server started on http://$host:${server.port}/');
+    server.listen(Conversation.onRequest, onError: Conversation.onError);
+  }).catchError((e) {
+    print("HttpServer.bind error: ${e.error}");
+    exit(1);
+  });
 }
diff --git a/sdk/lib/_internal/dartdoc/bin/dartdoc.dart b/sdk/lib/_internal/dartdoc/bin/dartdoc.dart
index c84c72c..ec63c06 100644
--- a/sdk/lib/_internal/dartdoc/bin/dartdoc.dart
+++ b/sdk/lib/_internal/dartdoc/bin/dartdoc.dart
@@ -39,7 +39,7 @@
 
   final Path libPath = scriptDir.append('../../../../');
 
-  Path pkgPath;
+  Path packageRoot;
 
   argParser.addFlag('no-code',
       help: 'Do not include source code in the documentation.',
@@ -160,12 +160,22 @@
         }
       }, allowMultiple: true);
 
-  argParser.addOption('pkg',
+  argParser.addOption('package-root',
       help: 'Sets the package directory to the specified directory.\n'
-        'If omitted the package directory is the SDK pkg/ dir',
-      callback: (pkgDir) {
-        if(pkgDir != null) {
-          pkgPath = new Path(pkgDir);
+        'If omitted the package directory is the closest packages directory to'
+        ' the entrypoint.',
+      callback: (packageDir) {
+        if(packageDir != null) {
+          packageRoot = new Path(packageDir);
+        }
+      });
+
+  // TODO(amouravski): This method is deprecated. Remove on April 22.
+  argParser.addOption('pkg',
+      help: 'Deprecated: same as --package-root.',
+      callback: (packageDir) {
+        if(packageDir != null) {
+          packageRoot = new Path(packageDir);
         }
       });
 
@@ -210,13 +220,13 @@
     exit(1);
   }
 
-  if (pkgPath == null) {
+  if (packageRoot == null) {
     // Check if there's a `packages` directory in the entry point directory.
     var script = path.normalize(path.absolute(entrypoints[0].toNativePath()));
     var dir = path.join(path.dirname(script), 'packages/');
     if (new Directory(dir).existsSync()) {
       // TODO(amouravski): convert all of dartdoc to use pathos.
-      pkgPath = new Path(dir);
+      packageRoot = new Path(dir);
     } else {
       // If there is not, then check if the entrypoint is somewhere in a `lib`
       // directory.
@@ -224,7 +234,7 @@
       var parts = path.split(dir);
       var libDir = parts.lastIndexOf('lib');
       if (libDir > 0) {
-        pkgPath = new Path(path.join(path.joinAll(parts.take(libDir)),
+        packageRoot = new Path(path.join(path.joinAll(parts.take(libDir)),
               'packages'));
       }
     }
@@ -233,7 +243,7 @@
   cleanOutputDirectory(dartdoc.outputDir);
 
   // Start the analysis and documentation.
-  dartdoc.documentLibraries(entrypoints, libPath, pkgPath)
+  dartdoc.documentLibraries(entrypoints, libPath, packageRoot)
     .then((_) {
       print('Copying static files...');
       Future.wait([
@@ -251,8 +261,9 @@
       }
     })
     .catchError((e) {
-        print('Error: generation failed: ${e.error}');
-        exit(1);
+      print('Error: generation failed: ${e}');
+      dartdoc.cleanup();
+      exit(1);
     })
     .whenComplete(() => dartdoc.cleanup());
 }
diff --git a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
index 83b0f28..42246b9 100644
--- a/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
+++ b/sdk/lib/_internal/dartdoc/lib/dartdoc.dart
@@ -403,15 +403,15 @@
     return content;
   }
 
-  Future documentEntryPoint(Path entrypoint, Path libPath, Path pkgPath) {
-    return documentLibraries(<Path>[entrypoint], libPath, pkgPath);
+  Future documentEntryPoint(Path entrypoint, Path libPath, Path packageRoot) {
+    return documentLibraries(<Path>[entrypoint], libPath, packageRoot);
   }
 
-  Future documentLibraries(List<Path> libraryList, Path libPath, Path pkgPath) {
+  Future documentLibraries(List<Path> libraryList, Path libPath, Path packageRoot) {
     // TODO(amouravski): make all of these print statements into logging
     // statements.
     print('Analyzing libraries...');
-    return dart2js.analyze(libraryList, libPath, packageRoot: pkgPath,
+    return dart2js.analyze(libraryList, libPath, packageRoot: packageRoot,
         options: COMPILER_OPTIONS)
       .then((MirrorSystem mirrors) {
         print('Generating documentation...');
@@ -1397,12 +1397,12 @@
       }
 
       if (!member.isConstructor) {
-        annotateType(host, member.returnType);
+        annotateDynamicType(host, member.returnType);
       }
     } else {
       assert(member is VariableMirror);
       if (asGetter) {
-        annotateType(host, member.type);
+        annotateDynamicType(host, member.type);
       } else {
         write('void ');
       }
@@ -1701,6 +1701,14 @@
   }
 
   /**
+   * Writes a type annotation, preferring to print dynamic.
+   */
+  annotateDynamicType(ContainerMirror enclosingType,
+                      TypeMirror type) {
+    annotateType(enclosingType, type, type.isDynamic ? 'dynamic' : null);
+  }
+
+  /**
    * Writes a type annotation for the given type and (optional) parameter name.
    */
   annotateType(ContainerMirror enclosingType,
diff --git a/sdk/lib/_internal/dartdoc/test/dartdoc_test.dart b/sdk/lib/_internal/dartdoc/test/dartdoc_test.dart
index e5b6787..c32c47f 100644
--- a/sdk/lib/_internal/dartdoc/test/dartdoc_test.dart
+++ b/sdk/lib/_internal/dartdoc/test/dartdoc_test.dart
@@ -16,15 +16,7 @@
 import '../lib/markdown.dart';
 import 'markdown_test.dart';
 
-// Pretty test config with --human
-import '../../../../../utils/tests/pub/command_line_config.dart';
-
 main() {
-  // Use the human-friendly config.
-  if (new Options().arguments.contains('--human')) {
-    configure(new CommandLineConfiguration());
-  }
-
   group('countOccurrences', () {
     test('empty text returns 0', () {
       expect(dd.countOccurrences('', 'needle'), equals(0));
diff --git a/sdk/lib/_internal/libraries.dart b/sdk/lib/_internal/libraries.dart
index 9bb62ff..d5f8a46 100644
--- a/sdk/lib/_internal/libraries.dart
+++ b/sdk/lib/_internal/libraries.dart
@@ -30,7 +30,9 @@
       "chrome/dart2js/chrome_dart2js.dart",
       category: "Client"),
 
-  "collection": const LibraryInfo("collection/collection.dart"),
+  "collection": const LibraryInfo(
+      "collection/collection.dart",
+      dart2jsPatchPath: "_internal/compiler/implementation/lib/collection_patch.dart"),
 
   "core": const LibraryInfo(
       "core/core.dart",
@@ -104,6 +106,11 @@
         category: "Client",
         dart2jsPath: "web_audio/dart2js/web_audio_dart2js.dart"),
 
+  "web_gl": const LibraryInfo(
+        "web_gl/dartium/web_gl_dartium.dart",
+        category: "Client",
+        dart2jsPath: "web_gl/dart2js/web_gl_dart2js.dart"),
+
   "web_sql": const LibraryInfo(
         "web_sql/dartium/web_sql_dartium.dart",
         category: "Client",
diff --git a/sdk/lib/async/collection_sink.dart b/sdk/lib/async/collection_sink.dart
index ad3dda5..4ecb831 100644
--- a/sdk/lib/async/collection_sink.dart
+++ b/sdk/lib/async/collection_sink.dart
@@ -7,7 +7,11 @@
 typedef void _CollectionSinkCallback<T>(Collection<T> collection);
 typedef void _CollectionSinkErrorCallback(AsyncError error);
 
-/** EventSink that stores incoming data in a collection. */
+/**
+ * EventSink that stores incoming data in a collection.
+ *
+ * *Deprecated*.
+ */
 class CollectionSink<T> extends StreamSink<T> {
   // TODO(8997): Implement EventSink instead.
   final Collection<T> collection;
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 759f9c7..e7a5ab6 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -237,6 +237,8 @@
    * Binds this stream as the input of the provided [StreamConsumer].
    */
   Future pipe(StreamConsumer<T, dynamic> streamConsumer) {
+    // TODO(floitsch): switch to:
+    // streamConsumer.addStream(this).then((_) => streamConsumer.close());
     return streamConsumer.consume(this);
   }
 
@@ -249,8 +251,18 @@
     return streamTransformer.bind(this);
   }
 
-  /** Reduces a sequence of values by repeatedly applying [combine]. */
+  /**
+   * Reduces a sequence of values by repeatedly applying [combine].
+   *
+   * *WARNING UPCOMING API-CHANGE*: This method will be changed so that
+   * it doesn't take an initial value. Use [fold] instead.
+   */
   Future reduce(var initialValue, combine(var previous, T element)) {
+    return fold(initialValue, combine);
+  }
+
+  /** Reduces a sequence of values by repeatedly applying [combine]. */
+  Future fold(var initialValue, combine(var previous, T element)) {
     _FutureImpl result = new _FutureImpl();
     var value = initialValue;
     StreamSubscription subscription;
@@ -973,6 +985,16 @@
  * done.
  */
 abstract class StreamConsumer<S, T> {
+  // TODO(floitsch): generic types.
+  // Currently not possible to add generic types, since they clash with other
+  // types that have already been used.
+  Future addStream(Stream<S> stream);
+  Future close();
+
+
+  /**
+   * Consume is deprecated. Use [addStream] followed by [close] instead.
+   */
   Future<T> consume(Stream<S> stream);
 }
 
diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
index 1563abd..e3ebd36 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.dart
@@ -942,17 +942,17 @@
   }
 
   void cancel() {
+    if (!_isSubscribed) return;
     _source._cancel(this);
   }
 
   void pause([Future resumeSignal]) {
+    if (!_isSubscribed) return;
     _source._pause(this, resumeSignal);
   }
 
   void resume() {
-    if (!isPaused) {
-      throw new StateError("Resuming unpaused subscription");
-    }
+    if (!_isSubscribed || !isPaused) return;
     _source._resume(this, false);
   }
 }
@@ -1270,9 +1270,7 @@
   }
 
   void pause([Future signal]) {
-    if (_isComplete) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_isComplete) return;
     if (_timer != null) {
       _timer.cancel();
       _timer = null;
@@ -1282,9 +1280,7 @@
   }
 
   void resume() {
-    if (_isComplete) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_isComplete) return;
     if (_pauseCount == 0) return;
     _pauseCount--;
     if (_pauseCount == 0) {
@@ -1295,9 +1291,7 @@
   bool get isPaused => _pauseCount > 0;
 
   void cancel() {
-    if (_isComplete) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_isComplete) return;
     if (_timer != null) {
       _timer.cancel();
       _timer = null;
diff --git a/sdk/lib/async/stream_pipe.dart b/sdk/lib/async/stream_pipe.dart
index 69210ec..f3a8ea1 100644
--- a/sdk/lib/async/stream_pipe.dart
+++ b/sdk/lib/async/stream_pipe.dart
@@ -158,25 +158,20 @@
   // StreamSubscription interface.
 
   void pause([Future resumeSignal]) {
-    if (_subscription == null) {
-      throw new StateError("Subscription has been unsubscribed");
-    }
+    if (_subscription == null) return;
     _subscription.pause(resumeSignal);
   }
 
   void resume() {
-    if (_subscription == null) {
-      throw new StateError("Subscription has been unsubscribed");
-    }
+    if (_subscription == null) return;
     _subscription.resume();
   }
 
   void cancel() {
-    if (_subscription == null) {
-      throw new StateError("Subscription has been unsubscribed");
+    if (_subscription != null) {
+      _subscription.cancel();
+      _subscription = null;
     }
-    _subscription.cancel();
-    _subscription = null;
   }
 
   // _EventOutputSink interface. Sends data to this subscription.
diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart
index 5d84317..8729452 100644
--- a/sdk/lib/collection/collections.dart
+++ b/sdk/lib/collection/collections.dart
@@ -40,6 +40,12 @@
   static dynamic reduce(Iterable iterable,
                         dynamic initialValue,
                         dynamic combine(dynamic previousValue, element)) {
+    return fold(iterable, initialValue, combine);
+  }
+
+  static dynamic fold(Iterable iterable,
+                      dynamic initialValue,
+                      dynamic combine(dynamic previousValue, element)) {
     for (final element in iterable) {
       initialValue = combine(initialValue, element);
     }
@@ -274,20 +280,8 @@
   }
 
   static String join(Iterable iterable, [String separator]) {
-    Iterator iterator = iterable.iterator;
-    if (!iterator.moveNext()) return "";
     StringBuffer buffer = new StringBuffer();
-    if (separator == null || separator == "") {
-      do {
-        buffer.write("${iterator.current}");
-      } while (iterator.moveNext());
-    } else {
-      buffer.write("${iterator.current}");
-      while (iterator.moveNext()) {
-        buffer.write(separator);
-        buffer.write("${iterator.current}");
-      }
-    }
+    buffer.writeAll(iterable, separator == null ? "" : separator);
     return buffer.toString();
   }
 
diff --git a/sdk/lib/collection/hash_map.dart b/sdk/lib/collection/hash_map.dart
index d90b4b9..0fe3526 100644
--- a/sdk/lib/collection/hash_map.dart
+++ b/sdk/lib/collection/hash_map.dart
@@ -21,116 +21,32 @@
 }
 
 class HashMap<K, V> implements Map<K, V> {
-  final _HashMapTable<K, V> _hashTable;
-
-  HashMap() : _hashTable = new _HashMapTable<K, V>() {
-    _hashTable._container = this;
-  }
+  external HashMap();
 
   factory HashMap.from(Map<K, V> other) {
     return new HashMap<K, V>()..addAll(other);
   }
 
-  bool containsKey(K key) {
-    return _hashTable._get(key) >= 0;
-  }
+  external int get length;
+  external bool get isEmpty;
 
-  bool containsValue(V value) {
-    List table = _hashTable._table;
-    int entrySize = _hashTable._entrySize;
-    for (int offset = 0; offset < table.length; offset += entrySize) {
-      if (!_hashTable._isFree(table[offset]) &&
-          _hashTable._value(offset) == value) {
-        return true;
-      }
-    }
-    return false;
-  }
+  external Iterable<K> get keys;
+  external Iterable<V> get values;
 
-  void addAll(Map<K, V> other) {
-    other.forEach((K key, V value) {
-      int offset = _hashTable._put(key);
-      _hashTable._setValue(offset, value);
-      _hashTable._checkCapacity();
-    });
-  }
+  external bool containsKey(K key);
+  external bool containsValue(V value);
 
-  V operator [](K key) {
-    int offset = _hashTable._get(key);
-    if (offset >= 0) return _hashTable._value(offset);
-    return null;
-  }
+  external void addAll(Map<K, V> other);
 
-  void operator []=(K key, V value) {
-    int offset = _hashTable._put(key);
-    _hashTable._setValue(offset, value);
-    _hashTable._checkCapacity();
-  }
+  external V operator [](K key);
+  external void operator []=(K key, V value);
 
-  V putIfAbsent(K key, V ifAbsent()) {
-    int offset = _hashTable._probeForAdd(_hashTable._hashCodeOf(key), key);
-    Object entry = _hashTable._table[offset];
-    if (!_hashTable._isFree(entry)) {
-      return _hashTable._value(offset);
-    }
-    int modificationCount = _hashTable._modificationCount;
-    V value = ifAbsent();
-    if (modificationCount == _hashTable._modificationCount) {
-      _hashTable._setKey(offset, key);
-      _hashTable._setValue(offset, value);
-      if (entry == null) {
-        _hashTable._entryCount++;
-        _hashTable._checkCapacity();
-      } else {
-        assert(identical(entry, _TOMBSTONE));
-        _hashTable._deletedCount--;
-      }
-      _hashTable._recordModification();
-    } else {
-      // The table might have changed, so we can't trust [offset] any more.
-      // Do another lookup before setting the value.
-      offset = _hashTable._put(key);
-      _hashTable._setValue(offset, value);
-      _hashTable._checkCapacity();
-    }
-    return value;
-  }
+  external V putIfAbsent(K key, V ifAbsent());
 
-  V remove(K key) {
-    int offset = _hashTable._remove(key);
-    if (offset < 0) return null;
-    V oldValue = _hashTable._value(offset);
-    _hashTable._setValue(offset, null);
-    _hashTable._checkCapacity();
-    return oldValue;
-  }
+  external V remove(K key);
+  external void clear();
 
-  void clear() {
-    _hashTable._clear();
-  }
-
-  void forEach(void action (K key, V value)) {
-    int modificationCount = _hashTable._modificationCount;
-    List table = _hashTable._table;
-    int entrySize = _hashTable._entrySize;
-    for (int offset = 0; offset < table.length; offset += entrySize) {
-      Object entry = table[offset];
-      if (!_hashTable._isFree(entry)) {
-        K key = entry;
-        V value = _hashTable._value(offset);
-        action(key, value);
-        _hashTable._checkModification(modificationCount);
-      }
-    }
-  }
-
-  Iterable<K> get keys => new _HashTableKeyIterable<K>(_hashTable);
-  Iterable<V> get values =>
-      new _HashTableValueIterable<V>(_hashTable, _HashMapTable._VALUE_INDEX);
-
-  int get length => _hashTable._elementCount;
-
-  bool get isEmpty => _hashTable._elementCount == 0;
+  external void forEach(void action(K key, V value));
 
   String toString() => Maps.mapToString(this);
 }
diff --git a/sdk/lib/collection/hash_set.dart b/sdk/lib/collection/hash_set.dart
index ca32220..977dcff 100644
--- a/sdk/lib/collection/hash_set.dart
+++ b/sdk/lib/collection/hash_set.dart
@@ -5,85 +5,39 @@
 part of dart.collection;
 
 class HashSet<E> extends Collection<E> implements Set<E> {
-  static const int _INITIAL_CAPACITY = 8;
-  final _HashTable<E> _table;
-
-  HashSet() : _table = new _HashTable(_INITIAL_CAPACITY) {
-    _table._container = this;
-  }
+  external HashSet();
 
   factory HashSet.from(Iterable<E> iterable) {
     return new HashSet<E>()..addAll(iterable);
   }
 
   // Iterable.
-  Iterator<E> get iterator => new _HashTableKeyIterator<E>(_table);
+  external Iterator<E> get iterator;
 
-  int get length => _table._elementCount;
+  external int get length;
 
-  bool get isEmpty => _table._elementCount == 0;
+  external bool get isEmpty;
 
-  bool contains(Object object) => _table._get(object) >= 0;
+  external bool contains(Object object);
 
   // Collection.
-  void add(E element) {
-    _table._put(element);
-    _table._checkCapacity();
-  }
+  external void add(E element);
 
-  void addAll(Iterable<E> objects) {
-    for (E object in objects) {
-      _table._put(object);
-      _table._checkCapacity();
-    }
-  }
+  external void addAll(Iterable<E> objects);
 
-  bool remove(Object object) {
-    int offset = _table._remove(object);
-    _table._checkCapacity();
-    return offset >= 0;
-  }
+  external bool remove(Object object);
 
-  void removeAll(Iterable objectsToRemove) {
-    for (Object object in objectsToRemove) {
-      _table._remove(object);
-      _table._checkCapacity();
-    }
-  }
+  external void removeAll(Iterable objectsToRemove);
 
   void retainAll(Iterable objectsToRetain) {
     IterableMixinWorkaround.retainAll(this, objectsToRetain);
   }
 
-  void _filterWhere(bool test(E element), bool removeMatching) {
-    int entrySize = _table._entrySize;
-    int length = _table._table.length;
-    for (int offset =  0; offset < length; offset += entrySize) {
-      Object entry = _table._table[offset];
-      if (!_table._isFree(entry)) {
-        E key = identical(entry, _NULL) ? null : entry;
-        int modificationCount = _table._modificationCount;
-        bool shouldRemove = (removeMatching == test(key));
-        _table._checkModification(modificationCount);
-        if (shouldRemove) {
-          _table._deleteEntry(offset);
-        }
-      }
-    }
-    _table._checkCapacity();
-  }
+  external void removeWhere(bool test(E element));
 
-  void removeWhere(bool test(E element)) {
-    _filterWhere(test, true);
-  }
+  external void retainWhere(bool test(E element));
 
-  void retainWhere(bool test(E element)) {
-    _filterWhere(test, false);
-  }
-
-  void clear() {
-    _table._clear();
-  }
+  external void clear();
 
   // Set.
   bool isSubsetOf(Collection<E> other) {
diff --git a/sdk/lib/core/collection.dart b/sdk/lib/core/collection.dart
index 0f772d8..6a725a1 100644
--- a/sdk/lib/core/collection.dart
+++ b/sdk/lib/core/collection.dart
@@ -15,6 +15,8 @@
  *
  * Collections are [Iterable]. The order of iteration is defined by
  * each type of collection.
+ *
+ * *Deprecated*: This class is deprecated and will be removed soon.
  */
 abstract class Collection<E> extends Iterable<E> {
   const Collection();
diff --git a/sdk/lib/core/double.dart b/sdk/lib/core/double.dart
index 58bb3dd..65b9c30 100644
--- a/sdk/lib/core/double.dart
+++ b/sdk/lib/core/double.dart
@@ -23,7 +23,6 @@
   static const double MIN_POSITIVE = 5e-324;
   static const double MAX_FINITE = 1.7976931348623157e+308;
 
-  /** Return the remainder from dividing this [double] by [other]. */
   double remainder(num other);
 
   /** Addition operator. */
@@ -35,7 +34,6 @@
   /** Multiplication operator. */
   double operator *(num other);
 
-  /** Euclidean modulo operator. */
   double operator %(num other);
 
   /** Division operator. */
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index 604c4a8..0fda6f1 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -98,12 +98,31 @@
    * Use [initialValue] as the initial value, and the function [combine] to
    * create a new value from the previous one and an element.
    *
-   * Example of calculating the sum of a collection:
+   * Example of calculating the sum of an iterable:
    *
-   *   collection.reduce(0, (prev, element) => prev + element);
+   *   iterable.reduce((prev, element) => prev + element);
+   *
+   * *UPCOMING API-CHANGE*: this method will soon be changed to not take
+   * an initial value: `iterable.reduce(min)`. Use [fold] instead.
    */
+  @deprecated
   dynamic reduce(var initialValue,
                  dynamic combine(var previousValue, E element)) {
+    return fold(initialValue, combine);
+  }
+
+  /**
+   * Reduce a collection to a single value by iteratively combining each element
+   * of the collection with an existing value using the provided function.
+   * Use [initialValue] as the initial value, and the function [combine] to
+   * create a new value from the previous one and an element.
+   *
+   * Example of calculating the sum of an iterable:
+   *
+   *   iterable.fold(0, (prev, element) => prev + element);
+   */
+  dynamic fold(var initialValue,
+               dynamic combine(var previousValue, E element)) {
     var value = initialValue;
     for (E element in this) value = combine(value, element);
     return value;
@@ -128,20 +147,8 @@
    * string.
    */
   String join([String separator]) {
-    Iterator<E> iterator = this.iterator;
-    if (!iterator.moveNext()) return "";
     StringBuffer buffer = new StringBuffer();
-    if (separator == null || separator == "") {
-      do {
-        buffer.write("${iterator.current}");
-      } while (iterator.moveNext());
-    } else {
-      buffer.write("${iterator.current}");
-      while (iterator.moveNext()) {
-        buffer.write(separator);
-        buffer.write("${iterator.current}");
-      }
-    }
+    buffer.writeAll(this, separator == null ? "" : separator);
     return buffer.toString();
   }
 
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 58d6139..f144782 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -132,16 +132,6 @@
   void add(E value);
 
   /**
-   * Adds [value] at the end of the list, extending the length by
-   * one. Throws an [UnsupportedError] if the list is not
-   * extendable.
-   *
-   * *Deprecated*: Use [add] instead.
-   */
-  @deprecated
-  void addLast(E value);
-
-  /**
    * Appends all elements of the [iterable] to the end of this list.
    * Extends the length of the list by the number of elements in [iterable].
    * Throws an [UnsupportedError] if this list is not extensible.
diff --git a/sdk/lib/core/num.dart b/sdk/lib/core/num.dart
index 3551fc6..eb8f82c 100644
--- a/sdk/lib/core/num.dart
+++ b/sdk/lib/core/num.dart
@@ -17,7 +17,21 @@
   /** Multiplication operator. */
   num operator *(num other);
 
-  /** Euclidean modulo operator. */
+  /**
+   * Euclidean modulo operator.
+   *
+   * Returns the remainder of the euclidean division. The euclidean division of
+   * two integers `a` and `b` yields two integers `q` and `r` such that
+   * `a = b*q + r` and `0 <= r < |a|`.
+   *
+   * The euclidean division is only defined for integers, but can be easily
+   * extended to work with doubles. In that case `r` may have a non-integer
+   * value, but it still verifies `0 <= r < |a|`.
+   *
+   * The sign of the returned value `r` is always positive.
+   *
+   * See [remainder] for the remainder of the truncating division.
+   */
   num operator %(num other);
 
   /** Division operator. */
@@ -37,7 +51,13 @@
   /** Negate operator. */
   num operator -();
 
-  /** Return the remainder from dividing this [num] by [other]. */
+  /**
+   * Return the remainder of the truncating division of `this` by [other].
+   *
+   * The result `r` of this operation satisfies: `this = this ~/ other + r`.
+   * As a consequence the remainder `r` has the same sign as the dividend
+   * `this`.
+   */
   num remainder(num other);
 
   /** Relational less than operator. */
diff --git a/sdk/lib/core/string_buffer.dart b/sdk/lib/core/string_buffer.dart
index 50bb51c..6ecdc57 100644
--- a/sdk/lib/core/string_buffer.dart
+++ b/sdk/lib/core/string_buffer.dart
@@ -29,8 +29,20 @@
   /// Adds the string representation of [charCode] to the buffer.
   external void writeCharCode(int charCode);
 
-  void writeAll(Iterable objects) {
-    for (Object obj in objects) write(obj);
+  void writeAll(Iterable objects, [String separator = ""]) {
+    Iterator iterator = objects.iterator;
+    if (!iterator.moveNext()) return;
+    if (separator == "") {
+      do {
+        write(iterator.current);
+      } while (iterator.moveNext());
+    } else {
+      write(iterator.current);
+      while (iterator.moveNext()) {
+        write(separator);
+        write(iterator.current);
+      }
+    }
   }
 
   void writeln([Object obj = ""]) {
diff --git a/sdk/lib/core/string_sink.dart b/sdk/lib/core/string_sink.dart
index 1e1647e..16c9f4f 100644
--- a/sdk/lib/core/string_sink.dart
+++ b/sdk/lib/core/string_sink.dart
@@ -15,7 +15,7 @@
   /**
    * Iterates over the given [objects] and [write]s them in sequence.
    */
-  void writeAll(Iterable objects);
+  void writeAll(Iterable objects, [String separator = ""]);
 
   /**
    * Converts [obj] to a String by invoking `toString` and adds the result to
diff --git a/sdk/lib/crypto/crypto.dart b/sdk/lib/crypto/crypto.dart
index f22e2ab..a34ce53 100644
--- a/sdk/lib/crypto/crypto.dart
+++ b/sdk/lib/crypto/crypto.dart
@@ -132,12 +132,41 @@
   }
 
   /**
-   * Converts a list of bytes (for example a message digest) into a
-   * base64 encoded string optionally broken up in to lines of
-   * [lineLength] chars separated by '\r\n'.
+   * Converts a list of bytes into a Base 64 encoded string.
+   *
+   * The list can be any list of integers in the range 0..255,
+   * for example a message digest.
+   *
+   * If [addLineSeparator] is true, the resulting string will  be
+   * broken into lines of 76 characters, separated by "\r\n".
+   *
+   * If [urlSafe] is true, the result is URL and filename safe.
+   *
+   * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648)
+   *
    */
-  static String bytesToBase64(List<int> bytes, [int lineLength]) {
-    return _CryptoUtils.bytesToBase64(bytes, lineLength);
+  static String bytesToBase64(List<int> bytes,
+                              {bool urlSafe : false,
+                               bool addLineSeparator : false}) {
+    return _CryptoUtils.bytesToBase64(bytes,
+                                      urlSafe,
+                                      addLineSeparator);
+  }
+
+
+  /**
+   * Converts a Base 64 encoded String into list of bytes.
+   *
+   * Decoder ignores "\r\n" sequences from input. By default it also ignores
+   * all illegal characters unless [ignoreInvalidCharacters] is false.
+   *
+   * Accepts both URL safe and unsafe Base 64 encoded strings.
+   *
+   * Based on [RFC 4648](http://tools.ietf.org/html/rfc4648)
+   */
+  static List<int> base64StringToBytes(String input,
+                                       {bool ignoreInvalidCharacters : true}) {
+    return _CryptoUtils.base64StringToBytes(input, ignoreInvalidCharacters);
   }
 }
 
diff --git a/sdk/lib/crypto/crypto_utils.dart b/sdk/lib/crypto/crypto_utils.dart
index 4c09dff..e08bbdd 100644
--- a/sdk/lib/crypto/crypto_utils.dart
+++ b/sdk/lib/crypto/crypto_utils.dart
@@ -4,25 +4,6 @@
 
 part of dart.crypto;
 
-class _LineWrappingStringBuffer {
-  _LineWrappingStringBuffer(int this._lineLength) : _sb = new StringBuffer();
-
-  void write(String s) {
-    if (_lineLength != null && _currentLineLength == _lineLength) {
-      _sb.write('\r\n');
-      _currentLineLength = 0;
-    }
-    _sb.write(s);
-    _currentLineLength++;
-  }
-
-  String toString() => _sb.toString();
-
-  int _lineLength;
-  StringBuffer _sb;
-  int _currentLineLength = 0;
-}
-
 abstract class _CryptoUtils {
   static String bytesToHex(List<int> bytes) {
     var result = new StringBuffer();
@@ -32,45 +13,149 @@
     return result.toString();
   }
 
-  static String bytesToBase64(List<int> bytes, [int lineLength]) {
-    final table =
-        const [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
-                'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
-                'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
-                'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
-                'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7',
-                '8', '9', '+', '/' ];
+  static const int PAD = 61; // '='
+  static const int CR = 13;  // '\r'
+  static const int LF = 10;  // '\n'
+  static const int LINE_LENGTH = 76;
 
-    var result = new _LineWrappingStringBuffer(lineLength);
+  static const String _encodeTable =
+      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
-    // Encode all full 24-bit blocks.
-    var i = 0;
-    for (; (i + 2) < bytes.length; i += 3) {
-      var b0 = bytes[i] & 0xff;
-      var b1 = bytes[i + 1] & 0xff;
-      var b2 = bytes[i + 2] & 0xff;
-      result.write(table[b0 >> 2]);
-      result.write(table[((b0 << 4) | (b1 >> 4)) & 0x3f]);
-      result.write(table[((b1 << 2) | (b2 >> 6)) & 0x3f]);
-      result.write(table[b2 & 0x3f]);
+  static const String _encodeTableUrlSafe =
+      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
+
+  // Lookup table used for finding Base 64 alphabet index of a given byte.
+  // -2 : Outside Base 64 alphabet.
+  // -1 : '\r' or '\n'
+  //  0 : = (Padding character).
+  // >0 : Base 64 alphabet index of given byte.
+  static const List<int> _decodeTable =
+      const [ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -1, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 62, -2, 62, -2, 63,
+              52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2,  0, -2, -2,
+              -2,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
+              15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -2, -2, -2, -2, 63,
+              -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+              41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
+              -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2 ];
+
+  static String bytesToBase64(List<int> bytes,
+                              [bool urlSafe = false,
+                               bool addLineSeparator = false]) {
+    int len = bytes.length;
+    if (len == 0) {
+      return "";
+    }
+    final String lookup = urlSafe ? _encodeTableUrlSafe : _encodeTable;
+    // Size of 24 bit chunks.
+    final int remainderLength = len.remainder(3);
+    final int chunkLength = len - remainderLength;
+    // Size of base output.
+    int outputLen = ((len ~/ 3) * 4) + ((remainderLength > 0) ? 4 : 0);
+    // Add extra for line separators.
+    if (addLineSeparator) {
+      outputLen += ((outputLen - 1) ~/ LINE_LENGTH) << 1;
+    }
+    List<int> out = new List<int>(outputLen);
+
+    // Encode 24 bit chunks.
+    int j = 0, i = 0, c = 0;
+    while (i < chunkLength) {
+      int x = ((bytes[i++] << 16) & 0xFFFFFF) |
+              ((bytes[i++] << 8) & 0xFFFFFF) |
+                bytes[i++];
+      out[j++] = lookup.codeUnitAt(x >> 18);
+      out[j++] = lookup.codeUnitAt((x >> 12) & 0x3F);
+      out[j++] = lookup.codeUnitAt((x >> 6)  & 0x3F);
+      out[j++] = lookup.codeUnitAt(x & 0x3f);
+      // Add optional line separator for each 76 char output.
+      if (addLineSeparator && ++c == 19 && j < outputLen - 2) {
+          out[j++] = CR;
+          out[j++] = LF;
+          c = 0;
+      }
     }
 
-    // Deal with the last non-full block if any and add padding '='.
-    if (i == bytes.length - 1) {
-      var b0 = bytes[i] & 0xff;
-      result.write(table[b0 >> 2]);
-      result.write(table[(b0 << 4) & 0x3f]);
-      result.write('=');
-      result.write('=');
-    } else if (i == bytes.length - 2) {
-      var b0 = bytes[i] & 0xff;
-      var b1 = bytes[i + 1] & 0xff;
-      result.write(table[b0 >> 2]);
-      result.write(table[((b0 << 4) | (b1 >> 4)) & 0x3f]);
-      result.write(table[(b1 << 2) & 0x3f]);
-      result.write('=');
+    // If input length if not a multiple of 3, encode remaining bytes and
+    // add padding.
+    if (remainderLength == 1) {
+      int x = bytes[i];
+      out[j++] = lookup.codeUnitAt(x >> 2);
+      out[j++] = lookup.codeUnitAt((x << 4) & 0x3F);
+      out[j++] = PAD;
+      out[j++] = PAD;
+    } else if (remainderLength == 2) {
+      int x = bytes[i];
+      int y = bytes[i + 1];
+      out[j++] = lookup.codeUnitAt(x >> 2);
+      out[j++] = lookup.codeUnitAt(((x << 4) | (y >> 4)) & 0x3F);
+      out[j++] = lookup.codeUnitAt((y << 2) & 0x3F);
+      out[j++] = PAD;
     }
 
-    return result.toString();
+    return new String.fromCharCodes(out);
   }
+
+  static List<int> base64StringToBytes(String input,
+                                       [bool ignoreInvalidCharacters = true]) {
+    int len = input.length;
+    if (len == 0) {
+      return new List<int>(0);
+    }
+
+    // Count '\r', '\n' and illegal characters, For illegal characters,
+    // if [ignoreInvalidCharacters] is false, throw an exception.
+    int extrasLen = 0;
+    for (int i = 0; i < len; i++) {
+      int c = _decodeTable[input.codeUnitAt(i)];
+      if (c < 0) {
+        extrasLen++;
+        if(c == -2 && !ignoreInvalidCharacters) {
+          throw new FormatException('Invalid character: ${input[i]}');
+        }
+      }
+    }
+
+    if ((len - extrasLen) % 4 != 0) {
+      throw new FormatException('''Size of Base 64 characters in Input
+          must be a multiple of 4. Input: $input''');
+    }
+
+    // Count pad characters, ignore illegal characters at the end.
+    int padLength = 0;
+    for (int i = len - 1; i >= 0; i--) {
+      int currentCodeUnit = input.codeUnitAt(i);
+      if (_decodeTable[currentCodeUnit] > 0) break;
+      if (currentCodeUnit == PAD) padLength++;
+    }
+    int outputLen = (((len - extrasLen) * 6) >> 3) - padLength;
+    List<int> out = new List<int>(outputLen);
+
+    for (int i = 0, o = 0; o < outputLen;) {
+      // Accumulate 4 valid 6 bit Base 64 characters into an int.
+      int x = 0;
+      for (int j = 4; j > 0;) {
+        int c = _decodeTable[input.codeUnitAt(i++)];
+        if (c >= 0) {
+          x = ((x << 6) & 0xFFFFFF) | c;
+          j--;
+        }
+      }
+      out[o++] = x >> 16;
+      if (o < outputLen) {
+        out[o++] = (x >> 8) & 0xFF;
+        if (o < outputLen) out[o++] = x & 0xFF;
+      }
+    }
+    return out;
+  }
+
 }
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 018b8aa..f46a08f 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -11,6 +11,7 @@
 import 'dart:web_sql';
 import 'dart:svg' as svg;
 import 'dart:web_audio' as web_audio;
+import 'dart:web_gl' as gl;
 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
 import 'dart:_isolate_helper' show IsolateNatives;
 import 'dart:_foreign_helper' show JS;
@@ -978,7 +979,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @Experimental
-  WebGLRenderingContext getContext3d({alpha: true, depth: true, stencil: false,
+  gl.RenderingContext getContext3d({alpha: true, depth: true, stencil: false,
     antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) {
 
     var options = {
@@ -7328,6 +7329,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, DomMimeType)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(DomMimeType element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(DomMimeType element)) => IterableMixinWorkaround.forEach(this, f);
@@ -7389,10 +7394,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(DomMimeType value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<DomMimeType> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -7596,6 +7597,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, DomPlugin)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(DomPlugin element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(DomPlugin element)) => IterableMixinWorkaround.forEach(this, f);
@@ -7657,10 +7662,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(DomPlugin value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<DomPlugin> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -7971,6 +7972,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, String)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   // contains() defined by IDL.
 
   void forEach(void f(String element)) => IterableMixinWorkaround.forEach(this, f);
@@ -8032,10 +8037,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(String value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<String> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -8327,8 +8328,6 @@
     return value;
   }
 
-  Element addLast(Element value) => add(value);
-
   Iterator<Element> get iterator => toList().iterator;
 
   void addAll(Iterable<Element> iterable) {
@@ -8354,6 +8353,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Element element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
     throw new UnimplementedError();
   }
@@ -8581,10 +8585,6 @@
     throw new UnsupportedError('');
   }
 
-  void addLast(Element value) {
-    throw new UnsupportedError('');
-  }
-
   Iterator<Element> get iterator => new _FrozenElementListIterator(this);
 
   void addAll(Iterable<Element> iterable) {
@@ -8604,6 +8604,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Element element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
     throw new UnsupportedError('');
   }
@@ -10674,96 +10679,6 @@
 
 
 @DocsEditable
-@DomName('EXTDrawBuffers')
-class ExtDrawBuffers native "*EXTDrawBuffers" {
-
-  static const int COLOR_ATTACHMENT0_EXT = 0x8CE0;
-
-  static const int COLOR_ATTACHMENT10_EXT = 0x8CEA;
-
-  static const int COLOR_ATTACHMENT11_EXT = 0x8CEB;
-
-  static const int COLOR_ATTACHMENT12_EXT = 0x8CEC;
-
-  static const int COLOR_ATTACHMENT13_EXT = 0x8CED;
-
-  static const int COLOR_ATTACHMENT14_EXT = 0x8CEE;
-
-  static const int COLOR_ATTACHMENT15_EXT = 0x8CEF;
-
-  static const int COLOR_ATTACHMENT1_EXT = 0x8CE1;
-
-  static const int COLOR_ATTACHMENT2_EXT = 0x8CE2;
-
-  static const int COLOR_ATTACHMENT3_EXT = 0x8CE3;
-
-  static const int COLOR_ATTACHMENT4_EXT = 0x8CE4;
-
-  static const int COLOR_ATTACHMENT5_EXT = 0x8CE5;
-
-  static const int COLOR_ATTACHMENT6_EXT = 0x8CE6;
-
-  static const int COLOR_ATTACHMENT7_EXT = 0x8CE7;
-
-  static const int COLOR_ATTACHMENT8_EXT = 0x8CE8;
-
-  static const int COLOR_ATTACHMENT9_EXT = 0x8CE9;
-
-  static const int DRAW_BUFFER0_EXT = 0x8825;
-
-  static const int DRAW_BUFFER10_EXT = 0x882F;
-
-  static const int DRAW_BUFFER11_EXT = 0x8830;
-
-  static const int DRAW_BUFFER12_EXT = 0x8831;
-
-  static const int DRAW_BUFFER13_EXT = 0x8832;
-
-  static const int DRAW_BUFFER14_EXT = 0x8833;
-
-  static const int DRAW_BUFFER15_EXT = 0x8834;
-
-  static const int DRAW_BUFFER1_EXT = 0x8826;
-
-  static const int DRAW_BUFFER2_EXT = 0x8827;
-
-  static const int DRAW_BUFFER3_EXT = 0x8828;
-
-  static const int DRAW_BUFFER4_EXT = 0x8829;
-
-  static const int DRAW_BUFFER5_EXT = 0x882A;
-
-  static const int DRAW_BUFFER6_EXT = 0x882B;
-
-  static const int DRAW_BUFFER7_EXT = 0x882C;
-
-  static const int DRAW_BUFFER8_EXT = 0x882D;
-
-  static const int DRAW_BUFFER9_EXT = 0x882E;
-
-  static const int MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF;
-
-  static const int MAX_DRAW_BUFFERS_EXT = 0x8824;
-}
-// 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('EXTTextureFilterAnisotropic')
-class ExtTextureFilterAnisotropic native "*EXTTextureFilterAnisotropic" {
-
-  static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
-
-  static const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
-}
-// 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('HTMLFieldSetElement')
 class FieldSetElement extends Element native "*HTMLFieldSetElement" {
 
@@ -11024,6 +10939,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, File)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(File element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(File element)) => IterableMixinWorkaround.forEach(this, f);
@@ -11085,10 +11004,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(File value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<File> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -11597,6 +11512,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, num)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(num element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
@@ -11658,10 +11577,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(num value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<num> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -11829,6 +11744,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, num)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(num element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
@@ -11890,10 +11809,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(num value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<num> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -12481,6 +12396,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Node)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
@@ -12542,10 +12461,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Node value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Node> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -12702,6 +12617,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Node)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
@@ -12763,10 +12682,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Node value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Node> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -14746,6 +14661,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -14807,10 +14726,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -14978,6 +14893,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -15039,10 +14958,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -15210,6 +15125,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -15271,10 +15190,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -17705,11 +17620,6 @@
     _this.append(value);
   }
 
-  void addLast(Node value) {
-    _this.append(value);
-  }
-
-
   void addAll(Iterable<Node> iterable) {
     if (iterable is _ChildNodeListLazy) {
       if (!identical(iterable._this, _this)) {
@@ -17797,6 +17707,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Node element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   String join([String separator]) {
     return IterableMixinWorkaround.joinList(this, separator);
   }
@@ -18295,6 +18210,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Node)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
@@ -18356,10 +18275,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Node value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Node> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -18773,75 +18688,6 @@
 
 
 @DocsEditable
-@DomName('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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('OESStandardDerivatives')
-class OesStandardDerivatives native "*OESStandardDerivatives" {
-
-  static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
-}
-// 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('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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('OESVertexArrayObject')
-class OesVertexArrayObject native "*OESVertexArrayObject" {
-
-  static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
-
-  @JSName('bindVertexArrayOES')
-  @DomName('OESVertexArrayObject.bindVertexArrayOES')
-  @DocsEditable
-  void bindVertexArray(WebGLVertexArrayObject arrayObject) native;
-
-  @JSName('createVertexArrayOES')
-  @DomName('OESVertexArrayObject.createVertexArrayOES')
-  @DocsEditable
-  WebGLVertexArrayObject createVertexArray() native;
-
-  @JSName('deleteVertexArrayOES')
-  @DomName('OESVertexArrayObject.deleteVertexArrayOES')
-  @DocsEditable
-  void deleteVertexArray(WebGLVertexArrayObject arrayObject) native;
-
-  @JSName('isVertexArrayOES')
-  @DomName('OESVertexArrayObject.isVertexArrayOES')
-  @DocsEditable
-  bool isVertexArray(WebGLVertexArrayObject arrayObject) 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('HTMLOptGroupElement')
 class OptGroupElement extends Element native "*HTMLOptGroupElement" {
 
@@ -20688,6 +20534,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, SourceBuffer)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(SourceBuffer element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(SourceBuffer element)) => IterableMixinWorkaround.forEach(this, f);
@@ -20749,10 +20599,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(SourceBuffer value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<SourceBuffer> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -20982,6 +20828,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, SpeechGrammar)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(SpeechGrammar element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(SpeechGrammar element)) => IterableMixinWorkaround.forEach(this, f);
@@ -21043,10 +20893,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(SpeechGrammar value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<SpeechGrammar> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -22033,6 +21879,19 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+
+@DocsEditable
+@DomName('HTMLTemplateElement')
+class TemplateElement extends Element native "*HTMLTemplateElement" {
+
+  @DomName('HTMLTemplateElement.content')
+  @DocsEditable
+  final DocumentFragment content;
+}
+// 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.
 
 
@@ -22426,6 +22285,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, TextTrackCue)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(TextTrackCue element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(TextTrackCue element)) => IterableMixinWorkaround.forEach(this, f);
@@ -22487,10 +22350,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(TextTrackCue value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<TextTrackCue> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -22645,6 +22504,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, TextTrack)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(TextTrack element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(TextTrack element)) => IterableMixinWorkaround.forEach(this, f);
@@ -22706,10 +22569,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(TextTrack value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<TextTrack> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -23090,6 +22949,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Touch)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Touch element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Touch element)) => IterableMixinWorkaround.forEach(this, f);
@@ -23151,10 +23014,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Touch value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Touch> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -23572,6 +23431,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -23633,10 +23496,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -23804,6 +23663,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -23865,10 +23728,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -24036,6 +23895,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -24097,10 +23960,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -24265,6 +24124,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -24326,10 +24189,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -24636,1520 +24495,6 @@
 
 
 @DocsEditable
-@DomName('WebGLActiveInfo')
-class WebGLActiveInfo native "*WebGLActiveInfo" {
-
-  @DomName('WebGLActiveInfo.name')
-  @DocsEditable
-  final String name;
-
-  @DomName('WebGLActiveInfo.size')
-  @DocsEditable
-  final int size;
-
-  @DomName('WebGLActiveInfo.type')
-  @DocsEditable
-  final int type;
-}
-// 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('WebGLBuffer')
-class WebGLBuffer 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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('WebGLCompressedTextureATC')
-class WebGLCompressedTextureAtc native "*WebGLCompressedTextureATC" {
-
-  static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
-
-  static const int COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
-
-  static const int COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
-}
-// 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('WebGLCompressedTexturePVRTC')
-class WebGLCompressedTexturePvrtc native "*WebGLCompressedTexturePVRTC" {
-
-  static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
-
-  static const int COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
-
-  static const int COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
-
-  static const int COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
-}
-// 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('WebGLCompressedTextureS3TC')
-class WebGLCompressedTextureS3TC native "*WebGLCompressedTextureS3TC" {
-
-  static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
-
-  static const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
-
-  static const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
-
-  static const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
-}
-// 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('WebGLContextAttributes')
-class WebGLContextAttributes native "*WebGLContextAttributes" {
-
-  @DomName('WebGLContextAttributes.alpha')
-  @DocsEditable
-  bool alpha;
-
-  @DomName('WebGLContextAttributes.antialias')
-  @DocsEditable
-  bool antialias;
-
-  @DomName('WebGLContextAttributes.depth')
-  @DocsEditable
-  bool depth;
-
-  @DomName('WebGLContextAttributes.premultipliedAlpha')
-  @DocsEditable
-  bool premultipliedAlpha;
-
-  @DomName('WebGLContextAttributes.preserveDrawingBuffer')
-  @DocsEditable
-  bool preserveDrawingBuffer;
-
-  @DomName('WebGLContextAttributes.stencil')
-  @DocsEditable
-  bool stencil;
-}
-// 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('WebGLContextEvent')
-class WebGLContextEvent extends Event native "*WebGLContextEvent" {
-
-  @DomName('WebGLContextEvent.statusMessage')
-  @DocsEditable
-  final String statusMessage;
-}
-// 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('WebGLDebugRendererInfo')
-class WebGLDebugRendererInfo native "*WebGLDebugRendererInfo" {
-
-  static const int UNMASKED_RENDERER_WEBGL = 0x9246;
-
-  static const int UNMASKED_VENDOR_WEBGL = 0x9245;
-}
-// 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('WebGLDebugShaders')
-class WebGLDebugShaders native "*WebGLDebugShaders" {
-
-  @DomName('WebGLDebugShaders.getTranslatedShaderSource')
-  @DocsEditable
-  String getTranslatedShaderSource(WebGLShader shader) 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('WebGLDepthTexture')
-class WebGLDepthTexture native "*WebGLDepthTexture" {
-
-  static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
-}
-// 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('WebGLFramebuffer')
-class WebGLFramebuffer 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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('WebGLLoseContext')
-class WebGLLoseContext native "*WebGLLoseContext" {
-
-  @DomName('WebGLLoseContext.loseContext')
-  @DocsEditable
-  void loseContext() native;
-
-  @DomName('WebGLLoseContext.restoreContext')
-  @DocsEditable
-  void restoreContext() 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('WebGLProgram')
-class WebGLProgram 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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('WebGLRenderbuffer')
-class WebGLRenderbuffer 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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('WebGLRenderingContext')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@Experimental
-class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderingContext" {
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => JS('bool', '!!(window.WebGLRenderingContext)');
-
-  static const int ACTIVE_ATTRIBUTES = 0x8B89;
-
-  static const int ACTIVE_TEXTURE = 0x84E0;
-
-  static const int ACTIVE_UNIFORMS = 0x8B86;
-
-  static const int ALIASED_LINE_WIDTH_RANGE = 0x846E;
-
-  static const int ALIASED_POINT_SIZE_RANGE = 0x846D;
-
-  static const int ALPHA = 0x1906;
-
-  static const int ALPHA_BITS = 0x0D55;
-
-  static const int ALWAYS = 0x0207;
-
-  static const int ARRAY_BUFFER = 0x8892;
-
-  static const int ARRAY_BUFFER_BINDING = 0x8894;
-
-  static const int ATTACHED_SHADERS = 0x8B85;
-
-  static const int BACK = 0x0405;
-
-  static const int BLEND = 0x0BE2;
-
-  static const int BLEND_COLOR = 0x8005;
-
-  static const int BLEND_DST_ALPHA = 0x80CA;
-
-  static const int BLEND_DST_RGB = 0x80C8;
-
-  static const int BLEND_EQUATION = 0x8009;
-
-  static const int BLEND_EQUATION_ALPHA = 0x883D;
-
-  static const int BLEND_EQUATION_RGB = 0x8009;
-
-  static const int BLEND_SRC_ALPHA = 0x80CB;
-
-  static const int BLEND_SRC_RGB = 0x80C9;
-
-  static const int BLUE_BITS = 0x0D54;
-
-  static const int BOOL = 0x8B56;
-
-  static const int BOOL_VEC2 = 0x8B57;
-
-  static const int BOOL_VEC3 = 0x8B58;
-
-  static const int BOOL_VEC4 = 0x8B59;
-
-  static const int BROWSER_DEFAULT_WEBGL = 0x9244;
-
-  static const int BUFFER_SIZE = 0x8764;
-
-  static const int BUFFER_USAGE = 0x8765;
-
-  static const int BYTE = 0x1400;
-
-  static const int CCW = 0x0901;
-
-  static const int CLAMP_TO_EDGE = 0x812F;
-
-  static const int COLOR_ATTACHMENT0 = 0x8CE0;
-
-  static const int COLOR_BUFFER_BIT = 0x00004000;
-
-  static const int COLOR_CLEAR_VALUE = 0x0C22;
-
-  static const int COLOR_WRITEMASK = 0x0C23;
-
-  static const int COMPILE_STATUS = 0x8B81;
-
-  static const int COMPRESSED_TEXTURE_FORMATS = 0x86A3;
-
-  static const int CONSTANT_ALPHA = 0x8003;
-
-  static const int CONSTANT_COLOR = 0x8001;
-
-  static const int CONTEXT_LOST_WEBGL = 0x9242;
-
-  static const int CULL_FACE = 0x0B44;
-
-  static const int CULL_FACE_MODE = 0x0B45;
-
-  static const int CURRENT_PROGRAM = 0x8B8D;
-
-  static const int CURRENT_VERTEX_ATTRIB = 0x8626;
-
-  static const int CW = 0x0900;
-
-  static const int DECR = 0x1E03;
-
-  static const int DECR_WRAP = 0x8508;
-
-  static const int DELETE_STATUS = 0x8B80;
-
-  static const int DEPTH_ATTACHMENT = 0x8D00;
-
-  static const int DEPTH_BITS = 0x0D56;
-
-  static const int DEPTH_BUFFER_BIT = 0x00000100;
-
-  static const int DEPTH_CLEAR_VALUE = 0x0B73;
-
-  static const int DEPTH_COMPONENT = 0x1902;
-
-  static const int DEPTH_COMPONENT16 = 0x81A5;
-
-  static const int DEPTH_FUNC = 0x0B74;
-
-  static const int DEPTH_RANGE = 0x0B70;
-
-  static const int DEPTH_STENCIL = 0x84F9;
-
-  static const int DEPTH_STENCIL_ATTACHMENT = 0x821A;
-
-  static const int DEPTH_TEST = 0x0B71;
-
-  static const int DEPTH_WRITEMASK = 0x0B72;
-
-  static const int DITHER = 0x0BD0;
-
-  static const int DONT_CARE = 0x1100;
-
-  static const int DST_ALPHA = 0x0304;
-
-  static const int DST_COLOR = 0x0306;
-
-  static const int DYNAMIC_DRAW = 0x88E8;
-
-  static const int ELEMENT_ARRAY_BUFFER = 0x8893;
-
-  static const int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
-
-  static const int EQUAL = 0x0202;
-
-  static const int FASTEST = 0x1101;
-
-  static const int FLOAT = 0x1406;
-
-  static const int FLOAT_MAT2 = 0x8B5A;
-
-  static const int FLOAT_MAT3 = 0x8B5B;
-
-  static const int FLOAT_MAT4 = 0x8B5C;
-
-  static const int FLOAT_VEC2 = 0x8B50;
-
-  static const int FLOAT_VEC3 = 0x8B51;
-
-  static const int FLOAT_VEC4 = 0x8B52;
-
-  static const int FRAGMENT_SHADER = 0x8B30;
-
-  static const int FRAMEBUFFER = 0x8D40;
-
-  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
-
-  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
-
-  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
-
-  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
-
-  static const int FRAMEBUFFER_BINDING = 0x8CA6;
-
-  static const int FRAMEBUFFER_COMPLETE = 0x8CD5;
-
-  static const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
-
-  static const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
-
-  static const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
-
-  static const int FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
-
-  static const int FRONT = 0x0404;
-
-  static const int FRONT_AND_BACK = 0x0408;
-
-  static const int FRONT_FACE = 0x0B46;
-
-  static const int FUNC_ADD = 0x8006;
-
-  static const int FUNC_REVERSE_SUBTRACT = 0x800B;
-
-  static const int FUNC_SUBTRACT = 0x800A;
-
-  static const int GENERATE_MIPMAP_HINT = 0x8192;
-
-  static const int GEQUAL = 0x0206;
-
-  static const int GREATER = 0x0204;
-
-  static const int GREEN_BITS = 0x0D53;
-
-  static const int HALF_FLOAT_OES = 0x8D61;
-
-  static const int HIGH_FLOAT = 0x8DF2;
-
-  static const int HIGH_INT = 0x8DF5;
-
-  static const int INCR = 0x1E02;
-
-  static const int INCR_WRAP = 0x8507;
-
-  static const int INT = 0x1404;
-
-  static const int INT_VEC2 = 0x8B53;
-
-  static const int INT_VEC3 = 0x8B54;
-
-  static const int INT_VEC4 = 0x8B55;
-
-  static const int INVALID_ENUM = 0x0500;
-
-  static const int INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
-  static const int INVALID_OPERATION = 0x0502;
-
-  static const int INVALID_VALUE = 0x0501;
-
-  static const int INVERT = 0x150A;
-
-  static const int KEEP = 0x1E00;
-
-  static const int LEQUAL = 0x0203;
-
-  static const int LESS = 0x0201;
-
-  static const int LINEAR = 0x2601;
-
-  static const int LINEAR_MIPMAP_LINEAR = 0x2703;
-
-  static const int LINEAR_MIPMAP_NEAREST = 0x2701;
-
-  static const int LINES = 0x0001;
-
-  static const int LINE_LOOP = 0x0002;
-
-  static const int LINE_STRIP = 0x0003;
-
-  static const int LINE_WIDTH = 0x0B21;
-
-  static const int LINK_STATUS = 0x8B82;
-
-  static const int LOW_FLOAT = 0x8DF0;
-
-  static const int LOW_INT = 0x8DF3;
-
-  static const int LUMINANCE = 0x1909;
-
-  static const int LUMINANCE_ALPHA = 0x190A;
-
-  static const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
-
-  static const int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
-
-  static const int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
-
-  static const int MAX_RENDERBUFFER_SIZE = 0x84E8;
-
-  static const int MAX_TEXTURE_IMAGE_UNITS = 0x8872;
-
-  static const int MAX_TEXTURE_SIZE = 0x0D33;
-
-  static const int MAX_VARYING_VECTORS = 0x8DFC;
-
-  static const int MAX_VERTEX_ATTRIBS = 0x8869;
-
-  static const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
-
-  static const int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
-
-  static const int MAX_VIEWPORT_DIMS = 0x0D3A;
-
-  static const int MEDIUM_FLOAT = 0x8DF1;
-
-  static const int MEDIUM_INT = 0x8DF4;
-
-  static const int MIRRORED_REPEAT = 0x8370;
-
-  static const int NEAREST = 0x2600;
-
-  static const int NEAREST_MIPMAP_LINEAR = 0x2702;
-
-  static const int NEAREST_MIPMAP_NEAREST = 0x2700;
-
-  static const int NEVER = 0x0200;
-
-  static const int NICEST = 0x1102;
-
-  static const int NONE = 0;
-
-  static const int NOTEQUAL = 0x0205;
-
-  static const int NO_ERROR = 0;
-
-  static const int ONE = 1;
-
-  static const int ONE_MINUS_CONSTANT_ALPHA = 0x8004;
-
-  static const int ONE_MINUS_CONSTANT_COLOR = 0x8002;
-
-  static const int ONE_MINUS_DST_ALPHA = 0x0305;
-
-  static const int ONE_MINUS_DST_COLOR = 0x0307;
-
-  static const int ONE_MINUS_SRC_ALPHA = 0x0303;
-
-  static const int ONE_MINUS_SRC_COLOR = 0x0301;
-
-  static const int OUT_OF_MEMORY = 0x0505;
-
-  static const int PACK_ALIGNMENT = 0x0D05;
-
-  static const int POINTS = 0x0000;
-
-  static const int POLYGON_OFFSET_FACTOR = 0x8038;
-
-  static const int POLYGON_OFFSET_FILL = 0x8037;
-
-  static const int POLYGON_OFFSET_UNITS = 0x2A00;
-
-  static const int RED_BITS = 0x0D52;
-
-  static const int RENDERBUFFER = 0x8D41;
-
-  static const int RENDERBUFFER_ALPHA_SIZE = 0x8D53;
-
-  static const int RENDERBUFFER_BINDING = 0x8CA7;
-
-  static const int RENDERBUFFER_BLUE_SIZE = 0x8D52;
-
-  static const int RENDERBUFFER_DEPTH_SIZE = 0x8D54;
-
-  static const int RENDERBUFFER_GREEN_SIZE = 0x8D51;
-
-  static const int RENDERBUFFER_HEIGHT = 0x8D43;
-
-  static const int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
-
-  static const int RENDERBUFFER_RED_SIZE = 0x8D50;
-
-  static const int RENDERBUFFER_STENCIL_SIZE = 0x8D55;
-
-  static const int RENDERBUFFER_WIDTH = 0x8D42;
-
-  static const int RENDERER = 0x1F01;
-
-  static const int REPEAT = 0x2901;
-
-  static const int REPLACE = 0x1E01;
-
-  static const int RGB = 0x1907;
-
-  static const int RGB565 = 0x8D62;
-
-  static const int RGB5_A1 = 0x8057;
-
-  static const int RGBA = 0x1908;
-
-  static const int RGBA4 = 0x8056;
-
-  static const int SAMPLER_2D = 0x8B5E;
-
-  static const int SAMPLER_CUBE = 0x8B60;
-
-  static const int SAMPLES = 0x80A9;
-
-  static const int SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
-
-  static const int SAMPLE_BUFFERS = 0x80A8;
-
-  static const int SAMPLE_COVERAGE = 0x80A0;
-
-  static const int SAMPLE_COVERAGE_INVERT = 0x80AB;
-
-  static const int SAMPLE_COVERAGE_VALUE = 0x80AA;
-
-  static const int SCISSOR_BOX = 0x0C10;
-
-  static const int SCISSOR_TEST = 0x0C11;
-
-  static const int SHADER_TYPE = 0x8B4F;
-
-  static const int SHADING_LANGUAGE_VERSION = 0x8B8C;
-
-  static const int SHORT = 0x1402;
-
-  static const int SRC_ALPHA = 0x0302;
-
-  static const int SRC_ALPHA_SATURATE = 0x0308;
-
-  static const int SRC_COLOR = 0x0300;
-
-  static const int STATIC_DRAW = 0x88E4;
-
-  static const int STENCIL_ATTACHMENT = 0x8D20;
-
-  static const int STENCIL_BACK_FAIL = 0x8801;
-
-  static const int STENCIL_BACK_FUNC = 0x8800;
-
-  static const int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
-
-  static const int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
-
-  static const int STENCIL_BACK_REF = 0x8CA3;
-
-  static const int STENCIL_BACK_VALUE_MASK = 0x8CA4;
-
-  static const int STENCIL_BACK_WRITEMASK = 0x8CA5;
-
-  static const int STENCIL_BITS = 0x0D57;
-
-  static const int STENCIL_BUFFER_BIT = 0x00000400;
-
-  static const int STENCIL_CLEAR_VALUE = 0x0B91;
-
-  static const int STENCIL_FAIL = 0x0B94;
-
-  static const int STENCIL_FUNC = 0x0B92;
-
-  static const int STENCIL_INDEX = 0x1901;
-
-  static const int STENCIL_INDEX8 = 0x8D48;
-
-  static const int STENCIL_PASS_DEPTH_FAIL = 0x0B95;
-
-  static const int STENCIL_PASS_DEPTH_PASS = 0x0B96;
-
-  static const int STENCIL_REF = 0x0B97;
-
-  static const int STENCIL_TEST = 0x0B90;
-
-  static const int STENCIL_VALUE_MASK = 0x0B93;
-
-  static const int STENCIL_WRITEMASK = 0x0B98;
-
-  static const int STREAM_DRAW = 0x88E0;
-
-  static const int SUBPIXEL_BITS = 0x0D50;
-
-  static const int TEXTURE = 0x1702;
-
-  static const int TEXTURE0 = 0x84C0;
-
-  static const int TEXTURE1 = 0x84C1;
-
-  static const int TEXTURE10 = 0x84CA;
-
-  static const int TEXTURE11 = 0x84CB;
-
-  static const int TEXTURE12 = 0x84CC;
-
-  static const int TEXTURE13 = 0x84CD;
-
-  static const int TEXTURE14 = 0x84CE;
-
-  static const int TEXTURE15 = 0x84CF;
-
-  static const int TEXTURE16 = 0x84D0;
-
-  static const int TEXTURE17 = 0x84D1;
-
-  static const int TEXTURE18 = 0x84D2;
-
-  static const int TEXTURE19 = 0x84D3;
-
-  static const int TEXTURE2 = 0x84C2;
-
-  static const int TEXTURE20 = 0x84D4;
-
-  static const int TEXTURE21 = 0x84D5;
-
-  static const int TEXTURE22 = 0x84D6;
-
-  static const int TEXTURE23 = 0x84D7;
-
-  static const int TEXTURE24 = 0x84D8;
-
-  static const int TEXTURE25 = 0x84D9;
-
-  static const int TEXTURE26 = 0x84DA;
-
-  static const int TEXTURE27 = 0x84DB;
-
-  static const int TEXTURE28 = 0x84DC;
-
-  static const int TEXTURE29 = 0x84DD;
-
-  static const int TEXTURE3 = 0x84C3;
-
-  static const int TEXTURE30 = 0x84DE;
-
-  static const int TEXTURE31 = 0x84DF;
-
-  static const int TEXTURE4 = 0x84C4;
-
-  static const int TEXTURE5 = 0x84C5;
-
-  static const int TEXTURE6 = 0x84C6;
-
-  static const int TEXTURE7 = 0x84C7;
-
-  static const int TEXTURE8 = 0x84C8;
-
-  static const int TEXTURE9 = 0x84C9;
-
-  static const int TEXTURE_2D = 0x0DE1;
-
-  static const int TEXTURE_BINDING_2D = 0x8069;
-
-  static const int TEXTURE_BINDING_CUBE_MAP = 0x8514;
-
-  static const int TEXTURE_CUBE_MAP = 0x8513;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
-
-  static const int TEXTURE_MAG_FILTER = 0x2800;
-
-  static const int TEXTURE_MIN_FILTER = 0x2801;
-
-  static const int TEXTURE_WRAP_S = 0x2802;
-
-  static const int TEXTURE_WRAP_T = 0x2803;
-
-  static const int TRIANGLES = 0x0004;
-
-  static const int TRIANGLE_FAN = 0x0006;
-
-  static const int TRIANGLE_STRIP = 0x0005;
-
-  static const int UNPACK_ALIGNMENT = 0x0CF5;
-
-  static const int UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
-
-  static const int UNPACK_FLIP_Y_WEBGL = 0x9240;
-
-  static const int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
-
-  static const int UNSIGNED_BYTE = 0x1401;
-
-  static const int UNSIGNED_INT = 0x1405;
-
-  static const int UNSIGNED_SHORT = 0x1403;
-
-  static const int UNSIGNED_SHORT_4_4_4_4 = 0x8033;
-
-  static const int UNSIGNED_SHORT_5_5_5_1 = 0x8034;
-
-  static const int UNSIGNED_SHORT_5_6_5 = 0x8363;
-
-  static const int VALIDATE_STATUS = 0x8B83;
-
-  static const int VENDOR = 0x1F00;
-
-  static const int VERSION = 0x1F02;
-
-  static const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
-
-  static const int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
-
-  static const int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
-
-  static const int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
-
-  static const int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
-
-  static const int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
-
-  static const int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
-
-  static const int VERTEX_SHADER = 0x8B31;
-
-  static const int VIEWPORT = 0x0BA2;
-
-  static const int ZERO = 0;
-
-  @DomName('WebGLRenderingContext.drawingBufferHeight')
-  @DocsEditable
-  final int drawingBufferHeight;
-
-  @DomName('WebGLRenderingContext.drawingBufferWidth')
-  @DocsEditable
-  final int drawingBufferWidth;
-
-  @DomName('WebGLRenderingContext.activeTexture')
-  @DocsEditable
-  void activeTexture(int texture) native;
-
-  @DomName('WebGLRenderingContext.attachShader')
-  @DocsEditable
-  void attachShader(WebGLProgram program, WebGLShader shader) native;
-
-  @DomName('WebGLRenderingContext.bindAttribLocation')
-  @DocsEditable
-  void bindAttribLocation(WebGLProgram program, int index, String name) native;
-
-  @DomName('WebGLRenderingContext.bindBuffer')
-  @DocsEditable
-  void bindBuffer(int target, WebGLBuffer buffer) native;
-
-  @DomName('WebGLRenderingContext.bindFramebuffer')
-  @DocsEditable
-  void bindFramebuffer(int target, WebGLFramebuffer framebuffer) native;
-
-  @DomName('WebGLRenderingContext.bindRenderbuffer')
-  @DocsEditable
-  void bindRenderbuffer(int target, WebGLRenderbuffer renderbuffer) native;
-
-  @DomName('WebGLRenderingContext.bindTexture')
-  @DocsEditable
-  void bindTexture(int target, WebGLTexture texture) native;
-
-  @DomName('WebGLRenderingContext.blendColor')
-  @DocsEditable
-  void blendColor(num red, num green, num blue, num alpha) native;
-
-  @DomName('WebGLRenderingContext.blendEquation')
-  @DocsEditable
-  void blendEquation(int mode) native;
-
-  @DomName('WebGLRenderingContext.blendEquationSeparate')
-  @DocsEditable
-  void blendEquationSeparate(int modeRGB, int modeAlpha) native;
-
-  @DomName('WebGLRenderingContext.blendFunc')
-  @DocsEditable
-  void blendFunc(int sfactor, int dfactor) native;
-
-  @DomName('WebGLRenderingContext.blendFuncSeparate')
-  @DocsEditable
-  void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) native;
-
-  @DomName('WebGLRenderingContext.bufferData')
-  @DocsEditable
-  void bufferData(int target, data_OR_size, int usage) native;
-
-  @DomName('WebGLRenderingContext.bufferSubData')
-  @DocsEditable
-  void bufferSubData(int target, int offset, /*ArrayBuffer*/ data) native;
-
-  @DomName('WebGLRenderingContext.checkFramebufferStatus')
-  @DocsEditable
-  int checkFramebufferStatus(int target) native;
-
-  @DomName('WebGLRenderingContext.clear')
-  @DocsEditable
-  void clear(int mask) native;
-
-  @DomName('WebGLRenderingContext.clearColor')
-  @DocsEditable
-  void clearColor(num red, num green, num blue, num alpha) native;
-
-  @DomName('WebGLRenderingContext.clearDepth')
-  @DocsEditable
-  void clearDepth(num depth) native;
-
-  @DomName('WebGLRenderingContext.clearStencil')
-  @DocsEditable
-  void clearStencil(int s) native;
-
-  @DomName('WebGLRenderingContext.colorMask')
-  @DocsEditable
-  void colorMask(bool red, bool green, bool blue, bool alpha) native;
-
-  @DomName('WebGLRenderingContext.compileShader')
-  @DocsEditable
-  void compileShader(WebGLShader shader) native;
-
-  @DomName('WebGLRenderingContext.compressedTexImage2D')
-  @DocsEditable
-  void compressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, /*ArrayBufferView*/ 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;
-
-  @DomName('WebGLRenderingContext.copyTexImage2D')
-  @DocsEditable
-  void copyTexImage2D(int target, int level, int internalformat, int x, int y, int width, int height, int border) native;
-
-  @DomName('WebGLRenderingContext.copyTexSubImage2D')
-  @DocsEditable
-  void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) native;
-
-  @DomName('WebGLRenderingContext.createBuffer')
-  @DocsEditable
-  WebGLBuffer createBuffer() native;
-
-  @DomName('WebGLRenderingContext.createFramebuffer')
-  @DocsEditable
-  WebGLFramebuffer createFramebuffer() native;
-
-  @DomName('WebGLRenderingContext.createProgram')
-  @DocsEditable
-  WebGLProgram createProgram() native;
-
-  @DomName('WebGLRenderingContext.createRenderbuffer')
-  @DocsEditable
-  WebGLRenderbuffer createRenderbuffer() native;
-
-  @DomName('WebGLRenderingContext.createShader')
-  @DocsEditable
-  WebGLShader createShader(int type) native;
-
-  @DomName('WebGLRenderingContext.createTexture')
-  @DocsEditable
-  WebGLTexture createTexture() native;
-
-  @DomName('WebGLRenderingContext.cullFace')
-  @DocsEditable
-  void cullFace(int mode) native;
-
-  @DomName('WebGLRenderingContext.deleteBuffer')
-  @DocsEditable
-  void deleteBuffer(WebGLBuffer buffer) native;
-
-  @DomName('WebGLRenderingContext.deleteFramebuffer')
-  @DocsEditable
-  void deleteFramebuffer(WebGLFramebuffer framebuffer) native;
-
-  @DomName('WebGLRenderingContext.deleteProgram')
-  @DocsEditable
-  void deleteProgram(WebGLProgram program) native;
-
-  @DomName('WebGLRenderingContext.deleteRenderbuffer')
-  @DocsEditable
-  void deleteRenderbuffer(WebGLRenderbuffer renderbuffer) native;
-
-  @DomName('WebGLRenderingContext.deleteShader')
-  @DocsEditable
-  void deleteShader(WebGLShader shader) native;
-
-  @DomName('WebGLRenderingContext.deleteTexture')
-  @DocsEditable
-  void deleteTexture(WebGLTexture texture) native;
-
-  @DomName('WebGLRenderingContext.depthFunc')
-  @DocsEditable
-  void depthFunc(int func) native;
-
-  @DomName('WebGLRenderingContext.depthMask')
-  @DocsEditable
-  void depthMask(bool flag) native;
-
-  @DomName('WebGLRenderingContext.depthRange')
-  @DocsEditable
-  void depthRange(num zNear, num zFar) native;
-
-  @DomName('WebGLRenderingContext.detachShader')
-  @DocsEditable
-  void detachShader(WebGLProgram program, WebGLShader shader) native;
-
-  @DomName('WebGLRenderingContext.disable')
-  @DocsEditable
-  void disable(int cap) native;
-
-  @DomName('WebGLRenderingContext.disableVertexAttribArray')
-  @DocsEditable
-  void disableVertexAttribArray(int index) native;
-
-  @DomName('WebGLRenderingContext.drawArrays')
-  @DocsEditable
-  void drawArrays(int mode, int first, int count) native;
-
-  @DomName('WebGLRenderingContext.drawElements')
-  @DocsEditable
-  void drawElements(int mode, int count, int type, int offset) native;
-
-  @DomName('WebGLRenderingContext.enable')
-  @DocsEditable
-  void enable(int cap) native;
-
-  @DomName('WebGLRenderingContext.enableVertexAttribArray')
-  @DocsEditable
-  void enableVertexAttribArray(int index) native;
-
-  @DomName('WebGLRenderingContext.finish')
-  @DocsEditable
-  void finish() native;
-
-  @DomName('WebGLRenderingContext.flush')
-  @DocsEditable
-  void flush() native;
-
-  @DomName('WebGLRenderingContext.framebufferRenderbuffer')
-  @DocsEditable
-  void framebufferRenderbuffer(int target, int attachment, int renderbuffertarget, WebGLRenderbuffer renderbuffer) native;
-
-  @DomName('WebGLRenderingContext.framebufferTexture2D')
-  @DocsEditable
-  void framebufferTexture2D(int target, int attachment, int textarget, WebGLTexture texture, int level) native;
-
-  @DomName('WebGLRenderingContext.frontFace')
-  @DocsEditable
-  void frontFace(int mode) native;
-
-  @DomName('WebGLRenderingContext.generateMipmap')
-  @DocsEditable
-  void generateMipmap(int target) native;
-
-  @DomName('WebGLRenderingContext.getActiveAttrib')
-  @DocsEditable
-  WebGLActiveInfo getActiveAttrib(WebGLProgram program, int index) native;
-
-  @DomName('WebGLRenderingContext.getActiveUniform')
-  @DocsEditable
-  WebGLActiveInfo getActiveUniform(WebGLProgram program, int index) native;
-
-  @DomName('WebGLRenderingContext.getAttachedShaders')
-  @DocsEditable
-  void getAttachedShaders(WebGLProgram program) native;
-
-  @DomName('WebGLRenderingContext.getAttribLocation')
-  @DocsEditable
-  int getAttribLocation(WebGLProgram program, String name) native;
-
-  @DomName('WebGLRenderingContext.getBufferParameter')
-  @DocsEditable
-  Object getBufferParameter(int target, int pname) native;
-
-  @DomName('WebGLRenderingContext.getContextAttributes')
-  @DocsEditable
-  WebGLContextAttributes getContextAttributes() native;
-
-  @DomName('WebGLRenderingContext.getError')
-  @DocsEditable
-  int getError() native;
-
-  @DomName('WebGLRenderingContext.getExtension')
-  @DocsEditable
-  Object getExtension(String name) native;
-
-  @DomName('WebGLRenderingContext.getFramebufferAttachmentParameter')
-  @DocsEditable
-  Object getFramebufferAttachmentParameter(int target, int attachment, int pname) native;
-
-  @DomName('WebGLRenderingContext.getParameter')
-  @DocsEditable
-  @Creates('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')
-  @Returns('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')
-  Object getParameter(int pname) native;
-
-  @DomName('WebGLRenderingContext.getProgramInfoLog')
-  @DocsEditable
-  String getProgramInfoLog(WebGLProgram program) native;
-
-  @DomName('WebGLRenderingContext.getProgramParameter')
-  @DocsEditable
-  Object getProgramParameter(WebGLProgram program, int pname) native;
-
-  @DomName('WebGLRenderingContext.getRenderbufferParameter')
-  @DocsEditable
-  Object getRenderbufferParameter(int target, int pname) native;
-
-  @DomName('WebGLRenderingContext.getShaderInfoLog')
-  @DocsEditable
-  String getShaderInfoLog(WebGLShader shader) native;
-
-  @DomName('WebGLRenderingContext.getShaderParameter')
-  @DocsEditable
-  Object getShaderParameter(WebGLShader shader, int pname) native;
-
-  @DomName('WebGLRenderingContext.getShaderPrecisionFormat')
-  @DocsEditable
-  WebGLShaderPrecisionFormat getShaderPrecisionFormat(int shadertype, int precisiontype) native;
-
-  @DomName('WebGLRenderingContext.getShaderSource')
-  @DocsEditable
-  String getShaderSource(WebGLShader shader) native;
-
-  @DomName('WebGLRenderingContext.getSupportedExtensions')
-  @DocsEditable
-  List<String> getSupportedExtensions() native;
-
-  @DomName('WebGLRenderingContext.getTexParameter')
-  @DocsEditable
-  Object getTexParameter(int target, int pname) native;
-
-  @DomName('WebGLRenderingContext.getUniform')
-  @DocsEditable
-  Object getUniform(WebGLProgram program, WebGLUniformLocation location) native;
-
-  @DomName('WebGLRenderingContext.getUniformLocation')
-  @DocsEditable
-  WebGLUniformLocation getUniformLocation(WebGLProgram program, String name) native;
-
-  @DomName('WebGLRenderingContext.getVertexAttrib')
-  @DocsEditable
-  Object getVertexAttrib(int index, int pname) native;
-
-  @DomName('WebGLRenderingContext.getVertexAttribOffset')
-  @DocsEditable
-  int getVertexAttribOffset(int index, int pname) native;
-
-  @DomName('WebGLRenderingContext.hint')
-  @DocsEditable
-  void hint(int target, int mode) native;
-
-  @DomName('WebGLRenderingContext.isBuffer')
-  @DocsEditable
-  bool isBuffer(WebGLBuffer buffer) native;
-
-  @DomName('WebGLRenderingContext.isContextLost')
-  @DocsEditable
-  bool isContextLost() native;
-
-  @DomName('WebGLRenderingContext.isEnabled')
-  @DocsEditable
-  bool isEnabled(int cap) native;
-
-  @DomName('WebGLRenderingContext.isFramebuffer')
-  @DocsEditable
-  bool isFramebuffer(WebGLFramebuffer framebuffer) native;
-
-  @DomName('WebGLRenderingContext.isProgram')
-  @DocsEditable
-  bool isProgram(WebGLProgram program) native;
-
-  @DomName('WebGLRenderingContext.isRenderbuffer')
-  @DocsEditable
-  bool isRenderbuffer(WebGLRenderbuffer renderbuffer) native;
-
-  @DomName('WebGLRenderingContext.isShader')
-  @DocsEditable
-  bool isShader(WebGLShader shader) native;
-
-  @DomName('WebGLRenderingContext.isTexture')
-  @DocsEditable
-  bool isTexture(WebGLTexture texture) native;
-
-  @DomName('WebGLRenderingContext.lineWidth')
-  @DocsEditable
-  void lineWidth(num width) native;
-
-  @DomName('WebGLRenderingContext.linkProgram')
-  @DocsEditable
-  void linkProgram(WebGLProgram program) native;
-
-  @DomName('WebGLRenderingContext.pixelStorei')
-  @DocsEditable
-  void pixelStorei(int pname, int param) native;
-
-  @DomName('WebGLRenderingContext.polygonOffset')
-  @DocsEditable
-  void polygonOffset(num factor, num units) native;
-
-  @DomName('WebGLRenderingContext.readPixels')
-  @DocsEditable
-  void readPixels(int x, int y, int width, int height, int format, int type, /*ArrayBufferView*/ pixels) native;
-
-  @DomName('WebGLRenderingContext.releaseShaderCompiler')
-  @DocsEditable
-  void releaseShaderCompiler() native;
-
-  @DomName('WebGLRenderingContext.renderbufferStorage')
-  @DocsEditable
-  void renderbufferStorage(int target, int internalformat, int width, int height) native;
-
-  @DomName('WebGLRenderingContext.sampleCoverage')
-  @DocsEditable
-  void sampleCoverage(num value, bool invert) native;
-
-  @DomName('WebGLRenderingContext.scissor')
-  @DocsEditable
-  void scissor(int x, int y, int width, int height) native;
-
-  @DomName('WebGLRenderingContext.shaderSource')
-  @DocsEditable
-  void shaderSource(WebGLShader shader, String string) native;
-
-  @DomName('WebGLRenderingContext.stencilFunc')
-  @DocsEditable
-  void stencilFunc(int func, int ref, int mask) native;
-
-  @DomName('WebGLRenderingContext.stencilFuncSeparate')
-  @DocsEditable
-  void stencilFuncSeparate(int face, int func, int ref, int mask) native;
-
-  @DomName('WebGLRenderingContext.stencilMask')
-  @DocsEditable
-  void stencilMask(int mask) native;
-
-  @DomName('WebGLRenderingContext.stencilMaskSeparate')
-  @DocsEditable
-  void stencilMaskSeparate(int face, int mask) native;
-
-  @DomName('WebGLRenderingContext.stencilOp')
-  @DocsEditable
-  void stencilOp(int fail, int zfail, int zpass) native;
-
-  @DomName('WebGLRenderingContext.stencilOpSeparate')
-  @DocsEditable
-  void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
-
-  @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) {
-      _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
-      return;
-    }
-    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
-      var pixels_1 = _convertDartToNative_ImageData(border_OR_canvas_OR_image_OR_pixels_OR_video);
-      _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_type, pixels_1);
-      return;
-    }
-    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
-      _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is CanvasElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
-      _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is VideoElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
-      _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  @JSName('texImage2D')
-  @DomName('WebGLRenderingContext.texImage2D')
-  @DocsEditable
-  void _texImage2D_1(target, level, internalformat, width, height, int border, format, type, pixels) native;
-  @JSName('texImage2D')
-  @DomName('WebGLRenderingContext.texImage2D')
-  @DocsEditable
-  void _texImage2D_2(target, level, internalformat, format, type, pixels) native;
-  @JSName('texImage2D')
-  @DomName('WebGLRenderingContext.texImage2D')
-  @DocsEditable
-  void _texImage2D_3(target, level, internalformat, format, type, ImageElement image) native;
-  @JSName('texImage2D')
-  @DomName('WebGLRenderingContext.texImage2D')
-  @DocsEditable
-  void _texImage2D_4(target, level, internalformat, format, type, CanvasElement canvas) native;
-  @JSName('texImage2D')
-  @DomName('WebGLRenderingContext.texImage2D')
-  @DocsEditable
-  void _texImage2D_5(target, level, internalformat, format, type, VideoElement video) native;
-
-  @DomName('WebGLRenderingContext.texParameterf')
-  @DocsEditable
-  void texParameterf(int target, int pname, num param) native;
-
-  @DomName('WebGLRenderingContext.texParameteri')
-  @DocsEditable
-  void texParameteri(int target, int pname, int param) native;
-
-  @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) {
-      _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
-      return;
-    }
-    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
-      var pixels_1 = _convertDartToNative_ImageData(canvas_OR_format_OR_image_OR_pixels_OR_video);
-      _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_OR_type, pixels_1);
-      return;
-    }
-    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
-      _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is CanvasElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
-      _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is VideoElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
-      _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-  @JSName('texSubImage2D')
-  @DomName('WebGLRenderingContext.texSubImage2D')
-  @DocsEditable
-  void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int format, type, pixels) native;
-  @JSName('texSubImage2D')
-  @DomName('WebGLRenderingContext.texSubImage2D')
-  @DocsEditable
-  void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels) native;
-  @JSName('texSubImage2D')
-  @DomName('WebGLRenderingContext.texSubImage2D')
-  @DocsEditable
-  void _texSubImage2D_3(target, level, xoffset, yoffset, format, type, ImageElement image) native;
-  @JSName('texSubImage2D')
-  @DomName('WebGLRenderingContext.texSubImage2D')
-  @DocsEditable
-  void _texSubImage2D_4(target, level, xoffset, yoffset, format, type, CanvasElement canvas) native;
-  @JSName('texSubImage2D')
-  @DomName('WebGLRenderingContext.texSubImage2D')
-  @DocsEditable
-  void _texSubImage2D_5(target, level, xoffset, yoffset, format, type, VideoElement video) native;
-
-  @DomName('WebGLRenderingContext.uniform1f')
-  @DocsEditable
-  void uniform1f(WebGLUniformLocation location, num x) native;
-
-  @DomName('WebGLRenderingContext.uniform1fv')
-  @DocsEditable
-  void uniform1fv(WebGLUniformLocation location, Float32Array v) native;
-
-  @DomName('WebGLRenderingContext.uniform1i')
-  @DocsEditable
-  void uniform1i(WebGLUniformLocation location, int x) native;
-
-  @DomName('WebGLRenderingContext.uniform1iv')
-  @DocsEditable
-  void uniform1iv(WebGLUniformLocation location, Int32Array v) native;
-
-  @DomName('WebGLRenderingContext.uniform2f')
-  @DocsEditable
-  void uniform2f(WebGLUniformLocation location, num x, num y) native;
-
-  @DomName('WebGLRenderingContext.uniform2fv')
-  @DocsEditable
-  void uniform2fv(WebGLUniformLocation location, Float32Array v) native;
-
-  @DomName('WebGLRenderingContext.uniform2i')
-  @DocsEditable
-  void uniform2i(WebGLUniformLocation location, int x, int y) native;
-
-  @DomName('WebGLRenderingContext.uniform2iv')
-  @DocsEditable
-  void uniform2iv(WebGLUniformLocation location, Int32Array v) native;
-
-  @DomName('WebGLRenderingContext.uniform3f')
-  @DocsEditable
-  void uniform3f(WebGLUniformLocation location, num x, num y, num z) native;
-
-  @DomName('WebGLRenderingContext.uniform3fv')
-  @DocsEditable
-  void uniform3fv(WebGLUniformLocation location, Float32Array v) native;
-
-  @DomName('WebGLRenderingContext.uniform3i')
-  @DocsEditable
-  void uniform3i(WebGLUniformLocation location, int x, int y, int z) native;
-
-  @DomName('WebGLRenderingContext.uniform3iv')
-  @DocsEditable
-  void uniform3iv(WebGLUniformLocation location, Int32Array v) native;
-
-  @DomName('WebGLRenderingContext.uniform4f')
-  @DocsEditable
-  void uniform4f(WebGLUniformLocation location, num x, num y, num z, num w) native;
-
-  @DomName('WebGLRenderingContext.uniform4fv')
-  @DocsEditable
-  void uniform4fv(WebGLUniformLocation location, Float32Array v) native;
-
-  @DomName('WebGLRenderingContext.uniform4i')
-  @DocsEditable
-  void uniform4i(WebGLUniformLocation location, int x, int y, int z, int w) native;
-
-  @DomName('WebGLRenderingContext.uniform4iv')
-  @DocsEditable
-  void uniform4iv(WebGLUniformLocation location, Int32Array v) native;
-
-  @DomName('WebGLRenderingContext.uniformMatrix2fv')
-  @DocsEditable
-  void uniformMatrix2fv(WebGLUniformLocation location, bool transpose, Float32Array array) native;
-
-  @DomName('WebGLRenderingContext.uniformMatrix3fv')
-  @DocsEditable
-  void uniformMatrix3fv(WebGLUniformLocation location, bool transpose, Float32Array array) native;
-
-  @DomName('WebGLRenderingContext.uniformMatrix4fv')
-  @DocsEditable
-  void uniformMatrix4fv(WebGLUniformLocation location, bool transpose, Float32Array array) native;
-
-  @DomName('WebGLRenderingContext.useProgram')
-  @DocsEditable
-  void useProgram(WebGLProgram program) native;
-
-  @DomName('WebGLRenderingContext.validateProgram')
-  @DocsEditable
-  void validateProgram(WebGLProgram program) native;
-
-  @DomName('WebGLRenderingContext.vertexAttrib1f')
-  @DocsEditable
-  void vertexAttrib1f(int indx, num x) native;
-
-  @DomName('WebGLRenderingContext.vertexAttrib1fv')
-  @DocsEditable
-  void vertexAttrib1fv(int indx, Float32Array values) native;
-
-  @DomName('WebGLRenderingContext.vertexAttrib2f')
-  @DocsEditable
-  void vertexAttrib2f(int indx, num x, num y) native;
-
-  @DomName('WebGLRenderingContext.vertexAttrib2fv')
-  @DocsEditable
-  void vertexAttrib2fv(int indx, Float32Array values) native;
-
-  @DomName('WebGLRenderingContext.vertexAttrib3f')
-  @DocsEditable
-  void vertexAttrib3f(int indx, num x, num y, num z) native;
-
-  @DomName('WebGLRenderingContext.vertexAttrib3fv')
-  @DocsEditable
-  void vertexAttrib3fv(int indx, Float32Array values) native;
-
-  @DomName('WebGLRenderingContext.vertexAttrib4f')
-  @DocsEditable
-  void vertexAttrib4f(int indx, num x, num y, num z, num w) native;
-
-  @DomName('WebGLRenderingContext.vertexAttrib4fv')
-  @DocsEditable
-  void vertexAttrib4fv(int indx, Float32Array values) native;
-
-  @DomName('WebGLRenderingContext.vertexAttribPointer')
-  @DocsEditable
-  void vertexAttribPointer(int indx, int size, int type, bool normalized, int stride, int offset) native;
-
-  @DomName('WebGLRenderingContext.viewport')
-  @DocsEditable
-  void viewport(int x, int y, int width, int height) 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('WebGLShader')
-class WebGLShader 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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('WebGLShaderPrecisionFormat')
-class WebGLShaderPrecisionFormat native "*WebGLShaderPrecisionFormat" {
-
-  @DomName('WebGLShaderPrecisionFormat.precision')
-  @DocsEditable
-  final int precision;
-
-  @DomName('WebGLShaderPrecisionFormat.rangeMax')
-  @DocsEditable
-  final int rangeMax;
-
-  @DomName('WebGLShaderPrecisionFormat.rangeMin')
-  @DocsEditable
-  final int rangeMin;
-}
-// 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('WebGLTexture')
-class WebGLTexture 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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('WebGLUniformLocation')
-class WebGLUniformLocation 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
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('WebGLVertexArrayObjectOES')
-class WebGLVertexArrayObject native "*WebGLVertexArrayObjectOES" {
-}
-// 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('WebKitCSSFilterRule')
 class WebKitCssFilterRule extends CssRule native "*WebKitCSSFilterRule" {
 
@@ -26438,6 +24783,13 @@
       eventType = 'MouseScrollEvents';
     }
     final event = document.$dom_createEvent(eventType);
+    // If polyfilling, then flip these because we'll flip them back to match
+    // the W3C standard:
+    // http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY
+    if (JS('bool', '#.deltaY === undefined', event)) {
+      deltaX = -deltaX;
+      deltaY = -deltaY;
+    }
     if (event._hasInitWheelEvent) {
       var modifiers = [];
       if (ctrlKey) {
@@ -26507,6 +24859,14 @@
   void $dom_initWebKitWheelEvent(int wheelDeltaX, int wheelDeltaY, Window view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native;
 
 
+  /**
+   * The amount that is expected to scroll vertically, in units determined by
+   * [deltaMode].
+   *
+   * See also:
+   *
+   * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
+   */
   @DomName('WheelEvent.deltaY')
   num get deltaY {
     if (JS('bool', '#.deltaY !== undefined', this)) {
@@ -26514,7 +24874,7 @@
       return this._deltaY;
     } else if (JS('bool', '#.wheelDelta !== undefined', this)) {
       // Chrome and IE
-      return this._wheelDelta;
+      return -this._wheelDelta;
     } else if (JS('bool', '#.detail !== undefined', this)) {
       // Firefox
 
@@ -26524,10 +24884,10 @@
         var detail = this._detail;
         // Firefox is normally the number of lines to scale (normally 3)
         // so multiply it by 40 to get pixels to move, matching IE & WebKit.
-        if (detail < 100) {
-          return detail * 40;
+        if (detail.abs() < 100) {
+          return -detail * 40;
         }
-        return detail;
+        return -detail;
       }
       return 0;
     }
@@ -26535,6 +24895,14 @@
         'deltaY is not supported');
   }
 
+  /**
+   * The amount that is expected to scroll horizontally, in units determined by
+   * [deltaMode].
+   *
+   * See also:
+   *
+   * * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
+   */
   @DomName('WheelEvent.deltaX')
   num get deltaX {
     if (JS('bool', '#.deltaX !== undefined', this)) {
@@ -26542,7 +24910,7 @@
       return this._deltaX;
     } else if (JS('bool', '#.wheelDeltaX !== undefined', this)) {
       // Chrome
-      return this._wheelDeltaX;
+      return -this._wheelDeltaX;
     } else if (JS('bool', '#.detail !== undefined', this)) {
       // Firefox and IE.
       // IE will have detail set but will not set axis.
@@ -26555,9 +24923,9 @@
         // Firefox is normally the number of lines to scale (normally 3)
         // so multiply it by 40 to get pixels to move, matching IE & WebKit.
         if (detail < 100) {
-          return detail * 40;
+          return -detail * 40;
         }
-        return detail;
+        return -detail;
       }
       return 0;
     }
@@ -28300,6 +26668,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Rect)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Rect element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Rect element)) => IterableMixinWorkaround.forEach(this, f);
@@ -28361,10 +26733,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Rect value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Rect> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -28511,6 +26879,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, CssRule)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(CssRule element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(CssRule element)) => IterableMixinWorkaround.forEach(this, f);
@@ -28572,10 +26944,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(CssRule value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<CssRule> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -28722,6 +27090,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, CssValue)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(CssValue element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(CssValue element)) => IterableMixinWorkaround.forEach(this, f);
@@ -28783,10 +27155,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(CssValue value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<CssValue> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -28933,6 +27301,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Entry)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Entry element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Entry element)) => IterableMixinWorkaround.forEach(this, f);
@@ -28994,10 +27366,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Entry value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Entry> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -29144,6 +27512,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, EntrySync)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(EntrySync element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(EntrySync element)) => IterableMixinWorkaround.forEach(this, f);
@@ -29205,10 +27577,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(EntrySync value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<EntrySync> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -29355,6 +27723,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Gamepad)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Gamepad element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Gamepad element)) => IterableMixinWorkaround.forEach(this, f);
@@ -29416,10 +27788,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Gamepad value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Gamepad> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -29629,6 +27997,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Node)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
@@ -29690,10 +28062,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Node value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Node> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -29864,6 +28232,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, SpeechInputResult)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(SpeechInputResult element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(SpeechInputResult element)) => IterableMixinWorkaround.forEach(this, f);
@@ -29925,10 +28297,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(SpeechInputResult value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<SpeechInputResult> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -30075,6 +28443,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, SpeechRecognitionResult)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(SpeechRecognitionResult element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(SpeechRecognitionResult element)) => IterableMixinWorkaround.forEach(this, f);
@@ -30136,10 +28508,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(SpeechRecognitionResult value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<SpeechRecognitionResult> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -30286,6 +28654,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, StyleSheet)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(StyleSheet element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(StyleSheet element)) => IterableMixinWorkaround.forEach(this, f);
@@ -30347,10 +28719,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(StyleSheet value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<StyleSheet> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -30932,6 +29300,11 @@
       dynamic combine(dynamic previousValue, String element)) {
     return readClasses().reduce(initialValue, combine);
   }
+
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, String element)) {
+    return readClasses().fold(initialValue, combine);
+  }
   // interface Collection - END
 
   // interface Set - BEGIN
@@ -31135,9 +29508,7 @@
   }
 
   void cancel() {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_canceled) return;
 
     _unlisten();
     // Clear out the target to indicate this is complete.
@@ -31165,9 +29536,7 @@
   void onDone(void handleDone()) {}
 
   void pause([Future resumeSignal]) {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_canceled) return;
     ++_pauseCount;
     _unlisten();
 
@@ -31179,12 +29548,7 @@
   bool get _paused => _pauseCount > 0;
 
   void resume() {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
-    if (!_paused) {
-      throw new StateError("Subscription is not paused.");
-    }
+    if (_canceled || !_paused) return;
     --_pauseCount;
     _tryResume();
   }
@@ -32756,68 +31120,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
-// TODO(antonm): support not DOM isolates too.
-class _Timer implements Timer {
-  final canceller;
-
-  _Timer(this.canceller);
-
-  void cancel() { canceller(); }
-}
-
-get _timerFactoryClosure => (int milliSeconds, void callback(Timer timer), bool repeating) {
-  var maker;
-  var canceller;
-  if (repeating) {
-    maker = window._setInterval;
-    canceller = window._clearInterval;
-  } else {
-    maker = window._setTimeout;
-    canceller = window._clearTimeout;
-  }
-  Timer timer;
-  final int id = maker(() { callback(timer); }, milliSeconds);
-  timer = new _Timer(() { canceller(id); });
-  return timer;
-};
-
-class _PureIsolateTimer implements Timer {
-  final ReceivePort _port = new ReceivePort();
-  SendPort _sendPort; // Effectively final.
-
-  _PureIsolateTimer(int milliSeconds, callback, repeating) {
-    _sendPort = _port.toSendPort();
-    _port.receive((msg, replyTo) {
-      assert(msg == _TIMER_PING);
-      assert(replyTo == _HELPER_ISOLATE_PORT);
-      callback(this);
-      if (!repeating) _cancel();
-    });
-    _HELPER_ISOLATE_PORT.then((port) {
-      port.send([_NEW_TIMER, milliSeconds, repeating], _sendPort);
-    });
-  }
-
-  void cancel() {
-    _cancel();
-    _HELPER_ISOLATE_PORT.then((port) {
-      port.send([_CANCEL_TIMER], _sendPort);
-    });
-  }
-
-  void _cancel() {
-    _port.close();
-  }
-}
-
-get _pureIsolateTimerFactoryClosure =>
-    ((int milliSeconds, void callback(Timer time), bool repeating) =>
-        new _PureIsolateTimer(milliSeconds, callback, repeating));
-// 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 _HttpRequestUtils {
 
   // Helper for factory HttpRequest.get
@@ -33426,6 +31728,9 @@
   dynamic reduce(initialValue, combine(previousValue, E element)) =>
       _list.reduce(initialValue, combine);
 
+  dynamic fold(initialValue, combine(previousValue, E element)) =>
+      _list.fold(initialValue, combine);
+
   bool every(bool f(E element)) => _list.every(f);
 
   String join([String separator]) => _list.join(separator);
@@ -33495,8 +31800,6 @@
 
   void set length(int newLength) { _list.length = newLength; }
 
-  void addLast(E value) { _list.add(value); }
-
   Iterable<E> get reversed => _list.reversed;
 
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
@@ -33619,6 +31922,9 @@
 }
 
 EventTarget _convertNativeToDart_EventTarget(e) {
+  if (e == null) {
+    return null;
+  }
   // Assume it's a Window if it contains the setInterval property.  It may be
   // from a different frame - without a patched prototype - so we cannot
   // rely on Dart type checking.
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index d7bb433..c2165db 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -10,6 +10,7 @@
 import 'dart:math';
 import 'dart:nativewrappers';
 import 'dart:typeddata' as _typeddata;
+import 'dart:web_gl' as gl;
 import 'dart:web_sql';
 import 'dart:svg' as svg;
 import 'dart:web_audio' as web_audio;
@@ -1166,7 +1167,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @Experimental
-  WebGLRenderingContext getContext3d({alpha: true, depth: true, stencil: false,
+  gl.RenderingContext getContext3d({alpha: true, depth: true, stencil: false,
     antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) {
 
     var options = {
@@ -7995,6 +7996,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, DomMimeType)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(DomMimeType element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(DomMimeType element)) => IterableMixinWorkaround.forEach(this, f);
@@ -8056,10 +8061,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(DomMimeType value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<DomMimeType> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -8277,6 +8278,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, DomPlugin)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(DomPlugin element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(DomPlugin element)) => IterableMixinWorkaround.forEach(this, f);
@@ -8338,10 +8343,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(DomPlugin value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<DomPlugin> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -8677,6 +8678,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, String)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   // contains() defined by IDL.
 
   void forEach(void f(String element)) => IterableMixinWorkaround.forEach(this, f);
@@ -8738,10 +8743,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(String value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<String> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -9054,8 +9055,6 @@
     return value;
   }
 
-  Element addLast(Element value) => add(value);
-
   Iterator<Element> get iterator => toList().iterator;
 
   void addAll(Iterable<Element> iterable) {
@@ -9081,6 +9080,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Element element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
     throw new UnimplementedError();
   }
@@ -9308,10 +9312,6 @@
     throw new UnsupportedError('');
   }
 
-  void addLast(Element value) {
-    throw new UnsupportedError('');
-  }
-
   Iterator<Element> get iterator => new _FrozenElementListIterator(this);
 
   void addAll(Iterable<Element> iterable) {
@@ -9331,6 +9331,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Element element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
     throw new UnsupportedError('');
   }
@@ -11316,104 +11321,6 @@
 
 
 @DocsEditable
-@DomName('EXTDrawBuffers')
-class ExtDrawBuffers extends NativeFieldWrapperClass1 {
-  ExtDrawBuffers.internal();
-
-  static const int COLOR_ATTACHMENT0_EXT = 0x8CE0;
-
-  static const int COLOR_ATTACHMENT10_EXT = 0x8CEA;
-
-  static const int COLOR_ATTACHMENT11_EXT = 0x8CEB;
-
-  static const int COLOR_ATTACHMENT12_EXT = 0x8CEC;
-
-  static const int COLOR_ATTACHMENT13_EXT = 0x8CED;
-
-  static const int COLOR_ATTACHMENT14_EXT = 0x8CEE;
-
-  static const int COLOR_ATTACHMENT15_EXT = 0x8CEF;
-
-  static const int COLOR_ATTACHMENT1_EXT = 0x8CE1;
-
-  static const int COLOR_ATTACHMENT2_EXT = 0x8CE2;
-
-  static const int COLOR_ATTACHMENT3_EXT = 0x8CE3;
-
-  static const int COLOR_ATTACHMENT4_EXT = 0x8CE4;
-
-  static const int COLOR_ATTACHMENT5_EXT = 0x8CE5;
-
-  static const int COLOR_ATTACHMENT6_EXT = 0x8CE6;
-
-  static const int COLOR_ATTACHMENT7_EXT = 0x8CE7;
-
-  static const int COLOR_ATTACHMENT8_EXT = 0x8CE8;
-
-  static const int COLOR_ATTACHMENT9_EXT = 0x8CE9;
-
-  static const int DRAW_BUFFER0_EXT = 0x8825;
-
-  static const int DRAW_BUFFER10_EXT = 0x882F;
-
-  static const int DRAW_BUFFER11_EXT = 0x8830;
-
-  static const int DRAW_BUFFER12_EXT = 0x8831;
-
-  static const int DRAW_BUFFER13_EXT = 0x8832;
-
-  static const int DRAW_BUFFER14_EXT = 0x8833;
-
-  static const int DRAW_BUFFER15_EXT = 0x8834;
-
-  static const int DRAW_BUFFER1_EXT = 0x8826;
-
-  static const int DRAW_BUFFER2_EXT = 0x8827;
-
-  static const int DRAW_BUFFER3_EXT = 0x8828;
-
-  static const int DRAW_BUFFER4_EXT = 0x8829;
-
-  static const int DRAW_BUFFER5_EXT = 0x882A;
-
-  static const int DRAW_BUFFER6_EXT = 0x882B;
-
-  static const int DRAW_BUFFER7_EXT = 0x882C;
-
-  static const int DRAW_BUFFER8_EXT = 0x882D;
-
-  static const int DRAW_BUFFER9_EXT = 0x882E;
-
-  static const int MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF;
-
-  static const int MAX_DRAW_BUFFERS_EXT = 0x8824;
-
-}
-// 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('EXTTextureFilterAnisotropic')
-class ExtTextureFilterAnisotropic extends NativeFieldWrapperClass1 {
-  ExtTextureFilterAnisotropic.internal();
-
-  static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
-
-  static const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
-
-}
-// 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('HTMLFieldSetElement')
 class FieldSetElement extends _Element_Merged {
   FieldSetElement.internal() : super.internal();
@@ -11696,6 +11603,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, File)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(File element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(File element)) => IterableMixinWorkaround.forEach(this, f);
@@ -11757,10 +11668,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(File value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<File> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -12321,6 +12228,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, num)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(num element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
@@ -12382,10 +12293,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(num value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<num> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -12570,6 +12477,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, num)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(num element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
@@ -12631,10 +12542,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(num value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<num> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -13268,6 +13175,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Node)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
@@ -13329,10 +13240,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Node value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Node> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -13491,6 +13398,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Node)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
@@ -13552,10 +13463,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Node value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Node> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -15861,6 +15768,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -15922,10 +15833,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -16110,6 +16017,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -16171,10 +16082,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -16359,6 +16266,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -16420,10 +16331,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -19148,11 +19055,6 @@
     _this.append(value);
   }
 
-  void addLast(Node value) {
-    _this.append(value);
-  }
-
-
   void addAll(Iterable<Node> iterable) {
     if (iterable is _ChildNodeListLazy) {
       if (!identical(iterable._this, _this)) {
@@ -19240,6 +19142,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Node element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   String join([String separator]) {
     return IterableMixinWorkaround.joinList(this, separator);
   }
@@ -19735,6 +19642,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Node)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
@@ -19796,10 +19707,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Node value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Node> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -20271,91 +20178,6 @@
 
 
 @DocsEditable
-@DomName('OESElementIndexUint')
-class OesElementIndexUint extends NativeFieldWrapperClass1 {
-  OesElementIndexUint.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('OESStandardDerivatives')
-class OesStandardDerivatives extends NativeFieldWrapperClass1 {
-  OesStandardDerivatives.internal();
-
-  static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
-
-}
-// 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('OESTextureFloat')
-class OesTextureFloat extends NativeFieldWrapperClass1 {
-  OesTextureFloat.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('OESTextureHalfFloat')
-class OesTextureHalfFloat extends NativeFieldWrapperClass1 {
-  OesTextureHalfFloat.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('OESVertexArrayObject')
-class OesVertexArrayObject extends NativeFieldWrapperClass1 {
-  OesVertexArrayObject.internal();
-
-  static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
-
-  @DomName('OESVertexArrayObject.bindVertexArrayOES')
-  @DocsEditable
-  void bindVertexArray(WebGLVertexArrayObject arrayObject) native "OESVertexArrayObject_bindVertexArrayOES_Callback";
-
-  @DomName('OESVertexArrayObject.createVertexArrayOES')
-  @DocsEditable
-  WebGLVertexArrayObject createVertexArray() native "OESVertexArrayObject_createVertexArrayOES_Callback";
-
-  @DomName('OESVertexArrayObject.deleteVertexArrayOES')
-  @DocsEditable
-  void deleteVertexArray(WebGLVertexArrayObject arrayObject) native "OESVertexArrayObject_deleteVertexArrayOES_Callback";
-
-  @DomName('OESVertexArrayObject.isVertexArrayOES')
-  @DocsEditable
-  bool isVertexArray(WebGLVertexArrayObject arrayObject) native "OESVertexArrayObject_isVertexArrayOES_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('HTMLOptGroupElement')
 class OptGroupElement extends _Element_Merged {
   OptGroupElement.internal() : super.internal();
@@ -22427,6 +22249,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, SourceBuffer)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(SourceBuffer element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(SourceBuffer element)) => IterableMixinWorkaround.forEach(this, f);
@@ -22488,10 +22314,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(SourceBuffer value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<SourceBuffer> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -22759,6 +22581,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, SpeechGrammar)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(SpeechGrammar element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(SpeechGrammar element)) => IterableMixinWorkaround.forEach(this, f);
@@ -22820,10 +22646,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(SpeechGrammar value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<SpeechGrammar> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -23944,6 +23766,23 @@
 // WARNING: Do not edit - generated code.
 
 
+@DocsEditable
+@DomName('HTMLTemplateElement')
+class TemplateElement extends _Element_Merged {
+  TemplateElement.internal() : super.internal();
+
+  @DomName('HTMLTemplateElement.content')
+  @DocsEditable
+  DocumentFragment get content native "HTMLTemplateElement_content_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.
+
+
 @DomName('Text')
 class Text extends CharacterData {
   factory Text(String data) => _TextFactoryProvider.createText(data);
@@ -24489,6 +24328,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, TextTrackCue)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(TextTrackCue element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(TextTrackCue element)) => IterableMixinWorkaround.forEach(this, f);
@@ -24550,10 +24393,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(TextTrackCue value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<TextTrackCue> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -24712,6 +24551,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, TextTrack)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(TextTrack element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(TextTrack element)) => IterableMixinWorkaround.forEach(this, f);
@@ -24773,10 +24616,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(TextTrack value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<TextTrack> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -25152,6 +24991,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Touch)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Touch element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Touch element)) => IterableMixinWorkaround.forEach(this, f);
@@ -25213,10 +25056,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Touch value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Touch> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -25675,6 +25514,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -25736,10 +25579,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -25924,6 +25763,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -25985,10 +25828,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -26173,6 +26012,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -26234,10 +26077,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -26420,6 +26259,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, int)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(int element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
@@ -26481,10 +26324,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(int value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<int> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -26839,1656 +26678,6 @@
 
 
 @DocsEditable
-@DomName('WebGLActiveInfo')
-class WebGLActiveInfo extends NativeFieldWrapperClass1 {
-  WebGLActiveInfo.internal();
-
-  @DomName('WebGLActiveInfo.name')
-  @DocsEditable
-  String get name native "WebGLActiveInfo_name_Getter";
-
-  @DomName('WebGLActiveInfo.size')
-  @DocsEditable
-  int get size native "WebGLActiveInfo_size_Getter";
-
-  @DomName('WebGLActiveInfo.type')
-  @DocsEditable
-  int get type native "WebGLActiveInfo_type_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('WebGLBuffer')
-class WebGLBuffer extends NativeFieldWrapperClass1 {
-  WebGLBuffer.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('WebGLCompressedTextureATC')
-class WebGLCompressedTextureAtc extends NativeFieldWrapperClass1 {
-  WebGLCompressedTextureAtc.internal();
-
-  static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
-
-  static const int COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
-
-  static const int COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
-
-}
-// 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('WebGLCompressedTexturePVRTC')
-class WebGLCompressedTexturePvrtc extends NativeFieldWrapperClass1 {
-  WebGLCompressedTexturePvrtc.internal();
-
-  static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
-
-  static const int COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
-
-  static const int COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
-
-  static const int COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
-
-}
-// 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('WebGLCompressedTextureS3TC')
-class WebGLCompressedTextureS3TC extends NativeFieldWrapperClass1 {
-  WebGLCompressedTextureS3TC.internal();
-
-  static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
-
-  static const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
-
-  static const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
-
-  static const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
-
-}
-// 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('WebGLContextAttributes')
-class WebGLContextAttributes extends NativeFieldWrapperClass1 {
-  WebGLContextAttributes.internal();
-
-  @DomName('WebGLContextAttributes.alpha')
-  @DocsEditable
-  bool get alpha native "WebGLContextAttributes_alpha_Getter";
-
-  @DomName('WebGLContextAttributes.alpha')
-  @DocsEditable
-  void set alpha(bool value) native "WebGLContextAttributes_alpha_Setter";
-
-  @DomName('WebGLContextAttributes.antialias')
-  @DocsEditable
-  bool get antialias native "WebGLContextAttributes_antialias_Getter";
-
-  @DomName('WebGLContextAttributes.antialias')
-  @DocsEditable
-  void set antialias(bool value) native "WebGLContextAttributes_antialias_Setter";
-
-  @DomName('WebGLContextAttributes.depth')
-  @DocsEditable
-  bool get depth native "WebGLContextAttributes_depth_Getter";
-
-  @DomName('WebGLContextAttributes.depth')
-  @DocsEditable
-  void set depth(bool value) native "WebGLContextAttributes_depth_Setter";
-
-  @DomName('WebGLContextAttributes.premultipliedAlpha')
-  @DocsEditable
-  bool get premultipliedAlpha native "WebGLContextAttributes_premultipliedAlpha_Getter";
-
-  @DomName('WebGLContextAttributes.premultipliedAlpha')
-  @DocsEditable
-  void set premultipliedAlpha(bool value) native "WebGLContextAttributes_premultipliedAlpha_Setter";
-
-  @DomName('WebGLContextAttributes.preserveDrawingBuffer')
-  @DocsEditable
-  bool get preserveDrawingBuffer native "WebGLContextAttributes_preserveDrawingBuffer_Getter";
-
-  @DomName('WebGLContextAttributes.preserveDrawingBuffer')
-  @DocsEditable
-  void set preserveDrawingBuffer(bool value) native "WebGLContextAttributes_preserveDrawingBuffer_Setter";
-
-  @DomName('WebGLContextAttributes.stencil')
-  @DocsEditable
-  bool get stencil native "WebGLContextAttributes_stencil_Getter";
-
-  @DomName('WebGLContextAttributes.stencil')
-  @DocsEditable
-  void set stencil(bool value) native "WebGLContextAttributes_stencil_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.
-
-
-@DocsEditable
-@DomName('WebGLContextEvent')
-class WebGLContextEvent extends Event {
-  WebGLContextEvent.internal() : super.internal();
-
-  @DomName('WebGLContextEvent.statusMessage')
-  @DocsEditable
-  String get statusMessage native "WebGLContextEvent_statusMessage_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('WebGLDebugRendererInfo')
-class WebGLDebugRendererInfo extends NativeFieldWrapperClass1 {
-  WebGLDebugRendererInfo.internal();
-
-  static const int UNMASKED_RENDERER_WEBGL = 0x9246;
-
-  static const int UNMASKED_VENDOR_WEBGL = 0x9245;
-
-}
-// 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('WebGLDebugShaders')
-class WebGLDebugShaders extends NativeFieldWrapperClass1 {
-  WebGLDebugShaders.internal();
-
-  @DomName('WebGLDebugShaders.getTranslatedShaderSource')
-  @DocsEditable
-  String getTranslatedShaderSource(WebGLShader shader) native "WebGLDebugShaders_getTranslatedShaderSource_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('WebGLDepthTexture')
-class WebGLDepthTexture extends NativeFieldWrapperClass1 {
-  WebGLDepthTexture.internal();
-
-  static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
-
-}
-// 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('WebGLFramebuffer')
-class WebGLFramebuffer extends NativeFieldWrapperClass1 {
-  WebGLFramebuffer.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('WebGLLoseContext')
-class WebGLLoseContext extends NativeFieldWrapperClass1 {
-  WebGLLoseContext.internal();
-
-  @DomName('WebGLLoseContext.loseContext')
-  @DocsEditable
-  void loseContext() native "WebGLLoseContext_loseContext_Callback";
-
-  @DomName('WebGLLoseContext.restoreContext')
-  @DocsEditable
-  void restoreContext() native "WebGLLoseContext_restoreContext_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('WebGLProgram')
-class WebGLProgram extends NativeFieldWrapperClass1 {
-  WebGLProgram.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('WebGLRenderbuffer')
-class WebGLRenderbuffer extends NativeFieldWrapperClass1 {
-  WebGLRenderbuffer.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('WebGLRenderingContext')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@Experimental
-class WebGLRenderingContext extends CanvasRenderingContext {
-  WebGLRenderingContext.internal() : super.internal();
-
-  /// Checks if this type is supported on the current platform.
-  static bool get supported => true;
-
-  static const int ACTIVE_ATTRIBUTES = 0x8B89;
-
-  static const int ACTIVE_TEXTURE = 0x84E0;
-
-  static const int ACTIVE_UNIFORMS = 0x8B86;
-
-  static const int ALIASED_LINE_WIDTH_RANGE = 0x846E;
-
-  static const int ALIASED_POINT_SIZE_RANGE = 0x846D;
-
-  static const int ALPHA = 0x1906;
-
-  static const int ALPHA_BITS = 0x0D55;
-
-  static const int ALWAYS = 0x0207;
-
-  static const int ARRAY_BUFFER = 0x8892;
-
-  static const int ARRAY_BUFFER_BINDING = 0x8894;
-
-  static const int ATTACHED_SHADERS = 0x8B85;
-
-  static const int BACK = 0x0405;
-
-  static const int BLEND = 0x0BE2;
-
-  static const int BLEND_COLOR = 0x8005;
-
-  static const int BLEND_DST_ALPHA = 0x80CA;
-
-  static const int BLEND_DST_RGB = 0x80C8;
-
-  static const int BLEND_EQUATION = 0x8009;
-
-  static const int BLEND_EQUATION_ALPHA = 0x883D;
-
-  static const int BLEND_EQUATION_RGB = 0x8009;
-
-  static const int BLEND_SRC_ALPHA = 0x80CB;
-
-  static const int BLEND_SRC_RGB = 0x80C9;
-
-  static const int BLUE_BITS = 0x0D54;
-
-  static const int BOOL = 0x8B56;
-
-  static const int BOOL_VEC2 = 0x8B57;
-
-  static const int BOOL_VEC3 = 0x8B58;
-
-  static const int BOOL_VEC4 = 0x8B59;
-
-  static const int BROWSER_DEFAULT_WEBGL = 0x9244;
-
-  static const int BUFFER_SIZE = 0x8764;
-
-  static const int BUFFER_USAGE = 0x8765;
-
-  static const int BYTE = 0x1400;
-
-  static const int CCW = 0x0901;
-
-  static const int CLAMP_TO_EDGE = 0x812F;
-
-  static const int COLOR_ATTACHMENT0 = 0x8CE0;
-
-  static const int COLOR_BUFFER_BIT = 0x00004000;
-
-  static const int COLOR_CLEAR_VALUE = 0x0C22;
-
-  static const int COLOR_WRITEMASK = 0x0C23;
-
-  static const int COMPILE_STATUS = 0x8B81;
-
-  static const int COMPRESSED_TEXTURE_FORMATS = 0x86A3;
-
-  static const int CONSTANT_ALPHA = 0x8003;
-
-  static const int CONSTANT_COLOR = 0x8001;
-
-  static const int CONTEXT_LOST_WEBGL = 0x9242;
-
-  static const int CULL_FACE = 0x0B44;
-
-  static const int CULL_FACE_MODE = 0x0B45;
-
-  static const int CURRENT_PROGRAM = 0x8B8D;
-
-  static const int CURRENT_VERTEX_ATTRIB = 0x8626;
-
-  static const int CW = 0x0900;
-
-  static const int DECR = 0x1E03;
-
-  static const int DECR_WRAP = 0x8508;
-
-  static const int DELETE_STATUS = 0x8B80;
-
-  static const int DEPTH_ATTACHMENT = 0x8D00;
-
-  static const int DEPTH_BITS = 0x0D56;
-
-  static const int DEPTH_BUFFER_BIT = 0x00000100;
-
-  static const int DEPTH_CLEAR_VALUE = 0x0B73;
-
-  static const int DEPTH_COMPONENT = 0x1902;
-
-  static const int DEPTH_COMPONENT16 = 0x81A5;
-
-  static const int DEPTH_FUNC = 0x0B74;
-
-  static const int DEPTH_RANGE = 0x0B70;
-
-  static const int DEPTH_STENCIL = 0x84F9;
-
-  static const int DEPTH_STENCIL_ATTACHMENT = 0x821A;
-
-  static const int DEPTH_TEST = 0x0B71;
-
-  static const int DEPTH_WRITEMASK = 0x0B72;
-
-  static const int DITHER = 0x0BD0;
-
-  static const int DONT_CARE = 0x1100;
-
-  static const int DST_ALPHA = 0x0304;
-
-  static const int DST_COLOR = 0x0306;
-
-  static const int DYNAMIC_DRAW = 0x88E8;
-
-  static const int ELEMENT_ARRAY_BUFFER = 0x8893;
-
-  static const int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
-
-  static const int EQUAL = 0x0202;
-
-  static const int FASTEST = 0x1101;
-
-  static const int FLOAT = 0x1406;
-
-  static const int FLOAT_MAT2 = 0x8B5A;
-
-  static const int FLOAT_MAT3 = 0x8B5B;
-
-  static const int FLOAT_MAT4 = 0x8B5C;
-
-  static const int FLOAT_VEC2 = 0x8B50;
-
-  static const int FLOAT_VEC3 = 0x8B51;
-
-  static const int FLOAT_VEC4 = 0x8B52;
-
-  static const int FRAGMENT_SHADER = 0x8B30;
-
-  static const int FRAMEBUFFER = 0x8D40;
-
-  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
-
-  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
-
-  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
-
-  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
-
-  static const int FRAMEBUFFER_BINDING = 0x8CA6;
-
-  static const int FRAMEBUFFER_COMPLETE = 0x8CD5;
-
-  static const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
-
-  static const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
-
-  static const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
-
-  static const int FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
-
-  static const int FRONT = 0x0404;
-
-  static const int FRONT_AND_BACK = 0x0408;
-
-  static const int FRONT_FACE = 0x0B46;
-
-  static const int FUNC_ADD = 0x8006;
-
-  static const int FUNC_REVERSE_SUBTRACT = 0x800B;
-
-  static const int FUNC_SUBTRACT = 0x800A;
-
-  static const int GENERATE_MIPMAP_HINT = 0x8192;
-
-  static const int GEQUAL = 0x0206;
-
-  static const int GREATER = 0x0204;
-
-  static const int GREEN_BITS = 0x0D53;
-
-  static const int HALF_FLOAT_OES = 0x8D61;
-
-  static const int HIGH_FLOAT = 0x8DF2;
-
-  static const int HIGH_INT = 0x8DF5;
-
-  static const int INCR = 0x1E02;
-
-  static const int INCR_WRAP = 0x8507;
-
-  static const int INT = 0x1404;
-
-  static const int INT_VEC2 = 0x8B53;
-
-  static const int INT_VEC3 = 0x8B54;
-
-  static const int INT_VEC4 = 0x8B55;
-
-  static const int INVALID_ENUM = 0x0500;
-
-  static const int INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
-  static const int INVALID_OPERATION = 0x0502;
-
-  static const int INVALID_VALUE = 0x0501;
-
-  static const int INVERT = 0x150A;
-
-  static const int KEEP = 0x1E00;
-
-  static const int LEQUAL = 0x0203;
-
-  static const int LESS = 0x0201;
-
-  static const int LINEAR = 0x2601;
-
-  static const int LINEAR_MIPMAP_LINEAR = 0x2703;
-
-  static const int LINEAR_MIPMAP_NEAREST = 0x2701;
-
-  static const int LINES = 0x0001;
-
-  static const int LINE_LOOP = 0x0002;
-
-  static const int LINE_STRIP = 0x0003;
-
-  static const int LINE_WIDTH = 0x0B21;
-
-  static const int LINK_STATUS = 0x8B82;
-
-  static const int LOW_FLOAT = 0x8DF0;
-
-  static const int LOW_INT = 0x8DF3;
-
-  static const int LUMINANCE = 0x1909;
-
-  static const int LUMINANCE_ALPHA = 0x190A;
-
-  static const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
-
-  static const int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
-
-  static const int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
-
-  static const int MAX_RENDERBUFFER_SIZE = 0x84E8;
-
-  static const int MAX_TEXTURE_IMAGE_UNITS = 0x8872;
-
-  static const int MAX_TEXTURE_SIZE = 0x0D33;
-
-  static const int MAX_VARYING_VECTORS = 0x8DFC;
-
-  static const int MAX_VERTEX_ATTRIBS = 0x8869;
-
-  static const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
-
-  static const int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
-
-  static const int MAX_VIEWPORT_DIMS = 0x0D3A;
-
-  static const int MEDIUM_FLOAT = 0x8DF1;
-
-  static const int MEDIUM_INT = 0x8DF4;
-
-  static const int MIRRORED_REPEAT = 0x8370;
-
-  static const int NEAREST = 0x2600;
-
-  static const int NEAREST_MIPMAP_LINEAR = 0x2702;
-
-  static const int NEAREST_MIPMAP_NEAREST = 0x2700;
-
-  static const int NEVER = 0x0200;
-
-  static const int NICEST = 0x1102;
-
-  static const int NONE = 0;
-
-  static const int NOTEQUAL = 0x0205;
-
-  static const int NO_ERROR = 0;
-
-  static const int ONE = 1;
-
-  static const int ONE_MINUS_CONSTANT_ALPHA = 0x8004;
-
-  static const int ONE_MINUS_CONSTANT_COLOR = 0x8002;
-
-  static const int ONE_MINUS_DST_ALPHA = 0x0305;
-
-  static const int ONE_MINUS_DST_COLOR = 0x0307;
-
-  static const int ONE_MINUS_SRC_ALPHA = 0x0303;
-
-  static const int ONE_MINUS_SRC_COLOR = 0x0301;
-
-  static const int OUT_OF_MEMORY = 0x0505;
-
-  static const int PACK_ALIGNMENT = 0x0D05;
-
-  static const int POINTS = 0x0000;
-
-  static const int POLYGON_OFFSET_FACTOR = 0x8038;
-
-  static const int POLYGON_OFFSET_FILL = 0x8037;
-
-  static const int POLYGON_OFFSET_UNITS = 0x2A00;
-
-  static const int RED_BITS = 0x0D52;
-
-  static const int RENDERBUFFER = 0x8D41;
-
-  static const int RENDERBUFFER_ALPHA_SIZE = 0x8D53;
-
-  static const int RENDERBUFFER_BINDING = 0x8CA7;
-
-  static const int RENDERBUFFER_BLUE_SIZE = 0x8D52;
-
-  static const int RENDERBUFFER_DEPTH_SIZE = 0x8D54;
-
-  static const int RENDERBUFFER_GREEN_SIZE = 0x8D51;
-
-  static const int RENDERBUFFER_HEIGHT = 0x8D43;
-
-  static const int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
-
-  static const int RENDERBUFFER_RED_SIZE = 0x8D50;
-
-  static const int RENDERBUFFER_STENCIL_SIZE = 0x8D55;
-
-  static const int RENDERBUFFER_WIDTH = 0x8D42;
-
-  static const int RENDERER = 0x1F01;
-
-  static const int REPEAT = 0x2901;
-
-  static const int REPLACE = 0x1E01;
-
-  static const int RGB = 0x1907;
-
-  static const int RGB565 = 0x8D62;
-
-  static const int RGB5_A1 = 0x8057;
-
-  static const int RGBA = 0x1908;
-
-  static const int RGBA4 = 0x8056;
-
-  static const int SAMPLER_2D = 0x8B5E;
-
-  static const int SAMPLER_CUBE = 0x8B60;
-
-  static const int SAMPLES = 0x80A9;
-
-  static const int SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
-
-  static const int SAMPLE_BUFFERS = 0x80A8;
-
-  static const int SAMPLE_COVERAGE = 0x80A0;
-
-  static const int SAMPLE_COVERAGE_INVERT = 0x80AB;
-
-  static const int SAMPLE_COVERAGE_VALUE = 0x80AA;
-
-  static const int SCISSOR_BOX = 0x0C10;
-
-  static const int SCISSOR_TEST = 0x0C11;
-
-  static const int SHADER_TYPE = 0x8B4F;
-
-  static const int SHADING_LANGUAGE_VERSION = 0x8B8C;
-
-  static const int SHORT = 0x1402;
-
-  static const int SRC_ALPHA = 0x0302;
-
-  static const int SRC_ALPHA_SATURATE = 0x0308;
-
-  static const int SRC_COLOR = 0x0300;
-
-  static const int STATIC_DRAW = 0x88E4;
-
-  static const int STENCIL_ATTACHMENT = 0x8D20;
-
-  static const int STENCIL_BACK_FAIL = 0x8801;
-
-  static const int STENCIL_BACK_FUNC = 0x8800;
-
-  static const int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
-
-  static const int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
-
-  static const int STENCIL_BACK_REF = 0x8CA3;
-
-  static const int STENCIL_BACK_VALUE_MASK = 0x8CA4;
-
-  static const int STENCIL_BACK_WRITEMASK = 0x8CA5;
-
-  static const int STENCIL_BITS = 0x0D57;
-
-  static const int STENCIL_BUFFER_BIT = 0x00000400;
-
-  static const int STENCIL_CLEAR_VALUE = 0x0B91;
-
-  static const int STENCIL_FAIL = 0x0B94;
-
-  static const int STENCIL_FUNC = 0x0B92;
-
-  static const int STENCIL_INDEX = 0x1901;
-
-  static const int STENCIL_INDEX8 = 0x8D48;
-
-  static const int STENCIL_PASS_DEPTH_FAIL = 0x0B95;
-
-  static const int STENCIL_PASS_DEPTH_PASS = 0x0B96;
-
-  static const int STENCIL_REF = 0x0B97;
-
-  static const int STENCIL_TEST = 0x0B90;
-
-  static const int STENCIL_VALUE_MASK = 0x0B93;
-
-  static const int STENCIL_WRITEMASK = 0x0B98;
-
-  static const int STREAM_DRAW = 0x88E0;
-
-  static const int SUBPIXEL_BITS = 0x0D50;
-
-  static const int TEXTURE = 0x1702;
-
-  static const int TEXTURE0 = 0x84C0;
-
-  static const int TEXTURE1 = 0x84C1;
-
-  static const int TEXTURE10 = 0x84CA;
-
-  static const int TEXTURE11 = 0x84CB;
-
-  static const int TEXTURE12 = 0x84CC;
-
-  static const int TEXTURE13 = 0x84CD;
-
-  static const int TEXTURE14 = 0x84CE;
-
-  static const int TEXTURE15 = 0x84CF;
-
-  static const int TEXTURE16 = 0x84D0;
-
-  static const int TEXTURE17 = 0x84D1;
-
-  static const int TEXTURE18 = 0x84D2;
-
-  static const int TEXTURE19 = 0x84D3;
-
-  static const int TEXTURE2 = 0x84C2;
-
-  static const int TEXTURE20 = 0x84D4;
-
-  static const int TEXTURE21 = 0x84D5;
-
-  static const int TEXTURE22 = 0x84D6;
-
-  static const int TEXTURE23 = 0x84D7;
-
-  static const int TEXTURE24 = 0x84D8;
-
-  static const int TEXTURE25 = 0x84D9;
-
-  static const int TEXTURE26 = 0x84DA;
-
-  static const int TEXTURE27 = 0x84DB;
-
-  static const int TEXTURE28 = 0x84DC;
-
-  static const int TEXTURE29 = 0x84DD;
-
-  static const int TEXTURE3 = 0x84C3;
-
-  static const int TEXTURE30 = 0x84DE;
-
-  static const int TEXTURE31 = 0x84DF;
-
-  static const int TEXTURE4 = 0x84C4;
-
-  static const int TEXTURE5 = 0x84C5;
-
-  static const int TEXTURE6 = 0x84C6;
-
-  static const int TEXTURE7 = 0x84C7;
-
-  static const int TEXTURE8 = 0x84C8;
-
-  static const int TEXTURE9 = 0x84C9;
-
-  static const int TEXTURE_2D = 0x0DE1;
-
-  static const int TEXTURE_BINDING_2D = 0x8069;
-
-  static const int TEXTURE_BINDING_CUBE_MAP = 0x8514;
-
-  static const int TEXTURE_CUBE_MAP = 0x8513;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
-
-  static const int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
-
-  static const int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
-
-  static const int TEXTURE_MAG_FILTER = 0x2800;
-
-  static const int TEXTURE_MIN_FILTER = 0x2801;
-
-  static const int TEXTURE_WRAP_S = 0x2802;
-
-  static const int TEXTURE_WRAP_T = 0x2803;
-
-  static const int TRIANGLES = 0x0004;
-
-  static const int TRIANGLE_FAN = 0x0006;
-
-  static const int TRIANGLE_STRIP = 0x0005;
-
-  static const int UNPACK_ALIGNMENT = 0x0CF5;
-
-  static const int UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
-
-  static const int UNPACK_FLIP_Y_WEBGL = 0x9240;
-
-  static const int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
-
-  static const int UNSIGNED_BYTE = 0x1401;
-
-  static const int UNSIGNED_INT = 0x1405;
-
-  static const int UNSIGNED_SHORT = 0x1403;
-
-  static const int UNSIGNED_SHORT_4_4_4_4 = 0x8033;
-
-  static const int UNSIGNED_SHORT_5_5_5_1 = 0x8034;
-
-  static const int UNSIGNED_SHORT_5_6_5 = 0x8363;
-
-  static const int VALIDATE_STATUS = 0x8B83;
-
-  static const int VENDOR = 0x1F00;
-
-  static const int VERSION = 0x1F02;
-
-  static const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
-
-  static const int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
-
-  static const int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
-
-  static const int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
-
-  static const int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
-
-  static const int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
-
-  static const int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
-
-  static const int VERTEX_SHADER = 0x8B31;
-
-  static const int VIEWPORT = 0x0BA2;
-
-  static const int ZERO = 0;
-
-  @DomName('WebGLRenderingContext.drawingBufferHeight')
-  @DocsEditable
-  int get drawingBufferHeight native "WebGLRenderingContext_drawingBufferHeight_Getter";
-
-  @DomName('WebGLRenderingContext.drawingBufferWidth')
-  @DocsEditable
-  int get drawingBufferWidth native "WebGLRenderingContext_drawingBufferWidth_Getter";
-
-  @DomName('WebGLRenderingContext.activeTexture')
-  @DocsEditable
-  void activeTexture(int texture) native "WebGLRenderingContext_activeTexture_Callback";
-
-  @DomName('WebGLRenderingContext.attachShader')
-  @DocsEditable
-  void attachShader(WebGLProgram program, WebGLShader shader) native "WebGLRenderingContext_attachShader_Callback";
-
-  @DomName('WebGLRenderingContext.bindAttribLocation')
-  @DocsEditable
-  void bindAttribLocation(WebGLProgram program, int index, String name) native "WebGLRenderingContext_bindAttribLocation_Callback";
-
-  @DomName('WebGLRenderingContext.bindBuffer')
-  @DocsEditable
-  void bindBuffer(int target, WebGLBuffer buffer) native "WebGLRenderingContext_bindBuffer_Callback";
-
-  @DomName('WebGLRenderingContext.bindFramebuffer')
-  @DocsEditable
-  void bindFramebuffer(int target, WebGLFramebuffer framebuffer) native "WebGLRenderingContext_bindFramebuffer_Callback";
-
-  @DomName('WebGLRenderingContext.bindRenderbuffer')
-  @DocsEditable
-  void bindRenderbuffer(int target, WebGLRenderbuffer renderbuffer) native "WebGLRenderingContext_bindRenderbuffer_Callback";
-
-  @DomName('WebGLRenderingContext.bindTexture')
-  @DocsEditable
-  void bindTexture(int target, WebGLTexture texture) native "WebGLRenderingContext_bindTexture_Callback";
-
-  @DomName('WebGLRenderingContext.blendColor')
-  @DocsEditable
-  void blendColor(num red, num green, num blue, num alpha) native "WebGLRenderingContext_blendColor_Callback";
-
-  @DomName('WebGLRenderingContext.blendEquation')
-  @DocsEditable
-  void blendEquation(int mode) native "WebGLRenderingContext_blendEquation_Callback";
-
-  @DomName('WebGLRenderingContext.blendEquationSeparate')
-  @DocsEditable
-  void blendEquationSeparate(int modeRGB, int modeAlpha) native "WebGLRenderingContext_blendEquationSeparate_Callback";
-
-  @DomName('WebGLRenderingContext.blendFunc')
-  @DocsEditable
-  void blendFunc(int sfactor, int dfactor) native "WebGLRenderingContext_blendFunc_Callback";
-
-  @DomName('WebGLRenderingContext.blendFuncSeparate')
-  @DocsEditable
-  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)) {
-      _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)) {
-      _bufferData_2(target, data_OR_size, usage);
-      return;
-    }
-    if ((target is int || target == null) && (data_OR_size is int || data_OR_size == null) && (usage is int || usage == null)) {
-      _bufferData_3(target, data_OR_size, usage);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @DomName('WebGLRenderingContext._bufferData_1')
-  @DocsEditable
-  void _bufferData_1(target, data_OR_size, usage) native "WebGLRenderingContext__bufferData_1_Callback";
-
-  @DomName('WebGLRenderingContext._bufferData_2')
-  @DocsEditable
-  void _bufferData_2(target, data_OR_size, usage) native "WebGLRenderingContext__bufferData_2_Callback";
-
-  @DomName('WebGLRenderingContext._bufferData_3')
-  @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)) {
-      _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)) {
-      _bufferSubData_2(target, offset, data);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @DomName('WebGLRenderingContext._bufferSubData_1')
-  @DocsEditable
-  void _bufferSubData_1(target, offset, data) native "WebGLRenderingContext__bufferSubData_1_Callback";
-
-  @DomName('WebGLRenderingContext._bufferSubData_2')
-  @DocsEditable
-  void _bufferSubData_2(target, offset, data) native "WebGLRenderingContext__bufferSubData_2_Callback";
-
-  @DomName('WebGLRenderingContext.checkFramebufferStatus')
-  @DocsEditable
-  int checkFramebufferStatus(int target) native "WebGLRenderingContext_checkFramebufferStatus_Callback";
-
-  @DomName('WebGLRenderingContext.clear')
-  @DocsEditable
-  void clear(int mask) native "WebGLRenderingContext_clear_Callback";
-
-  @DomName('WebGLRenderingContext.clearColor')
-  @DocsEditable
-  void clearColor(num red, num green, num blue, num alpha) native "WebGLRenderingContext_clearColor_Callback";
-
-  @DomName('WebGLRenderingContext.clearDepth')
-  @DocsEditable
-  void clearDepth(num depth) native "WebGLRenderingContext_clearDepth_Callback";
-
-  @DomName('WebGLRenderingContext.clearStencil')
-  @DocsEditable
-  void clearStencil(int s) native "WebGLRenderingContext_clearStencil_Callback";
-
-  @DomName('WebGLRenderingContext.colorMask')
-  @DocsEditable
-  void colorMask(bool red, bool green, bool blue, bool alpha) native "WebGLRenderingContext_colorMask_Callback";
-
-  @DomName('WebGLRenderingContext.compileShader')
-  @DocsEditable
-  void compileShader(WebGLShader shader) native "WebGLRenderingContext_compileShader_Callback";
-
-  @DomName('WebGLRenderingContext.compressedTexImage2D')
-  @DocsEditable
-  void compressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, /*ArrayBufferView*/ 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";
-
-  @DomName('WebGLRenderingContext.copyTexImage2D')
-  @DocsEditable
-  void copyTexImage2D(int target, int level, int internalformat, int x, int y, int width, int height, int border) native "WebGLRenderingContext_copyTexImage2D_Callback";
-
-  @DomName('WebGLRenderingContext.copyTexSubImage2D')
-  @DocsEditable
-  void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) native "WebGLRenderingContext_copyTexSubImage2D_Callback";
-
-  @DomName('WebGLRenderingContext.createBuffer')
-  @DocsEditable
-  WebGLBuffer createBuffer() native "WebGLRenderingContext_createBuffer_Callback";
-
-  @DomName('WebGLRenderingContext.createFramebuffer')
-  @DocsEditable
-  WebGLFramebuffer createFramebuffer() native "WebGLRenderingContext_createFramebuffer_Callback";
-
-  @DomName('WebGLRenderingContext.createProgram')
-  @DocsEditable
-  WebGLProgram createProgram() native "WebGLRenderingContext_createProgram_Callback";
-
-  @DomName('WebGLRenderingContext.createRenderbuffer')
-  @DocsEditable
-  WebGLRenderbuffer createRenderbuffer() native "WebGLRenderingContext_createRenderbuffer_Callback";
-
-  @DomName('WebGLRenderingContext.createShader')
-  @DocsEditable
-  WebGLShader createShader(int type) native "WebGLRenderingContext_createShader_Callback";
-
-  @DomName('WebGLRenderingContext.createTexture')
-  @DocsEditable
-  WebGLTexture createTexture() native "WebGLRenderingContext_createTexture_Callback";
-
-  @DomName('WebGLRenderingContext.cullFace')
-  @DocsEditable
-  void cullFace(int mode) native "WebGLRenderingContext_cullFace_Callback";
-
-  @DomName('WebGLRenderingContext.deleteBuffer')
-  @DocsEditable
-  void deleteBuffer(WebGLBuffer buffer) native "WebGLRenderingContext_deleteBuffer_Callback";
-
-  @DomName('WebGLRenderingContext.deleteFramebuffer')
-  @DocsEditable
-  void deleteFramebuffer(WebGLFramebuffer framebuffer) native "WebGLRenderingContext_deleteFramebuffer_Callback";
-
-  @DomName('WebGLRenderingContext.deleteProgram')
-  @DocsEditable
-  void deleteProgram(WebGLProgram program) native "WebGLRenderingContext_deleteProgram_Callback";
-
-  @DomName('WebGLRenderingContext.deleteRenderbuffer')
-  @DocsEditable
-  void deleteRenderbuffer(WebGLRenderbuffer renderbuffer) native "WebGLRenderingContext_deleteRenderbuffer_Callback";
-
-  @DomName('WebGLRenderingContext.deleteShader')
-  @DocsEditable
-  void deleteShader(WebGLShader shader) native "WebGLRenderingContext_deleteShader_Callback";
-
-  @DomName('WebGLRenderingContext.deleteTexture')
-  @DocsEditable
-  void deleteTexture(WebGLTexture texture) native "WebGLRenderingContext_deleteTexture_Callback";
-
-  @DomName('WebGLRenderingContext.depthFunc')
-  @DocsEditable
-  void depthFunc(int func) native "WebGLRenderingContext_depthFunc_Callback";
-
-  @DomName('WebGLRenderingContext.depthMask')
-  @DocsEditable
-  void depthMask(bool flag) native "WebGLRenderingContext_depthMask_Callback";
-
-  @DomName('WebGLRenderingContext.depthRange')
-  @DocsEditable
-  void depthRange(num zNear, num zFar) native "WebGLRenderingContext_depthRange_Callback";
-
-  @DomName('WebGLRenderingContext.detachShader')
-  @DocsEditable
-  void detachShader(WebGLProgram program, WebGLShader shader) native "WebGLRenderingContext_detachShader_Callback";
-
-  @DomName('WebGLRenderingContext.disable')
-  @DocsEditable
-  void disable(int cap) native "WebGLRenderingContext_disable_Callback";
-
-  @DomName('WebGLRenderingContext.disableVertexAttribArray')
-  @DocsEditable
-  void disableVertexAttribArray(int index) native "WebGLRenderingContext_disableVertexAttribArray_Callback";
-
-  @DomName('WebGLRenderingContext.drawArrays')
-  @DocsEditable
-  void drawArrays(int mode, int first, int count) native "WebGLRenderingContext_drawArrays_Callback";
-
-  @DomName('WebGLRenderingContext.drawElements')
-  @DocsEditable
-  void drawElements(int mode, int count, int type, int offset) native "WebGLRenderingContext_drawElements_Callback";
-
-  @DomName('WebGLRenderingContext.enable')
-  @DocsEditable
-  void enable(int cap) native "WebGLRenderingContext_enable_Callback";
-
-  @DomName('WebGLRenderingContext.enableVertexAttribArray')
-  @DocsEditable
-  void enableVertexAttribArray(int index) native "WebGLRenderingContext_enableVertexAttribArray_Callback";
-
-  @DomName('WebGLRenderingContext.finish')
-  @DocsEditable
-  void finish() native "WebGLRenderingContext_finish_Callback";
-
-  @DomName('WebGLRenderingContext.flush')
-  @DocsEditable
-  void flush() native "WebGLRenderingContext_flush_Callback";
-
-  @DomName('WebGLRenderingContext.framebufferRenderbuffer')
-  @DocsEditable
-  void framebufferRenderbuffer(int target, int attachment, int renderbuffertarget, WebGLRenderbuffer renderbuffer) native "WebGLRenderingContext_framebufferRenderbuffer_Callback";
-
-  @DomName('WebGLRenderingContext.framebufferTexture2D')
-  @DocsEditable
-  void framebufferTexture2D(int target, int attachment, int textarget, WebGLTexture texture, int level) native "WebGLRenderingContext_framebufferTexture2D_Callback";
-
-  @DomName('WebGLRenderingContext.frontFace')
-  @DocsEditable
-  void frontFace(int mode) native "WebGLRenderingContext_frontFace_Callback";
-
-  @DomName('WebGLRenderingContext.generateMipmap')
-  @DocsEditable
-  void generateMipmap(int target) native "WebGLRenderingContext_generateMipmap_Callback";
-
-  @DomName('WebGLRenderingContext.getActiveAttrib')
-  @DocsEditable
-  WebGLActiveInfo getActiveAttrib(WebGLProgram program, int index) native "WebGLRenderingContext_getActiveAttrib_Callback";
-
-  @DomName('WebGLRenderingContext.getActiveUniform')
-  @DocsEditable
-  WebGLActiveInfo getActiveUniform(WebGLProgram program, int index) native "WebGLRenderingContext_getActiveUniform_Callback";
-
-  @DomName('WebGLRenderingContext.getAttachedShaders')
-  @DocsEditable
-  void getAttachedShaders(WebGLProgram program) native "WebGLRenderingContext_getAttachedShaders_Callback";
-
-  @DomName('WebGLRenderingContext.getAttribLocation')
-  @DocsEditable
-  int getAttribLocation(WebGLProgram program, String name) native "WebGLRenderingContext_getAttribLocation_Callback";
-
-  @DomName('WebGLRenderingContext.getBufferParameter')
-  @DocsEditable
-  Object getBufferParameter(int target, int pname) native "WebGLRenderingContext_getBufferParameter_Callback";
-
-  @DomName('WebGLRenderingContext.getContextAttributes')
-  @DocsEditable
-  WebGLContextAttributes getContextAttributes() native "WebGLRenderingContext_getContextAttributes_Callback";
-
-  @DomName('WebGLRenderingContext.getError')
-  @DocsEditable
-  int getError() native "WebGLRenderingContext_getError_Callback";
-
-  @DomName('WebGLRenderingContext.getExtension')
-  @DocsEditable
-  Object getExtension(String name) native "WebGLRenderingContext_getExtension_Callback";
-
-  @DomName('WebGLRenderingContext.getFramebufferAttachmentParameter')
-  @DocsEditable
-  Object getFramebufferAttachmentParameter(int target, int attachment, int pname) native "WebGLRenderingContext_getFramebufferAttachmentParameter_Callback";
-
-  @DomName('WebGLRenderingContext.getParameter')
-  @DocsEditable
-  Object getParameter(int pname) native "WebGLRenderingContext_getParameter_Callback";
-
-  @DomName('WebGLRenderingContext.getProgramInfoLog')
-  @DocsEditable
-  String getProgramInfoLog(WebGLProgram program) native "WebGLRenderingContext_getProgramInfoLog_Callback";
-
-  @DomName('WebGLRenderingContext.getProgramParameter')
-  @DocsEditable
-  Object getProgramParameter(WebGLProgram program, int pname) native "WebGLRenderingContext_getProgramParameter_Callback";
-
-  @DomName('WebGLRenderingContext.getRenderbufferParameter')
-  @DocsEditable
-  Object getRenderbufferParameter(int target, int pname) native "WebGLRenderingContext_getRenderbufferParameter_Callback";
-
-  @DomName('WebGLRenderingContext.getShaderInfoLog')
-  @DocsEditable
-  String getShaderInfoLog(WebGLShader shader) native "WebGLRenderingContext_getShaderInfoLog_Callback";
-
-  @DomName('WebGLRenderingContext.getShaderParameter')
-  @DocsEditable
-  Object getShaderParameter(WebGLShader shader, int pname) native "WebGLRenderingContext_getShaderParameter_Callback";
-
-  @DomName('WebGLRenderingContext.getShaderPrecisionFormat')
-  @DocsEditable
-  WebGLShaderPrecisionFormat getShaderPrecisionFormat(int shadertype, int precisiontype) native "WebGLRenderingContext_getShaderPrecisionFormat_Callback";
-
-  @DomName('WebGLRenderingContext.getShaderSource')
-  @DocsEditable
-  String getShaderSource(WebGLShader shader) native "WebGLRenderingContext_getShaderSource_Callback";
-
-  @DomName('WebGLRenderingContext.getSupportedExtensions')
-  @DocsEditable
-  List<String> getSupportedExtensions() native "WebGLRenderingContext_getSupportedExtensions_Callback";
-
-  @DomName('WebGLRenderingContext.getTexParameter')
-  @DocsEditable
-  Object getTexParameter(int target, int pname) native "WebGLRenderingContext_getTexParameter_Callback";
-
-  @DomName('WebGLRenderingContext.getUniform')
-  @DocsEditable
-  Object getUniform(WebGLProgram program, WebGLUniformLocation location) native "WebGLRenderingContext_getUniform_Callback";
-
-  @DomName('WebGLRenderingContext.getUniformLocation')
-  @DocsEditable
-  WebGLUniformLocation getUniformLocation(WebGLProgram program, String name) native "WebGLRenderingContext_getUniformLocation_Callback";
-
-  @DomName('WebGLRenderingContext.getVertexAttrib')
-  @DocsEditable
-  Object getVertexAttrib(int index, int pname) native "WebGLRenderingContext_getVertexAttrib_Callback";
-
-  @DomName('WebGLRenderingContext.getVertexAttribOffset')
-  @DocsEditable
-  int getVertexAttribOffset(int index, int pname) native "WebGLRenderingContext_getVertexAttribOffset_Callback";
-
-  @DomName('WebGLRenderingContext.hint')
-  @DocsEditable
-  void hint(int target, int mode) native "WebGLRenderingContext_hint_Callback";
-
-  @DomName('WebGLRenderingContext.isBuffer')
-  @DocsEditable
-  bool isBuffer(WebGLBuffer buffer) native "WebGLRenderingContext_isBuffer_Callback";
-
-  @DomName('WebGLRenderingContext.isContextLost')
-  @DocsEditable
-  bool isContextLost() native "WebGLRenderingContext_isContextLost_Callback";
-
-  @DomName('WebGLRenderingContext.isEnabled')
-  @DocsEditable
-  bool isEnabled(int cap) native "WebGLRenderingContext_isEnabled_Callback";
-
-  @DomName('WebGLRenderingContext.isFramebuffer')
-  @DocsEditable
-  bool isFramebuffer(WebGLFramebuffer framebuffer) native "WebGLRenderingContext_isFramebuffer_Callback";
-
-  @DomName('WebGLRenderingContext.isProgram')
-  @DocsEditable
-  bool isProgram(WebGLProgram program) native "WebGLRenderingContext_isProgram_Callback";
-
-  @DomName('WebGLRenderingContext.isRenderbuffer')
-  @DocsEditable
-  bool isRenderbuffer(WebGLRenderbuffer renderbuffer) native "WebGLRenderingContext_isRenderbuffer_Callback";
-
-  @DomName('WebGLRenderingContext.isShader')
-  @DocsEditable
-  bool isShader(WebGLShader shader) native "WebGLRenderingContext_isShader_Callback";
-
-  @DomName('WebGLRenderingContext.isTexture')
-  @DocsEditable
-  bool isTexture(WebGLTexture texture) native "WebGLRenderingContext_isTexture_Callback";
-
-  @DomName('WebGLRenderingContext.lineWidth')
-  @DocsEditable
-  void lineWidth(num width) native "WebGLRenderingContext_lineWidth_Callback";
-
-  @DomName('WebGLRenderingContext.linkProgram')
-  @DocsEditable
-  void linkProgram(WebGLProgram program) native "WebGLRenderingContext_linkProgram_Callback";
-
-  @DomName('WebGLRenderingContext.pixelStorei')
-  @DocsEditable
-  void pixelStorei(int pname, int param) native "WebGLRenderingContext_pixelStorei_Callback";
-
-  @DomName('WebGLRenderingContext.polygonOffset')
-  @DocsEditable
-  void polygonOffset(num factor, num units) native "WebGLRenderingContext_polygonOffset_Callback";
-
-  @DomName('WebGLRenderingContext.readPixels')
-  @DocsEditable
-  void readPixels(int x, int y, int width, int height, int format, int type, /*ArrayBufferView*/ pixels) native "WebGLRenderingContext_readPixels_Callback";
-
-  @DomName('WebGLRenderingContext.releaseShaderCompiler')
-  @DocsEditable
-  void releaseShaderCompiler() native "WebGLRenderingContext_releaseShaderCompiler_Callback";
-
-  @DomName('WebGLRenderingContext.renderbufferStorage')
-  @DocsEditable
-  void renderbufferStorage(int target, int internalformat, int width, int height) native "WebGLRenderingContext_renderbufferStorage_Callback";
-
-  @DomName('WebGLRenderingContext.sampleCoverage')
-  @DocsEditable
-  void sampleCoverage(num value, bool invert) native "WebGLRenderingContext_sampleCoverage_Callback";
-
-  @DomName('WebGLRenderingContext.scissor')
-  @DocsEditable
-  void scissor(int x, int y, int width, int height) native "WebGLRenderingContext_scissor_Callback";
-
-  @DomName('WebGLRenderingContext.shaderSource')
-  @DocsEditable
-  void shaderSource(WebGLShader shader, String string) native "WebGLRenderingContext_shaderSource_Callback";
-
-  @DomName('WebGLRenderingContext.stencilFunc')
-  @DocsEditable
-  void stencilFunc(int func, int ref, int mask) native "WebGLRenderingContext_stencilFunc_Callback";
-
-  @DomName('WebGLRenderingContext.stencilFuncSeparate')
-  @DocsEditable
-  void stencilFuncSeparate(int face, int func, int ref, int mask) native "WebGLRenderingContext_stencilFuncSeparate_Callback";
-
-  @DomName('WebGLRenderingContext.stencilMask')
-  @DocsEditable
-  void stencilMask(int mask) native "WebGLRenderingContext_stencilMask_Callback";
-
-  @DomName('WebGLRenderingContext.stencilMaskSeparate')
-  @DocsEditable
-  void stencilMaskSeparate(int face, int mask) native "WebGLRenderingContext_stencilMaskSeparate_Callback";
-
-  @DomName('WebGLRenderingContext.stencilOp')
-  @DocsEditable
-  void stencilOp(int fail, int zfail, int zpass) native "WebGLRenderingContext_stencilOp_Callback";
-
-  @DomName('WebGLRenderingContext.stencilOpSeparate')
-  @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)) {
-      _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
-      return;
-    }
-    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 ImageData || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
-      _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    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 ImageElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
-      _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    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 CanvasElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
-      _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    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 VideoElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
-      _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @DomName('WebGLRenderingContext._texImage2D_1')
-  @DocsEditable
-  void _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels) native "WebGLRenderingContext__texImage2D_1_Callback";
-
-  @DomName('WebGLRenderingContext._texImage2D_2')
-  @DocsEditable
-  void _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texImage2D_2_Callback";
-
-  @DomName('WebGLRenderingContext._texImage2D_3')
-  @DocsEditable
-  void _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texImage2D_3_Callback";
-
-  @DomName('WebGLRenderingContext._texImage2D_4')
-  @DocsEditable
-  void _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texImage2D_4_Callback";
-
-  @DomName('WebGLRenderingContext._texImage2D_5')
-  @DocsEditable
-  void _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texImage2D_5_Callback";
-
-  @DomName('WebGLRenderingContext.texParameterf')
-  @DocsEditable
-  void texParameterf(int target, int pname, num param) native "WebGLRenderingContext_texParameterf_Callback";
-
-  @DomName('WebGLRenderingContext.texParameteri')
-  @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)) {
-      _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
-      return;
-    }
-    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 ImageData || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
-      _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    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 ImageElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
-      _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    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 CanvasElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
-      _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    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 VideoElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
-      _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
-      return;
-    }
-    throw new ArgumentError("Incorrect number or type of arguments");
-  }
-
-  @DomName('WebGLRenderingContext._texSubImage2D_1')
-  @DocsEditable
-  void _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels) native "WebGLRenderingContext__texSubImage2D_1_Callback";
-
-  @DomName('WebGLRenderingContext._texSubImage2D_2')
-  @DocsEditable
-  void _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texSubImage2D_2_Callback";
-
-  @DomName('WebGLRenderingContext._texSubImage2D_3')
-  @DocsEditable
-  void _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texSubImage2D_3_Callback";
-
-  @DomName('WebGLRenderingContext._texSubImage2D_4')
-  @DocsEditable
-  void _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texSubImage2D_4_Callback";
-
-  @DomName('WebGLRenderingContext._texSubImage2D_5')
-  @DocsEditable
-  void _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texSubImage2D_5_Callback";
-
-  @DomName('WebGLRenderingContext.uniform1f')
-  @DocsEditable
-  void uniform1f(WebGLUniformLocation location, num x) native "WebGLRenderingContext_uniform1f_Callback";
-
-  @DomName('WebGLRenderingContext.uniform1fv')
-  @DocsEditable
-  void uniform1fv(WebGLUniformLocation location, List<double> v) native "WebGLRenderingContext_uniform1fv_Callback";
-
-  @DomName('WebGLRenderingContext.uniform1i')
-  @DocsEditable
-  void uniform1i(WebGLUniformLocation location, int x) native "WebGLRenderingContext_uniform1i_Callback";
-
-  @DomName('WebGLRenderingContext.uniform1iv')
-  @DocsEditable
-  void uniform1iv(WebGLUniformLocation location, List<int> v) native "WebGLRenderingContext_uniform1iv_Callback";
-
-  @DomName('WebGLRenderingContext.uniform2f')
-  @DocsEditable
-  void uniform2f(WebGLUniformLocation location, num x, num y) native "WebGLRenderingContext_uniform2f_Callback";
-
-  @DomName('WebGLRenderingContext.uniform2fv')
-  @DocsEditable
-  void uniform2fv(WebGLUniformLocation location, List<double> v) native "WebGLRenderingContext_uniform2fv_Callback";
-
-  @DomName('WebGLRenderingContext.uniform2i')
-  @DocsEditable
-  void uniform2i(WebGLUniformLocation location, int x, int y) native "WebGLRenderingContext_uniform2i_Callback";
-
-  @DomName('WebGLRenderingContext.uniform2iv')
-  @DocsEditable
-  void uniform2iv(WebGLUniformLocation location, List<int> v) native "WebGLRenderingContext_uniform2iv_Callback";
-
-  @DomName('WebGLRenderingContext.uniform3f')
-  @DocsEditable
-  void uniform3f(WebGLUniformLocation location, num x, num y, num z) native "WebGLRenderingContext_uniform3f_Callback";
-
-  @DomName('WebGLRenderingContext.uniform3fv')
-  @DocsEditable
-  void uniform3fv(WebGLUniformLocation location, List<double> v) native "WebGLRenderingContext_uniform3fv_Callback";
-
-  @DomName('WebGLRenderingContext.uniform3i')
-  @DocsEditable
-  void uniform3i(WebGLUniformLocation location, int x, int y, int z) native "WebGLRenderingContext_uniform3i_Callback";
-
-  @DomName('WebGLRenderingContext.uniform3iv')
-  @DocsEditable
-  void uniform3iv(WebGLUniformLocation location, List<int> v) native "WebGLRenderingContext_uniform3iv_Callback";
-
-  @DomName('WebGLRenderingContext.uniform4f')
-  @DocsEditable
-  void uniform4f(WebGLUniformLocation location, num x, num y, num z, num w) native "WebGLRenderingContext_uniform4f_Callback";
-
-  @DomName('WebGLRenderingContext.uniform4fv')
-  @DocsEditable
-  void uniform4fv(WebGLUniformLocation location, List<double> v) native "WebGLRenderingContext_uniform4fv_Callback";
-
-  @DomName('WebGLRenderingContext.uniform4i')
-  @DocsEditable
-  void uniform4i(WebGLUniformLocation location, int x, int y, int z, int w) native "WebGLRenderingContext_uniform4i_Callback";
-
-  @DomName('WebGLRenderingContext.uniform4iv')
-  @DocsEditable
-  void uniform4iv(WebGLUniformLocation location, List<int> v) native "WebGLRenderingContext_uniform4iv_Callback";
-
-  @DomName('WebGLRenderingContext.uniformMatrix2fv')
-  @DocsEditable
-  void uniformMatrix2fv(WebGLUniformLocation location, bool transpose, List<double> array) native "WebGLRenderingContext_uniformMatrix2fv_Callback";
-
-  @DomName('WebGLRenderingContext.uniformMatrix3fv')
-  @DocsEditable
-  void uniformMatrix3fv(WebGLUniformLocation location, bool transpose, List<double> array) native "WebGLRenderingContext_uniformMatrix3fv_Callback";
-
-  @DomName('WebGLRenderingContext.uniformMatrix4fv')
-  @DocsEditable
-  void uniformMatrix4fv(WebGLUniformLocation location, bool transpose, List<double> array) native "WebGLRenderingContext_uniformMatrix4fv_Callback";
-
-  @DomName('WebGLRenderingContext.useProgram')
-  @DocsEditable
-  void useProgram(WebGLProgram program) native "WebGLRenderingContext_useProgram_Callback";
-
-  @DomName('WebGLRenderingContext.validateProgram')
-  @DocsEditable
-  void validateProgram(WebGLProgram program) native "WebGLRenderingContext_validateProgram_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttrib1f')
-  @DocsEditable
-  void vertexAttrib1f(int indx, num x) native "WebGLRenderingContext_vertexAttrib1f_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttrib1fv')
-  @DocsEditable
-  void vertexAttrib1fv(int indx, List<double> values) native "WebGLRenderingContext_vertexAttrib1fv_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttrib2f')
-  @DocsEditable
-  void vertexAttrib2f(int indx, num x, num y) native "WebGLRenderingContext_vertexAttrib2f_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttrib2fv')
-  @DocsEditable
-  void vertexAttrib2fv(int indx, List<double> values) native "WebGLRenderingContext_vertexAttrib2fv_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttrib3f')
-  @DocsEditable
-  void vertexAttrib3f(int indx, num x, num y, num z) native "WebGLRenderingContext_vertexAttrib3f_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttrib3fv')
-  @DocsEditable
-  void vertexAttrib3fv(int indx, List<double> values) native "WebGLRenderingContext_vertexAttrib3fv_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttrib4f')
-  @DocsEditable
-  void vertexAttrib4f(int indx, num x, num y, num z, num w) native "WebGLRenderingContext_vertexAttrib4f_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttrib4fv')
-  @DocsEditable
-  void vertexAttrib4fv(int indx, List<double> values) native "WebGLRenderingContext_vertexAttrib4fv_Callback";
-
-  @DomName('WebGLRenderingContext.vertexAttribPointer')
-  @DocsEditable
-  void vertexAttribPointer(int indx, int size, int type, bool normalized, int stride, int offset) native "WebGLRenderingContext_vertexAttribPointer_Callback";
-
-  @DomName('WebGLRenderingContext.viewport')
-  @DocsEditable
-  void viewport(int x, int y, int width, int height) native "WebGLRenderingContext_viewport_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('WebGLShader')
-class WebGLShader extends NativeFieldWrapperClass1 {
-  WebGLShader.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('WebGLShaderPrecisionFormat')
-class WebGLShaderPrecisionFormat extends NativeFieldWrapperClass1 {
-  WebGLShaderPrecisionFormat.internal();
-
-  @DomName('WebGLShaderPrecisionFormat.precision')
-  @DocsEditable
-  int get precision native "WebGLShaderPrecisionFormat_precision_Getter";
-
-  @DomName('WebGLShaderPrecisionFormat.rangeMax')
-  @DocsEditable
-  int get rangeMax native "WebGLShaderPrecisionFormat_rangeMax_Getter";
-
-  @DomName('WebGLShaderPrecisionFormat.rangeMin')
-  @DocsEditable
-  int get rangeMin native "WebGLShaderPrecisionFormat_rangeMin_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('WebGLTexture')
-class WebGLTexture extends NativeFieldWrapperClass1 {
-  WebGLTexture.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('WebGLUniformLocation')
-class WebGLUniformLocation extends NativeFieldWrapperClass1 {
-  WebGLUniformLocation.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
-@DomName('WebGLVertexArrayObjectOES')
-class WebGLVertexArrayObject extends NativeFieldWrapperClass1 {
-  WebGLVertexArrayObject.internal();
-
-}
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DocsEditable
 @DomName('WebKitCSSFilterRule')
 class WebKitCssFilterRule extends CssRule {
   WebKitCssFilterRule.internal() : super.internal();
@@ -28815,6 +27004,10 @@
       eventType = 'MouseScrollEvents';
     }
     final event = document.$dom_createEvent(eventType);
+    // Dartium always needs these flipped because we're essentially always
+    // polyfilling (see similar dart2js code as well)
+    deltaX = -deltaX;
+    deltaY = -deltaY;
       // Fallthrough for Dartium.
       event.$dom_initMouseEvent(type, canBubble, cancelable, view, detail,
           screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
@@ -28859,10 +27052,27 @@
   void $dom_initWebKitWheelEvent(int wheelDeltaX, int wheelDeltaY, Window view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native "WheelEvent_initWebKitWheelEvent_Callback";
 
 
+  /**
+   * The amount that is expected to scroll horizontally, in units determined by
+   * [deltaMode].
+   *
+   * See also:
+   *
+   * * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
+   */
   @DomName('WheelEvent.deltaX')
-  num get deltaX => $dom_wheelDeltaX;
+  num get deltaX => -$dom_wheelDeltaX;
+
+  /**
+   * The amount that is expected to scroll vertically, in units determined by
+   * [deltaMode].
+   *
+   * See also:
+   *
+   * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
+   */
   @DomName('WheelEvent.deltaY')
-  num get deltaY => $dom_wheelDeltaY;
+  num get deltaY => -$dom_wheelDeltaY;
 }
 // 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
@@ -30388,6 +28598,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Rect)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Rect element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Rect element)) => IterableMixinWorkaround.forEach(this, f);
@@ -30449,10 +28663,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Rect value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Rect> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -30603,6 +28813,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, CssRule)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(CssRule element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(CssRule element)) => IterableMixinWorkaround.forEach(this, f);
@@ -30664,10 +28878,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(CssRule value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<CssRule> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -30818,6 +29028,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, CssValue)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(CssValue element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(CssValue element)) => IterableMixinWorkaround.forEach(this, f);
@@ -30879,10 +29093,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(CssValue value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<CssValue> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -31176,6 +29386,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Entry)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Entry element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Entry element)) => IterableMixinWorkaround.forEach(this, f);
@@ -31237,10 +29451,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Entry value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Entry> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -31391,6 +29601,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, EntrySync)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(EntrySync element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(EntrySync element)) => IterableMixinWorkaround.forEach(this, f);
@@ -31452,10 +29666,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(EntrySync value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<EntrySync> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -31606,6 +29816,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Gamepad)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Gamepad element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Gamepad element)) => IterableMixinWorkaround.forEach(this, f);
@@ -31667,10 +29881,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Gamepad value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Gamepad> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -31912,6 +30122,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Node)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
@@ -31973,10 +30187,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Node value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Node> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -32151,6 +30361,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, SpeechInputResult)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(SpeechInputResult element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(SpeechInputResult element)) => IterableMixinWorkaround.forEach(this, f);
@@ -32212,10 +30426,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(SpeechInputResult value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<SpeechInputResult> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -32366,6 +30576,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, SpeechRecognitionResult)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(SpeechRecognitionResult element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(SpeechRecognitionResult element)) => IterableMixinWorkaround.forEach(this, f);
@@ -32427,10 +30641,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(SpeechRecognitionResult value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<SpeechRecognitionResult> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -32581,6 +30791,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, StyleSheet)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(StyleSheet element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(StyleSheet element)) => IterableMixinWorkaround.forEach(this, f);
@@ -32642,10 +30856,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(StyleSheet value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<StyleSheet> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -33229,6 +31439,11 @@
       dynamic combine(dynamic previousValue, String element)) {
     return readClasses().reduce(initialValue, combine);
   }
+
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, String element)) {
+    return readClasses().fold(initialValue, combine);
+  }
   // interface Collection - END
 
   // interface Set - BEGIN
@@ -33432,9 +31647,7 @@
   }
 
   void cancel() {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_canceled) return;
 
     _unlisten();
     // Clear out the target to indicate this is complete.
@@ -33462,9 +31675,7 @@
   void onDone(void handleDone()) {}
 
   void pause([Future resumeSignal]) {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_canceled) return;
     ++_pauseCount;
     _unlisten();
 
@@ -33476,12 +31687,7 @@
   bool get _paused => _pauseCount > 0;
 
   void resume() {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
-    if (!_paused) {
-      throw new StateError("Subscription is not paused.");
-    }
+    if (_canceled || !_paused) return;
     --_pauseCount;
     _tryResume();
   }
@@ -35048,68 +33254,6 @@
   Point get bottomRight => new Point(this.left + this.width,
       this.top + this.height);
 }
-// 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.
-
-
-// TODO(antonm): support not DOM isolates too.
-class _Timer implements Timer {
-  final canceller;
-
-  _Timer(this.canceller);
-
-  void cancel() { canceller(); }
-}
-
-get _timerFactoryClosure => (int milliSeconds, void callback(Timer timer), bool repeating) {
-  var maker;
-  var canceller;
-  if (repeating) {
-    maker = window._setInterval;
-    canceller = window._clearInterval;
-  } else {
-    maker = window._setTimeout;
-    canceller = window._clearTimeout;
-  }
-  Timer timer;
-  final int id = maker(() { callback(timer); }, milliSeconds);
-  timer = new _Timer(() { canceller(id); });
-  return timer;
-};
-
-class _PureIsolateTimer implements Timer {
-  final ReceivePort _port = new ReceivePort();
-  SendPort _sendPort; // Effectively final.
-
-  _PureIsolateTimer(int milliSeconds, callback, repeating) {
-    _sendPort = _port.toSendPort();
-    _port.receive((msg, replyTo) {
-      assert(msg == _TIMER_PING);
-      assert(replyTo == _HELPER_ISOLATE_PORT);
-      callback(this);
-      if (!repeating) _cancel();
-    });
-    _HELPER_ISOLATE_PORT.then((port) {
-      port.send([_NEW_TIMER, milliSeconds, repeating], _sendPort);
-    });
-  }
-
-  void cancel() {
-    _cancel();
-    _HELPER_ISOLATE_PORT.then((port) {
-      port.send([_CANCEL_TIMER], _sendPort);
-    });
-  }
-
-  void _cancel() {
-    _port.close();
-  }
-}
-
-get _pureIsolateTimerFactoryClosure =>
-    ((int milliSeconds, void callback(Timer time), bool repeating) =>
-        new _PureIsolateTimer(milliSeconds, callback, repeating));
 // 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.
@@ -35141,6 +33285,9 @@
   dynamic reduce(initialValue, combine(previousValue, E element)) =>
       _list.reduce(initialValue, combine);
 
+  dynamic fold(initialValue, combine(previousValue, E element)) =>
+      _list.fold(initialValue, combine);
+
   bool every(bool f(E element)) => _list.every(f);
 
   String join([String separator]) => _list.join(separator);
@@ -35210,8 +33357,6 @@
 
   void set length(int newLength) { _list.length = newLength; }
 
-  void addLast(E value) { _list.add(value); }
-
   Iterable<E> get reversed => _list.reversed;
 
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
@@ -36159,8 +34304,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 
-// This API is exploratory.
-Future<SendPort> spawnDomFunction(Function topLevelFunction) {
+_makeSendPortFuture(spawnRequest) {
   final completer = new Completer<SendPort>();
   final port = new ReceivePort();
   port.receive((result, _) {
@@ -36168,10 +34312,17 @@
     port.close();
   });
   // TODO: SendPort.hashCode is ugly way to access port id.
-  _Utils.spawnDomFunction(topLevelFunction, port.toSendPort().hashCode);
+  spawnRequest(port.toSendPort().hashCode);
   return completer.future;
 }
 
+// This API is exploratory.
+Future<SendPort> spawnDomFunction(Function f) =>
+    _makeSendPortFuture((portId) { _Utils.spawnDomFunction(f, portId); });
+
+Future<SendPort> spawnDomUri(String uri) =>
+    _makeSendPortFuture((portId) { _Utils.spawnDomUri(uri, portId); });
+
 // testRunner implementation.
 // FIXME: provide a separate lib for testRunner.
 
@@ -36254,7 +34405,8 @@
 
   static window() native "Utils_window";
   static forwardingPrint(String message) native "Utils_forwardingPrint";
-  static void spawnDomFunction(Function topLevelFunction, int replyTo) native "Utils_spawnDomFunction";
+  static void spawnDomFunction(Function f, int replyTo) native "Utils_spawnDomFunction";
+  static void spawnDomUri(String uri, int replyTo) native "Utils_spawnDomUri";
   static int _getNewIsolateId() native "Utils_getNewIsolateId";
   static bool shadowRootSupported(Document document) native "Utils_shadowRootSupported";
 }
@@ -36326,9 +34478,29 @@
   bool get isEmpty => Maps.isEmpty(this);
 }
 
-final Future<SendPort> _HELPER_ISOLATE_PORT =
+final Future<SendPort> __HELPER_ISOLATE_PORT =
     spawnDomFunction(_helperIsolateMain);
 
+// Tricky part.
+// Once __HELPER_ISOLATE_PORT gets resolved, it will still delay in .then
+// and to delay Timer.run is used. However, Timer.run will try to register
+// another Timer and here we got stuck: event cannot be posted as then
+// callback is not executed because it's delayed with timer.
+// Therefore once future is resolved, it's unsafe to call .then on it
+// in Timer code.
+SendPort __SEND_PORT;
+
+_sendToHelperIsolate(msg, SendPort replyTo) {
+  if (__SEND_PORT != null) {
+    __SEND_PORT.send(msg, replyTo);
+  } else {
+    __HELPER_ISOLATE_PORT.then((port) {
+      __SEND_PORT = port;
+      __SEND_PORT.send(msg, replyTo);
+    });
+  }
+}
+
 final _TIMER_REGISTRY = new Map<SendPort, Timer>();
 
 const _NEW_TIMER = 'NEW_TIMER';
@@ -36342,10 +34514,10 @@
     if (cmd == _NEW_TIMER) {
       final duration = new Duration(milliseconds: msg[1]);
       bool periodic = msg[2];
-      final callback = () { replyTo.send(_TIMER_PING); };
+      ping() { replyTo.send(_TIMER_PING); };
       _TIMER_REGISTRY[replyTo] = periodic ?
-          new Timer.periodic(duration, callback) :
-          new Timer(duration, callback);
+          new Timer.periodic(duration, (_) { ping(); }) :
+          new Timer(duration, ping);
     } else if (cmd == _CANCEL_TIMER) {
       _TIMER_REGISTRY.remove(replyTo).cancel();
     } else if (cmd == _PRINT) {
@@ -36358,9 +34530,66 @@
 
 final _printClosure = window.console.log;
 final _pureIsolatePrintClosure = (s) {
-  _HELPER_ISOLATE_PORT.then((sendPort) {
-    sendPort.send([_PRINT, s]);
-  });
+  _sendToHelperIsolate([_PRINT, s], null);
 };
 
 final _forwardingPrintClosure = _Utils.forwardingPrint;
+
+class _Timer implements Timer {
+  final canceller;
+
+  _Timer(this.canceller);
+
+  void cancel() { canceller(); }
+}
+
+get _timerFactoryClosure => (int milliSeconds, void callback(Timer timer), bool repeating) {
+  var maker;
+  var canceller;
+  if (repeating) {
+    maker = window._setInterval;
+    canceller = window._clearInterval;
+  } else {
+    maker = window._setTimeout;
+    canceller = window._clearTimeout;
+  }
+  Timer timer;
+  final int id = maker(() { callback(timer); }, milliSeconds);
+  timer = new _Timer(() { canceller(id); });
+  return timer;
+};
+
+class _PureIsolateTimer implements Timer {
+  final ReceivePort _port = new ReceivePort();
+  SendPort _sendPort; // Effectively final.
+
+  static SendPort _SEND_PORT;
+
+  _PureIsolateTimer(int milliSeconds, callback, repeating) {
+    _sendPort = _port.toSendPort();
+    _port.receive((msg, replyTo) {
+      assert(msg == _TIMER_PING);
+      callback(this);
+      if (!repeating) _cancel();
+    });
+
+    _send([_NEW_TIMER, milliSeconds, repeating]);
+  }
+
+  void cancel() {
+    _cancel();
+    _send([_CANCEL_TIMER]);
+  }
+
+  void _cancel() {
+    _port.close();
+  }
+
+  _send(msg) {
+    _sendToHelperIsolate(msg, _sendPort);
+  }
+}
+
+get _pureIsolateTimerFactoryClosure =>
+    ((int milliSeconds, void callback(Timer time), bool repeating) =>
+        new _PureIsolateTimer(milliSeconds, callback, repeating));
diff --git a/sdk/lib/html/html_common/filtered_element_list.dart b/sdk/lib/html/html_common/filtered_element_list.dart
index 5c07fe1..43d004d 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.dart
@@ -61,10 +61,6 @@
     }
   }
 
-  void addLast(Element value) {
-    add(value);
-  }
-
   bool contains(Element element) {
     return element is Element && _childNodes.contains(element);
   }
@@ -149,6 +145,12 @@
       dynamic combine(dynamic previousValue, Element element)) {
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
+
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Element element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool every(bool f(Element element)) => _filtered.every(f);
   bool any(bool f(Element element)) => _filtered.any(f);
   List<Element> toList({ bool growable: true }) =>
diff --git a/sdk/lib/io/buffer_list.dart b/sdk/lib/io/buffer_list.dart
index 0b3716c..25a4fdd 100644
--- a/sdk/lib/io/buffer_list.dart
+++ b/sdk/lib/io/buffer_list.dart
@@ -69,7 +69,8 @@
   List<int> readBytes([int count]) {
     if (count == null) count = length;
     List<int> result;
-    if (_length == 0 || _length < count) return null;
+    if (_length == 0) return new Uint8List(0);
+    if (_length < count) return null;
     if (_index == 0 && _buffers.first.length == count) {
       result = _buffers.first;
       _buffers.removeFirst();
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index 7de3d7d..85aa1b3 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -50,6 +50,8 @@
 
   /**
    * Synchronously check if the file exists.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   bool existsSync();
 
@@ -67,6 +69,8 @@
    * Synchronously create the file. Existing files are left untouched
    * by [createSync]. Calling [createSync] on an existing file might fail
    * if there are restrictive permissions on the file.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   void createSync();
 
@@ -78,6 +82,8 @@
 
   /**
    * Synchronously delete the file.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   void deleteSync();
 
@@ -91,6 +97,8 @@
   /**
    * Synchronously get a [Directory] object for the directory containing
    * this file.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   Directory directorySync();
 
@@ -102,6 +110,8 @@
 
   /**
    * Synchronously get the length of the file.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   int lengthSync();
 
@@ -115,6 +125,8 @@
   /**
    * Get the last-modified time of the file. Throws an exception
    * if the file does not exist.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   DateTime lastModifiedSync();
 
@@ -144,6 +156,8 @@
    * the [RandomAccessFile.close] method.
    *
    * See [open] for information on the [mode] argument.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   RandomAccessFile openSync({FileMode mode: FileMode.READ});
 
@@ -155,6 +169,8 @@
 
   /**
    * Synchronously get the canonical full path corresponding to the file path.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   String fullPathSync();
 
@@ -168,7 +184,6 @@
    */
   Stream<List<int>> openRead();
 
-
   /**
    * Creates a new independent [IOSink] for the file. The
    * [IOSink] must be closed when no longer used, to free
@@ -197,6 +212,8 @@
 
   /**
    * Synchronously read the entire file contents as a list of bytes.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   List<int> readAsBytesSync();
 
@@ -212,6 +229,8 @@
   /**
    * Synchronously read the entire file contents as a string using the
    * given [Encoding].
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   String readAsStringSync({Encoding encoding: Encoding.UTF_8});
 
@@ -227,6 +246,8 @@
   /**
    * Synchronously read the entire file contents as lines of text
    * using the given [Encoding].
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   List<String> readAsLinesSync({Encoding encoding: Encoding.UTF_8});
 
@@ -251,6 +272,8 @@
    * By default [writeAsBytesSync] creates the file for writing and truncates
    * the file if it already exists. In order to append the bytes to an existing
    * file, pass [FileMode.APPEND] as the optional mode parameter.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   void writeAsBytesSync(List<int> bytes, {FileMode mode: FileMode.WRITE});
 
@@ -279,6 +302,8 @@
    * truncates the file if it already exists. In order to append the bytes
    * to an existing file, pass [FileMode.APPEND] as the optional mode
    * parameter.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   void writeAsStringSync(String contents,
                          {FileMode mode: FileMode.WRITE,
@@ -305,6 +330,8 @@
 
   /**
    * Synchronously closes the file.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   void closeSync();
 
@@ -317,6 +344,8 @@
   /**
    * Synchronously reads a single byte from the file. If end-of-file
    * has been reached -1 is returned.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   int readByteSync();
 
@@ -326,9 +355,10 @@
   Future<List<int>> read(int bytes);
 
   /**
-   * Synchronously reads a maximum of [bytes] bytes from a file
-   * and returns the result in a
-   * list of bytes.
+   * Synchronously reads a maximum of [bytes] bytes from a file and
+   * returns the result in a list of bytes.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   List<int> readSync(int bytes);
 
@@ -343,6 +373,8 @@
    * Synchronously reads from a file into [buffer].  A maximum of [bytes] bytes
    * is read into [buffer], starting at position [offset] in the buffer.
    * Returns the number of bytes read.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   int readListSync(List<int> buffer, int offset, int bytes);
 
@@ -356,6 +388,8 @@
   /**
    * Synchronously writes a single byte to the file. Returns the
    * number of bytes successfully written.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   int writeByteSync(int value);
 
@@ -368,10 +402,11 @@
   Future<RandomAccessFile> writeList(List<int> buffer, int offset, int bytes);
 
   /**
-   * Synchronously writes a List<int> to the file.
-   * [bytes] bytes are written from
-   * [buffer], starting at position [offset] in the buffer. Returns the number
-   * of bytes successfully written.
+   * Synchronously writes a List<int> to the file.  [bytes] bytes are
+   * written from [buffer], starting at position [offset] in the
+   * buffer. Returns the number of bytes successfully written.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   int writeListSync(List<int> buffer, int offset, int bytes);
 
@@ -387,6 +422,8 @@
    * Synchronously writes a single string to the file using the given
    * [Encoding]. Returns the number of characters successfully
    * written.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   int writeStringSync(String string,
                       {Encoding encoding: Encoding.UTF_8});
@@ -399,6 +436,8 @@
 
   /**
    * Synchronously gets the current byte position in the file.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   int positionSync();
 
@@ -411,6 +450,8 @@
 
   /**
    * Synchronously sets the byte position in the file.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   void setPositionSync(int position);
 
@@ -423,6 +464,8 @@
 
   /**
    * Synchronously truncates (or extends) the file to [length] bytes.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   void truncateSync(int length);
 
@@ -434,6 +477,8 @@
 
   /**
    * Synchronously gets the length of the file.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   int lengthSync();
 
@@ -446,6 +491,8 @@
 
   /**
    * Synchronously flushes the contents of the file to disk.
+   *
+   * Throws a [FileIOException] if the operation fails.
    */
   void flushSync();
 
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index f6fdb84..57b8cd1 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -4,14 +4,14 @@
 
 part of dart.io;
 
+// Read the file in blocks of size 64k.
+const int _BLOCK_SIZE = 64 * 1024;
+
 
 class _FileStream extends Stream<List<int>> {
   // Stream controller.
   StreamController<List<int>> _controller;
 
-  // Read the file in blocks of size 64k.
-  final int _blockSize = 64 * 1024;
-
   // Information about the underlying file.
   String _path;
   RandomAccessFile _openedFile;
@@ -76,7 +76,7 @@
           }
           return null;
         } else {
-          return _openedFile.read(_blockSize);
+          return _openedFile.read(_BLOCK_SIZE);
         }
       })
       .then((block) {
@@ -151,6 +151,7 @@
   File _file;
   Future<RandomAccessFile> _openFuture;
   StreamSubscription _subscription;
+  
 
   _FileStreamConsumer(File this._file, FileMode mode) {
     _openFuture = _file.open(mode: mode);
@@ -162,6 +163,10 @@
   }
 
   Future<File> consume(Stream<List<int>> stream) {
+    return addStream(stream).then((_) => close());
+  }
+
+  Future<File> addStream(Stream<List<int>> stream) {
     Completer<File> completer = new Completer<File>();
     _openFuture
       .then((openedFile) {
@@ -176,15 +181,7 @@
               });
           },
           onDone: () {
-            // Wait for the file to close (and therefore flush) before
-            // completing the future.
-            openedFile.close()
-              .then((_) {
-                completer.complete(_file);
-              })
-              .catchError((e) {
-                completer.completeError(e);
-              });
+            completer.complete(_file);
           },
           onError: (e) {
             openedFile.close();
@@ -197,6 +194,10 @@
       });
     return completer.future;
   }
+
+  Future<File> close() {
+    return _openFuture.then((openedFile) => openedFile.close());
+  }
 }
 
 
@@ -503,14 +504,13 @@
 
   List<int> readAsBytesSync() {
     var opened = openSync();
-    var length = opened.lengthSync();
-    var result = new Uint8List(length);
-    var read = opened.readListSync(result, 0, length);
-    if (read != length) {
-      throw new FileIOException("Failed to read file");
+    var chunks = new _BufferList();
+    var data;
+    while ((data = opened.readSync(_BLOCK_SIZE)).length > 0) {
+      chunks.add(data);
     }
     opened.closeSync();
-    return result;
+    return chunks.readBytes();
   }
 
   Future<String> readAsString({Encoding encoding: Encoding.UTF_8}) {
@@ -699,11 +699,17 @@
   external static _read(int id, int bytes);
 
   List<int> readSync(int bytes) {
+    _checkNotClosed();
     if (bytes is !int) {
       throw new FileIOException(
           "Invalid arguments to readSync for file '$_path'");
     }
-    return _read(_id, bytes);
+    var result = _read(_id, bytes);
+    if (result is OSError) {
+      throw new FileIOException("readSync failed for file '$_path'",
+                                result);
+    }
+    return result;
   }
 
   Future<int> readList(List<int> buffer, int offset, int bytes) {
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index c1272d3..6fc339a 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -260,7 +260,7 @@
         // TODO(sgjesse): Support digest.
         if (cr.scheme == _AuthenticationScheme.BASIC) {
           // Drain body and retry.
-          return reduce(null, (x, y) {}).then((_) {
+          return fold(null, (x, y) {}).then((_) {
               return _httpClient._openUrlFromRequest(_httpRequest.method,
                                                      _httpRequest.uri,
                                                      _httpRequest)
@@ -375,8 +375,16 @@
     _ioSink.write(string);
   }
 
-  void writeAll(Iterable objects) {
-    for (Object obj in objects) write(obj);
+  void writeAll(Iterable objects, [String separator = ""]) {
+    bool isFirst = true;
+    for (Object obj in objects) {
+      if (isFirst) {
+        isFirst = false;
+      } else {
+        if (separator != "") write(separator);
+      }
+      write(obj);
+    }
   }
 
   void writeln([Object obj = ""]) {
@@ -399,12 +407,16 @@
     return _ioSink.consume(stream);
   }
 
-  Future<T> writeStream(Stream<List<int>> stream) {
+  Future<T> addStream(Stream<List<int>> stream) {
     _writeHeaders();
     return _ioSink.writeStream(stream).then((_) => this);
   }
 
-  void close() {
+  Future<T> writeStream(Stream<List<int>> stream) {
+    return addStream(stream);
+  }
+
+  Future close() {
     // TODO(ajohnsen): Currently, contentLength, chunkedTransferEncoding and
     // persistentConnection is not guaranteed to be in sync.
     if (!_headersWritten && !_ignoreBody && headers.contentLength == -1) {
@@ -414,7 +426,7 @@
       headers.contentLength = 0;
     }
     _writeHeaders();
-    _ioSink.close();
+    return _ioSink.close();
   }
 
   Future<T> get done {
@@ -452,7 +464,7 @@
     int contentLength = headers.contentLength;
     if (_ignoreBody) {
       ioSink.close();
-      return stream.reduce(null, (x, y) {}).then((_) => this);
+      return stream.fold(null, (x, y) {}).then((_) => this);
     }
     stream = stream.transform(new _BufferTransformer());
     if (headers.chunkedTransferEncoding) {
@@ -479,6 +491,14 @@
                         bool this._asGZip);
 
   Future consume(var stream) => _consume(_ioSink, stream, _asGZip);
+
+  Future addStream(var stream) {
+    throw new UnimplementedError("_HttpOutboundConsumer.addStream");
+  }
+
+  Future close() {
+    throw new UnimplementedError("_HttpOutboundConsumer.close");
+  }
 }
 
 
@@ -727,11 +747,11 @@
     if (followRedirects && response.isRedirect) {
       if (response.redirects.length < maxRedirects) {
         // Redirect and drain response.
-        future = response.reduce(null, (x, y) {})
+        future = response.fold(null, (x, y) {})
           .then((_) => response.redirect());
       } else {
         // End with exception, too many redirects.
-        future = response.reduce(null, (x, y) {})
+        future = response.fold(null, (x, y) {})
             .then((_) => new Future.immediateError(
                 new RedirectLimitExceededException(response.redirects)));
       }
@@ -886,6 +906,14 @@
     // Use .then to ensure a Future branch.
     return _consumeCompleter.future.then((_) => this);
   }
+
+  Future addStream(Stream<List<int>> stream) {
+    throw new UnimplementedError("_HttpOutgoing.addStream");
+  }
+
+  Future close() {
+    throw new UnimplementedError("_HttpOutgoing.close");
+  }
 }
 
 
@@ -1089,7 +1117,7 @@
     _closing = true;
     // Create flattened copy of _idleConnections, as 'destory' will manipulate
     // it.
-    var idle = _idleConnections.values.reduce(
+    var idle = _idleConnections.values.fold(
         [],
         (l, e) {
           l.addAll(e);
@@ -1241,7 +1269,7 @@
   _Credentials _findCredentials(Uri url, [_AuthenticationScheme scheme]) {
     // Look for credentials.
     _Credentials cr =
-        _credentials.reduce(null, (_Credentials prev, _Credentials value) {
+        _credentials.fold(null, (_Credentials prev, _Credentials value) {
           if (value.applies(url, scheme)) {
             if (prev == null) return value;
             return value.uri.path.length > prev.uri.path.length ? value : prev;
@@ -1635,7 +1663,9 @@
 
   void writeCharCode(int charCode) => _socket.writeCharCode(charCode);
 
-  void writeAll(Iterable objects) => _socket.writeAll(objects);
+  void writeAll(Iterable objects, [String separator = ""]) {
+    _socket.writeAll(objects, separator);
+  }
 
   void writeBytes(List<int> bytes) => _socket.writeBytes(bytes);
 
@@ -1643,13 +1673,17 @@
     return _socket.consume(stream);
   }
 
+  Future<Socket> addStream(Stream<List<int>> stream) {
+    return _socket.addStream(stream);
+  }
+
   Future<Socket> writeStream(Stream<List<int>> stream) {
     return _socket.writeStream(stream);
   }
 
   void destroy() => _socket.destroy();
 
-  void close() => _socket.close();
+  Future close() => _socket.close();
 
   Future<Socket> get done => _socket.done;
 
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index 047f37a..7d098d0 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -242,6 +242,14 @@
     return completer.future;
   }
 
+  Future<_HttpParser> addStream(Stream<List<int>> stream) {
+    throw new UnimplementedError("_HttpParser.addStream");
+  }
+
+  Future<_HttpParser> close() {
+    throw new UnimplementedError("_HttpParser.close");
+  }
+
   // From RFC 2616.
   // generic-message = start-line
   //                   *(message-header CRLF)
diff --git a/sdk/lib/io/io_sink.dart b/sdk/lib/io/io_sink.dart
index 7c564fa..4ee7b4f 100644
--- a/sdk/lib/io/io_sink.dart
+++ b/sdk/lib/io/io_sink.dart
@@ -37,14 +37,23 @@
   Future<T> consume(Stream<List<int>> stream);
 
   /**
+   * Adds all elements of the given [stream] to `this`.
+   */
+  Future<T> addStream(Stream<List<int>> stream);
+
+  /**
    * Like [consume], but will not close the target when done.
+   *
+   * *Deprecated*: use [addStream] instead.
    */
   Future<T> writeStream(Stream<List<int>> stream);
 
   /**
    * Close the target.
    */
-  void close();
+  // TODO(floitsch): Currently the future cannot be typed because it has
+  // hardcoded type Future<HttpClientResponse> in subclass HttpClientRequest.
+  Future close();
 
   /**
    * Get future that will complete when all data has been written to
@@ -94,8 +103,20 @@
     writeBytes(_encodeString(string, _encoding));
   }
 
-  void writeAll(Iterable objects) {
-    for (Object obj in objects) write(obj);
+  void writeAll(Iterable objects, [String separator = ""]) {
+    Iterator iterator = objects.iterator;
+    if (!iterator.moveNext()) return;
+    if (separator == "") {
+      do {
+        write(iterator.current);
+      } while (iterator.moveNext());
+    } else {
+      write(iterator.current);
+      while (iterator.moveNext()) {
+        write(separator);
+        write(iterator.current);
+      }
+    }
   }
 
   void writeln([Object obj = ""]) {
@@ -122,17 +143,22 @@
   }
 
   Future<T> writeStream(Stream<List<int>> stream) {
+    return addStream(stream);
+  }
+
+  Future<T> addStream(Stream<List<int>> stream) {
     if (_isBound) {
       throw new StateError("IOSink is already bound to a stream");
     }
     return _fillFromStream(stream, unbind: true);
   }
 
-  void close() {
+  Future close() {
     if (_isBound) {
       throw new StateError("IOSink is already bound to a stream");
     }
     _controller.close();
+    return _pipeFuture;
   }
 
   Future<T> get done {
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart
index e3c62e9..8ceb41d 100644
--- a/sdk/lib/io/process.dart
+++ b/sdk/lib/io/process.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.
 
@@ -9,6 +9,7 @@
 class _ProcessUtils {
   external static _exit(int status);
   external static _setExitCode(int status);
+  external static _sleep(int millis);
 }
 
 /**
@@ -39,6 +40,16 @@
 }
 
 /**
+ * Sleep for the duration specified in [duration].
+ *
+ * Use this with care, as no asynchronous operations can be processed
+ * in a isolate while it is blocked in a [sleep] call.
+ */
+void sleep(Duration duration) {
+  _ProcessUtils._sleep(duration.inMilliseconds);
+}
+
+/**
  * [Process] is used to start new processes using the static
  * [start] and [run] methods.
  */
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
index eb7119c..1ed157e 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.dart
@@ -8,7 +8,7 @@
 const int _STDIO_HANDLE_TYPE_PIPE = 1;
 const int _STDIO_HANDLE_TYPE_FILE = 2;
 const int _STDIO_HANDLE_TYPE_SOCKET = 3;
-const int _STDIO_HANDLE_TYPE_OTHER = -1;
+const int _STDIO_HANDLE_TYPE_OTHER = 4;
 
 
 class StdioType {
@@ -16,8 +16,9 @@
   static const StdioType PIPE = const StdioType._("pipe");
   static const StdioType FILE = const StdioType._("file");
   static const StdioType OTHER = const StdioType._("other");
-  const StdioType._(String this.name);
   final String name;
+  const StdioType._(String this.name);
+  String toString() => "StdioType: $name";
 }
 
 
@@ -63,7 +64,7 @@
   }
   if (object is IOSink) {
     try {
-      if (object._sink.target is _FileStreamConsumer) {
+      if (object._target is _FileStreamConsumer) {
         return StdioType.FILE;
       }
     } catch (e) {
diff --git a/sdk/lib/svg/dart2js/svg_dart2js.dart b/sdk/lib/svg/dart2js/svg_dart2js.dart
index dea8a56..feeb745 100644
--- a/sdk/lib/svg/dart2js/svg_dart2js.dart
+++ b/sdk/lib/svg/dart2js/svg_dart2js.dart
@@ -3073,6 +3073,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Length)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Length element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Length element)) => IterableMixinWorkaround.forEach(this, f);
@@ -3134,10 +3138,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Length value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Length> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -3711,6 +3711,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Number)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Number element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Number element)) => IterableMixinWorkaround.forEach(this, f);
@@ -3772,10 +3776,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Number value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Number> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -4625,6 +4625,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, PathSeg)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(PathSeg element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(PathSeg element)) => IterableMixinWorkaround.forEach(this, f);
@@ -4686,10 +4690,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(PathSeg value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<PathSeg> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -5524,6 +5524,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, String)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(String element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(String element)) => IterableMixinWorkaround.forEach(this, f);
@@ -5585,10 +5589,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(String value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<String> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -6700,6 +6700,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Transform)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Transform element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Transform element)) => IterableMixinWorkaround.forEach(this, f);
@@ -6761,10 +6765,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Transform value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Transform> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -7231,6 +7231,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, ElementInstance)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(ElementInstance element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(ElementInstance element)) => IterableMixinWorkaround.forEach(this, f);
@@ -7292,10 +7296,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(ElementInstance value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<ElementInstance> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
diff --git a/sdk/lib/svg/dartium/svg_dartium.dart b/sdk/lib/svg/dartium/svg_dartium.dart
index b6fc12e..a665e68 100644
--- a/sdk/lib/svg/dartium/svg_dartium.dart
+++ b/sdk/lib/svg/dartium/svg_dartium.dart
@@ -3336,6 +3336,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Length)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Length element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Length element)) => IterableMixinWorkaround.forEach(this, f);
@@ -3397,10 +3401,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Length value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Length> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -4051,6 +4051,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Number)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Number element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Number element)) => IterableMixinWorkaround.forEach(this, f);
@@ -4112,10 +4116,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Number value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Number> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -5242,6 +5242,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, PathSeg)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(PathSeg element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(PathSeg element)) => IterableMixinWorkaround.forEach(this, f);
@@ -5303,10 +5307,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(PathSeg value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<PathSeg> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -6238,6 +6238,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, String)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(String element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(String element)) => IterableMixinWorkaround.forEach(this, f);
@@ -6299,10 +6303,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(String value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<String> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -7503,6 +7503,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Transform)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Transform element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Transform element)) => IterableMixinWorkaround.forEach(this, f);
@@ -7564,10 +7568,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Transform value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Transform> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
@@ -8088,6 +8088,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, ElementInstance)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(ElementInstance element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(ElementInstance element)) => IterableMixinWorkaround.forEach(this, f);
@@ -8149,10 +8153,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(ElementInstance value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<ElementInstance> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
diff --git a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
new file mode 100644
index 0000000..1064ba7
--- /dev/null
+++ b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
@@ -0,0 +1,1989 @@
+library dart.dom.web_gl;
+
+import 'dart:collection';
+import 'dart:html';
+import 'dart:html_common';
+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:
+// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
+// Auto-generated dart:web_gl library.
+
+
+
+
+
+// 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.
+
+
+const int ACTIVE_ATTRIBUTES = RenderingContext.ACTIVE_ATTRIBUTES;
+const int ACTIVE_TEXTURE = RenderingContext.ACTIVE_TEXTURE;
+const int ACTIVE_UNIFORMS = RenderingContext.ACTIVE_UNIFORMS;
+const int ALIASED_LINE_WIDTH_RANGE = RenderingContext.ALIASED_LINE_WIDTH_RANGE;
+const int ALIASED_POINT_SIZE_RANGE = RenderingContext.ALIASED_POINT_SIZE_RANGE;
+const int ALPHA = RenderingContext.ALPHA;
+const int ALPHA_BITS = RenderingContext.ALPHA_BITS;
+const int ALWAYS = RenderingContext.ALWAYS;
+const int ARRAY_BUFFER = RenderingContext.ARRAY_BUFFER;
+const int ARRAY_BUFFER_BINDING = RenderingContext.ARRAY_BUFFER_BINDING;
+const int ATTACHED_SHADERS = RenderingContext.ATTACHED_SHADERS;
+const int BACK = RenderingContext.BACK;
+const int BLEND = RenderingContext.BLEND;
+const int BLEND_COLOR = RenderingContext.BLEND_COLOR;
+const int BLEND_DST_ALPHA = RenderingContext.BLEND_DST_ALPHA;
+const int BLEND_DST_RGB = RenderingContext.BLEND_DST_RGB;
+const int BLEND_EQUATION = RenderingContext.BLEND_EQUATION;
+const int BLEND_EQUATION_ALPHA = RenderingContext.BLEND_EQUATION_ALPHA;
+const int BLEND_EQUATION_RGB = RenderingContext.BLEND_EQUATION_RGB;
+const int BLEND_SRC_ALPHA = RenderingContext.BLEND_SRC_ALPHA;
+const int BLEND_SRC_RGB = RenderingContext.BLEND_SRC_RGB;
+const int BLUE_BITS = RenderingContext.BLUE_BITS;
+const int BOOL = RenderingContext.BOOL;
+const int BOOL_VEC2 = RenderingContext.BOOL_VEC2;
+const int BOOL_VEC3 = RenderingContext.BOOL_VEC3;
+const int BOOL_VEC4 = RenderingContext.BOOL_VEC4;
+const int BROWSER_DEFAULT_WEBGL = RenderingContext.BROWSER_DEFAULT_WEBGL;
+const int BUFFER_SIZE = RenderingContext.BUFFER_SIZE;
+const int BUFFER_USAGE = RenderingContext.BUFFER_USAGE;
+const int BYTE = RenderingContext.BYTE;
+const int CCW = RenderingContext.CCW;
+const int CLAMP_TO_EDGE = RenderingContext.CLAMP_TO_EDGE;
+const int COLOR_ATTACHMENT0 = RenderingContext.COLOR_ATTACHMENT0;
+const int COLOR_BUFFER_BIT = RenderingContext.COLOR_BUFFER_BIT;
+const int COLOR_CLEAR_VALUE = RenderingContext.COLOR_CLEAR_VALUE;
+const int COLOR_WRITEMASK = RenderingContext.COLOR_WRITEMASK;
+const int COMPILE_STATUS = RenderingContext.COMPILE_STATUS;
+const int COMPRESSED_TEXTURE_FORMATS = RenderingContext.COMPRESSED_TEXTURE_FORMATS;
+const int CONSTANT_ALPHA = RenderingContext.CONSTANT_ALPHA;
+const int CONSTANT_COLOR = RenderingContext.CONSTANT_COLOR;
+const int CONTEXT_LOST_WEBGL = RenderingContext.CONTEXT_LOST_WEBGL;
+const int CULL_FACE = RenderingContext.CULL_FACE;
+const int CULL_FACE_MODE = RenderingContext.CULL_FACE_MODE;
+const int CURRENT_PROGRAM = RenderingContext.CURRENT_PROGRAM;
+const int CURRENT_VERTEX_ATTRIB = RenderingContext.CURRENT_VERTEX_ATTRIB;
+const int CW = RenderingContext.CW;
+const int DECR = RenderingContext.DECR;
+const int DECR_WRAP = RenderingContext.DECR_WRAP;
+const int DELETE_STATUS = RenderingContext.DELETE_STATUS;
+const int DEPTH_ATTACHMENT = RenderingContext.DEPTH_ATTACHMENT;
+const int DEPTH_BITS = RenderingContext.DEPTH_BITS;
+const int DEPTH_BUFFER_BIT = RenderingContext.DEPTH_BUFFER_BIT;
+const int DEPTH_CLEAR_VALUE = RenderingContext.DEPTH_CLEAR_VALUE;
+const int DEPTH_COMPONENT = RenderingContext.DEPTH_COMPONENT;
+const int DEPTH_COMPONENT16 = RenderingContext.DEPTH_COMPONENT16;
+const int DEPTH_FUNC = RenderingContext.DEPTH_FUNC;
+const int DEPTH_RANGE = RenderingContext.DEPTH_RANGE;
+const int DEPTH_STENCIL = RenderingContext.DEPTH_STENCIL;
+const int DEPTH_STENCIL_ATTACHMENT = RenderingContext.DEPTH_STENCIL_ATTACHMENT;
+const int DEPTH_TEST = RenderingContext.DEPTH_TEST;
+const int DEPTH_WRITEMASK = RenderingContext.DEPTH_WRITEMASK;
+const int DITHER = RenderingContext.DITHER;
+const int DONT_CARE = RenderingContext.DONT_CARE;
+const int DST_ALPHA = RenderingContext.DST_ALPHA;
+const int DST_COLOR = RenderingContext.DST_COLOR;
+const int DYNAMIC_DRAW = RenderingContext.DYNAMIC_DRAW;
+const int ELEMENT_ARRAY_BUFFER = RenderingContext.ELEMENT_ARRAY_BUFFER;
+const int ELEMENT_ARRAY_BUFFER_BINDING = RenderingContext.ELEMENT_ARRAY_BUFFER_BINDING;
+const int EQUAL = RenderingContext.EQUAL;
+const int FASTEST = RenderingContext.FASTEST;
+const int FLOAT = RenderingContext.FLOAT;
+const int FLOAT_MAT2 = RenderingContext.FLOAT_MAT2;
+const int FLOAT_MAT3 = RenderingContext.FLOAT_MAT3;
+const int FLOAT_MAT4 = RenderingContext.FLOAT_MAT4;
+const int FLOAT_VEC2 = RenderingContext.FLOAT_VEC2;
+const int FLOAT_VEC3 = RenderingContext.FLOAT_VEC3;
+const int FLOAT_VEC4 = RenderingContext.FLOAT_VEC4;
+const int FRAGMENT_SHADER = RenderingContext.FRAGMENT_SHADER;
+const int FRAMEBUFFER = RenderingContext.FRAMEBUFFER;
+const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = RenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME;
+const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = RenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE;
+const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = RenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE;
+const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = RenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL;
+const int FRAMEBUFFER_BINDING = RenderingContext.FRAMEBUFFER_BINDING;
+const int FRAMEBUFFER_COMPLETE = RenderingContext.FRAMEBUFFER_COMPLETE;
+const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = RenderingContext.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = RenderingContext.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
+const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = RenderingContext.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+const int FRAMEBUFFER_UNSUPPORTED = RenderingContext.FRAMEBUFFER_UNSUPPORTED;
+const int FRONT = RenderingContext.FRONT;
+const int FRONT_AND_BACK = RenderingContext.FRONT_AND_BACK;
+const int FRONT_FACE = RenderingContext.FRONT_FACE;
+const int FUNC_ADD = RenderingContext.FUNC_ADD;
+const int FUNC_REVERSE_SUBTRACT = RenderingContext.FUNC_REVERSE_SUBTRACT;
+const int FUNC_SUBTRACT = RenderingContext.FUNC_SUBTRACT;
+const int GENERATE_MIPMAP_HINT = RenderingContext.GENERATE_MIPMAP_HINT;
+const int GEQUAL = RenderingContext.GEQUAL;
+const int GREATER = RenderingContext.GREATER;
+const int GREEN_BITS = RenderingContext.GREEN_BITS;
+const int HALF_FLOAT_OES = RenderingContext.HALF_FLOAT_OES;
+const int HIGH_FLOAT = RenderingContext.HIGH_FLOAT;
+const int HIGH_INT = RenderingContext.HIGH_INT;
+const int INCR = RenderingContext.INCR;
+const int INCR_WRAP = RenderingContext.INCR_WRAP;
+const int INT = RenderingContext.INT;
+const int INT_VEC2 = RenderingContext.INT_VEC2;
+const int INT_VEC3 = RenderingContext.INT_VEC3;
+const int INT_VEC4 = RenderingContext.INT_VEC4;
+const int INVALID_ENUM = RenderingContext.INVALID_ENUM;
+const int INVALID_FRAMEBUFFER_OPERATION = RenderingContext.INVALID_FRAMEBUFFER_OPERATION;
+const int INVALID_OPERATION = RenderingContext.INVALID_OPERATION;
+const int INVALID_VALUE = RenderingContext.INVALID_VALUE;
+const int INVERT = RenderingContext.INVERT;
+const int KEEP = RenderingContext.KEEP;
+const int LEQUAL = RenderingContext.LEQUAL;
+const int LESS = RenderingContext.LESS;
+const int LINEAR = RenderingContext.LINEAR;
+const int LINEAR_MIPMAP_LINEAR = RenderingContext.LINEAR_MIPMAP_LINEAR;
+const int LINEAR_MIPMAP_NEAREST = RenderingContext.LINEAR_MIPMAP_NEAREST;
+const int LINES = RenderingContext.LINES;
+const int LINE_LOOP = RenderingContext.LINE_LOOP;
+const int LINE_STRIP = RenderingContext.LINE_STRIP;
+const int LINE_WIDTH = RenderingContext.LINE_WIDTH;
+const int LINK_STATUS = RenderingContext.LINK_STATUS;
+const int LOW_FLOAT = RenderingContext.LOW_FLOAT;
+const int LOW_INT = RenderingContext.LOW_INT;
+const int LUMINANCE = RenderingContext.LUMINANCE;
+const int LUMINANCE_ALPHA = RenderingContext.LUMINANCE_ALPHA;
+const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_COMBINED_TEXTURE_IMAGE_UNITS;
+const int MAX_CUBE_MAP_TEXTURE_SIZE = RenderingContext.MAX_CUBE_MAP_TEXTURE_SIZE;
+const int MAX_FRAGMENT_UNIFORM_VECTORS = RenderingContext.MAX_FRAGMENT_UNIFORM_VECTORS;
+const int MAX_RENDERBUFFER_SIZE = RenderingContext.MAX_RENDERBUFFER_SIZE;
+const int MAX_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_TEXTURE_IMAGE_UNITS;
+const int MAX_TEXTURE_SIZE = RenderingContext.MAX_TEXTURE_SIZE;
+const int MAX_VARYING_VECTORS = RenderingContext.MAX_VARYING_VECTORS;
+const int MAX_VERTEX_ATTRIBS = RenderingContext.MAX_VERTEX_ATTRIBS;
+const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+const int MAX_VERTEX_UNIFORM_VECTORS = RenderingContext.MAX_VERTEX_UNIFORM_VECTORS;
+const int MAX_VIEWPORT_DIMS = RenderingContext.MAX_VIEWPORT_DIMS;
+const int MEDIUM_FLOAT = RenderingContext.MEDIUM_FLOAT;
+const int MEDIUM_INT = RenderingContext.MEDIUM_INT;
+const int MIRRORED_REPEAT = RenderingContext.MIRRORED_REPEAT;
+const int NEAREST = RenderingContext.NEAREST;
+const int NEAREST_MIPMAP_LINEAR = RenderingContext.NEAREST_MIPMAP_LINEAR;
+const int NEAREST_MIPMAP_NEAREST = RenderingContext.NEAREST_MIPMAP_NEAREST;
+const int NEVER = RenderingContext.NEVER;
+const int NICEST = RenderingContext.NICEST;
+const int NONE = RenderingContext.NONE;
+const int NOTEQUAL = RenderingContext.NOTEQUAL;
+const int NO_ERROR = RenderingContext.NO_ERROR;
+const int ONE = RenderingContext.ONE;
+const int ONE_MINUS_CONSTANT_ALPHA = RenderingContext.ONE_MINUS_CONSTANT_ALPHA;
+const int ONE_MINUS_CONSTANT_COLOR = RenderingContext.ONE_MINUS_CONSTANT_COLOR;
+const int ONE_MINUS_DST_ALPHA = RenderingContext.ONE_MINUS_DST_ALPHA;
+const int ONE_MINUS_DST_COLOR = RenderingContext.ONE_MINUS_DST_COLOR;
+const int ONE_MINUS_SRC_ALPHA = RenderingContext.ONE_MINUS_SRC_ALPHA;
+const int ONE_MINUS_SRC_COLOR = RenderingContext.ONE_MINUS_SRC_COLOR;
+const int OUT_OF_MEMORY = RenderingContext.OUT_OF_MEMORY;
+const int PACK_ALIGNMENT = RenderingContext.PACK_ALIGNMENT;
+const int POINTS = RenderingContext.POINTS;
+const int POLYGON_OFFSET_FACTOR = RenderingContext.POLYGON_OFFSET_FACTOR;
+const int POLYGON_OFFSET_FILL = RenderingContext.POLYGON_OFFSET_FILL;
+const int POLYGON_OFFSET_UNITS = RenderingContext.POLYGON_OFFSET_UNITS;
+const int RED_BITS = RenderingContext.RED_BITS;
+const int RENDERBUFFER = RenderingContext.RENDERBUFFER;
+const int RENDERBUFFER_ALPHA_SIZE = RenderingContext.RENDERBUFFER_ALPHA_SIZE;
+const int RENDERBUFFER_BINDING = RenderingContext.RENDERBUFFER_BINDING;
+const int RENDERBUFFER_BLUE_SIZE = RenderingContext.RENDERBUFFER_BLUE_SIZE;
+const int RENDERBUFFER_DEPTH_SIZE = RenderingContext.RENDERBUFFER_DEPTH_SIZE;
+const int RENDERBUFFER_GREEN_SIZE = RenderingContext.RENDERBUFFER_GREEN_SIZE;
+const int RENDERBUFFER_HEIGHT = RenderingContext.RENDERBUFFER_HEIGHT;
+const int RENDERBUFFER_INTERNAL_FORMAT = RenderingContext.RENDERBUFFER_INTERNAL_FORMAT;
+const int RENDERBUFFER_RED_SIZE = RenderingContext.RENDERBUFFER_RED_SIZE;
+const int RENDERBUFFER_STENCIL_SIZE = RenderingContext.RENDERBUFFER_STENCIL_SIZE;
+const int RENDERBUFFER_WIDTH = RenderingContext.RENDERBUFFER_WIDTH;
+const int RENDERER = RenderingContext.RENDERER;
+const int REPEAT = RenderingContext.REPEAT;
+const int REPLACE = RenderingContext.REPLACE;
+const int RGB = RenderingContext.RGB;
+const int RGB565 = RenderingContext.RGB565;
+const int RGB5_A1 = RenderingContext.RGB5_A1;
+const int RGBA = RenderingContext.RGBA;
+const int RGBA4 = RenderingContext.RGBA4;
+const int SAMPLER_2D = RenderingContext.SAMPLER_2D;
+const int SAMPLER_CUBE = RenderingContext.SAMPLER_CUBE;
+const int SAMPLES = RenderingContext.SAMPLES;
+const int SAMPLE_ALPHA_TO_COVERAGE = RenderingContext.SAMPLE_ALPHA_TO_COVERAGE;
+const int SAMPLE_BUFFERS = RenderingContext.SAMPLE_BUFFERS;
+const int SAMPLE_COVERAGE = RenderingContext.SAMPLE_COVERAGE;
+const int SAMPLE_COVERAGE_INVERT = RenderingContext.SAMPLE_COVERAGE_INVERT;
+const int SAMPLE_COVERAGE_VALUE = RenderingContext.SAMPLE_COVERAGE_VALUE;
+const int SCISSOR_BOX = RenderingContext.SCISSOR_BOX;
+const int SCISSOR_TEST = RenderingContext.SCISSOR_TEST;
+const int SHADER_TYPE = RenderingContext.SHADER_TYPE;
+const int SHADING_LANGUAGE_VERSION = RenderingContext.SHADING_LANGUAGE_VERSION;
+const int SHORT = RenderingContext.SHORT;
+const int SRC_ALPHA = RenderingContext.SRC_ALPHA;
+const int SRC_ALPHA_SATURATE = RenderingContext.SRC_ALPHA_SATURATE;
+const int SRC_COLOR = RenderingContext.SRC_COLOR;
+const int STATIC_DRAW = RenderingContext.STATIC_DRAW;
+const int STENCIL_ATTACHMENT = RenderingContext.STENCIL_ATTACHMENT;
+const int STENCIL_BACK_FAIL = RenderingContext.STENCIL_BACK_FAIL;
+const int STENCIL_BACK_FUNC = RenderingContext.STENCIL_BACK_FUNC;
+const int STENCIL_BACK_PASS_DEPTH_FAIL = RenderingContext.STENCIL_BACK_PASS_DEPTH_FAIL;
+const int STENCIL_BACK_PASS_DEPTH_PASS = RenderingContext.STENCIL_BACK_PASS_DEPTH_PASS;
+const int STENCIL_BACK_REF = RenderingContext.STENCIL_BACK_REF;
+const int STENCIL_BACK_VALUE_MASK = RenderingContext.STENCIL_BACK_VALUE_MASK;
+const int STENCIL_BACK_WRITEMASK = RenderingContext.STENCIL_BACK_WRITEMASK;
+const int STENCIL_BITS = RenderingContext.STENCIL_BITS;
+const int STENCIL_BUFFER_BIT = RenderingContext.STENCIL_BUFFER_BIT;
+const int STENCIL_CLEAR_VALUE = RenderingContext.STENCIL_CLEAR_VALUE;
+const int STENCIL_FAIL = RenderingContext.STENCIL_FAIL;
+const int STENCIL_FUNC = RenderingContext.STENCIL_FUNC;
+const int STENCIL_INDEX = RenderingContext.STENCIL_INDEX;
+const int STENCIL_INDEX8 = RenderingContext.STENCIL_INDEX8;
+const int STENCIL_PASS_DEPTH_FAIL = RenderingContext.STENCIL_PASS_DEPTH_FAIL;
+const int STENCIL_PASS_DEPTH_PASS = RenderingContext.STENCIL_PASS_DEPTH_PASS;
+const int STENCIL_REF = RenderingContext.STENCIL_REF;
+const int STENCIL_TEST = RenderingContext.STENCIL_TEST;
+const int STENCIL_VALUE_MASK = RenderingContext.STENCIL_VALUE_MASK;
+const int STENCIL_WRITEMASK = RenderingContext.STENCIL_WRITEMASK;
+const int STREAM_DRAW = RenderingContext.STREAM_DRAW;
+const int SUBPIXEL_BITS = RenderingContext.SUBPIXEL_BITS;
+const int TEXTURE = RenderingContext.TEXTURE;
+const int TEXTURE0 = RenderingContext.TEXTURE0;
+const int TEXTURE1 = RenderingContext.TEXTURE1;
+const int TEXTURE10 = RenderingContext.TEXTURE10;
+const int TEXTURE11 = RenderingContext.TEXTURE11;
+const int TEXTURE12 = RenderingContext.TEXTURE12;
+const int TEXTURE13 = RenderingContext.TEXTURE13;
+const int TEXTURE14 = RenderingContext.TEXTURE14;
+const int TEXTURE15 = RenderingContext.TEXTURE15;
+const int TEXTURE16 = RenderingContext.TEXTURE16;
+const int TEXTURE17 = RenderingContext.TEXTURE17;
+const int TEXTURE18 = RenderingContext.TEXTURE18;
+const int TEXTURE19 = RenderingContext.TEXTURE19;
+const int TEXTURE2 = RenderingContext.TEXTURE2;
+const int TEXTURE20 = RenderingContext.TEXTURE20;
+const int TEXTURE21 = RenderingContext.TEXTURE21;
+const int TEXTURE22 = RenderingContext.TEXTURE22;
+const int TEXTURE23 = RenderingContext.TEXTURE23;
+const int TEXTURE24 = RenderingContext.TEXTURE24;
+const int TEXTURE25 = RenderingContext.TEXTURE25;
+const int TEXTURE26 = RenderingContext.TEXTURE26;
+const int TEXTURE27 = RenderingContext.TEXTURE27;
+const int TEXTURE28 = RenderingContext.TEXTURE28;
+const int TEXTURE29 = RenderingContext.TEXTURE29;
+const int TEXTURE3 = RenderingContext.TEXTURE3;
+const int TEXTURE30 = RenderingContext.TEXTURE30;
+const int TEXTURE31 = RenderingContext.TEXTURE31;
+const int TEXTURE4 = RenderingContext.TEXTURE4;
+const int TEXTURE5 = RenderingContext.TEXTURE5;
+const int TEXTURE6 = RenderingContext.TEXTURE6;
+const int TEXTURE7 = RenderingContext.TEXTURE7;
+const int TEXTURE8 = RenderingContext.TEXTURE8;
+const int TEXTURE9 = RenderingContext.TEXTURE9;
+const int TEXTURE_2D = RenderingContext.TEXTURE_2D;
+const int TEXTURE_BINDING_2D = RenderingContext.TEXTURE_BINDING_2D;
+const int TEXTURE_BINDING_CUBE_MAP = RenderingContext.TEXTURE_BINDING_CUBE_MAP;
+const int TEXTURE_CUBE_MAP = RenderingContext.TEXTURE_CUBE_MAP;
+const int TEXTURE_CUBE_MAP_NEGATIVE_X = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X;
+const int TEXTURE_CUBE_MAP_NEGATIVE_Y = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y;
+const int TEXTURE_CUBE_MAP_NEGATIVE_Z = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z;
+const int TEXTURE_CUBE_MAP_POSITIVE_X = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X;
+const int TEXTURE_CUBE_MAP_POSITIVE_Y = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y;
+const int TEXTURE_CUBE_MAP_POSITIVE_Z = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z;
+const int TEXTURE_MAG_FILTER = RenderingContext.TEXTURE_MAG_FILTER;
+const int TEXTURE_MIN_FILTER = RenderingContext.TEXTURE_MIN_FILTER;
+const int TEXTURE_WRAP_S = RenderingContext.TEXTURE_WRAP_S;
+const int TEXTURE_WRAP_T = RenderingContext.TEXTURE_WRAP_T;
+const int TRIANGLES = RenderingContext.TRIANGLES;
+const int TRIANGLE_FAN = RenderingContext.TRIANGLE_FAN;
+const int TRIANGLE_STRIP = RenderingContext.TRIANGLE_STRIP;
+const int UNPACK_ALIGNMENT = RenderingContext.UNPACK_ALIGNMENT;
+const int UNPACK_COLORSPACE_CONVERSION_WEBGL = RenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL;
+const int UNPACK_FLIP_Y_WEBGL = RenderingContext.UNPACK_FLIP_Y_WEBGL;
+const int UNPACK_PREMULTIPLY_ALPHA_WEBGL = RenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL;
+const int UNSIGNED_BYTE = RenderingContext.UNSIGNED_BYTE;
+const int UNSIGNED_INT = RenderingContext.UNSIGNED_INT;
+const int UNSIGNED_SHORT = RenderingContext.UNSIGNED_SHORT;
+const int UNSIGNED_SHORT_4_4_4_4 = RenderingContext.UNSIGNED_SHORT_4_4_4_4;
+const int UNSIGNED_SHORT_5_5_5_1 = RenderingContext.UNSIGNED_SHORT_5_5_5_1;
+const int UNSIGNED_SHORT_5_6_5 = RenderingContext.UNSIGNED_SHORT_5_6_5;
+const int VALIDATE_STATUS = RenderingContext.VALIDATE_STATUS;
+const int VENDOR = RenderingContext.VENDOR;
+const int VERSION = RenderingContext.VERSION;
+const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = RenderingContext.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING;
+const int VERTEX_ATTRIB_ARRAY_ENABLED = RenderingContext.VERTEX_ATTRIB_ARRAY_ENABLED;
+const int VERTEX_ATTRIB_ARRAY_NORMALIZED = RenderingContext.VERTEX_ATTRIB_ARRAY_NORMALIZED;
+const int VERTEX_ATTRIB_ARRAY_POINTER = RenderingContext.VERTEX_ATTRIB_ARRAY_POINTER;
+const int VERTEX_ATTRIB_ARRAY_SIZE = RenderingContext.VERTEX_ATTRIB_ARRAY_SIZE;
+const int VERTEX_ATTRIB_ARRAY_STRIDE = RenderingContext.VERTEX_ATTRIB_ARRAY_STRIDE;
+const int VERTEX_ATTRIB_ARRAY_TYPE = RenderingContext.VERTEX_ATTRIB_ARRAY_TYPE;
+const int VERTEX_SHADER = RenderingContext.VERTEX_SHADER;
+const int VIEWPORT = RenderingContext.VIEWPORT;
+const int ZERO = RenderingContext.ZERO;
+// 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('WebGLActiveInfo')
+class ActiveInfo native "*WebGLActiveInfo" {
+
+  @DomName('WebGLActiveInfo.name')
+  @DocsEditable
+  final String name;
+
+  @DomName('WebGLActiveInfo.size')
+  @DocsEditable
+  final int size;
+
+  @DomName('WebGLActiveInfo.type')
+  @DocsEditable
+  final int type;
+}
+// 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('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('WebGLCompressedTextureATC')
+class CompressedTextureAtc native "*WebGLCompressedTextureATC" {
+
+  static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
+
+  static const int COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
+
+  static const int COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
+}
+// 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('WebGLCompressedTexturePVRTC')
+class CompressedTexturePvrtc native "*WebGLCompressedTexturePVRTC" {
+
+  static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
+
+  static const int COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
+
+  static const int COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
+
+  static const int COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
+}
+// 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('WebGLCompressedTextureS3TC')
+class CompressedTextureS3TC native "*WebGLCompressedTextureS3TC" {
+
+  static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
+
+  static const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
+
+  static const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
+
+  static const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
+}
+// 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('WebGLContextAttributes')
+class ContextAttributes native "*WebGLContextAttributes" {
+
+  @DomName('WebGLContextAttributes.alpha')
+  @DocsEditable
+  bool alpha;
+
+  @DomName('WebGLContextAttributes.antialias')
+  @DocsEditable
+  bool antialias;
+
+  @DomName('WebGLContextAttributes.depth')
+  @DocsEditable
+  bool depth;
+
+  @DomName('WebGLContextAttributes.premultipliedAlpha')
+  @DocsEditable
+  bool premultipliedAlpha;
+
+  @DomName('WebGLContextAttributes.preserveDrawingBuffer')
+  @DocsEditable
+  bool preserveDrawingBuffer;
+
+  @DomName('WebGLContextAttributes.stencil')
+  @DocsEditable
+  bool stencil;
+}
+// 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('WebGLContextEvent')
+class ContextEvent extends Event native "*WebGLContextEvent" {
+
+  @DomName('WebGLContextEvent.statusMessage')
+  @DocsEditable
+  final String statusMessage;
+}
+// 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('WebGLDebugRendererInfo')
+class DebugRendererInfo native "*WebGLDebugRendererInfo" {
+
+  static const int UNMASKED_RENDERER_WEBGL = 0x9246;
+
+  static const int UNMASKED_VENDOR_WEBGL = 0x9245;
+}
+// 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('WebGLDebugShaders')
+class DebugShaders native "*WebGLDebugShaders" {
+
+  @DomName('WebGLDebugShaders.getTranslatedShaderSource')
+  @DocsEditable
+  String getTranslatedShaderSource(Shader shader) 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('WebGLDepthTexture')
+class DepthTexture native "*WebGLDepthTexture" {
+
+  static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
+}
+// 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('EXTDrawBuffers')
+class ExtDrawBuffers native "*EXTDrawBuffers" {
+
+  static const int COLOR_ATTACHMENT0_EXT = 0x8CE0;
+
+  static const int COLOR_ATTACHMENT10_EXT = 0x8CEA;
+
+  static const int COLOR_ATTACHMENT11_EXT = 0x8CEB;
+
+  static const int COLOR_ATTACHMENT12_EXT = 0x8CEC;
+
+  static const int COLOR_ATTACHMENT13_EXT = 0x8CED;
+
+  static const int COLOR_ATTACHMENT14_EXT = 0x8CEE;
+
+  static const int COLOR_ATTACHMENT15_EXT = 0x8CEF;
+
+  static const int COLOR_ATTACHMENT1_EXT = 0x8CE1;
+
+  static const int COLOR_ATTACHMENT2_EXT = 0x8CE2;
+
+  static const int COLOR_ATTACHMENT3_EXT = 0x8CE3;
+
+  static const int COLOR_ATTACHMENT4_EXT = 0x8CE4;
+
+  static const int COLOR_ATTACHMENT5_EXT = 0x8CE5;
+
+  static const int COLOR_ATTACHMENT6_EXT = 0x8CE6;
+
+  static const int COLOR_ATTACHMENT7_EXT = 0x8CE7;
+
+  static const int COLOR_ATTACHMENT8_EXT = 0x8CE8;
+
+  static const int COLOR_ATTACHMENT9_EXT = 0x8CE9;
+
+  static const int DRAW_BUFFER0_EXT = 0x8825;
+
+  static const int DRAW_BUFFER10_EXT = 0x882F;
+
+  static const int DRAW_BUFFER11_EXT = 0x8830;
+
+  static const int DRAW_BUFFER12_EXT = 0x8831;
+
+  static const int DRAW_BUFFER13_EXT = 0x8832;
+
+  static const int DRAW_BUFFER14_EXT = 0x8833;
+
+  static const int DRAW_BUFFER15_EXT = 0x8834;
+
+  static const int DRAW_BUFFER1_EXT = 0x8826;
+
+  static const int DRAW_BUFFER2_EXT = 0x8827;
+
+  static const int DRAW_BUFFER3_EXT = 0x8828;
+
+  static const int DRAW_BUFFER4_EXT = 0x8829;
+
+  static const int DRAW_BUFFER5_EXT = 0x882A;
+
+  static const int DRAW_BUFFER6_EXT = 0x882B;
+
+  static const int DRAW_BUFFER7_EXT = 0x882C;
+
+  static const int DRAW_BUFFER8_EXT = 0x882D;
+
+  static const int DRAW_BUFFER9_EXT = 0x882E;
+
+  static const int MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF;
+
+  static const int MAX_DRAW_BUFFERS_EXT = 0x8824;
+}
+// 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('EXTTextureFilterAnisotropic')
+class ExtTextureFilterAnisotropic native "*EXTTextureFilterAnisotropic" {
+
+  static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
+
+  static const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
+}
+// 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('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('WebGLLoseContext')
+class LoseContext native "*WebGLLoseContext" {
+
+  @DomName('WebGLLoseContext.loseContext')
+  @DocsEditable
+  void loseContext() native;
+
+  @DomName('WebGLLoseContext.restoreContext')
+  @DocsEditable
+  void restoreContext() 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('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('OESStandardDerivatives')
+class OesStandardDerivatives native "*OESStandardDerivatives" {
+
+  static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
+}
+// 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('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('OESVertexArrayObject')
+class OesVertexArrayObject native "*OESVertexArrayObject" {
+
+  static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
+
+  @JSName('bindVertexArrayOES')
+  @DomName('OESVertexArrayObject.bindVertexArrayOES')
+  @DocsEditable
+  void bindVertexArray(VertexArrayObject arrayObject) native;
+
+  @JSName('createVertexArrayOES')
+  @DomName('OESVertexArrayObject.createVertexArrayOES')
+  @DocsEditable
+  VertexArrayObject createVertexArray() native;
+
+  @JSName('deleteVertexArrayOES')
+  @DomName('OESVertexArrayObject.deleteVertexArrayOES')
+  @DocsEditable
+  void deleteVertexArray(VertexArrayObject arrayObject) native;
+
+  @JSName('isVertexArrayOES')
+  @DomName('OESVertexArrayObject.isVertexArrayOES')
+  @DocsEditable
+  bool isVertexArray(VertexArrayObject arrayObject) 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('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('WebGLRenderingContext')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@Experimental
+class RenderingContext extends CanvasRenderingContext native "*WebGLRenderingContext" {
+
+  /// Checks if this type is supported on the current platform.
+  static bool get supported => JS('bool', '!!(window.WebGLRenderingContext)');
+
+  static const int ACTIVE_ATTRIBUTES = 0x8B89;
+
+  static const int ACTIVE_TEXTURE = 0x84E0;
+
+  static const int ACTIVE_UNIFORMS = 0x8B86;
+
+  static const int ALIASED_LINE_WIDTH_RANGE = 0x846E;
+
+  static const int ALIASED_POINT_SIZE_RANGE = 0x846D;
+
+  static const int ALPHA = 0x1906;
+
+  static const int ALPHA_BITS = 0x0D55;
+
+  static const int ALWAYS = 0x0207;
+
+  static const int ARRAY_BUFFER = 0x8892;
+
+  static const int ARRAY_BUFFER_BINDING = 0x8894;
+
+  static const int ATTACHED_SHADERS = 0x8B85;
+
+  static const int BACK = 0x0405;
+
+  static const int BLEND = 0x0BE2;
+
+  static const int BLEND_COLOR = 0x8005;
+
+  static const int BLEND_DST_ALPHA = 0x80CA;
+
+  static const int BLEND_DST_RGB = 0x80C8;
+
+  static const int BLEND_EQUATION = 0x8009;
+
+  static const int BLEND_EQUATION_ALPHA = 0x883D;
+
+  static const int BLEND_EQUATION_RGB = 0x8009;
+
+  static const int BLEND_SRC_ALPHA = 0x80CB;
+
+  static const int BLEND_SRC_RGB = 0x80C9;
+
+  static const int BLUE_BITS = 0x0D54;
+
+  static const int BOOL = 0x8B56;
+
+  static const int BOOL_VEC2 = 0x8B57;
+
+  static const int BOOL_VEC3 = 0x8B58;
+
+  static const int BOOL_VEC4 = 0x8B59;
+
+  static const int BROWSER_DEFAULT_WEBGL = 0x9244;
+
+  static const int BUFFER_SIZE = 0x8764;
+
+  static const int BUFFER_USAGE = 0x8765;
+
+  static const int BYTE = 0x1400;
+
+  static const int CCW = 0x0901;
+
+  static const int CLAMP_TO_EDGE = 0x812F;
+
+  static const int COLOR_ATTACHMENT0 = 0x8CE0;
+
+  static const int COLOR_BUFFER_BIT = 0x00004000;
+
+  static const int COLOR_CLEAR_VALUE = 0x0C22;
+
+  static const int COLOR_WRITEMASK = 0x0C23;
+
+  static const int COMPILE_STATUS = 0x8B81;
+
+  static const int COMPRESSED_TEXTURE_FORMATS = 0x86A3;
+
+  static const int CONSTANT_ALPHA = 0x8003;
+
+  static const int CONSTANT_COLOR = 0x8001;
+
+  static const int CONTEXT_LOST_WEBGL = 0x9242;
+
+  static const int CULL_FACE = 0x0B44;
+
+  static const int CULL_FACE_MODE = 0x0B45;
+
+  static const int CURRENT_PROGRAM = 0x8B8D;
+
+  static const int CURRENT_VERTEX_ATTRIB = 0x8626;
+
+  static const int CW = 0x0900;
+
+  static const int DECR = 0x1E03;
+
+  static const int DECR_WRAP = 0x8508;
+
+  static const int DELETE_STATUS = 0x8B80;
+
+  static const int DEPTH_ATTACHMENT = 0x8D00;
+
+  static const int DEPTH_BITS = 0x0D56;
+
+  static const int DEPTH_BUFFER_BIT = 0x00000100;
+
+  static const int DEPTH_CLEAR_VALUE = 0x0B73;
+
+  static const int DEPTH_COMPONENT = 0x1902;
+
+  static const int DEPTH_COMPONENT16 = 0x81A5;
+
+  static const int DEPTH_FUNC = 0x0B74;
+
+  static const int DEPTH_RANGE = 0x0B70;
+
+  static const int DEPTH_STENCIL = 0x84F9;
+
+  static const int DEPTH_STENCIL_ATTACHMENT = 0x821A;
+
+  static const int DEPTH_TEST = 0x0B71;
+
+  static const int DEPTH_WRITEMASK = 0x0B72;
+
+  static const int DITHER = 0x0BD0;
+
+  static const int DONT_CARE = 0x1100;
+
+  static const int DST_ALPHA = 0x0304;
+
+  static const int DST_COLOR = 0x0306;
+
+  static const int DYNAMIC_DRAW = 0x88E8;
+
+  static const int ELEMENT_ARRAY_BUFFER = 0x8893;
+
+  static const int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
+
+  static const int EQUAL = 0x0202;
+
+  static const int FASTEST = 0x1101;
+
+  static const int FLOAT = 0x1406;
+
+  static const int FLOAT_MAT2 = 0x8B5A;
+
+  static const int FLOAT_MAT3 = 0x8B5B;
+
+  static const int FLOAT_MAT4 = 0x8B5C;
+
+  static const int FLOAT_VEC2 = 0x8B50;
+
+  static const int FLOAT_VEC3 = 0x8B51;
+
+  static const int FLOAT_VEC4 = 0x8B52;
+
+  static const int FRAGMENT_SHADER = 0x8B30;
+
+  static const int FRAMEBUFFER = 0x8D40;
+
+  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
+
+  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
+
+  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
+
+  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
+
+  static const int FRAMEBUFFER_BINDING = 0x8CA6;
+
+  static const int FRAMEBUFFER_COMPLETE = 0x8CD5;
+
+  static const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
+
+  static const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
+
+  static const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
+
+  static const int FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
+
+  static const int FRONT = 0x0404;
+
+  static const int FRONT_AND_BACK = 0x0408;
+
+  static const int FRONT_FACE = 0x0B46;
+
+  static const int FUNC_ADD = 0x8006;
+
+  static const int FUNC_REVERSE_SUBTRACT = 0x800B;
+
+  static const int FUNC_SUBTRACT = 0x800A;
+
+  static const int GENERATE_MIPMAP_HINT = 0x8192;
+
+  static const int GEQUAL = 0x0206;
+
+  static const int GREATER = 0x0204;
+
+  static const int GREEN_BITS = 0x0D53;
+
+  static const int HALF_FLOAT_OES = 0x8D61;
+
+  static const int HIGH_FLOAT = 0x8DF2;
+
+  static const int HIGH_INT = 0x8DF5;
+
+  static const int INCR = 0x1E02;
+
+  static const int INCR_WRAP = 0x8507;
+
+  static const int INT = 0x1404;
+
+  static const int INT_VEC2 = 0x8B53;
+
+  static const int INT_VEC3 = 0x8B54;
+
+  static const int INT_VEC4 = 0x8B55;
+
+  static const int INVALID_ENUM = 0x0500;
+
+  static const int INVALID_FRAMEBUFFER_OPERATION = 0x0506;
+
+  static const int INVALID_OPERATION = 0x0502;
+
+  static const int INVALID_VALUE = 0x0501;
+
+  static const int INVERT = 0x150A;
+
+  static const int KEEP = 0x1E00;
+
+  static const int LEQUAL = 0x0203;
+
+  static const int LESS = 0x0201;
+
+  static const int LINEAR = 0x2601;
+
+  static const int LINEAR_MIPMAP_LINEAR = 0x2703;
+
+  static const int LINEAR_MIPMAP_NEAREST = 0x2701;
+
+  static const int LINES = 0x0001;
+
+  static const int LINE_LOOP = 0x0002;
+
+  static const int LINE_STRIP = 0x0003;
+
+  static const int LINE_WIDTH = 0x0B21;
+
+  static const int LINK_STATUS = 0x8B82;
+
+  static const int LOW_FLOAT = 0x8DF0;
+
+  static const int LOW_INT = 0x8DF3;
+
+  static const int LUMINANCE = 0x1909;
+
+  static const int LUMINANCE_ALPHA = 0x190A;
+
+  static const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
+
+  static const int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
+
+  static const int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
+
+  static const int MAX_RENDERBUFFER_SIZE = 0x84E8;
+
+  static const int MAX_TEXTURE_IMAGE_UNITS = 0x8872;
+
+  static const int MAX_TEXTURE_SIZE = 0x0D33;
+
+  static const int MAX_VARYING_VECTORS = 0x8DFC;
+
+  static const int MAX_VERTEX_ATTRIBS = 0x8869;
+
+  static const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
+
+  static const int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
+
+  static const int MAX_VIEWPORT_DIMS = 0x0D3A;
+
+  static const int MEDIUM_FLOAT = 0x8DF1;
+
+  static const int MEDIUM_INT = 0x8DF4;
+
+  static const int MIRRORED_REPEAT = 0x8370;
+
+  static const int NEAREST = 0x2600;
+
+  static const int NEAREST_MIPMAP_LINEAR = 0x2702;
+
+  static const int NEAREST_MIPMAP_NEAREST = 0x2700;
+
+  static const int NEVER = 0x0200;
+
+  static const int NICEST = 0x1102;
+
+  static const int NONE = 0;
+
+  static const int NOTEQUAL = 0x0205;
+
+  static const int NO_ERROR = 0;
+
+  static const int ONE = 1;
+
+  static const int ONE_MINUS_CONSTANT_ALPHA = 0x8004;
+
+  static const int ONE_MINUS_CONSTANT_COLOR = 0x8002;
+
+  static const int ONE_MINUS_DST_ALPHA = 0x0305;
+
+  static const int ONE_MINUS_DST_COLOR = 0x0307;
+
+  static const int ONE_MINUS_SRC_ALPHA = 0x0303;
+
+  static const int ONE_MINUS_SRC_COLOR = 0x0301;
+
+  static const int OUT_OF_MEMORY = 0x0505;
+
+  static const int PACK_ALIGNMENT = 0x0D05;
+
+  static const int POINTS = 0x0000;
+
+  static const int POLYGON_OFFSET_FACTOR = 0x8038;
+
+  static const int POLYGON_OFFSET_FILL = 0x8037;
+
+  static const int POLYGON_OFFSET_UNITS = 0x2A00;
+
+  static const int RED_BITS = 0x0D52;
+
+  static const int RENDERBUFFER = 0x8D41;
+
+  static const int RENDERBUFFER_ALPHA_SIZE = 0x8D53;
+
+  static const int RENDERBUFFER_BINDING = 0x8CA7;
+
+  static const int RENDERBUFFER_BLUE_SIZE = 0x8D52;
+
+  static const int RENDERBUFFER_DEPTH_SIZE = 0x8D54;
+
+  static const int RENDERBUFFER_GREEN_SIZE = 0x8D51;
+
+  static const int RENDERBUFFER_HEIGHT = 0x8D43;
+
+  static const int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
+
+  static const int RENDERBUFFER_RED_SIZE = 0x8D50;
+
+  static const int RENDERBUFFER_STENCIL_SIZE = 0x8D55;
+
+  static const int RENDERBUFFER_WIDTH = 0x8D42;
+
+  static const int RENDERER = 0x1F01;
+
+  static const int REPEAT = 0x2901;
+
+  static const int REPLACE = 0x1E01;
+
+  static const int RGB = 0x1907;
+
+  static const int RGB565 = 0x8D62;
+
+  static const int RGB5_A1 = 0x8057;
+
+  static const int RGBA = 0x1908;
+
+  static const int RGBA4 = 0x8056;
+
+  static const int SAMPLER_2D = 0x8B5E;
+
+  static const int SAMPLER_CUBE = 0x8B60;
+
+  static const int SAMPLES = 0x80A9;
+
+  static const int SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
+
+  static const int SAMPLE_BUFFERS = 0x80A8;
+
+  static const int SAMPLE_COVERAGE = 0x80A0;
+
+  static const int SAMPLE_COVERAGE_INVERT = 0x80AB;
+
+  static const int SAMPLE_COVERAGE_VALUE = 0x80AA;
+
+  static const int SCISSOR_BOX = 0x0C10;
+
+  static const int SCISSOR_TEST = 0x0C11;
+
+  static const int SHADER_TYPE = 0x8B4F;
+
+  static const int SHADING_LANGUAGE_VERSION = 0x8B8C;
+
+  static const int SHORT = 0x1402;
+
+  static const int SRC_ALPHA = 0x0302;
+
+  static const int SRC_ALPHA_SATURATE = 0x0308;
+
+  static const int SRC_COLOR = 0x0300;
+
+  static const int STATIC_DRAW = 0x88E4;
+
+  static const int STENCIL_ATTACHMENT = 0x8D20;
+
+  static const int STENCIL_BACK_FAIL = 0x8801;
+
+  static const int STENCIL_BACK_FUNC = 0x8800;
+
+  static const int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
+
+  static const int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
+
+  static const int STENCIL_BACK_REF = 0x8CA3;
+
+  static const int STENCIL_BACK_VALUE_MASK = 0x8CA4;
+
+  static const int STENCIL_BACK_WRITEMASK = 0x8CA5;
+
+  static const int STENCIL_BITS = 0x0D57;
+
+  static const int STENCIL_BUFFER_BIT = 0x00000400;
+
+  static const int STENCIL_CLEAR_VALUE = 0x0B91;
+
+  static const int STENCIL_FAIL = 0x0B94;
+
+  static const int STENCIL_FUNC = 0x0B92;
+
+  static const int STENCIL_INDEX = 0x1901;
+
+  static const int STENCIL_INDEX8 = 0x8D48;
+
+  static const int STENCIL_PASS_DEPTH_FAIL = 0x0B95;
+
+  static const int STENCIL_PASS_DEPTH_PASS = 0x0B96;
+
+  static const int STENCIL_REF = 0x0B97;
+
+  static const int STENCIL_TEST = 0x0B90;
+
+  static const int STENCIL_VALUE_MASK = 0x0B93;
+
+  static const int STENCIL_WRITEMASK = 0x0B98;
+
+  static const int STREAM_DRAW = 0x88E0;
+
+  static const int SUBPIXEL_BITS = 0x0D50;
+
+  static const int TEXTURE = 0x1702;
+
+  static const int TEXTURE0 = 0x84C0;
+
+  static const int TEXTURE1 = 0x84C1;
+
+  static const int TEXTURE10 = 0x84CA;
+
+  static const int TEXTURE11 = 0x84CB;
+
+  static const int TEXTURE12 = 0x84CC;
+
+  static const int TEXTURE13 = 0x84CD;
+
+  static const int TEXTURE14 = 0x84CE;
+
+  static const int TEXTURE15 = 0x84CF;
+
+  static const int TEXTURE16 = 0x84D0;
+
+  static const int TEXTURE17 = 0x84D1;
+
+  static const int TEXTURE18 = 0x84D2;
+
+  static const int TEXTURE19 = 0x84D3;
+
+  static const int TEXTURE2 = 0x84C2;
+
+  static const int TEXTURE20 = 0x84D4;
+
+  static const int TEXTURE21 = 0x84D5;
+
+  static const int TEXTURE22 = 0x84D6;
+
+  static const int TEXTURE23 = 0x84D7;
+
+  static const int TEXTURE24 = 0x84D8;
+
+  static const int TEXTURE25 = 0x84D9;
+
+  static const int TEXTURE26 = 0x84DA;
+
+  static const int TEXTURE27 = 0x84DB;
+
+  static const int TEXTURE28 = 0x84DC;
+
+  static const int TEXTURE29 = 0x84DD;
+
+  static const int TEXTURE3 = 0x84C3;
+
+  static const int TEXTURE30 = 0x84DE;
+
+  static const int TEXTURE31 = 0x84DF;
+
+  static const int TEXTURE4 = 0x84C4;
+
+  static const int TEXTURE5 = 0x84C5;
+
+  static const int TEXTURE6 = 0x84C6;
+
+  static const int TEXTURE7 = 0x84C7;
+
+  static const int TEXTURE8 = 0x84C8;
+
+  static const int TEXTURE9 = 0x84C9;
+
+  static const int TEXTURE_2D = 0x0DE1;
+
+  static const int TEXTURE_BINDING_2D = 0x8069;
+
+  static const int TEXTURE_BINDING_CUBE_MAP = 0x8514;
+
+  static const int TEXTURE_CUBE_MAP = 0x8513;
+
+  static const int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
+
+  static const int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
+
+  static const int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
+
+  static const int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
+
+  static const int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
+
+  static const int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
+
+  static const int TEXTURE_MAG_FILTER = 0x2800;
+
+  static const int TEXTURE_MIN_FILTER = 0x2801;
+
+  static const int TEXTURE_WRAP_S = 0x2802;
+
+  static const int TEXTURE_WRAP_T = 0x2803;
+
+  static const int TRIANGLES = 0x0004;
+
+  static const int TRIANGLE_FAN = 0x0006;
+
+  static const int TRIANGLE_STRIP = 0x0005;
+
+  static const int UNPACK_ALIGNMENT = 0x0CF5;
+
+  static const int UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
+
+  static const int UNPACK_FLIP_Y_WEBGL = 0x9240;
+
+  static const int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
+
+  static const int UNSIGNED_BYTE = 0x1401;
+
+  static const int UNSIGNED_INT = 0x1405;
+
+  static const int UNSIGNED_SHORT = 0x1403;
+
+  static const int UNSIGNED_SHORT_4_4_4_4 = 0x8033;
+
+  static const int UNSIGNED_SHORT_5_5_5_1 = 0x8034;
+
+  static const int UNSIGNED_SHORT_5_6_5 = 0x8363;
+
+  static const int VALIDATE_STATUS = 0x8B83;
+
+  static const int VENDOR = 0x1F00;
+
+  static const int VERSION = 0x1F02;
+
+  static const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
+
+  static const int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
+
+  static const int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
+
+  static const int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
+
+  static const int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
+
+  static const int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
+
+  static const int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
+
+  static const int VERTEX_SHADER = 0x8B31;
+
+  static const int VIEWPORT = 0x0BA2;
+
+  static const int ZERO = 0;
+
+  @DomName('WebGLRenderingContext.drawingBufferHeight')
+  @DocsEditable
+  final int drawingBufferHeight;
+
+  @DomName('WebGLRenderingContext.drawingBufferWidth')
+  @DocsEditable
+  final int drawingBufferWidth;
+
+  @DomName('WebGLRenderingContext.activeTexture')
+  @DocsEditable
+  void activeTexture(int texture) native;
+
+  @DomName('WebGLRenderingContext.attachShader')
+  @DocsEditable
+  void attachShader(Program program, Shader shader) native;
+
+  @DomName('WebGLRenderingContext.bindAttribLocation')
+  @DocsEditable
+  void bindAttribLocation(Program program, int index, String name) native;
+
+  @DomName('WebGLRenderingContext.bindBuffer')
+  @DocsEditable
+  void bindBuffer(int target, Buffer buffer) native;
+
+  @DomName('WebGLRenderingContext.bindFramebuffer')
+  @DocsEditable
+  void bindFramebuffer(int target, Framebuffer framebuffer) native;
+
+  @DomName('WebGLRenderingContext.bindRenderbuffer')
+  @DocsEditable
+  void bindRenderbuffer(int target, Renderbuffer renderbuffer) native;
+
+  @DomName('WebGLRenderingContext.bindTexture')
+  @DocsEditable
+  void bindTexture(int target, Texture texture) native;
+
+  @DomName('WebGLRenderingContext.blendColor')
+  @DocsEditable
+  void blendColor(num red, num green, num blue, num alpha) native;
+
+  @DomName('WebGLRenderingContext.blendEquation')
+  @DocsEditable
+  void blendEquation(int mode) native;
+
+  @DomName('WebGLRenderingContext.blendEquationSeparate')
+  @DocsEditable
+  void blendEquationSeparate(int modeRGB, int modeAlpha) native;
+
+  @DomName('WebGLRenderingContext.blendFunc')
+  @DocsEditable
+  void blendFunc(int sfactor, int dfactor) native;
+
+  @DomName('WebGLRenderingContext.blendFuncSeparate')
+  @DocsEditable
+  void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) native;
+
+  @DomName('WebGLRenderingContext.bufferData')
+  @DocsEditable
+  void bufferData(int target, data_OR_size, int usage) native;
+
+  @DomName('WebGLRenderingContext.bufferSubData')
+  @DocsEditable
+  void bufferSubData(int target, int offset, /*ArrayBuffer*/ data) native;
+
+  @DomName('WebGLRenderingContext.checkFramebufferStatus')
+  @DocsEditable
+  int checkFramebufferStatus(int target) native;
+
+  @DomName('WebGLRenderingContext.clear')
+  @DocsEditable
+  void clear(int mask) native;
+
+  @DomName('WebGLRenderingContext.clearColor')
+  @DocsEditable
+  void clearColor(num red, num green, num blue, num alpha) native;
+
+  @DomName('WebGLRenderingContext.clearDepth')
+  @DocsEditable
+  void clearDepth(num depth) native;
+
+  @DomName('WebGLRenderingContext.clearStencil')
+  @DocsEditable
+  void clearStencil(int s) native;
+
+  @DomName('WebGLRenderingContext.colorMask')
+  @DocsEditable
+  void colorMask(bool red, bool green, bool blue, bool alpha) native;
+
+  @DomName('WebGLRenderingContext.compileShader')
+  @DocsEditable
+  void compileShader(Shader shader) native;
+
+  @DomName('WebGLRenderingContext.compressedTexImage2D')
+  @DocsEditable
+  void compressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, /*ArrayBufferView*/ 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;
+
+  @DomName('WebGLRenderingContext.copyTexImage2D')
+  @DocsEditable
+  void copyTexImage2D(int target, int level, int internalformat, int x, int y, int width, int height, int border) native;
+
+  @DomName('WebGLRenderingContext.copyTexSubImage2D')
+  @DocsEditable
+  void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) native;
+
+  @DomName('WebGLRenderingContext.createBuffer')
+  @DocsEditable
+  Buffer createBuffer() native;
+
+  @DomName('WebGLRenderingContext.createFramebuffer')
+  @DocsEditable
+  Framebuffer createFramebuffer() native;
+
+  @DomName('WebGLRenderingContext.createProgram')
+  @DocsEditable
+  Program createProgram() native;
+
+  @DomName('WebGLRenderingContext.createRenderbuffer')
+  @DocsEditable
+  Renderbuffer createRenderbuffer() native;
+
+  @DomName('WebGLRenderingContext.createShader')
+  @DocsEditable
+  Shader createShader(int type) native;
+
+  @DomName('WebGLRenderingContext.createTexture')
+  @DocsEditable
+  Texture createTexture() native;
+
+  @DomName('WebGLRenderingContext.cullFace')
+  @DocsEditable
+  void cullFace(int mode) native;
+
+  @DomName('WebGLRenderingContext.deleteBuffer')
+  @DocsEditable
+  void deleteBuffer(Buffer buffer) native;
+
+  @DomName('WebGLRenderingContext.deleteFramebuffer')
+  @DocsEditable
+  void deleteFramebuffer(Framebuffer framebuffer) native;
+
+  @DomName('WebGLRenderingContext.deleteProgram')
+  @DocsEditable
+  void deleteProgram(Program program) native;
+
+  @DomName('WebGLRenderingContext.deleteRenderbuffer')
+  @DocsEditable
+  void deleteRenderbuffer(Renderbuffer renderbuffer) native;
+
+  @DomName('WebGLRenderingContext.deleteShader')
+  @DocsEditable
+  void deleteShader(Shader shader) native;
+
+  @DomName('WebGLRenderingContext.deleteTexture')
+  @DocsEditable
+  void deleteTexture(Texture texture) native;
+
+  @DomName('WebGLRenderingContext.depthFunc')
+  @DocsEditable
+  void depthFunc(int func) native;
+
+  @DomName('WebGLRenderingContext.depthMask')
+  @DocsEditable
+  void depthMask(bool flag) native;
+
+  @DomName('WebGLRenderingContext.depthRange')
+  @DocsEditable
+  void depthRange(num zNear, num zFar) native;
+
+  @DomName('WebGLRenderingContext.detachShader')
+  @DocsEditable
+  void detachShader(Program program, Shader shader) native;
+
+  @DomName('WebGLRenderingContext.disable')
+  @DocsEditable
+  void disable(int cap) native;
+
+  @DomName('WebGLRenderingContext.disableVertexAttribArray')
+  @DocsEditable
+  void disableVertexAttribArray(int index) native;
+
+  @DomName('WebGLRenderingContext.drawArrays')
+  @DocsEditable
+  void drawArrays(int mode, int first, int count) native;
+
+  @DomName('WebGLRenderingContext.drawElements')
+  @DocsEditable
+  void drawElements(int mode, int count, int type, int offset) native;
+
+  @DomName('WebGLRenderingContext.enable')
+  @DocsEditable
+  void enable(int cap) native;
+
+  @DomName('WebGLRenderingContext.enableVertexAttribArray')
+  @DocsEditable
+  void enableVertexAttribArray(int index) native;
+
+  @DomName('WebGLRenderingContext.finish')
+  @DocsEditable
+  void finish() native;
+
+  @DomName('WebGLRenderingContext.flush')
+  @DocsEditable
+  void flush() native;
+
+  @DomName('WebGLRenderingContext.framebufferRenderbuffer')
+  @DocsEditable
+  void framebufferRenderbuffer(int target, int attachment, int renderbuffertarget, Renderbuffer renderbuffer) native;
+
+  @DomName('WebGLRenderingContext.framebufferTexture2D')
+  @DocsEditable
+  void framebufferTexture2D(int target, int attachment, int textarget, Texture texture, int level) native;
+
+  @DomName('WebGLRenderingContext.frontFace')
+  @DocsEditable
+  void frontFace(int mode) native;
+
+  @DomName('WebGLRenderingContext.generateMipmap')
+  @DocsEditable
+  void generateMipmap(int target) native;
+
+  @DomName('WebGLRenderingContext.getActiveAttrib')
+  @DocsEditable
+  ActiveInfo getActiveAttrib(Program program, int index) native;
+
+  @DomName('WebGLRenderingContext.getActiveUniform')
+  @DocsEditable
+  ActiveInfo getActiveUniform(Program program, int index) native;
+
+  @DomName('WebGLRenderingContext.getAttachedShaders')
+  @DocsEditable
+  void getAttachedShaders(Program program) native;
+
+  @DomName('WebGLRenderingContext.getAttribLocation')
+  @DocsEditable
+  int getAttribLocation(Program program, String name) native;
+
+  @DomName('WebGLRenderingContext.getBufferParameter')
+  @DocsEditable
+  Object getBufferParameter(int target, int pname) native;
+
+  @DomName('WebGLRenderingContext.getContextAttributes')
+  @DocsEditable
+  ContextAttributes getContextAttributes() native;
+
+  @DomName('WebGLRenderingContext.getError')
+  @DocsEditable
+  int getError() native;
+
+  @DomName('WebGLRenderingContext.getExtension')
+  @DocsEditable
+  Object getExtension(String name) native;
+
+  @DomName('WebGLRenderingContext.getFramebufferAttachmentParameter')
+  @DocsEditable
+  Object getFramebufferAttachmentParameter(int target, int attachment, int pname) native;
+
+  @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')
+  Object getParameter(int pname) native;
+
+  @DomName('WebGLRenderingContext.getProgramInfoLog')
+  @DocsEditable
+  String getProgramInfoLog(Program program) native;
+
+  @DomName('WebGLRenderingContext.getProgramParameter')
+  @DocsEditable
+  Object getProgramParameter(Program program, int pname) native;
+
+  @DomName('WebGLRenderingContext.getRenderbufferParameter')
+  @DocsEditable
+  Object getRenderbufferParameter(int target, int pname) native;
+
+  @DomName('WebGLRenderingContext.getShaderInfoLog')
+  @DocsEditable
+  String getShaderInfoLog(Shader shader) native;
+
+  @DomName('WebGLRenderingContext.getShaderParameter')
+  @DocsEditable
+  Object getShaderParameter(Shader shader, int pname) native;
+
+  @DomName('WebGLRenderingContext.getShaderPrecisionFormat')
+  @DocsEditable
+  ShaderPrecisionFormat getShaderPrecisionFormat(int shadertype, int precisiontype) native;
+
+  @DomName('WebGLRenderingContext.getShaderSource')
+  @DocsEditable
+  String getShaderSource(Shader shader) native;
+
+  @DomName('WebGLRenderingContext.getSupportedExtensions')
+  @DocsEditable
+  List<String> getSupportedExtensions() native;
+
+  @DomName('WebGLRenderingContext.getTexParameter')
+  @DocsEditable
+  Object getTexParameter(int target, int pname) native;
+
+  @DomName('WebGLRenderingContext.getUniform')
+  @DocsEditable
+  Object getUniform(Program program, UniformLocation location) native;
+
+  @DomName('WebGLRenderingContext.getUniformLocation')
+  @DocsEditable
+  UniformLocation getUniformLocation(Program program, String name) native;
+
+  @DomName('WebGLRenderingContext.getVertexAttrib')
+  @DocsEditable
+  Object getVertexAttrib(int index, int pname) native;
+
+  @DomName('WebGLRenderingContext.getVertexAttribOffset')
+  @DocsEditable
+  int getVertexAttribOffset(int index, int pname) native;
+
+  @DomName('WebGLRenderingContext.hint')
+  @DocsEditable
+  void hint(int target, int mode) native;
+
+  @DomName('WebGLRenderingContext.isBuffer')
+  @DocsEditable
+  bool isBuffer(Buffer buffer) native;
+
+  @DomName('WebGLRenderingContext.isContextLost')
+  @DocsEditable
+  bool isContextLost() native;
+
+  @DomName('WebGLRenderingContext.isEnabled')
+  @DocsEditable
+  bool isEnabled(int cap) native;
+
+  @DomName('WebGLRenderingContext.isFramebuffer')
+  @DocsEditable
+  bool isFramebuffer(Framebuffer framebuffer) native;
+
+  @DomName('WebGLRenderingContext.isProgram')
+  @DocsEditable
+  bool isProgram(Program program) native;
+
+  @DomName('WebGLRenderingContext.isRenderbuffer')
+  @DocsEditable
+  bool isRenderbuffer(Renderbuffer renderbuffer) native;
+
+  @DomName('WebGLRenderingContext.isShader')
+  @DocsEditable
+  bool isShader(Shader shader) native;
+
+  @DomName('WebGLRenderingContext.isTexture')
+  @DocsEditable
+  bool isTexture(Texture texture) native;
+
+  @DomName('WebGLRenderingContext.lineWidth')
+  @DocsEditable
+  void lineWidth(num width) native;
+
+  @DomName('WebGLRenderingContext.linkProgram')
+  @DocsEditable
+  void linkProgram(Program program) native;
+
+  @DomName('WebGLRenderingContext.pixelStorei')
+  @DocsEditable
+  void pixelStorei(int pname, int param) native;
+
+  @DomName('WebGLRenderingContext.polygonOffset')
+  @DocsEditable
+  void polygonOffset(num factor, num units) native;
+
+  @DomName('WebGLRenderingContext.readPixels')
+  @DocsEditable
+  void readPixels(int x, int y, int width, int height, int format, int type, /*ArrayBufferView*/ pixels) native;
+
+  @DomName('WebGLRenderingContext.releaseShaderCompiler')
+  @DocsEditable
+  void releaseShaderCompiler() native;
+
+  @DomName('WebGLRenderingContext.renderbufferStorage')
+  @DocsEditable
+  void renderbufferStorage(int target, int internalformat, int width, int height) native;
+
+  @DomName('WebGLRenderingContext.sampleCoverage')
+  @DocsEditable
+  void sampleCoverage(num value, bool invert) native;
+
+  @DomName('WebGLRenderingContext.scissor')
+  @DocsEditable
+  void scissor(int x, int y, int width, int height) native;
+
+  @DomName('WebGLRenderingContext.shaderSource')
+  @DocsEditable
+  void shaderSource(Shader shader, String string) native;
+
+  @DomName('WebGLRenderingContext.stencilFunc')
+  @DocsEditable
+  void stencilFunc(int func, int ref, int mask) native;
+
+  @DomName('WebGLRenderingContext.stencilFuncSeparate')
+  @DocsEditable
+  void stencilFuncSeparate(int face, int func, int ref, int mask) native;
+
+  @DomName('WebGLRenderingContext.stencilMask')
+  @DocsEditable
+  void stencilMask(int mask) native;
+
+  @DomName('WebGLRenderingContext.stencilMaskSeparate')
+  @DocsEditable
+  void stencilMaskSeparate(int face, int mask) native;
+
+  @DomName('WebGLRenderingContext.stencilOp')
+  @DocsEditable
+  void stencilOp(int fail, int zfail, int zpass) native;
+
+  @DomName('WebGLRenderingContext.stencilOpSeparate')
+  @DocsEditable
+  void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
+
+  @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) {
+      _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
+      return;
+    }
+    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
+      var pixels_1 = _convertDartToNative_ImageData(border_OR_canvas_OR_image_OR_pixels_OR_video);
+      _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_type, pixels_1);
+      return;
+    }
+    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is ImageElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
+      _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is CanvasElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
+      _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    if ((border_OR_canvas_OR_image_OR_pixels_OR_video is VideoElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
+      _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    throw new ArgumentError("Incorrect number or type of arguments");
+  }
+  @JSName('texImage2D')
+  @DomName('WebGLRenderingContext.texImage2D')
+  @DocsEditable
+  void _texImage2D_1(target, level, internalformat, width, height, int border, format, type, pixels) native;
+  @JSName('texImage2D')
+  @DomName('WebGLRenderingContext.texImage2D')
+  @DocsEditable
+  void _texImage2D_2(target, level, internalformat, format, type, pixels) native;
+  @JSName('texImage2D')
+  @DomName('WebGLRenderingContext.texImage2D')
+  @DocsEditable
+  void _texImage2D_3(target, level, internalformat, format, type, ImageElement image) native;
+  @JSName('texImage2D')
+  @DomName('WebGLRenderingContext.texImage2D')
+  @DocsEditable
+  void _texImage2D_4(target, level, internalformat, format, type, CanvasElement canvas) native;
+  @JSName('texImage2D')
+  @DomName('WebGLRenderingContext.texImage2D')
+  @DocsEditable
+  void _texImage2D_5(target, level, internalformat, format, type, VideoElement video) native;
+
+  @DomName('WebGLRenderingContext.texParameterf')
+  @DocsEditable
+  void texParameterf(int target, int pname, num param) native;
+
+  @DomName('WebGLRenderingContext.texParameteri')
+  @DocsEditable
+  void texParameteri(int target, int pname, int param) native;
+
+  @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) {
+      _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
+      return;
+    }
+    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
+      var pixels_1 = _convertDartToNative_ImageData(canvas_OR_format_OR_image_OR_pixels_OR_video);
+      _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_OR_type, pixels_1);
+      return;
+    }
+    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is ImageElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
+      _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is CanvasElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
+      _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    if ((canvas_OR_format_OR_image_OR_pixels_OR_video is VideoElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
+      _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    throw new ArgumentError("Incorrect number or type of arguments");
+  }
+  @JSName('texSubImage2D')
+  @DomName('WebGLRenderingContext.texSubImage2D')
+  @DocsEditable
+  void _texSubImage2D_1(target, level, xoffset, yoffset, width, height, int format, type, pixels) native;
+  @JSName('texSubImage2D')
+  @DomName('WebGLRenderingContext.texSubImage2D')
+  @DocsEditable
+  void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels) native;
+  @JSName('texSubImage2D')
+  @DomName('WebGLRenderingContext.texSubImage2D')
+  @DocsEditable
+  void _texSubImage2D_3(target, level, xoffset, yoffset, format, type, ImageElement image) native;
+  @JSName('texSubImage2D')
+  @DomName('WebGLRenderingContext.texSubImage2D')
+  @DocsEditable
+  void _texSubImage2D_4(target, level, xoffset, yoffset, format, type, CanvasElement canvas) native;
+  @JSName('texSubImage2D')
+  @DomName('WebGLRenderingContext.texSubImage2D')
+  @DocsEditable
+  void _texSubImage2D_5(target, level, xoffset, yoffset, format, type, VideoElement video) native;
+
+  @DomName('WebGLRenderingContext.uniform1f')
+  @DocsEditable
+  void uniform1f(UniformLocation location, num x) native;
+
+  @DomName('WebGLRenderingContext.uniform1fv')
+  @DocsEditable
+  void uniform1fv(UniformLocation location, Float32Array v) native;
+
+  @DomName('WebGLRenderingContext.uniform1i')
+  @DocsEditable
+  void uniform1i(UniformLocation location, int x) native;
+
+  @DomName('WebGLRenderingContext.uniform1iv')
+  @DocsEditable
+  void uniform1iv(UniformLocation location, Int32Array v) native;
+
+  @DomName('WebGLRenderingContext.uniform2f')
+  @DocsEditable
+  void uniform2f(UniformLocation location, num x, num y) native;
+
+  @DomName('WebGLRenderingContext.uniform2fv')
+  @DocsEditable
+  void uniform2fv(UniformLocation location, Float32Array v) native;
+
+  @DomName('WebGLRenderingContext.uniform2i')
+  @DocsEditable
+  void uniform2i(UniformLocation location, int x, int y) native;
+
+  @DomName('WebGLRenderingContext.uniform2iv')
+  @DocsEditable
+  void uniform2iv(UniformLocation location, Int32Array v) native;
+
+  @DomName('WebGLRenderingContext.uniform3f')
+  @DocsEditable
+  void uniform3f(UniformLocation location, num x, num y, num z) native;
+
+  @DomName('WebGLRenderingContext.uniform3fv')
+  @DocsEditable
+  void uniform3fv(UniformLocation location, Float32Array v) native;
+
+  @DomName('WebGLRenderingContext.uniform3i')
+  @DocsEditable
+  void uniform3i(UniformLocation location, int x, int y, int z) native;
+
+  @DomName('WebGLRenderingContext.uniform3iv')
+  @DocsEditable
+  void uniform3iv(UniformLocation location, Int32Array v) native;
+
+  @DomName('WebGLRenderingContext.uniform4f')
+  @DocsEditable
+  void uniform4f(UniformLocation location, num x, num y, num z, num w) native;
+
+  @DomName('WebGLRenderingContext.uniform4fv')
+  @DocsEditable
+  void uniform4fv(UniformLocation location, Float32Array v) native;
+
+  @DomName('WebGLRenderingContext.uniform4i')
+  @DocsEditable
+  void uniform4i(UniformLocation location, int x, int y, int z, int w) native;
+
+  @DomName('WebGLRenderingContext.uniform4iv')
+  @DocsEditable
+  void uniform4iv(UniformLocation location, Int32Array v) native;
+
+  @DomName('WebGLRenderingContext.uniformMatrix2fv')
+  @DocsEditable
+  void uniformMatrix2fv(UniformLocation location, bool transpose, Float32Array array) native;
+
+  @DomName('WebGLRenderingContext.uniformMatrix3fv')
+  @DocsEditable
+  void uniformMatrix3fv(UniformLocation location, bool transpose, Float32Array array) native;
+
+  @DomName('WebGLRenderingContext.uniformMatrix4fv')
+  @DocsEditable
+  void uniformMatrix4fv(UniformLocation location, bool transpose, Float32Array array) native;
+
+  @DomName('WebGLRenderingContext.useProgram')
+  @DocsEditable
+  void useProgram(Program program) native;
+
+  @DomName('WebGLRenderingContext.validateProgram')
+  @DocsEditable
+  void validateProgram(Program program) native;
+
+  @DomName('WebGLRenderingContext.vertexAttrib1f')
+  @DocsEditable
+  void vertexAttrib1f(int indx, num x) native;
+
+  @DomName('WebGLRenderingContext.vertexAttrib1fv')
+  @DocsEditable
+  void vertexAttrib1fv(int indx, Float32Array values) native;
+
+  @DomName('WebGLRenderingContext.vertexAttrib2f')
+  @DocsEditable
+  void vertexAttrib2f(int indx, num x, num y) native;
+
+  @DomName('WebGLRenderingContext.vertexAttrib2fv')
+  @DocsEditable
+  void vertexAttrib2fv(int indx, Float32Array values) native;
+
+  @DomName('WebGLRenderingContext.vertexAttrib3f')
+  @DocsEditable
+  void vertexAttrib3f(int indx, num x, num y, num z) native;
+
+  @DomName('WebGLRenderingContext.vertexAttrib3fv')
+  @DocsEditable
+  void vertexAttrib3fv(int indx, Float32Array values) native;
+
+  @DomName('WebGLRenderingContext.vertexAttrib4f')
+  @DocsEditable
+  void vertexAttrib4f(int indx, num x, num y, num z, num w) native;
+
+  @DomName('WebGLRenderingContext.vertexAttrib4fv')
+  @DocsEditable
+  void vertexAttrib4fv(int indx, Float32Array values) native;
+
+  @DomName('WebGLRenderingContext.vertexAttribPointer')
+  @DocsEditable
+  void vertexAttribPointer(int indx, int size, int type, bool normalized, int stride, int offset) native;
+
+  @DomName('WebGLRenderingContext.viewport')
+  @DocsEditable
+  void viewport(int x, int y, int width, int height) 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('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('WebGLShaderPrecisionFormat')
+class ShaderPrecisionFormat native "*WebGLShaderPrecisionFormat" {
+
+  @DomName('WebGLShaderPrecisionFormat.precision')
+  @DocsEditable
+  final int precision;
+
+  @DomName('WebGLShaderPrecisionFormat.rangeMax')
+  @DocsEditable
+  final int rangeMax;
+
+  @DomName('WebGLShaderPrecisionFormat.rangeMin')
+  @DocsEditable
+  final int rangeMin;
+}
+// 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('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('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
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('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
new file mode 100644
index 0000000..486d0cf
--- /dev/null
+++ b/sdk/lib/web_gl/dartium/web_gl_dartium.dart
@@ -0,0 +1,2149 @@
+library dart.dom.web_gl;
+
+import 'dart:async';
+import 'dart:collection';
+import 'dart:html';
+import 'dart:html_common';
+import 'dart:nativewrappers';
+import 'dart:typeddata' as _typeddata;
+// DO NOT EDIT
+// Auto-generated dart:web_gl library.
+
+
+
+
+
+// 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.
+
+
+const int ACTIVE_ATTRIBUTES = RenderingContext.ACTIVE_ATTRIBUTES;
+const int ACTIVE_TEXTURE = RenderingContext.ACTIVE_TEXTURE;
+const int ACTIVE_UNIFORMS = RenderingContext.ACTIVE_UNIFORMS;
+const int ALIASED_LINE_WIDTH_RANGE = RenderingContext.ALIASED_LINE_WIDTH_RANGE;
+const int ALIASED_POINT_SIZE_RANGE = RenderingContext.ALIASED_POINT_SIZE_RANGE;
+const int ALPHA = RenderingContext.ALPHA;
+const int ALPHA_BITS = RenderingContext.ALPHA_BITS;
+const int ALWAYS = RenderingContext.ALWAYS;
+const int ARRAY_BUFFER = RenderingContext.ARRAY_BUFFER;
+const int ARRAY_BUFFER_BINDING = RenderingContext.ARRAY_BUFFER_BINDING;
+const int ATTACHED_SHADERS = RenderingContext.ATTACHED_SHADERS;
+const int BACK = RenderingContext.BACK;
+const int BLEND = RenderingContext.BLEND;
+const int BLEND_COLOR = RenderingContext.BLEND_COLOR;
+const int BLEND_DST_ALPHA = RenderingContext.BLEND_DST_ALPHA;
+const int BLEND_DST_RGB = RenderingContext.BLEND_DST_RGB;
+const int BLEND_EQUATION = RenderingContext.BLEND_EQUATION;
+const int BLEND_EQUATION_ALPHA = RenderingContext.BLEND_EQUATION_ALPHA;
+const int BLEND_EQUATION_RGB = RenderingContext.BLEND_EQUATION_RGB;
+const int BLEND_SRC_ALPHA = RenderingContext.BLEND_SRC_ALPHA;
+const int BLEND_SRC_RGB = RenderingContext.BLEND_SRC_RGB;
+const int BLUE_BITS = RenderingContext.BLUE_BITS;
+const int BOOL = RenderingContext.BOOL;
+const int BOOL_VEC2 = RenderingContext.BOOL_VEC2;
+const int BOOL_VEC3 = RenderingContext.BOOL_VEC3;
+const int BOOL_VEC4 = RenderingContext.BOOL_VEC4;
+const int BROWSER_DEFAULT_WEBGL = RenderingContext.BROWSER_DEFAULT_WEBGL;
+const int BUFFER_SIZE = RenderingContext.BUFFER_SIZE;
+const int BUFFER_USAGE = RenderingContext.BUFFER_USAGE;
+const int BYTE = RenderingContext.BYTE;
+const int CCW = RenderingContext.CCW;
+const int CLAMP_TO_EDGE = RenderingContext.CLAMP_TO_EDGE;
+const int COLOR_ATTACHMENT0 = RenderingContext.COLOR_ATTACHMENT0;
+const int COLOR_BUFFER_BIT = RenderingContext.COLOR_BUFFER_BIT;
+const int COLOR_CLEAR_VALUE = RenderingContext.COLOR_CLEAR_VALUE;
+const int COLOR_WRITEMASK = RenderingContext.COLOR_WRITEMASK;
+const int COMPILE_STATUS = RenderingContext.COMPILE_STATUS;
+const int COMPRESSED_TEXTURE_FORMATS = RenderingContext.COMPRESSED_TEXTURE_FORMATS;
+const int CONSTANT_ALPHA = RenderingContext.CONSTANT_ALPHA;
+const int CONSTANT_COLOR = RenderingContext.CONSTANT_COLOR;
+const int CONTEXT_LOST_WEBGL = RenderingContext.CONTEXT_LOST_WEBGL;
+const int CULL_FACE = RenderingContext.CULL_FACE;
+const int CULL_FACE_MODE = RenderingContext.CULL_FACE_MODE;
+const int CURRENT_PROGRAM = RenderingContext.CURRENT_PROGRAM;
+const int CURRENT_VERTEX_ATTRIB = RenderingContext.CURRENT_VERTEX_ATTRIB;
+const int CW = RenderingContext.CW;
+const int DECR = RenderingContext.DECR;
+const int DECR_WRAP = RenderingContext.DECR_WRAP;
+const int DELETE_STATUS = RenderingContext.DELETE_STATUS;
+const int DEPTH_ATTACHMENT = RenderingContext.DEPTH_ATTACHMENT;
+const int DEPTH_BITS = RenderingContext.DEPTH_BITS;
+const int DEPTH_BUFFER_BIT = RenderingContext.DEPTH_BUFFER_BIT;
+const int DEPTH_CLEAR_VALUE = RenderingContext.DEPTH_CLEAR_VALUE;
+const int DEPTH_COMPONENT = RenderingContext.DEPTH_COMPONENT;
+const int DEPTH_COMPONENT16 = RenderingContext.DEPTH_COMPONENT16;
+const int DEPTH_FUNC = RenderingContext.DEPTH_FUNC;
+const int DEPTH_RANGE = RenderingContext.DEPTH_RANGE;
+const int DEPTH_STENCIL = RenderingContext.DEPTH_STENCIL;
+const int DEPTH_STENCIL_ATTACHMENT = RenderingContext.DEPTH_STENCIL_ATTACHMENT;
+const int DEPTH_TEST = RenderingContext.DEPTH_TEST;
+const int DEPTH_WRITEMASK = RenderingContext.DEPTH_WRITEMASK;
+const int DITHER = RenderingContext.DITHER;
+const int DONT_CARE = RenderingContext.DONT_CARE;
+const int DST_ALPHA = RenderingContext.DST_ALPHA;
+const int DST_COLOR = RenderingContext.DST_COLOR;
+const int DYNAMIC_DRAW = RenderingContext.DYNAMIC_DRAW;
+const int ELEMENT_ARRAY_BUFFER = RenderingContext.ELEMENT_ARRAY_BUFFER;
+const int ELEMENT_ARRAY_BUFFER_BINDING = RenderingContext.ELEMENT_ARRAY_BUFFER_BINDING;
+const int EQUAL = RenderingContext.EQUAL;
+const int FASTEST = RenderingContext.FASTEST;
+const int FLOAT = RenderingContext.FLOAT;
+const int FLOAT_MAT2 = RenderingContext.FLOAT_MAT2;
+const int FLOAT_MAT3 = RenderingContext.FLOAT_MAT3;
+const int FLOAT_MAT4 = RenderingContext.FLOAT_MAT4;
+const int FLOAT_VEC2 = RenderingContext.FLOAT_VEC2;
+const int FLOAT_VEC3 = RenderingContext.FLOAT_VEC3;
+const int FLOAT_VEC4 = RenderingContext.FLOAT_VEC4;
+const int FRAGMENT_SHADER = RenderingContext.FRAGMENT_SHADER;
+const int FRAMEBUFFER = RenderingContext.FRAMEBUFFER;
+const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = RenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME;
+const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = RenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE;
+const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = RenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE;
+const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = RenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL;
+const int FRAMEBUFFER_BINDING = RenderingContext.FRAMEBUFFER_BINDING;
+const int FRAMEBUFFER_COMPLETE = RenderingContext.FRAMEBUFFER_COMPLETE;
+const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = RenderingContext.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = RenderingContext.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
+const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = RenderingContext.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+const int FRAMEBUFFER_UNSUPPORTED = RenderingContext.FRAMEBUFFER_UNSUPPORTED;
+const int FRONT = RenderingContext.FRONT;
+const int FRONT_AND_BACK = RenderingContext.FRONT_AND_BACK;
+const int FRONT_FACE = RenderingContext.FRONT_FACE;
+const int FUNC_ADD = RenderingContext.FUNC_ADD;
+const int FUNC_REVERSE_SUBTRACT = RenderingContext.FUNC_REVERSE_SUBTRACT;
+const int FUNC_SUBTRACT = RenderingContext.FUNC_SUBTRACT;
+const int GENERATE_MIPMAP_HINT = RenderingContext.GENERATE_MIPMAP_HINT;
+const int GEQUAL = RenderingContext.GEQUAL;
+const int GREATER = RenderingContext.GREATER;
+const int GREEN_BITS = RenderingContext.GREEN_BITS;
+const int HALF_FLOAT_OES = RenderingContext.HALF_FLOAT_OES;
+const int HIGH_FLOAT = RenderingContext.HIGH_FLOAT;
+const int HIGH_INT = RenderingContext.HIGH_INT;
+const int INCR = RenderingContext.INCR;
+const int INCR_WRAP = RenderingContext.INCR_WRAP;
+const int INT = RenderingContext.INT;
+const int INT_VEC2 = RenderingContext.INT_VEC2;
+const int INT_VEC3 = RenderingContext.INT_VEC3;
+const int INT_VEC4 = RenderingContext.INT_VEC4;
+const int INVALID_ENUM = RenderingContext.INVALID_ENUM;
+const int INVALID_FRAMEBUFFER_OPERATION = RenderingContext.INVALID_FRAMEBUFFER_OPERATION;
+const int INVALID_OPERATION = RenderingContext.INVALID_OPERATION;
+const int INVALID_VALUE = RenderingContext.INVALID_VALUE;
+const int INVERT = RenderingContext.INVERT;
+const int KEEP = RenderingContext.KEEP;
+const int LEQUAL = RenderingContext.LEQUAL;
+const int LESS = RenderingContext.LESS;
+const int LINEAR = RenderingContext.LINEAR;
+const int LINEAR_MIPMAP_LINEAR = RenderingContext.LINEAR_MIPMAP_LINEAR;
+const int LINEAR_MIPMAP_NEAREST = RenderingContext.LINEAR_MIPMAP_NEAREST;
+const int LINES = RenderingContext.LINES;
+const int LINE_LOOP = RenderingContext.LINE_LOOP;
+const int LINE_STRIP = RenderingContext.LINE_STRIP;
+const int LINE_WIDTH = RenderingContext.LINE_WIDTH;
+const int LINK_STATUS = RenderingContext.LINK_STATUS;
+const int LOW_FLOAT = RenderingContext.LOW_FLOAT;
+const int LOW_INT = RenderingContext.LOW_INT;
+const int LUMINANCE = RenderingContext.LUMINANCE;
+const int LUMINANCE_ALPHA = RenderingContext.LUMINANCE_ALPHA;
+const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_COMBINED_TEXTURE_IMAGE_UNITS;
+const int MAX_CUBE_MAP_TEXTURE_SIZE = RenderingContext.MAX_CUBE_MAP_TEXTURE_SIZE;
+const int MAX_FRAGMENT_UNIFORM_VECTORS = RenderingContext.MAX_FRAGMENT_UNIFORM_VECTORS;
+const int MAX_RENDERBUFFER_SIZE = RenderingContext.MAX_RENDERBUFFER_SIZE;
+const int MAX_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_TEXTURE_IMAGE_UNITS;
+const int MAX_TEXTURE_SIZE = RenderingContext.MAX_TEXTURE_SIZE;
+const int MAX_VARYING_VECTORS = RenderingContext.MAX_VARYING_VECTORS;
+const int MAX_VERTEX_ATTRIBS = RenderingContext.MAX_VERTEX_ATTRIBS;
+const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+const int MAX_VERTEX_UNIFORM_VECTORS = RenderingContext.MAX_VERTEX_UNIFORM_VECTORS;
+const int MAX_VIEWPORT_DIMS = RenderingContext.MAX_VIEWPORT_DIMS;
+const int MEDIUM_FLOAT = RenderingContext.MEDIUM_FLOAT;
+const int MEDIUM_INT = RenderingContext.MEDIUM_INT;
+const int MIRRORED_REPEAT = RenderingContext.MIRRORED_REPEAT;
+const int NEAREST = RenderingContext.NEAREST;
+const int NEAREST_MIPMAP_LINEAR = RenderingContext.NEAREST_MIPMAP_LINEAR;
+const int NEAREST_MIPMAP_NEAREST = RenderingContext.NEAREST_MIPMAP_NEAREST;
+const int NEVER = RenderingContext.NEVER;
+const int NICEST = RenderingContext.NICEST;
+const int NONE = RenderingContext.NONE;
+const int NOTEQUAL = RenderingContext.NOTEQUAL;
+const int NO_ERROR = RenderingContext.NO_ERROR;
+const int ONE = RenderingContext.ONE;
+const int ONE_MINUS_CONSTANT_ALPHA = RenderingContext.ONE_MINUS_CONSTANT_ALPHA;
+const int ONE_MINUS_CONSTANT_COLOR = RenderingContext.ONE_MINUS_CONSTANT_COLOR;
+const int ONE_MINUS_DST_ALPHA = RenderingContext.ONE_MINUS_DST_ALPHA;
+const int ONE_MINUS_DST_COLOR = RenderingContext.ONE_MINUS_DST_COLOR;
+const int ONE_MINUS_SRC_ALPHA = RenderingContext.ONE_MINUS_SRC_ALPHA;
+const int ONE_MINUS_SRC_COLOR = RenderingContext.ONE_MINUS_SRC_COLOR;
+const int OUT_OF_MEMORY = RenderingContext.OUT_OF_MEMORY;
+const int PACK_ALIGNMENT = RenderingContext.PACK_ALIGNMENT;
+const int POINTS = RenderingContext.POINTS;
+const int POLYGON_OFFSET_FACTOR = RenderingContext.POLYGON_OFFSET_FACTOR;
+const int POLYGON_OFFSET_FILL = RenderingContext.POLYGON_OFFSET_FILL;
+const int POLYGON_OFFSET_UNITS = RenderingContext.POLYGON_OFFSET_UNITS;
+const int RED_BITS = RenderingContext.RED_BITS;
+const int RENDERBUFFER = RenderingContext.RENDERBUFFER;
+const int RENDERBUFFER_ALPHA_SIZE = RenderingContext.RENDERBUFFER_ALPHA_SIZE;
+const int RENDERBUFFER_BINDING = RenderingContext.RENDERBUFFER_BINDING;
+const int RENDERBUFFER_BLUE_SIZE = RenderingContext.RENDERBUFFER_BLUE_SIZE;
+const int RENDERBUFFER_DEPTH_SIZE = RenderingContext.RENDERBUFFER_DEPTH_SIZE;
+const int RENDERBUFFER_GREEN_SIZE = RenderingContext.RENDERBUFFER_GREEN_SIZE;
+const int RENDERBUFFER_HEIGHT = RenderingContext.RENDERBUFFER_HEIGHT;
+const int RENDERBUFFER_INTERNAL_FORMAT = RenderingContext.RENDERBUFFER_INTERNAL_FORMAT;
+const int RENDERBUFFER_RED_SIZE = RenderingContext.RENDERBUFFER_RED_SIZE;
+const int RENDERBUFFER_STENCIL_SIZE = RenderingContext.RENDERBUFFER_STENCIL_SIZE;
+const int RENDERBUFFER_WIDTH = RenderingContext.RENDERBUFFER_WIDTH;
+const int RENDERER = RenderingContext.RENDERER;
+const int REPEAT = RenderingContext.REPEAT;
+const int REPLACE = RenderingContext.REPLACE;
+const int RGB = RenderingContext.RGB;
+const int RGB565 = RenderingContext.RGB565;
+const int RGB5_A1 = RenderingContext.RGB5_A1;
+const int RGBA = RenderingContext.RGBA;
+const int RGBA4 = RenderingContext.RGBA4;
+const int SAMPLER_2D = RenderingContext.SAMPLER_2D;
+const int SAMPLER_CUBE = RenderingContext.SAMPLER_CUBE;
+const int SAMPLES = RenderingContext.SAMPLES;
+const int SAMPLE_ALPHA_TO_COVERAGE = RenderingContext.SAMPLE_ALPHA_TO_COVERAGE;
+const int SAMPLE_BUFFERS = RenderingContext.SAMPLE_BUFFERS;
+const int SAMPLE_COVERAGE = RenderingContext.SAMPLE_COVERAGE;
+const int SAMPLE_COVERAGE_INVERT = RenderingContext.SAMPLE_COVERAGE_INVERT;
+const int SAMPLE_COVERAGE_VALUE = RenderingContext.SAMPLE_COVERAGE_VALUE;
+const int SCISSOR_BOX = RenderingContext.SCISSOR_BOX;
+const int SCISSOR_TEST = RenderingContext.SCISSOR_TEST;
+const int SHADER_TYPE = RenderingContext.SHADER_TYPE;
+const int SHADING_LANGUAGE_VERSION = RenderingContext.SHADING_LANGUAGE_VERSION;
+const int SHORT = RenderingContext.SHORT;
+const int SRC_ALPHA = RenderingContext.SRC_ALPHA;
+const int SRC_ALPHA_SATURATE = RenderingContext.SRC_ALPHA_SATURATE;
+const int SRC_COLOR = RenderingContext.SRC_COLOR;
+const int STATIC_DRAW = RenderingContext.STATIC_DRAW;
+const int STENCIL_ATTACHMENT = RenderingContext.STENCIL_ATTACHMENT;
+const int STENCIL_BACK_FAIL = RenderingContext.STENCIL_BACK_FAIL;
+const int STENCIL_BACK_FUNC = RenderingContext.STENCIL_BACK_FUNC;
+const int STENCIL_BACK_PASS_DEPTH_FAIL = RenderingContext.STENCIL_BACK_PASS_DEPTH_FAIL;
+const int STENCIL_BACK_PASS_DEPTH_PASS = RenderingContext.STENCIL_BACK_PASS_DEPTH_PASS;
+const int STENCIL_BACK_REF = RenderingContext.STENCIL_BACK_REF;
+const int STENCIL_BACK_VALUE_MASK = RenderingContext.STENCIL_BACK_VALUE_MASK;
+const int STENCIL_BACK_WRITEMASK = RenderingContext.STENCIL_BACK_WRITEMASK;
+const int STENCIL_BITS = RenderingContext.STENCIL_BITS;
+const int STENCIL_BUFFER_BIT = RenderingContext.STENCIL_BUFFER_BIT;
+const int STENCIL_CLEAR_VALUE = RenderingContext.STENCIL_CLEAR_VALUE;
+const int STENCIL_FAIL = RenderingContext.STENCIL_FAIL;
+const int STENCIL_FUNC = RenderingContext.STENCIL_FUNC;
+const int STENCIL_INDEX = RenderingContext.STENCIL_INDEX;
+const int STENCIL_INDEX8 = RenderingContext.STENCIL_INDEX8;
+const int STENCIL_PASS_DEPTH_FAIL = RenderingContext.STENCIL_PASS_DEPTH_FAIL;
+const int STENCIL_PASS_DEPTH_PASS = RenderingContext.STENCIL_PASS_DEPTH_PASS;
+const int STENCIL_REF = RenderingContext.STENCIL_REF;
+const int STENCIL_TEST = RenderingContext.STENCIL_TEST;
+const int STENCIL_VALUE_MASK = RenderingContext.STENCIL_VALUE_MASK;
+const int STENCIL_WRITEMASK = RenderingContext.STENCIL_WRITEMASK;
+const int STREAM_DRAW = RenderingContext.STREAM_DRAW;
+const int SUBPIXEL_BITS = RenderingContext.SUBPIXEL_BITS;
+const int TEXTURE = RenderingContext.TEXTURE;
+const int TEXTURE0 = RenderingContext.TEXTURE0;
+const int TEXTURE1 = RenderingContext.TEXTURE1;
+const int TEXTURE10 = RenderingContext.TEXTURE10;
+const int TEXTURE11 = RenderingContext.TEXTURE11;
+const int TEXTURE12 = RenderingContext.TEXTURE12;
+const int TEXTURE13 = RenderingContext.TEXTURE13;
+const int TEXTURE14 = RenderingContext.TEXTURE14;
+const int TEXTURE15 = RenderingContext.TEXTURE15;
+const int TEXTURE16 = RenderingContext.TEXTURE16;
+const int TEXTURE17 = RenderingContext.TEXTURE17;
+const int TEXTURE18 = RenderingContext.TEXTURE18;
+const int TEXTURE19 = RenderingContext.TEXTURE19;
+const int TEXTURE2 = RenderingContext.TEXTURE2;
+const int TEXTURE20 = RenderingContext.TEXTURE20;
+const int TEXTURE21 = RenderingContext.TEXTURE21;
+const int TEXTURE22 = RenderingContext.TEXTURE22;
+const int TEXTURE23 = RenderingContext.TEXTURE23;
+const int TEXTURE24 = RenderingContext.TEXTURE24;
+const int TEXTURE25 = RenderingContext.TEXTURE25;
+const int TEXTURE26 = RenderingContext.TEXTURE26;
+const int TEXTURE27 = RenderingContext.TEXTURE27;
+const int TEXTURE28 = RenderingContext.TEXTURE28;
+const int TEXTURE29 = RenderingContext.TEXTURE29;
+const int TEXTURE3 = RenderingContext.TEXTURE3;
+const int TEXTURE30 = RenderingContext.TEXTURE30;
+const int TEXTURE31 = RenderingContext.TEXTURE31;
+const int TEXTURE4 = RenderingContext.TEXTURE4;
+const int TEXTURE5 = RenderingContext.TEXTURE5;
+const int TEXTURE6 = RenderingContext.TEXTURE6;
+const int TEXTURE7 = RenderingContext.TEXTURE7;
+const int TEXTURE8 = RenderingContext.TEXTURE8;
+const int TEXTURE9 = RenderingContext.TEXTURE9;
+const int TEXTURE_2D = RenderingContext.TEXTURE_2D;
+const int TEXTURE_BINDING_2D = RenderingContext.TEXTURE_BINDING_2D;
+const int TEXTURE_BINDING_CUBE_MAP = RenderingContext.TEXTURE_BINDING_CUBE_MAP;
+const int TEXTURE_CUBE_MAP = RenderingContext.TEXTURE_CUBE_MAP;
+const int TEXTURE_CUBE_MAP_NEGATIVE_X = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X;
+const int TEXTURE_CUBE_MAP_NEGATIVE_Y = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y;
+const int TEXTURE_CUBE_MAP_NEGATIVE_Z = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z;
+const int TEXTURE_CUBE_MAP_POSITIVE_X = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X;
+const int TEXTURE_CUBE_MAP_POSITIVE_Y = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y;
+const int TEXTURE_CUBE_MAP_POSITIVE_Z = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z;
+const int TEXTURE_MAG_FILTER = RenderingContext.TEXTURE_MAG_FILTER;
+const int TEXTURE_MIN_FILTER = RenderingContext.TEXTURE_MIN_FILTER;
+const int TEXTURE_WRAP_S = RenderingContext.TEXTURE_WRAP_S;
+const int TEXTURE_WRAP_T = RenderingContext.TEXTURE_WRAP_T;
+const int TRIANGLES = RenderingContext.TRIANGLES;
+const int TRIANGLE_FAN = RenderingContext.TRIANGLE_FAN;
+const int TRIANGLE_STRIP = RenderingContext.TRIANGLE_STRIP;
+const int UNPACK_ALIGNMENT = RenderingContext.UNPACK_ALIGNMENT;
+const int UNPACK_COLORSPACE_CONVERSION_WEBGL = RenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL;
+const int UNPACK_FLIP_Y_WEBGL = RenderingContext.UNPACK_FLIP_Y_WEBGL;
+const int UNPACK_PREMULTIPLY_ALPHA_WEBGL = RenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL;
+const int UNSIGNED_BYTE = RenderingContext.UNSIGNED_BYTE;
+const int UNSIGNED_INT = RenderingContext.UNSIGNED_INT;
+const int UNSIGNED_SHORT = RenderingContext.UNSIGNED_SHORT;
+const int UNSIGNED_SHORT_4_4_4_4 = RenderingContext.UNSIGNED_SHORT_4_4_4_4;
+const int UNSIGNED_SHORT_5_5_5_1 = RenderingContext.UNSIGNED_SHORT_5_5_5_1;
+const int UNSIGNED_SHORT_5_6_5 = RenderingContext.UNSIGNED_SHORT_5_6_5;
+const int VALIDATE_STATUS = RenderingContext.VALIDATE_STATUS;
+const int VENDOR = RenderingContext.VENDOR;
+const int VERSION = RenderingContext.VERSION;
+const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = RenderingContext.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING;
+const int VERTEX_ATTRIB_ARRAY_ENABLED = RenderingContext.VERTEX_ATTRIB_ARRAY_ENABLED;
+const int VERTEX_ATTRIB_ARRAY_NORMALIZED = RenderingContext.VERTEX_ATTRIB_ARRAY_NORMALIZED;
+const int VERTEX_ATTRIB_ARRAY_POINTER = RenderingContext.VERTEX_ATTRIB_ARRAY_POINTER;
+const int VERTEX_ATTRIB_ARRAY_SIZE = RenderingContext.VERTEX_ATTRIB_ARRAY_SIZE;
+const int VERTEX_ATTRIB_ARRAY_STRIDE = RenderingContext.VERTEX_ATTRIB_ARRAY_STRIDE;
+const int VERTEX_ATTRIB_ARRAY_TYPE = RenderingContext.VERTEX_ATTRIB_ARRAY_TYPE;
+const int VERTEX_SHADER = RenderingContext.VERTEX_SHADER;
+const int VIEWPORT = RenderingContext.VIEWPORT;
+const int ZERO = RenderingContext.ZERO;
+// 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('WebGLActiveInfo')
+class ActiveInfo extends NativeFieldWrapperClass1 {
+  ActiveInfo.internal();
+
+  @DomName('WebGLActiveInfo.name')
+  @DocsEditable
+  String get name native "WebGLActiveInfo_name_Getter";
+
+  @DomName('WebGLActiveInfo.size')
+  @DocsEditable
+  int get size native "WebGLActiveInfo_size_Getter";
+
+  @DomName('WebGLActiveInfo.type')
+  @DocsEditable
+  int get type native "WebGLActiveInfo_type_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('WebGLBuffer')
+class Buffer extends NativeFieldWrapperClass1 {
+  Buffer.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('WebGLCompressedTextureATC')
+class CompressedTextureAtc extends NativeFieldWrapperClass1 {
+  CompressedTextureAtc.internal();
+
+  static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
+
+  static const int COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
+
+  static const int COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
+
+}
+// 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('WebGLCompressedTexturePVRTC')
+class CompressedTexturePvrtc extends NativeFieldWrapperClass1 {
+  CompressedTexturePvrtc.internal();
+
+  static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
+
+  static const int COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
+
+  static const int COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
+
+  static const int COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
+
+}
+// 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('WebGLCompressedTextureS3TC')
+class CompressedTextureS3TC extends NativeFieldWrapperClass1 {
+  CompressedTextureS3TC.internal();
+
+  static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
+
+  static const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
+
+  static const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
+
+  static const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
+
+}
+// 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('WebGLContextAttributes')
+class ContextAttributes extends NativeFieldWrapperClass1 {
+  ContextAttributes.internal();
+
+  @DomName('WebGLContextAttributes.alpha')
+  @DocsEditable
+  bool get alpha native "WebGLContextAttributes_alpha_Getter";
+
+  @DomName('WebGLContextAttributes.alpha')
+  @DocsEditable
+  void set alpha(bool value) native "WebGLContextAttributes_alpha_Setter";
+
+  @DomName('WebGLContextAttributes.antialias')
+  @DocsEditable
+  bool get antialias native "WebGLContextAttributes_antialias_Getter";
+
+  @DomName('WebGLContextAttributes.antialias')
+  @DocsEditable
+  void set antialias(bool value) native "WebGLContextAttributes_antialias_Setter";
+
+  @DomName('WebGLContextAttributes.depth')
+  @DocsEditable
+  bool get depth native "WebGLContextAttributes_depth_Getter";
+
+  @DomName('WebGLContextAttributes.depth')
+  @DocsEditable
+  void set depth(bool value) native "WebGLContextAttributes_depth_Setter";
+
+  @DomName('WebGLContextAttributes.premultipliedAlpha')
+  @DocsEditable
+  bool get premultipliedAlpha native "WebGLContextAttributes_premultipliedAlpha_Getter";
+
+  @DomName('WebGLContextAttributes.premultipliedAlpha')
+  @DocsEditable
+  void set premultipliedAlpha(bool value) native "WebGLContextAttributes_premultipliedAlpha_Setter";
+
+  @DomName('WebGLContextAttributes.preserveDrawingBuffer')
+  @DocsEditable
+  bool get preserveDrawingBuffer native "WebGLContextAttributes_preserveDrawingBuffer_Getter";
+
+  @DomName('WebGLContextAttributes.preserveDrawingBuffer')
+  @DocsEditable
+  void set preserveDrawingBuffer(bool value) native "WebGLContextAttributes_preserveDrawingBuffer_Setter";
+
+  @DomName('WebGLContextAttributes.stencil')
+  @DocsEditable
+  bool get stencil native "WebGLContextAttributes_stencil_Getter";
+
+  @DomName('WebGLContextAttributes.stencil')
+  @DocsEditable
+  void set stencil(bool value) native "WebGLContextAttributes_stencil_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.
+
+
+@DocsEditable
+@DomName('WebGLContextEvent')
+class ContextEvent extends Event {
+  ContextEvent.internal() : super.internal();
+
+  @DomName('WebGLContextEvent.statusMessage')
+  @DocsEditable
+  String get statusMessage native "WebGLContextEvent_statusMessage_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('WebGLDebugRendererInfo')
+class DebugRendererInfo extends NativeFieldWrapperClass1 {
+  DebugRendererInfo.internal();
+
+  static const int UNMASKED_RENDERER_WEBGL = 0x9246;
+
+  static const int UNMASKED_VENDOR_WEBGL = 0x9245;
+
+}
+// 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('WebGLDebugShaders')
+class DebugShaders extends NativeFieldWrapperClass1 {
+  DebugShaders.internal();
+
+  @DomName('WebGLDebugShaders.getTranslatedShaderSource')
+  @DocsEditable
+  String getTranslatedShaderSource(Shader shader) native "WebGLDebugShaders_getTranslatedShaderSource_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('WebGLDepthTexture')
+class DepthTexture extends NativeFieldWrapperClass1 {
+  DepthTexture.internal();
+
+  static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
+
+}
+// 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('EXTDrawBuffers')
+class ExtDrawBuffers extends NativeFieldWrapperClass1 {
+  ExtDrawBuffers.internal();
+
+  static const int COLOR_ATTACHMENT0_EXT = 0x8CE0;
+
+  static const int COLOR_ATTACHMENT10_EXT = 0x8CEA;
+
+  static const int COLOR_ATTACHMENT11_EXT = 0x8CEB;
+
+  static const int COLOR_ATTACHMENT12_EXT = 0x8CEC;
+
+  static const int COLOR_ATTACHMENT13_EXT = 0x8CED;
+
+  static const int COLOR_ATTACHMENT14_EXT = 0x8CEE;
+
+  static const int COLOR_ATTACHMENT15_EXT = 0x8CEF;
+
+  static const int COLOR_ATTACHMENT1_EXT = 0x8CE1;
+
+  static const int COLOR_ATTACHMENT2_EXT = 0x8CE2;
+
+  static const int COLOR_ATTACHMENT3_EXT = 0x8CE3;
+
+  static const int COLOR_ATTACHMENT4_EXT = 0x8CE4;
+
+  static const int COLOR_ATTACHMENT5_EXT = 0x8CE5;
+
+  static const int COLOR_ATTACHMENT6_EXT = 0x8CE6;
+
+  static const int COLOR_ATTACHMENT7_EXT = 0x8CE7;
+
+  static const int COLOR_ATTACHMENT8_EXT = 0x8CE8;
+
+  static const int COLOR_ATTACHMENT9_EXT = 0x8CE9;
+
+  static const int DRAW_BUFFER0_EXT = 0x8825;
+
+  static const int DRAW_BUFFER10_EXT = 0x882F;
+
+  static const int DRAW_BUFFER11_EXT = 0x8830;
+
+  static const int DRAW_BUFFER12_EXT = 0x8831;
+
+  static const int DRAW_BUFFER13_EXT = 0x8832;
+
+  static const int DRAW_BUFFER14_EXT = 0x8833;
+
+  static const int DRAW_BUFFER15_EXT = 0x8834;
+
+  static const int DRAW_BUFFER1_EXT = 0x8826;
+
+  static const int DRAW_BUFFER2_EXT = 0x8827;
+
+  static const int DRAW_BUFFER3_EXT = 0x8828;
+
+  static const int DRAW_BUFFER4_EXT = 0x8829;
+
+  static const int DRAW_BUFFER5_EXT = 0x882A;
+
+  static const int DRAW_BUFFER6_EXT = 0x882B;
+
+  static const int DRAW_BUFFER7_EXT = 0x882C;
+
+  static const int DRAW_BUFFER8_EXT = 0x882D;
+
+  static const int DRAW_BUFFER9_EXT = 0x882E;
+
+  static const int MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF;
+
+  static const int MAX_DRAW_BUFFERS_EXT = 0x8824;
+
+}
+// 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('EXTTextureFilterAnisotropic')
+class ExtTextureFilterAnisotropic extends NativeFieldWrapperClass1 {
+  ExtTextureFilterAnisotropic.internal();
+
+  static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
+
+  static const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
+
+}
+// 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('WebGLFramebuffer')
+class Framebuffer extends NativeFieldWrapperClass1 {
+  Framebuffer.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('WebGLLoseContext')
+class LoseContext extends NativeFieldWrapperClass1 {
+  LoseContext.internal();
+
+  @DomName('WebGLLoseContext.loseContext')
+  @DocsEditable
+  void loseContext() native "WebGLLoseContext_loseContext_Callback";
+
+  @DomName('WebGLLoseContext.restoreContext')
+  @DocsEditable
+  void restoreContext() native "WebGLLoseContext_restoreContext_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('OESElementIndexUint')
+class OesElementIndexUint extends NativeFieldWrapperClass1 {
+  OesElementIndexUint.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('OESStandardDerivatives')
+class OesStandardDerivatives extends NativeFieldWrapperClass1 {
+  OesStandardDerivatives.internal();
+
+  static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
+
+}
+// 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('OESTextureFloat')
+class OesTextureFloat extends NativeFieldWrapperClass1 {
+  OesTextureFloat.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('OESTextureHalfFloat')
+class OesTextureHalfFloat extends NativeFieldWrapperClass1 {
+  OesTextureHalfFloat.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('OESVertexArrayObject')
+class OesVertexArrayObject extends NativeFieldWrapperClass1 {
+  OesVertexArrayObject.internal();
+
+  static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
+
+  @DomName('OESVertexArrayObject.bindVertexArrayOES')
+  @DocsEditable
+  void bindVertexArray(VertexArrayObject arrayObject) native "OESVertexArrayObject_bindVertexArrayOES_Callback";
+
+  @DomName('OESVertexArrayObject.createVertexArrayOES')
+  @DocsEditable
+  VertexArrayObject createVertexArray() native "OESVertexArrayObject_createVertexArrayOES_Callback";
+
+  @DomName('OESVertexArrayObject.deleteVertexArrayOES')
+  @DocsEditable
+  void deleteVertexArray(VertexArrayObject arrayObject) native "OESVertexArrayObject_deleteVertexArrayOES_Callback";
+
+  @DomName('OESVertexArrayObject.isVertexArrayOES')
+  @DocsEditable
+  bool isVertexArray(VertexArrayObject arrayObject) native "OESVertexArrayObject_isVertexArrayOES_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('WebGLProgram')
+class Program extends NativeFieldWrapperClass1 {
+  Program.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('WebGLRenderbuffer')
+class Renderbuffer extends NativeFieldWrapperClass1 {
+  Renderbuffer.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('WebGLRenderingContext')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@Experimental
+class RenderingContext extends CanvasRenderingContext {
+  RenderingContext.internal() : super.internal();
+
+  /// Checks if this type is supported on the current platform.
+  static bool get supported => true;
+
+  static const int ACTIVE_ATTRIBUTES = 0x8B89;
+
+  static const int ACTIVE_TEXTURE = 0x84E0;
+
+  static const int ACTIVE_UNIFORMS = 0x8B86;
+
+  static const int ALIASED_LINE_WIDTH_RANGE = 0x846E;
+
+  static const int ALIASED_POINT_SIZE_RANGE = 0x846D;
+
+  static const int ALPHA = 0x1906;
+
+  static const int ALPHA_BITS = 0x0D55;
+
+  static const int ALWAYS = 0x0207;
+
+  static const int ARRAY_BUFFER = 0x8892;
+
+  static const int ARRAY_BUFFER_BINDING = 0x8894;
+
+  static const int ATTACHED_SHADERS = 0x8B85;
+
+  static const int BACK = 0x0405;
+
+  static const int BLEND = 0x0BE2;
+
+  static const int BLEND_COLOR = 0x8005;
+
+  static const int BLEND_DST_ALPHA = 0x80CA;
+
+  static const int BLEND_DST_RGB = 0x80C8;
+
+  static const int BLEND_EQUATION = 0x8009;
+
+  static const int BLEND_EQUATION_ALPHA = 0x883D;
+
+  static const int BLEND_EQUATION_RGB = 0x8009;
+
+  static const int BLEND_SRC_ALPHA = 0x80CB;
+
+  static const int BLEND_SRC_RGB = 0x80C9;
+
+  static const int BLUE_BITS = 0x0D54;
+
+  static const int BOOL = 0x8B56;
+
+  static const int BOOL_VEC2 = 0x8B57;
+
+  static const int BOOL_VEC3 = 0x8B58;
+
+  static const int BOOL_VEC4 = 0x8B59;
+
+  static const int BROWSER_DEFAULT_WEBGL = 0x9244;
+
+  static const int BUFFER_SIZE = 0x8764;
+
+  static const int BUFFER_USAGE = 0x8765;
+
+  static const int BYTE = 0x1400;
+
+  static const int CCW = 0x0901;
+
+  static const int CLAMP_TO_EDGE = 0x812F;
+
+  static const int COLOR_ATTACHMENT0 = 0x8CE0;
+
+  static const int COLOR_BUFFER_BIT = 0x00004000;
+
+  static const int COLOR_CLEAR_VALUE = 0x0C22;
+
+  static const int COLOR_WRITEMASK = 0x0C23;
+
+  static const int COMPILE_STATUS = 0x8B81;
+
+  static const int COMPRESSED_TEXTURE_FORMATS = 0x86A3;
+
+  static const int CONSTANT_ALPHA = 0x8003;
+
+  static const int CONSTANT_COLOR = 0x8001;
+
+  static const int CONTEXT_LOST_WEBGL = 0x9242;
+
+  static const int CULL_FACE = 0x0B44;
+
+  static const int CULL_FACE_MODE = 0x0B45;
+
+  static const int CURRENT_PROGRAM = 0x8B8D;
+
+  static const int CURRENT_VERTEX_ATTRIB = 0x8626;
+
+  static const int CW = 0x0900;
+
+  static const int DECR = 0x1E03;
+
+  static const int DECR_WRAP = 0x8508;
+
+  static const int DELETE_STATUS = 0x8B80;
+
+  static const int DEPTH_ATTACHMENT = 0x8D00;
+
+  static const int DEPTH_BITS = 0x0D56;
+
+  static const int DEPTH_BUFFER_BIT = 0x00000100;
+
+  static const int DEPTH_CLEAR_VALUE = 0x0B73;
+
+  static const int DEPTH_COMPONENT = 0x1902;
+
+  static const int DEPTH_COMPONENT16 = 0x81A5;
+
+  static const int DEPTH_FUNC = 0x0B74;
+
+  static const int DEPTH_RANGE = 0x0B70;
+
+  static const int DEPTH_STENCIL = 0x84F9;
+
+  static const int DEPTH_STENCIL_ATTACHMENT = 0x821A;
+
+  static const int DEPTH_TEST = 0x0B71;
+
+  static const int DEPTH_WRITEMASK = 0x0B72;
+
+  static const int DITHER = 0x0BD0;
+
+  static const int DONT_CARE = 0x1100;
+
+  static const int DST_ALPHA = 0x0304;
+
+  static const int DST_COLOR = 0x0306;
+
+  static const int DYNAMIC_DRAW = 0x88E8;
+
+  static const int ELEMENT_ARRAY_BUFFER = 0x8893;
+
+  static const int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
+
+  static const int EQUAL = 0x0202;
+
+  static const int FASTEST = 0x1101;
+
+  static const int FLOAT = 0x1406;
+
+  static const int FLOAT_MAT2 = 0x8B5A;
+
+  static const int FLOAT_MAT3 = 0x8B5B;
+
+  static const int FLOAT_MAT4 = 0x8B5C;
+
+  static const int FLOAT_VEC2 = 0x8B50;
+
+  static const int FLOAT_VEC3 = 0x8B51;
+
+  static const int FLOAT_VEC4 = 0x8B52;
+
+  static const int FRAGMENT_SHADER = 0x8B30;
+
+  static const int FRAMEBUFFER = 0x8D40;
+
+  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
+
+  static const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
+
+  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
+
+  static const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
+
+  static const int FRAMEBUFFER_BINDING = 0x8CA6;
+
+  static const int FRAMEBUFFER_COMPLETE = 0x8CD5;
+
+  static const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
+
+  static const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
+
+  static const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
+
+  static const int FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
+
+  static const int FRONT = 0x0404;
+
+  static const int FRONT_AND_BACK = 0x0408;
+
+  static const int FRONT_FACE = 0x0B46;
+
+  static const int FUNC_ADD = 0x8006;
+
+  static const int FUNC_REVERSE_SUBTRACT = 0x800B;
+
+  static const int FUNC_SUBTRACT = 0x800A;
+
+  static const int GENERATE_MIPMAP_HINT = 0x8192;
+
+  static const int GEQUAL = 0x0206;
+
+  static const int GREATER = 0x0204;
+
+  static const int GREEN_BITS = 0x0D53;
+
+  static const int HALF_FLOAT_OES = 0x8D61;
+
+  static const int HIGH_FLOAT = 0x8DF2;
+
+  static const int HIGH_INT = 0x8DF5;
+
+  static const int INCR = 0x1E02;
+
+  static const int INCR_WRAP = 0x8507;
+
+  static const int INT = 0x1404;
+
+  static const int INT_VEC2 = 0x8B53;
+
+  static const int INT_VEC3 = 0x8B54;
+
+  static const int INT_VEC4 = 0x8B55;
+
+  static const int INVALID_ENUM = 0x0500;
+
+  static const int INVALID_FRAMEBUFFER_OPERATION = 0x0506;
+
+  static const int INVALID_OPERATION = 0x0502;
+
+  static const int INVALID_VALUE = 0x0501;
+
+  static const int INVERT = 0x150A;
+
+  static const int KEEP = 0x1E00;
+
+  static const int LEQUAL = 0x0203;
+
+  static const int LESS = 0x0201;
+
+  static const int LINEAR = 0x2601;
+
+  static const int LINEAR_MIPMAP_LINEAR = 0x2703;
+
+  static const int LINEAR_MIPMAP_NEAREST = 0x2701;
+
+  static const int LINES = 0x0001;
+
+  static const int LINE_LOOP = 0x0002;
+
+  static const int LINE_STRIP = 0x0003;
+
+  static const int LINE_WIDTH = 0x0B21;
+
+  static const int LINK_STATUS = 0x8B82;
+
+  static const int LOW_FLOAT = 0x8DF0;
+
+  static const int LOW_INT = 0x8DF3;
+
+  static const int LUMINANCE = 0x1909;
+
+  static const int LUMINANCE_ALPHA = 0x190A;
+
+  static const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
+
+  static const int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
+
+  static const int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
+
+  static const int MAX_RENDERBUFFER_SIZE = 0x84E8;
+
+  static const int MAX_TEXTURE_IMAGE_UNITS = 0x8872;
+
+  static const int MAX_TEXTURE_SIZE = 0x0D33;
+
+  static const int MAX_VARYING_VECTORS = 0x8DFC;
+
+  static const int MAX_VERTEX_ATTRIBS = 0x8869;
+
+  static const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
+
+  static const int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
+
+  static const int MAX_VIEWPORT_DIMS = 0x0D3A;
+
+  static const int MEDIUM_FLOAT = 0x8DF1;
+
+  static const int MEDIUM_INT = 0x8DF4;
+
+  static const int MIRRORED_REPEAT = 0x8370;
+
+  static const int NEAREST = 0x2600;
+
+  static const int NEAREST_MIPMAP_LINEAR = 0x2702;
+
+  static const int NEAREST_MIPMAP_NEAREST = 0x2700;
+
+  static const int NEVER = 0x0200;
+
+  static const int NICEST = 0x1102;
+
+  static const int NONE = 0;
+
+  static const int NOTEQUAL = 0x0205;
+
+  static const int NO_ERROR = 0;
+
+  static const int ONE = 1;
+
+  static const int ONE_MINUS_CONSTANT_ALPHA = 0x8004;
+
+  static const int ONE_MINUS_CONSTANT_COLOR = 0x8002;
+
+  static const int ONE_MINUS_DST_ALPHA = 0x0305;
+
+  static const int ONE_MINUS_DST_COLOR = 0x0307;
+
+  static const int ONE_MINUS_SRC_ALPHA = 0x0303;
+
+  static const int ONE_MINUS_SRC_COLOR = 0x0301;
+
+  static const int OUT_OF_MEMORY = 0x0505;
+
+  static const int PACK_ALIGNMENT = 0x0D05;
+
+  static const int POINTS = 0x0000;
+
+  static const int POLYGON_OFFSET_FACTOR = 0x8038;
+
+  static const int POLYGON_OFFSET_FILL = 0x8037;
+
+  static const int POLYGON_OFFSET_UNITS = 0x2A00;
+
+  static const int RED_BITS = 0x0D52;
+
+  static const int RENDERBUFFER = 0x8D41;
+
+  static const int RENDERBUFFER_ALPHA_SIZE = 0x8D53;
+
+  static const int RENDERBUFFER_BINDING = 0x8CA7;
+
+  static const int RENDERBUFFER_BLUE_SIZE = 0x8D52;
+
+  static const int RENDERBUFFER_DEPTH_SIZE = 0x8D54;
+
+  static const int RENDERBUFFER_GREEN_SIZE = 0x8D51;
+
+  static const int RENDERBUFFER_HEIGHT = 0x8D43;
+
+  static const int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
+
+  static const int RENDERBUFFER_RED_SIZE = 0x8D50;
+
+  static const int RENDERBUFFER_STENCIL_SIZE = 0x8D55;
+
+  static const int RENDERBUFFER_WIDTH = 0x8D42;
+
+  static const int RENDERER = 0x1F01;
+
+  static const int REPEAT = 0x2901;
+
+  static const int REPLACE = 0x1E01;
+
+  static const int RGB = 0x1907;
+
+  static const int RGB565 = 0x8D62;
+
+  static const int RGB5_A1 = 0x8057;
+
+  static const int RGBA = 0x1908;
+
+  static const int RGBA4 = 0x8056;
+
+  static const int SAMPLER_2D = 0x8B5E;
+
+  static const int SAMPLER_CUBE = 0x8B60;
+
+  static const int SAMPLES = 0x80A9;
+
+  static const int SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
+
+  static const int SAMPLE_BUFFERS = 0x80A8;
+
+  static const int SAMPLE_COVERAGE = 0x80A0;
+
+  static const int SAMPLE_COVERAGE_INVERT = 0x80AB;
+
+  static const int SAMPLE_COVERAGE_VALUE = 0x80AA;
+
+  static const int SCISSOR_BOX = 0x0C10;
+
+  static const int SCISSOR_TEST = 0x0C11;
+
+  static const int SHADER_TYPE = 0x8B4F;
+
+  static const int SHADING_LANGUAGE_VERSION = 0x8B8C;
+
+  static const int SHORT = 0x1402;
+
+  static const int SRC_ALPHA = 0x0302;
+
+  static const int SRC_ALPHA_SATURATE = 0x0308;
+
+  static const int SRC_COLOR = 0x0300;
+
+  static const int STATIC_DRAW = 0x88E4;
+
+  static const int STENCIL_ATTACHMENT = 0x8D20;
+
+  static const int STENCIL_BACK_FAIL = 0x8801;
+
+  static const int STENCIL_BACK_FUNC = 0x8800;
+
+  static const int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
+
+  static const int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
+
+  static const int STENCIL_BACK_REF = 0x8CA3;
+
+  static const int STENCIL_BACK_VALUE_MASK = 0x8CA4;
+
+  static const int STENCIL_BACK_WRITEMASK = 0x8CA5;
+
+  static const int STENCIL_BITS = 0x0D57;
+
+  static const int STENCIL_BUFFER_BIT = 0x00000400;
+
+  static const int STENCIL_CLEAR_VALUE = 0x0B91;
+
+  static const int STENCIL_FAIL = 0x0B94;
+
+  static const int STENCIL_FUNC = 0x0B92;
+
+  static const int STENCIL_INDEX = 0x1901;
+
+  static const int STENCIL_INDEX8 = 0x8D48;
+
+  static const int STENCIL_PASS_DEPTH_FAIL = 0x0B95;
+
+  static const int STENCIL_PASS_DEPTH_PASS = 0x0B96;
+
+  static const int STENCIL_REF = 0x0B97;
+
+  static const int STENCIL_TEST = 0x0B90;
+
+  static const int STENCIL_VALUE_MASK = 0x0B93;
+
+  static const int STENCIL_WRITEMASK = 0x0B98;
+
+  static const int STREAM_DRAW = 0x88E0;
+
+  static const int SUBPIXEL_BITS = 0x0D50;
+
+  static const int TEXTURE = 0x1702;
+
+  static const int TEXTURE0 = 0x84C0;
+
+  static const int TEXTURE1 = 0x84C1;
+
+  static const int TEXTURE10 = 0x84CA;
+
+  static const int TEXTURE11 = 0x84CB;
+
+  static const int TEXTURE12 = 0x84CC;
+
+  static const int TEXTURE13 = 0x84CD;
+
+  static const int TEXTURE14 = 0x84CE;
+
+  static const int TEXTURE15 = 0x84CF;
+
+  static const int TEXTURE16 = 0x84D0;
+
+  static const int TEXTURE17 = 0x84D1;
+
+  static const int TEXTURE18 = 0x84D2;
+
+  static const int TEXTURE19 = 0x84D3;
+
+  static const int TEXTURE2 = 0x84C2;
+
+  static const int TEXTURE20 = 0x84D4;
+
+  static const int TEXTURE21 = 0x84D5;
+
+  static const int TEXTURE22 = 0x84D6;
+
+  static const int TEXTURE23 = 0x84D7;
+
+  static const int TEXTURE24 = 0x84D8;
+
+  static const int TEXTURE25 = 0x84D9;
+
+  static const int TEXTURE26 = 0x84DA;
+
+  static const int TEXTURE27 = 0x84DB;
+
+  static const int TEXTURE28 = 0x84DC;
+
+  static const int TEXTURE29 = 0x84DD;
+
+  static const int TEXTURE3 = 0x84C3;
+
+  static const int TEXTURE30 = 0x84DE;
+
+  static const int TEXTURE31 = 0x84DF;
+
+  static const int TEXTURE4 = 0x84C4;
+
+  static const int TEXTURE5 = 0x84C5;
+
+  static const int TEXTURE6 = 0x84C6;
+
+  static const int TEXTURE7 = 0x84C7;
+
+  static const int TEXTURE8 = 0x84C8;
+
+  static const int TEXTURE9 = 0x84C9;
+
+  static const int TEXTURE_2D = 0x0DE1;
+
+  static const int TEXTURE_BINDING_2D = 0x8069;
+
+  static const int TEXTURE_BINDING_CUBE_MAP = 0x8514;
+
+  static const int TEXTURE_CUBE_MAP = 0x8513;
+
+  static const int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
+
+  static const int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
+
+  static const int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
+
+  static const int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
+
+  static const int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
+
+  static const int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
+
+  static const int TEXTURE_MAG_FILTER = 0x2800;
+
+  static const int TEXTURE_MIN_FILTER = 0x2801;
+
+  static const int TEXTURE_WRAP_S = 0x2802;
+
+  static const int TEXTURE_WRAP_T = 0x2803;
+
+  static const int TRIANGLES = 0x0004;
+
+  static const int TRIANGLE_FAN = 0x0006;
+
+  static const int TRIANGLE_STRIP = 0x0005;
+
+  static const int UNPACK_ALIGNMENT = 0x0CF5;
+
+  static const int UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
+
+  static const int UNPACK_FLIP_Y_WEBGL = 0x9240;
+
+  static const int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
+
+  static const int UNSIGNED_BYTE = 0x1401;
+
+  static const int UNSIGNED_INT = 0x1405;
+
+  static const int UNSIGNED_SHORT = 0x1403;
+
+  static const int UNSIGNED_SHORT_4_4_4_4 = 0x8033;
+
+  static const int UNSIGNED_SHORT_5_5_5_1 = 0x8034;
+
+  static const int UNSIGNED_SHORT_5_6_5 = 0x8363;
+
+  static const int VALIDATE_STATUS = 0x8B83;
+
+  static const int VENDOR = 0x1F00;
+
+  static const int VERSION = 0x1F02;
+
+  static const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
+
+  static const int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
+
+  static const int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
+
+  static const int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
+
+  static const int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
+
+  static const int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
+
+  static const int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
+
+  static const int VERTEX_SHADER = 0x8B31;
+
+  static const int VIEWPORT = 0x0BA2;
+
+  static const int ZERO = 0;
+
+  @DomName('WebGLRenderingContext.drawingBufferHeight')
+  @DocsEditable
+  int get drawingBufferHeight native "WebGLRenderingContext_drawingBufferHeight_Getter";
+
+  @DomName('WebGLRenderingContext.drawingBufferWidth')
+  @DocsEditable
+  int get drawingBufferWidth native "WebGLRenderingContext_drawingBufferWidth_Getter";
+
+  @DomName('WebGLRenderingContext.activeTexture')
+  @DocsEditable
+  void activeTexture(int texture) native "WebGLRenderingContext_activeTexture_Callback";
+
+  @DomName('WebGLRenderingContext.attachShader')
+  @DocsEditable
+  void attachShader(Program program, Shader shader) native "WebGLRenderingContext_attachShader_Callback";
+
+  @DomName('WebGLRenderingContext.bindAttribLocation')
+  @DocsEditable
+  void bindAttribLocation(Program program, int index, String name) native "WebGLRenderingContext_bindAttribLocation_Callback";
+
+  @DomName('WebGLRenderingContext.bindBuffer')
+  @DocsEditable
+  void bindBuffer(int target, Buffer buffer) native "WebGLRenderingContext_bindBuffer_Callback";
+
+  @DomName('WebGLRenderingContext.bindFramebuffer')
+  @DocsEditable
+  void bindFramebuffer(int target, Framebuffer framebuffer) native "WebGLRenderingContext_bindFramebuffer_Callback";
+
+  @DomName('WebGLRenderingContext.bindRenderbuffer')
+  @DocsEditable
+  void bindRenderbuffer(int target, Renderbuffer renderbuffer) native "WebGLRenderingContext_bindRenderbuffer_Callback";
+
+  @DomName('WebGLRenderingContext.bindTexture')
+  @DocsEditable
+  void bindTexture(int target, Texture texture) native "WebGLRenderingContext_bindTexture_Callback";
+
+  @DomName('WebGLRenderingContext.blendColor')
+  @DocsEditable
+  void blendColor(num red, num green, num blue, num alpha) native "WebGLRenderingContext_blendColor_Callback";
+
+  @DomName('WebGLRenderingContext.blendEquation')
+  @DocsEditable
+  void blendEquation(int mode) native "WebGLRenderingContext_blendEquation_Callback";
+
+  @DomName('WebGLRenderingContext.blendEquationSeparate')
+  @DocsEditable
+  void blendEquationSeparate(int modeRGB, int modeAlpha) native "WebGLRenderingContext_blendEquationSeparate_Callback";
+
+  @DomName('WebGLRenderingContext.blendFunc')
+  @DocsEditable
+  void blendFunc(int sfactor, int dfactor) native "WebGLRenderingContext_blendFunc_Callback";
+
+  @DomName('WebGLRenderingContext.blendFuncSeparate')
+  @DocsEditable
+  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)) {
+      _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)) {
+      _bufferData_2(target, data_OR_size, usage);
+      return;
+    }
+    if ((target is int || target == null) && (data_OR_size is int || data_OR_size == null) && (usage is int || usage == null)) {
+      _bufferData_3(target, data_OR_size, usage);
+      return;
+    }
+    throw new ArgumentError("Incorrect number or type of arguments");
+  }
+
+  @DomName('WebGLRenderingContext._bufferData_1')
+  @DocsEditable
+  void _bufferData_1(target, data_OR_size, usage) native "WebGLRenderingContext__bufferData_1_Callback";
+
+  @DomName('WebGLRenderingContext._bufferData_2')
+  @DocsEditable
+  void _bufferData_2(target, data_OR_size, usage) native "WebGLRenderingContext__bufferData_2_Callback";
+
+  @DomName('WebGLRenderingContext._bufferData_3')
+  @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)) {
+      _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)) {
+      _bufferSubData_2(target, offset, data);
+      return;
+    }
+    throw new ArgumentError("Incorrect number or type of arguments");
+  }
+
+  @DomName('WebGLRenderingContext._bufferSubData_1')
+  @DocsEditable
+  void _bufferSubData_1(target, offset, data) native "WebGLRenderingContext__bufferSubData_1_Callback";
+
+  @DomName('WebGLRenderingContext._bufferSubData_2')
+  @DocsEditable
+  void _bufferSubData_2(target, offset, data) native "WebGLRenderingContext__bufferSubData_2_Callback";
+
+  @DomName('WebGLRenderingContext.checkFramebufferStatus')
+  @DocsEditable
+  int checkFramebufferStatus(int target) native "WebGLRenderingContext_checkFramebufferStatus_Callback";
+
+  @DomName('WebGLRenderingContext.clear')
+  @DocsEditable
+  void clear(int mask) native "WebGLRenderingContext_clear_Callback";
+
+  @DomName('WebGLRenderingContext.clearColor')
+  @DocsEditable
+  void clearColor(num red, num green, num blue, num alpha) native "WebGLRenderingContext_clearColor_Callback";
+
+  @DomName('WebGLRenderingContext.clearDepth')
+  @DocsEditable
+  void clearDepth(num depth) native "WebGLRenderingContext_clearDepth_Callback";
+
+  @DomName('WebGLRenderingContext.clearStencil')
+  @DocsEditable
+  void clearStencil(int s) native "WebGLRenderingContext_clearStencil_Callback";
+
+  @DomName('WebGLRenderingContext.colorMask')
+  @DocsEditable
+  void colorMask(bool red, bool green, bool blue, bool alpha) native "WebGLRenderingContext_colorMask_Callback";
+
+  @DomName('WebGLRenderingContext.compileShader')
+  @DocsEditable
+  void compileShader(Shader shader) native "WebGLRenderingContext_compileShader_Callback";
+
+  @DomName('WebGLRenderingContext.compressedTexImage2D')
+  @DocsEditable
+  void compressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, /*ArrayBufferView*/ 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";
+
+  @DomName('WebGLRenderingContext.copyTexImage2D')
+  @DocsEditable
+  void copyTexImage2D(int target, int level, int internalformat, int x, int y, int width, int height, int border) native "WebGLRenderingContext_copyTexImage2D_Callback";
+
+  @DomName('WebGLRenderingContext.copyTexSubImage2D')
+  @DocsEditable
+  void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) native "WebGLRenderingContext_copyTexSubImage2D_Callback";
+
+  @DomName('WebGLRenderingContext.createBuffer')
+  @DocsEditable
+  Buffer createBuffer() native "WebGLRenderingContext_createBuffer_Callback";
+
+  @DomName('WebGLRenderingContext.createFramebuffer')
+  @DocsEditable
+  Framebuffer createFramebuffer() native "WebGLRenderingContext_createFramebuffer_Callback";
+
+  @DomName('WebGLRenderingContext.createProgram')
+  @DocsEditable
+  Program createProgram() native "WebGLRenderingContext_createProgram_Callback";
+
+  @DomName('WebGLRenderingContext.createRenderbuffer')
+  @DocsEditable
+  Renderbuffer createRenderbuffer() native "WebGLRenderingContext_createRenderbuffer_Callback";
+
+  @DomName('WebGLRenderingContext.createShader')
+  @DocsEditable
+  Shader createShader(int type) native "WebGLRenderingContext_createShader_Callback";
+
+  @DomName('WebGLRenderingContext.createTexture')
+  @DocsEditable
+  Texture createTexture() native "WebGLRenderingContext_createTexture_Callback";
+
+  @DomName('WebGLRenderingContext.cullFace')
+  @DocsEditable
+  void cullFace(int mode) native "WebGLRenderingContext_cullFace_Callback";
+
+  @DomName('WebGLRenderingContext.deleteBuffer')
+  @DocsEditable
+  void deleteBuffer(Buffer buffer) native "WebGLRenderingContext_deleteBuffer_Callback";
+
+  @DomName('WebGLRenderingContext.deleteFramebuffer')
+  @DocsEditable
+  void deleteFramebuffer(Framebuffer framebuffer) native "WebGLRenderingContext_deleteFramebuffer_Callback";
+
+  @DomName('WebGLRenderingContext.deleteProgram')
+  @DocsEditable
+  void deleteProgram(Program program) native "WebGLRenderingContext_deleteProgram_Callback";
+
+  @DomName('WebGLRenderingContext.deleteRenderbuffer')
+  @DocsEditable
+  void deleteRenderbuffer(Renderbuffer renderbuffer) native "WebGLRenderingContext_deleteRenderbuffer_Callback";
+
+  @DomName('WebGLRenderingContext.deleteShader')
+  @DocsEditable
+  void deleteShader(Shader shader) native "WebGLRenderingContext_deleteShader_Callback";
+
+  @DomName('WebGLRenderingContext.deleteTexture')
+  @DocsEditable
+  void deleteTexture(Texture texture) native "WebGLRenderingContext_deleteTexture_Callback";
+
+  @DomName('WebGLRenderingContext.depthFunc')
+  @DocsEditable
+  void depthFunc(int func) native "WebGLRenderingContext_depthFunc_Callback";
+
+  @DomName('WebGLRenderingContext.depthMask')
+  @DocsEditable
+  void depthMask(bool flag) native "WebGLRenderingContext_depthMask_Callback";
+
+  @DomName('WebGLRenderingContext.depthRange')
+  @DocsEditable
+  void depthRange(num zNear, num zFar) native "WebGLRenderingContext_depthRange_Callback";
+
+  @DomName('WebGLRenderingContext.detachShader')
+  @DocsEditable
+  void detachShader(Program program, Shader shader) native "WebGLRenderingContext_detachShader_Callback";
+
+  @DomName('WebGLRenderingContext.disable')
+  @DocsEditable
+  void disable(int cap) native "WebGLRenderingContext_disable_Callback";
+
+  @DomName('WebGLRenderingContext.disableVertexAttribArray')
+  @DocsEditable
+  void disableVertexAttribArray(int index) native "WebGLRenderingContext_disableVertexAttribArray_Callback";
+
+  @DomName('WebGLRenderingContext.drawArrays')
+  @DocsEditable
+  void drawArrays(int mode, int first, int count) native "WebGLRenderingContext_drawArrays_Callback";
+
+  @DomName('WebGLRenderingContext.drawElements')
+  @DocsEditable
+  void drawElements(int mode, int count, int type, int offset) native "WebGLRenderingContext_drawElements_Callback";
+
+  @DomName('WebGLRenderingContext.enable')
+  @DocsEditable
+  void enable(int cap) native "WebGLRenderingContext_enable_Callback";
+
+  @DomName('WebGLRenderingContext.enableVertexAttribArray')
+  @DocsEditable
+  void enableVertexAttribArray(int index) native "WebGLRenderingContext_enableVertexAttribArray_Callback";
+
+  @DomName('WebGLRenderingContext.finish')
+  @DocsEditable
+  void finish() native "WebGLRenderingContext_finish_Callback";
+
+  @DomName('WebGLRenderingContext.flush')
+  @DocsEditable
+  void flush() native "WebGLRenderingContext_flush_Callback";
+
+  @DomName('WebGLRenderingContext.framebufferRenderbuffer')
+  @DocsEditable
+  void framebufferRenderbuffer(int target, int attachment, int renderbuffertarget, Renderbuffer renderbuffer) native "WebGLRenderingContext_framebufferRenderbuffer_Callback";
+
+  @DomName('WebGLRenderingContext.framebufferTexture2D')
+  @DocsEditable
+  void framebufferTexture2D(int target, int attachment, int textarget, Texture texture, int level) native "WebGLRenderingContext_framebufferTexture2D_Callback";
+
+  @DomName('WebGLRenderingContext.frontFace')
+  @DocsEditable
+  void frontFace(int mode) native "WebGLRenderingContext_frontFace_Callback";
+
+  @DomName('WebGLRenderingContext.generateMipmap')
+  @DocsEditable
+  void generateMipmap(int target) native "WebGLRenderingContext_generateMipmap_Callback";
+
+  @DomName('WebGLRenderingContext.getActiveAttrib')
+  @DocsEditable
+  ActiveInfo getActiveAttrib(Program program, int index) native "WebGLRenderingContext_getActiveAttrib_Callback";
+
+  @DomName('WebGLRenderingContext.getActiveUniform')
+  @DocsEditable
+  ActiveInfo getActiveUniform(Program program, int index) native "WebGLRenderingContext_getActiveUniform_Callback";
+
+  @DomName('WebGLRenderingContext.getAttachedShaders')
+  @DocsEditable
+  void getAttachedShaders(Program program) native "WebGLRenderingContext_getAttachedShaders_Callback";
+
+  @DomName('WebGLRenderingContext.getAttribLocation')
+  @DocsEditable
+  int getAttribLocation(Program program, String name) native "WebGLRenderingContext_getAttribLocation_Callback";
+
+  @DomName('WebGLRenderingContext.getBufferParameter')
+  @DocsEditable
+  Object getBufferParameter(int target, int pname) native "WebGLRenderingContext_getBufferParameter_Callback";
+
+  @DomName('WebGLRenderingContext.getContextAttributes')
+  @DocsEditable
+  ContextAttributes getContextAttributes() native "WebGLRenderingContext_getContextAttributes_Callback";
+
+  @DomName('WebGLRenderingContext.getError')
+  @DocsEditable
+  int getError() native "WebGLRenderingContext_getError_Callback";
+
+  @DomName('WebGLRenderingContext.getExtension')
+  @DocsEditable
+  Object getExtension(String name) native "WebGLRenderingContext_getExtension_Callback";
+
+  @DomName('WebGLRenderingContext.getFramebufferAttachmentParameter')
+  @DocsEditable
+  Object getFramebufferAttachmentParameter(int target, int attachment, int pname) native "WebGLRenderingContext_getFramebufferAttachmentParameter_Callback";
+
+  @DomName('WebGLRenderingContext.getParameter')
+  @DocsEditable
+  Object getParameter(int pname) native "WebGLRenderingContext_getParameter_Callback";
+
+  @DomName('WebGLRenderingContext.getProgramInfoLog')
+  @DocsEditable
+  String getProgramInfoLog(Program program) native "WebGLRenderingContext_getProgramInfoLog_Callback";
+
+  @DomName('WebGLRenderingContext.getProgramParameter')
+  @DocsEditable
+  Object getProgramParameter(Program program, int pname) native "WebGLRenderingContext_getProgramParameter_Callback";
+
+  @DomName('WebGLRenderingContext.getRenderbufferParameter')
+  @DocsEditable
+  Object getRenderbufferParameter(int target, int pname) native "WebGLRenderingContext_getRenderbufferParameter_Callback";
+
+  @DomName('WebGLRenderingContext.getShaderInfoLog')
+  @DocsEditable
+  String getShaderInfoLog(Shader shader) native "WebGLRenderingContext_getShaderInfoLog_Callback";
+
+  @DomName('WebGLRenderingContext.getShaderParameter')
+  @DocsEditable
+  Object getShaderParameter(Shader shader, int pname) native "WebGLRenderingContext_getShaderParameter_Callback";
+
+  @DomName('WebGLRenderingContext.getShaderPrecisionFormat')
+  @DocsEditable
+  ShaderPrecisionFormat getShaderPrecisionFormat(int shadertype, int precisiontype) native "WebGLRenderingContext_getShaderPrecisionFormat_Callback";
+
+  @DomName('WebGLRenderingContext.getShaderSource')
+  @DocsEditable
+  String getShaderSource(Shader shader) native "WebGLRenderingContext_getShaderSource_Callback";
+
+  @DomName('WebGLRenderingContext.getSupportedExtensions')
+  @DocsEditable
+  List<String> getSupportedExtensions() native "WebGLRenderingContext_getSupportedExtensions_Callback";
+
+  @DomName('WebGLRenderingContext.getTexParameter')
+  @DocsEditable
+  Object getTexParameter(int target, int pname) native "WebGLRenderingContext_getTexParameter_Callback";
+
+  @DomName('WebGLRenderingContext.getUniform')
+  @DocsEditable
+  Object getUniform(Program program, UniformLocation location) native "WebGLRenderingContext_getUniform_Callback";
+
+  @DomName('WebGLRenderingContext.getUniformLocation')
+  @DocsEditable
+  UniformLocation getUniformLocation(Program program, String name) native "WebGLRenderingContext_getUniformLocation_Callback";
+
+  @DomName('WebGLRenderingContext.getVertexAttrib')
+  @DocsEditable
+  Object getVertexAttrib(int index, int pname) native "WebGLRenderingContext_getVertexAttrib_Callback";
+
+  @DomName('WebGLRenderingContext.getVertexAttribOffset')
+  @DocsEditable
+  int getVertexAttribOffset(int index, int pname) native "WebGLRenderingContext_getVertexAttribOffset_Callback";
+
+  @DomName('WebGLRenderingContext.hint')
+  @DocsEditable
+  void hint(int target, int mode) native "WebGLRenderingContext_hint_Callback";
+
+  @DomName('WebGLRenderingContext.isBuffer')
+  @DocsEditable
+  bool isBuffer(Buffer buffer) native "WebGLRenderingContext_isBuffer_Callback";
+
+  @DomName('WebGLRenderingContext.isContextLost')
+  @DocsEditable
+  bool isContextLost() native "WebGLRenderingContext_isContextLost_Callback";
+
+  @DomName('WebGLRenderingContext.isEnabled')
+  @DocsEditable
+  bool isEnabled(int cap) native "WebGLRenderingContext_isEnabled_Callback";
+
+  @DomName('WebGLRenderingContext.isFramebuffer')
+  @DocsEditable
+  bool isFramebuffer(Framebuffer framebuffer) native "WebGLRenderingContext_isFramebuffer_Callback";
+
+  @DomName('WebGLRenderingContext.isProgram')
+  @DocsEditable
+  bool isProgram(Program program) native "WebGLRenderingContext_isProgram_Callback";
+
+  @DomName('WebGLRenderingContext.isRenderbuffer')
+  @DocsEditable
+  bool isRenderbuffer(Renderbuffer renderbuffer) native "WebGLRenderingContext_isRenderbuffer_Callback";
+
+  @DomName('WebGLRenderingContext.isShader')
+  @DocsEditable
+  bool isShader(Shader shader) native "WebGLRenderingContext_isShader_Callback";
+
+  @DomName('WebGLRenderingContext.isTexture')
+  @DocsEditable
+  bool isTexture(Texture texture) native "WebGLRenderingContext_isTexture_Callback";
+
+  @DomName('WebGLRenderingContext.lineWidth')
+  @DocsEditable
+  void lineWidth(num width) native "WebGLRenderingContext_lineWidth_Callback";
+
+  @DomName('WebGLRenderingContext.linkProgram')
+  @DocsEditable
+  void linkProgram(Program program) native "WebGLRenderingContext_linkProgram_Callback";
+
+  @DomName('WebGLRenderingContext.pixelStorei')
+  @DocsEditable
+  void pixelStorei(int pname, int param) native "WebGLRenderingContext_pixelStorei_Callback";
+
+  @DomName('WebGLRenderingContext.polygonOffset')
+  @DocsEditable
+  void polygonOffset(num factor, num units) native "WebGLRenderingContext_polygonOffset_Callback";
+
+  @DomName('WebGLRenderingContext.readPixels')
+  @DocsEditable
+  void readPixels(int x, int y, int width, int height, int format, int type, /*ArrayBufferView*/ pixels) native "WebGLRenderingContext_readPixels_Callback";
+
+  @DomName('WebGLRenderingContext.releaseShaderCompiler')
+  @DocsEditable
+  void releaseShaderCompiler() native "WebGLRenderingContext_releaseShaderCompiler_Callback";
+
+  @DomName('WebGLRenderingContext.renderbufferStorage')
+  @DocsEditable
+  void renderbufferStorage(int target, int internalformat, int width, int height) native "WebGLRenderingContext_renderbufferStorage_Callback";
+
+  @DomName('WebGLRenderingContext.sampleCoverage')
+  @DocsEditable
+  void sampleCoverage(num value, bool invert) native "WebGLRenderingContext_sampleCoverage_Callback";
+
+  @DomName('WebGLRenderingContext.scissor')
+  @DocsEditable
+  void scissor(int x, int y, int width, int height) native "WebGLRenderingContext_scissor_Callback";
+
+  @DomName('WebGLRenderingContext.shaderSource')
+  @DocsEditable
+  void shaderSource(Shader shader, String string) native "WebGLRenderingContext_shaderSource_Callback";
+
+  @DomName('WebGLRenderingContext.stencilFunc')
+  @DocsEditable
+  void stencilFunc(int func, int ref, int mask) native "WebGLRenderingContext_stencilFunc_Callback";
+
+  @DomName('WebGLRenderingContext.stencilFuncSeparate')
+  @DocsEditable
+  void stencilFuncSeparate(int face, int func, int ref, int mask) native "WebGLRenderingContext_stencilFuncSeparate_Callback";
+
+  @DomName('WebGLRenderingContext.stencilMask')
+  @DocsEditable
+  void stencilMask(int mask) native "WebGLRenderingContext_stencilMask_Callback";
+
+  @DomName('WebGLRenderingContext.stencilMaskSeparate')
+  @DocsEditable
+  void stencilMaskSeparate(int face, int mask) native "WebGLRenderingContext_stencilMaskSeparate_Callback";
+
+  @DomName('WebGLRenderingContext.stencilOp')
+  @DocsEditable
+  void stencilOp(int fail, int zfail, int zpass) native "WebGLRenderingContext_stencilOp_Callback";
+
+  @DomName('WebGLRenderingContext.stencilOpSeparate')
+  @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)) {
+      _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
+      return;
+    }
+    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 ImageData || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
+      _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    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 ImageElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
+      _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    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 CanvasElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
+      _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    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 VideoElement || border_OR_canvas_OR_image_OR_pixels_OR_video == null) && !?format && !?type && !?pixels) {
+      _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    throw new ArgumentError("Incorrect number or type of arguments");
+  }
+
+  @DomName('WebGLRenderingContext._texImage2D_1')
+  @DocsEditable
+  void _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels) native "WebGLRenderingContext__texImage2D_1_Callback";
+
+  @DomName('WebGLRenderingContext._texImage2D_2')
+  @DocsEditable
+  void _texImage2D_2(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texImage2D_2_Callback";
+
+  @DomName('WebGLRenderingContext._texImage2D_3')
+  @DocsEditable
+  void _texImage2D_3(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texImage2D_3_Callback";
+
+  @DomName('WebGLRenderingContext._texImage2D_4')
+  @DocsEditable
+  void _texImage2D_4(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texImage2D_4_Callback";
+
+  @DomName('WebGLRenderingContext._texImage2D_5')
+  @DocsEditable
+  void _texImage2D_5(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texImage2D_5_Callback";
+
+  @DomName('WebGLRenderingContext.texParameterf')
+  @DocsEditable
+  void texParameterf(int target, int pname, num param) native "WebGLRenderingContext_texParameterf_Callback";
+
+  @DomName('WebGLRenderingContext.texParameteri')
+  @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)) {
+      _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
+      return;
+    }
+    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 ImageData || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
+      _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    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 ImageElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
+      _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    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 CanvasElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
+      _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    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 VideoElement || canvas_OR_format_OR_image_OR_pixels_OR_video == null) && !?type && !?pixels) {
+      _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video);
+      return;
+    }
+    throw new ArgumentError("Incorrect number or type of arguments");
+  }
+
+  @DomName('WebGLRenderingContext._texSubImage2D_1')
+  @DocsEditable
+  void _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels) native "WebGLRenderingContext__texSubImage2D_1_Callback";
+
+  @DomName('WebGLRenderingContext._texSubImage2D_2')
+  @DocsEditable
+  void _texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texSubImage2D_2_Callback";
+
+  @DomName('WebGLRenderingContext._texSubImage2D_3')
+  @DocsEditable
+  void _texSubImage2D_3(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texSubImage2D_3_Callback";
+
+  @DomName('WebGLRenderingContext._texSubImage2D_4')
+  @DocsEditable
+  void _texSubImage2D_4(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texSubImage2D_4_Callback";
+
+  @DomName('WebGLRenderingContext._texSubImage2D_5')
+  @DocsEditable
+  void _texSubImage2D_5(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video) native "WebGLRenderingContext__texSubImage2D_5_Callback";
+
+  @DomName('WebGLRenderingContext.uniform1f')
+  @DocsEditable
+  void uniform1f(UniformLocation location, num x) native "WebGLRenderingContext_uniform1f_Callback";
+
+  @DomName('WebGLRenderingContext.uniform1fv')
+  @DocsEditable
+  void uniform1fv(UniformLocation location, List<double> v) native "WebGLRenderingContext_uniform1fv_Callback";
+
+  @DomName('WebGLRenderingContext.uniform1i')
+  @DocsEditable
+  void uniform1i(UniformLocation location, int x) native "WebGLRenderingContext_uniform1i_Callback";
+
+  @DomName('WebGLRenderingContext.uniform1iv')
+  @DocsEditable
+  void uniform1iv(UniformLocation location, List<int> v) native "WebGLRenderingContext_uniform1iv_Callback";
+
+  @DomName('WebGLRenderingContext.uniform2f')
+  @DocsEditable
+  void uniform2f(UniformLocation location, num x, num y) native "WebGLRenderingContext_uniform2f_Callback";
+
+  @DomName('WebGLRenderingContext.uniform2fv')
+  @DocsEditable
+  void uniform2fv(UniformLocation location, List<double> v) native "WebGLRenderingContext_uniform2fv_Callback";
+
+  @DomName('WebGLRenderingContext.uniform2i')
+  @DocsEditable
+  void uniform2i(UniformLocation location, int x, int y) native "WebGLRenderingContext_uniform2i_Callback";
+
+  @DomName('WebGLRenderingContext.uniform2iv')
+  @DocsEditable
+  void uniform2iv(UniformLocation location, List<int> v) native "WebGLRenderingContext_uniform2iv_Callback";
+
+  @DomName('WebGLRenderingContext.uniform3f')
+  @DocsEditable
+  void uniform3f(UniformLocation location, num x, num y, num z) native "WebGLRenderingContext_uniform3f_Callback";
+
+  @DomName('WebGLRenderingContext.uniform3fv')
+  @DocsEditable
+  void uniform3fv(UniformLocation location, List<double> v) native "WebGLRenderingContext_uniform3fv_Callback";
+
+  @DomName('WebGLRenderingContext.uniform3i')
+  @DocsEditable
+  void uniform3i(UniformLocation location, int x, int y, int z) native "WebGLRenderingContext_uniform3i_Callback";
+
+  @DomName('WebGLRenderingContext.uniform3iv')
+  @DocsEditable
+  void uniform3iv(UniformLocation location, List<int> v) native "WebGLRenderingContext_uniform3iv_Callback";
+
+  @DomName('WebGLRenderingContext.uniform4f')
+  @DocsEditable
+  void uniform4f(UniformLocation location, num x, num y, num z, num w) native "WebGLRenderingContext_uniform4f_Callback";
+
+  @DomName('WebGLRenderingContext.uniform4fv')
+  @DocsEditable
+  void uniform4fv(UniformLocation location, List<double> v) native "WebGLRenderingContext_uniform4fv_Callback";
+
+  @DomName('WebGLRenderingContext.uniform4i')
+  @DocsEditable
+  void uniform4i(UniformLocation location, int x, int y, int z, int w) native "WebGLRenderingContext_uniform4i_Callback";
+
+  @DomName('WebGLRenderingContext.uniform4iv')
+  @DocsEditable
+  void uniform4iv(UniformLocation location, List<int> v) native "WebGLRenderingContext_uniform4iv_Callback";
+
+  @DomName('WebGLRenderingContext.uniformMatrix2fv')
+  @DocsEditable
+  void uniformMatrix2fv(UniformLocation location, bool transpose, List<double> array) native "WebGLRenderingContext_uniformMatrix2fv_Callback";
+
+  @DomName('WebGLRenderingContext.uniformMatrix3fv')
+  @DocsEditable
+  void uniformMatrix3fv(UniformLocation location, bool transpose, List<double> array) native "WebGLRenderingContext_uniformMatrix3fv_Callback";
+
+  @DomName('WebGLRenderingContext.uniformMatrix4fv')
+  @DocsEditable
+  void uniformMatrix4fv(UniformLocation location, bool transpose, List<double> array) native "WebGLRenderingContext_uniformMatrix4fv_Callback";
+
+  @DomName('WebGLRenderingContext.useProgram')
+  @DocsEditable
+  void useProgram(Program program) native "WebGLRenderingContext_useProgram_Callback";
+
+  @DomName('WebGLRenderingContext.validateProgram')
+  @DocsEditable
+  void validateProgram(Program program) native "WebGLRenderingContext_validateProgram_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttrib1f')
+  @DocsEditable
+  void vertexAttrib1f(int indx, num x) native "WebGLRenderingContext_vertexAttrib1f_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttrib1fv')
+  @DocsEditable
+  void vertexAttrib1fv(int indx, List<double> values) native "WebGLRenderingContext_vertexAttrib1fv_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttrib2f')
+  @DocsEditable
+  void vertexAttrib2f(int indx, num x, num y) native "WebGLRenderingContext_vertexAttrib2f_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttrib2fv')
+  @DocsEditable
+  void vertexAttrib2fv(int indx, List<double> values) native "WebGLRenderingContext_vertexAttrib2fv_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttrib3f')
+  @DocsEditable
+  void vertexAttrib3f(int indx, num x, num y, num z) native "WebGLRenderingContext_vertexAttrib3f_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttrib3fv')
+  @DocsEditable
+  void vertexAttrib3fv(int indx, List<double> values) native "WebGLRenderingContext_vertexAttrib3fv_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttrib4f')
+  @DocsEditable
+  void vertexAttrib4f(int indx, num x, num y, num z, num w) native "WebGLRenderingContext_vertexAttrib4f_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttrib4fv')
+  @DocsEditable
+  void vertexAttrib4fv(int indx, List<double> values) native "WebGLRenderingContext_vertexAttrib4fv_Callback";
+
+  @DomName('WebGLRenderingContext.vertexAttribPointer')
+  @DocsEditable
+  void vertexAttribPointer(int indx, int size, int type, bool normalized, int stride, int offset) native "WebGLRenderingContext_vertexAttribPointer_Callback";
+
+  @DomName('WebGLRenderingContext.viewport')
+  @DocsEditable
+  void viewport(int x, int y, int width, int height) native "WebGLRenderingContext_viewport_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('WebGLShader')
+class Shader extends NativeFieldWrapperClass1 {
+  Shader.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('WebGLShaderPrecisionFormat')
+class ShaderPrecisionFormat extends NativeFieldWrapperClass1 {
+  ShaderPrecisionFormat.internal();
+
+  @DomName('WebGLShaderPrecisionFormat.precision')
+  @DocsEditable
+  int get precision native "WebGLShaderPrecisionFormat_precision_Getter";
+
+  @DomName('WebGLShaderPrecisionFormat.rangeMax')
+  @DocsEditable
+  int get rangeMax native "WebGLShaderPrecisionFormat_rangeMax_Getter";
+
+  @DomName('WebGLShaderPrecisionFormat.rangeMin')
+  @DocsEditable
+  int get rangeMin native "WebGLShaderPrecisionFormat_rangeMin_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('WebGLTexture')
+class Texture extends NativeFieldWrapperClass1 {
+  Texture.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('WebGLUniformLocation')
+class UniformLocation extends NativeFieldWrapperClass1 {
+  UniformLocation.internal();
+
+}
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DocsEditable
+@DomName('WebGLVertexArrayObjectOES')
+class VertexArrayObject extends NativeFieldWrapperClass1 {
+  VertexArrayObject.internal();
+
+}
diff --git a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
index c0df4c9..00a5947 100644
--- a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
@@ -267,6 +267,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Map)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Map element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Map element)) => IterableMixinWorkaround.forEach(this, f);
@@ -328,10 +332,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Map value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Map> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
diff --git a/sdk/lib/web_sql/dartium/web_sql_dartium.dart b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
index e984c16..2fca22d 100644
--- a/sdk/lib/web_sql/dartium/web_sql_dartium.dart
+++ b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
@@ -289,6 +289,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, Map)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   bool contains(Map element) => IterableMixinWorkaround.contains(this, element);
 
   void forEach(void f(Map element)) => IterableMixinWorkaround.forEach(this, f);
@@ -350,10 +354,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast(Map value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<Map> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
diff --git a/tests/co19/co19-compiler.status b/tests/co19/co19-compiler.status
index 8fc530f..e6f59d8 100644
--- a/tests/co19/co19-compiler.status
+++ b/tests/co19/co19-compiler.status
@@ -3,118 +3,59 @@
 # BSD-style license that can be found in the LICENSE file.
 
 [ $compiler == dartc ]
+Language/03_Overview/1_Scoping_A02_t28: Fail # TODO(dartc-team): Please triage this failure.
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t01: Fail # TODO(dartc-team): Please triage this failure.
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t04: Fail # TODO(dartc-team): Please triage this failure.
+Language/07_Classes/07_Classes_A07_t10: Fail # TODO(dartc-team): Please triage this failure.
+Language/11_Expressions/11_Instance_Creation_A05_t02: Fail # TODO(dartc-team): Please triage this failure.
+Language/11_Expressions/33_Argument_Definition_Test_A01_t06: Fail # TODO(dartc-team): Please triage this failure.
+Language/13_Libraries_and_Scripts/4_Scripts_A01_t20: Fail # TODO(dartc-team): Please triage this failure.
+Language/13_Libraries_and_Scripts/4_Scripts_A01_t22: Fail # TODO(dartc-team): Please triage this failure.
+Language/14_Types/8_Parameterized_Types_A03_t03: Fail # TODO(dartc-team): Please triage this failure.
+Language/14_Types/8_Parameterized_Types_A03_t05: Fail # TODO(dartc-team): Please triage this failure.
+Language/15_Reference/1_Lexical_Rules_A01_t09: Fail # TODO(dartc-team): Please triage this failure.
+Language/15_Reference/1_Lexical_Rules_A01_t11: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/asStream_A01_t02: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/asStream_A02_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t02: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t03: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/forEach_A01_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/forEach_A02_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/forEach_A03_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/then_A01_t03: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/then_A02_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/then_A02_t02: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/then_A03_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/then_A04_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t04: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t05: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t06: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A01_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A02_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A03_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A04_t01: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A04_t02: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/collection/Queue/Queue.from_A01_t02: Fail # TODO(dartc-team): Please triage this failure.
+LibTest/core/Set/intersection_A03_t01: Fail # TODO(dartc-team): Please triage this failure.
 
-Language/12_Statements/06_For/2_For_in_A01_t05: Fail # co19 issue 365 # co19 issue 365 (iterator changes)
 LibTest/core/Set/Set.from_A01_t02: Fail # co19 issue 365 # co19 issue 365 (iterator changes)
-LibTest/core/Queue/Queue.from_A01_t02: Fail # co19 issue 365 # co19 issue 365 (iterator changes)
-
-Language/13_Libraries_and_Scripts/1_Imports_A02_t29: Fail # co19 issue 336 (allow use same prefix for several imports)
-
-
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t21: Fail # co19 issue 337 (export in scripts is allowed in 0.13)
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t23: Fail # co19 issue 337 (export in scripts is allowed in 0.13)
-
-
-Language/05_Variables/05_Variables_A07_t01: Fail # co19 issue 335 (assignment to final is warning, not error)
-Language/05_Variables/05_Variables_A07_t02: Fail # co19 issue 335 (assignment to final is warning, not error)
-Language/05_Variables/05_Variables_A07_t03: Fail # co19 issue 335 (assignment to final is warning, not error)
-Language/05_Variables/05_Variables_A07_t04: Fail # co19 issue 335 (assignment to final is warning, not error)
-Language/05_Variables/05_Variables_A07_t10: Fail # co19 issue 335 (assignment to final is warning, not error)
-Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t05: Fail # co19 issue 335 (assignment to final is warning, not error)
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t06: Fail # co19 issue 335 (assignment to final is warning, not error)
-
-Language/12_Statements/09_Switch_A02_t03: Fail # co19 issue 344 ('null' is constant, so can be used in 'case')
 
 Language/15_Reference/1_Lexical_Rules_A01_t10: Fail # co19 343 (invalid unicode NFC)
 
-
-Language/11_Expressions/01_Constants_A20_t03: Fail # co19 issue 339 (type variable is not constant)
-
-
-Language/11_Expressions/08_Throw_A05_t01: Fail # co19 issue 340 (deprecated catch syntax)
-Language/12_Statements/10_Try_A03_t02: Fail # co19 issue 340 (deprecated catch syntax)
-Language/12_Statements/10_Try_A03_t03: Fail # co19 issue 340 (deprecated catch syntax)
-
-
-Language/11_Expressions/31_Type_Test_A01_t02: Fail # co19 issue 341 (class Type has no type parameters)
-Language/11_Expressions/31_Type_Test_A01_t04: Fail # co19 issue 341 (class Type has no type parameters)
-
-
-Language/11_Expressions/32_Type_Cast_A01_t04: Fail # co19 issue 342 (class can be used anywhere, including left side of "as")
-
-
 Language/14_Types/5_Function_Types_A01_t10: Pass # co19 issue 392, issue 9058
 Language/14_Types/5_Function_Types_A02_t06: Pass # co19 issue 392, issue 9058
-Language/14_Types/5_Function_Types_A04_t01: Fail # co19 issue 345 (optional parameters list cannot by empty)
 
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t15: Fail # co19 issue 346 (invalid 'one ugly cascade')
 
-Language/08_Interfaces/5_Superinterfaces_A01_t02: Fail # co19 issue 347 (duplicate class in implements clause)
-
-Language/13_Libraries_and_Scripts/1_Imports_A02_t12: Fail, OK # co19 issue 320
-Language/13_Libraries_and_Scripts/1_Imports_A02_t15: Fail, OK # co19 issue 320
-Language/13_Libraries_and_Scripts/1_Imports_A02_t18: Fail, OK # co19 issue 320
-Language/13_Libraries_and_Scripts/1_Imports_A02_t19: Fail, OK # co19 issue 320
-
-
-Language/13_Libraries_and_Scripts/1_Imports_A02_t16: Fail, OK # co19 issue 298
-Language/13_Libraries_and_Scripts/1_Imports_A02_t17: Fail, OK # co19 issue 298
-
-
-LibTest/core/Expect/approxEquals_A04_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/equals_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/identical_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/isFalse_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/isNotNull_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/isNull_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/isTrue_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/listEquals_A03_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/notEquals_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/setEquals_A03_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/stringEquals_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Expect/throws_A01_t04: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Future/chain_A02_t04: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Future/chain_A02_t05: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Future/transform_A02_t03: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Future/transform_A02_t04: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/every_A04_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/filter_A04_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/forEach_A03_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/List.from_A01_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/operator_subscript_A01_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/operator_subscript_A01_t02: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/operator_subscripted_assignment_A01_t02: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/operator_subscripted_assignment_A01_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/List/setRange_A01_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/Queue/addFirst_A01_t01: Fail # co19 issue 351 (use deprecated === and !==)
 LibTest/core/Set/intersection_A01_t03: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/String/toLowerCase_A01_t02: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/String/toUpperCase_A01_t02: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/String/trim_A01_t02: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/StringBuffer/add_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/StringBuffer/addAll_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-LibTest/core/StringBuffer/clear_A02_t01: Fail # co19 issue 351 (use deprecated === and !==)
-
-LibTest/isolate/SendPort/send_A01_t01: Fail # co19 issue 352 (use function expression with return type and name)
-
-Language/07_Classes/6_Constructors/2_Factories_A01_t02: Fail # co19 issue 354
-
-
-Language/07_Classes/6_Constructors_A03_t03: Fail # co19 issue 372 (@static-clean where type warnings are expected)
-Language/11_Expressions/11_Instance_Creation/1_New_A06_t04: Fail # co19 issue 372 (@static-clean where type warnings are expected)
-Language/11_Expressions/11_Instance_Creation/1_New_A06_t05: Fail # co19 issue 372 (@static-clean where type warnings are expected)
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A01_t01: Fail # co19 issue 372 (@static-clean where type warnings are expected)
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A02_t01: Fail # co19 issue 372 (@static-clean where type warnings are expected)
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A06_t01: Fail # co19 issue 372 (@static-clean where type warnings are expected)
 
 LibTest/core/Set/intersection_A01_t01: Fail # issue 390
 LibTest/core/Set/intersection_A01_t02: Pass # issue 390
 
 Language/11_Expressions/30_Identifier_Reference_A01_t08: Skip # testing framework or VM issue 7388 (dies on Turkish character)
 
-
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t02: Fail, OK # deprecated parameter syntax
-
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A15_t07: Fail # Issue 3323
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A05_t01: Fail # Issue 2477
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A05_t02: Fail # Issue 2477
@@ -123,351 +64,18 @@
 Language/11_Expressions/01_Constants_A16_t02: Fail # Issue 1473
 Language/11_Expressions/01_Constants_A16_t03: Fail # Issue 1473
 Language/11_Expressions/01_Constants_A17_t03: Fail # Issue 1473
-Language/11_Expressions/22_Equality_A01_t19: Fail # language change 3368
-Language/11_Expressions/22_Equality_A01_t20: Fail # language change 3368
-Language/11_Expressions/22_Equality_A02_t03: Fail, OK # co19 issue 169
 
-
-
-LibTest/math/parseDouble_A01_t01: Fail, OK # co19 issue 317
-LibTest/math/parseDouble_A02_t01: Fail, OK # co19 issue 317
-LibTest/math/parseInt_A01_t01: Fail, OK # co19 issue 317
-LibTest/math/parseInt_A02_t01: Fail, OK # co19 issue 317
-
-
-Language/03_Overview/1_Scoping_A02_t30: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/03_Overview/2_Privacy_A01_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/05_Variables/05_Variables_A11_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 Language/07_Classes/07_Classes_A01_t20: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/07_Classes_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/07_Classes_A02_t34: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/07_Classes_A03_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/07_Classes_A03_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/07_Classes_A03_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/07_Classes_A03_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/1_Instance_Methods/2_Operators_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/3_Setters_A04_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/3_Setters_A04_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/3_Setters_A04_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/4_Abstract_Instance_Members_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/4_Abstract_Instance_Members_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/4_Abstract_Instance_Members_A04_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/4_Abstract_Instance_Members_A07_t07: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/4_Abstract_Instance_Members_A07_t09: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/6_Constructors/1_Generative_Constructors_A17_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/07_Classes/6_Constructors/1_Generative_Constructors_A18_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/08_Interfaces/5_Superinterfaces/1_Inheritance_and_Overriding_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/08_Interfaces/5_Superinterfaces/1_Inheritance_and_Overriding_A02_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/05_Strings/1_String_Interpolation_A01_t13: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/11_Instance_Creation/1_New_A06_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/11_Instance_Creation/1_New_A06_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/11_Instance_Creation/1_New_A06_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/11_Instance_Creation/1_New_A06_t07: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/11_Instance_Creation/1_New_A06_t08: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/11_Instance_Creation/1_New_A06_t09: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/11_Instance_Creation/1_New_A11_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/11_Instance_Creation/1_New_A12_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A05_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A05_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 Language/11_Expressions/15_Method_Invocation/2_Cascaded_Invocation_A01_t19: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/17_Getter_Invocation_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/18_Assignment_A08_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/18_Assignment_A08_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/19_Conditional_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/19_Conditional_A01_t10: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/19_Conditional_A01_t12: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/19_Conditional_A01_t14: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t10: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t11: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t12: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t13: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t14: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t15: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/21_Bitwise_Expressions_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/21_Bitwise_Expressions_A01_t12: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/21_Bitwise_Expressions_A01_t13: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/21_Bitwise_Expressions_A01_t14: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/21_Bitwise_Expressions_A01_t15: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/21_Bitwise_Expressions_A01_t16: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/21_Bitwise_Expressions_A01_t17: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/22_Equality_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/23_Relational_Expressions_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/23_Relational_Expressions_A01_t18: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/23_Relational_Expressions_A01_t19: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/23_Relational_Expressions_A01_t20: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/23_Relational_Expressions_A01_t21: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/23_Relational_Expressions_A01_t22: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/23_Relational_Expressions_A01_t23: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/24_Shift_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/24_Shift_A01_t09: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/24_Shift_A01_t10: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/24_Shift_A01_t11: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/24_Shift_A01_t12: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/24_Shift_A01_t13: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/24_Shift_A01_t14: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/25_Additive_Expressions_A01_t07: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/25_Additive_Expressions_A01_t08: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/25_Additive_Expressions_A01_t11: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/25_Additive_Expressions_A01_t12: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/25_Additive_Expressions_A01_t13: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/25_Additive_Expressions_A01_t14: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/26_Multiplicative_Expressions_A01_t10: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/26_Multiplicative_Expressions_A01_t11: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/26_Multiplicative_Expressions_A01_t14: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/26_Multiplicative_Expressions_A01_t15: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/26_Multiplicative_Expressions_A01_t16: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/26_Multiplicative_Expressions_A01_t17: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t11: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t12: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t13: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t17: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t18: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t19: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t20: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t21: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t22: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/27_Unary_Expressions_A01_t27: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/28_Postfix_Expressions_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/28_Postfix_Expressions_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/28_Postfix_Expressions_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/29_Assignable_Expressions_A01_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 Language/11_Expressions/29_Assignable_Expressions_A01_t08: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/29_Assignable_Expressions_A01_t09: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/29_Assignable_Expressions_A01_t26: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/30_Identifier_Reference_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/11_Expressions/30_Identifier_Reference_A08_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/12_Statements/04_Local_Function_Declaration_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/12_Statements/06_For/1_For_Loop_A01_t07: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/12_Statements/06_For/2_For_in_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/12_Statements/07_While_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/12_Statements/08_Do_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/12_Statements/09_Switch_A02_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/13_Libraries_and_Scripts_A05_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/13_Libraries_and_Scripts_A05_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A01_t51: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A01_t52: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t11: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t13: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t14: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t20: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/2_Exports_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/2_Exports_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/2_Exports_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/2_Exports_A03_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/13_Libraries_and_Scripts/3_Parts_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/14_Types/1_Static_Types_A02_t09: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/14_Types/2_Dynamic_Type_System_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 Language/14_Types/4_Interface_Types_A08_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-Language/14_Types/5_Function_Types_A06_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 LibTest/core/AssertionError/column_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 LibTest/core/AssertionError/failedAssertion_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 LibTest/core/AssertionError/line_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 LibTest/core/AssertionError/url_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/Completer_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/completeException_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/completeException_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/completeException_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/completeException_A03_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/complete_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/complete_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/complete_A02_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Completer/future_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Date/subtract_A06_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/Future.immediate_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t07: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t08: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A01_t09: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A02_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A02_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/chain_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/exception_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/exception_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/exception_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/handleException_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/handleException_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/handleException_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/handleException_A01_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/handleException_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/handleException_A01_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/handleException_A01_t07: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/hasValue_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/isComplete_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/then_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/then_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/then_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/then_A01_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/then_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A01_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A01_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A01_t07: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A02_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/transform_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/value_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/value_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Future/value_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Futures/wait_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Futures/wait_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Futures/wait_A01_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Futures/wait_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Futures/wait_A01_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Futures/wait_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Futures/wait_A02_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Futures/wait_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/LinkedHashMap/LinkedHashMap_class_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/every_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/filter_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/filter_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/filter_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/filter_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/iterator_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/iterator_hasNext_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/iterator_next_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/iterator_next_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/setRange_A05_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/some_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/some_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/some_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/List/some_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Map/getKeys_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Map/getKeys_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Map/getValues_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Map/getValues_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/end_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/groupCount_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/group_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/group_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/groups_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/groups_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/operator_subscript_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/operator_subscript_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/pattern_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/start_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Match/str_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/filter_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/filter_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/filter_A01_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/filter_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/filter_A01_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/iterator_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/iterator_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/iterator_hasNext_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/iterator_hasNext_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/iterator_next_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/iterator_next_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/iterator_next_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/some_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/some_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/some_A01_t04: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/some_A01_t05: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Queue/some_A01_t06: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A04_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A03_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A06_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Disjunction_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/RegExp_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/RegExp_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/allMatches_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/allMatches_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/firstMatch_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/firstMatch_A03_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/hasMatch_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/hasMatch_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/ignoreCase_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/multiLine_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/pattern_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/stringMatch_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/RegExp/stringMatch_A02_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Set/filter_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Set/filter_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Set/filter_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Set/some_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Set/some_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/Set/some_A01_t03: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/String/contains_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/String/contains_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/String/replaceAll_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/String/replaceFirst_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/String/split_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/core/String/split_A01_t02: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
 LibTest/core/StringBuffer/isEmpty_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/isolate/SendPort/call_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-LibTest/math/Random/nextDouble_A01_t01: Fail, OK # TODO(ahe): This test is failing after correctly implementing static warning checks in co19 test suite. The co19 authors have informed me that some of these failures are due to bugs in the test suite.
-
-Language/14_Types/4_Interface_Types_A08_t06: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Expect/setEquals_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Expect/setEquals_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap.from_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet.from_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap.from_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/List/List.from_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/List/addAll_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue.from_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addFirst_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addFirst_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addLast_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addLast_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/add_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/add_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/clear_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t04: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t05: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t06: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/first_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/first_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t05: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t04: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/isEmpty_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/last_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/last_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/length_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeFirst_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeFirst_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeLast_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeLast_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Set/Set.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
 
 LibTest/core/Date/compareTo_A03_t01: Fail # Comparable<T>.compareTo now statically accepts type T arguments.
 
@@ -482,12 +90,6 @@
 LibTest/core/Strings/concatAll_A03_t01: Fail # Strings class has been removed. co19 issue 380
 LibTest/core/Strings/concatAll_A04_t01: Fail # Strings class has been removed. co19 issue 380
 
-LibTest/core/RegExp/RegExp_A01_t03: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t03: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/IllegalJSRegExpException/toString_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/IllegalJSRegExpException/IllegalJSRegExpException_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-
 LibTest/core/String/charCodeAt_A01_t01: Fail # Deprecated string members removed (issue 382).
 LibTest/core/String/charCodeAt_A02_t01: Fail # Deprecated string members removed (issue 382).
 LibTest/core/String/charCodeAt_A03_t01: Fail # Deprecated string members removed (issue 382).
@@ -568,5 +170,12 @@
 
 LibTest/core/int/operator_division_A01_t01: Fail # truncate/ceil/floor/round returns ints, issue 389
 
+Language/11_Expressions/06_Lists_A06_t01: Fail # Issue 397
+LibTest/core/Iterable/where_A01_t07: Fail # Issue 397
+LibTest/core/List/addLast_A01_t01: Fail # Issue 397
+LibTest/core/List/addLast_A01_t03: Fail # Issue 397
+LibTest/core/List/addLast_A02_t01: Fail # Issue 397
+LibTest/core/List/filter_A03_t01: Fail # Issue 397
+
 [ $runtime == drt && $compiler == none ]
 *: Skip
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index cf39145..f3f373d 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -3,25 +3,66 @@
 # BSD-style license that can be found in the LICENSE file.
 
 [ $compiler == dart2dart ]
-Language/03_Overview/1_Scoping_A02_t32: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A04_t15: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/07_Classes/6_Constructors/2_Factories_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/07_Classes/6_Constructors/2_Factories_A02_t02: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/07_Classes/6_Constructors/2_Factories_A02_t03: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/07_Classes/6_Constructors/2_Factories_A02_t04: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/07_Classes/6_Constructors/2_Factories_A02_t05: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t03: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/11_Expressions/01_Constants_A18_t06: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/11_Expressions/11_Instance_Creation/2_Const_A03_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/11_Expressions/11_Instance_Creation_A05_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/11_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t10: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/11_Expressions/33_Argument_Definition_Test_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/11_Expressions/33_Argument_Definition_Test_A02_t02: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/12_Statements/03_Variable_Declaration_A04_t07: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/12_Statements/03_Variable_Declaration_A04_t08: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/12_Statements/09_Switch_A04_t01: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/12_Statements/10_Try_A03_t01: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/12_Statements/10_Try_A03_t02: Fail # TODO(dart2dart-team): Please triage this failure.
 Language/12_Statements/10_Try_A03_t03: Fail # TODO(dart2dart-team): Please triage this failure.
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t20: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/13_Libraries_and_Scripts/1_Imports_A02_t12: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/13_Libraries_and_Scripts/1_Imports_A02_t15: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/13_Libraries_and_Scripts/1_Imports_A02_t29: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/15_Reference/1_Lexical_Rules_A01_t10: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/Future.delayed_A01_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/Future.delayed_A01_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/Future.delayed_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/asStream_A01_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/asStream_A01_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/asStream_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t03: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/forEach_A01_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/forEach_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/forEach_A03_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/then_A01_t03: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/then_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/then_A02_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/then_A03_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/then_A04_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t04: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t05: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t06: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/wait_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/wait_A02_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A01_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A03_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A04_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A04_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/collection/Queue/iterator_A01_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/collection/Queue/iterator_current_A01_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/collection/Queue/iterator_moveNext_A01_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/core/List/List_A01_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/core/double/toStringAsExponential_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+LibTest/core/int/toStringAsExponential_A02_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+
 Language/14_Types/5_Function_Types_A01_t10: Fail # co19 issue 392
 Language/14_Types/5_Function_Types_A02_t06: Fail # co19 issue 392
-Language/14_Types/5_Function_Types_A04_t01: Fail # TODO(dart2dart-team): Please triage this failure.
-Language/15_Reference/1_Lexical_Rules_A01_t09: Fail # TODO(dart2dart-team): Please triage this failure.
-Language/15_Reference/1_Lexical_Rules_A01_t11: Fail # TODO(dart2dart-team): Please triage this failure.
 
 Language/03_Overview/1_Scoping_A01_t39: Fail # http://dartbug.com/7202
 Language/14_Types/3_Type_Declarations/1_Typedef_A06_t01: Fail # http://dartbug.com/7202
@@ -71,13 +112,10 @@
 Language/05_Variables/05_Variables_A05_t15: Fail # Inherited from VM (assignment to final variable does not throw NSME).
 Language/05_Variables/05_Variables_A07_t01: Fail # Inherited from dart2js
 Language/05_Variables/05_Variables_A07_t02: Fail # Inherited from dart2js
-Language/05_Variables/05_Variables_A07_t03: Fail # Inherited from dart2js
-Language/05_Variables/05_Variables_A07_t04: Fail # Inherited from dart2js
 Language/05_Variables/05_Variables_A07_t05: Fail # Inherited from dart2js
 Language/05_Variables/05_Variables_A07_t06: Fail # Inherited from dart2js
 Language/05_Variables/05_Variables_A07_t07: Fail # Inherited from dart2js
 Language/05_Variables/05_Variables_A07_t08: Fail # Inherited from dart2js
-Language/05_Variables/05_Variables_A07_t10: Fail # Inherited from dart2js
 Language/05_Variables/05_Variables_A08_t01: Fail # Inherited from dart2js
 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?).
@@ -89,14 +127,11 @@
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t06: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t07: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t06: Fail # http://dartbug.com/5519
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t07: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t10: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t14: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t15: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A02_t01: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A02_t02: Fail # http://dartbug.com/5519
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t01: Fail # inherited from VM
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t02: Fail # inherited from VM
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t03: Fail # inherited from VM
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t04: Fail # http://dartbug.com/5519
 Language/06_Functions/2_Formal_Parameters_A03_t01: Fail # http://dartbug.com/5519
@@ -161,7 +196,6 @@
 Language/11_Expressions/01_Constants_A03_t03: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A03_t04: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A03_t05: Fail # http://dartbug.com/5519
-Language/11_Expressions/01_Constants_A05_t01: Fail # inherited from VM
 Language/11_Expressions/01_Constants_A05_t02: Fail # http://dartbug.com/5519
 Language/11_Expressions/01_Constants_A05_t03: Fail # http://dartbug.com/5810
 Language/11_Expressions/01_Constants_A05_t04: Fail # http://dartbug.com/5519
@@ -224,7 +258,6 @@
 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/08_Throw_A05_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
@@ -239,10 +272,7 @@
 Language/11_Expressions/11_Instance_Creation/2_Const_A06_t02: Fail # http://dartbug.com/5519
 Language/11_Expressions/11_Instance_Creation/2_Const_A10_t01: Fail # inherited from VM
 Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A05_t01: Fail # inherited from VM
-Language/11_Expressions/17_Getter_Invocation_A02_t01: Fail # inherited from VM
-Language/11_Expressions/18_Assignment_A05_t02: Fail # inherited from VM
 Language/11_Expressions/18_Assignment_A05_t04: Fail, Pass, OK # Fails in minified, depends on method names.
-Language/11_Expressions/18_Assignment_A05_t05: Fail # inherited from VM
 Language/11_Expressions/19_Conditional_A01_t14: Fail # Inherited from dart2js
 Language/11_Expressions/19_Conditional_A01_t15: Fail # Inherited from dart2js
 Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t14: Fail # Inherited from dart2js
@@ -256,7 +286,6 @@
 Language/11_Expressions/22_Equality_A01_t20: Fail, OK # co19 issue 241
 Language/11_Expressions/22_Equality_A01_t23: Fail # Inherited from dart2js
 Language/11_Expressions/22_Equality_A01_t24: Fail # Inherited from dart2js
-Language/11_Expressions/22_Equality_A02_t03: Fail # inherited from VM
 Language/11_Expressions/22_Equality_A05_t01: Fail # inherited from VM
 Language/11_Expressions/23_Relational_Expressions_A01_t10: Fail # http://dartbug.com/5519
 Language/11_Expressions/23_Relational_Expressions_A01_t11: Fail # http://dartbug.com/5519
@@ -288,10 +317,8 @@
 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_t02: Fail # Inherited from dart2js
 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_A01_t04: 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
 Language/11_Expressions/32_Type_Cast_A05_t01: Fail # Inherited from dart2js
@@ -310,7 +337,6 @@
 Language/12_Statements/09_Switch_A01_t02: Fail # Inherited from VM (switch case with several labels).
 Language/12_Statements/09_Switch_A02_t01: Fail # Inherited from dart2js
 Language/12_Statements/09_Switch_A02_t02: Fail # Inherited from dart2js
-Language/12_Statements/09_Switch_A02_t03: Fail # Inherited from dart2js
 Language/12_Statements/09_Switch_A03_t01: Fail # Inherited from dart2js
 Language/12_Statements/09_Switch_A03_t02: Fail # Inherited from dart2js
 Language/12_Statements/09_Switch_A06_t02: Fail # Inherited from VM (does not throw NSME).
@@ -325,14 +351,9 @@
 Language/12_Statements/14_Continue_A02_t12: Fail # Inherited from dart2js
 Language/12_Statements/14_Continue_A02_t13: Fail # Inherited from dart2js
 Language/13_Libraries_and_Scripts/1_Imports_A02_t14: Fail # Inherited from dart2js
-Language/13_Libraries_and_Scripts/1_Imports_A02_t16: Fail # Inherited from dart2js
-Language/13_Libraries_and_Scripts/1_Imports_A02_t17: Fail # Inherited from dart2js
 Language/13_Libraries_and_Scripts/1_Imports_A02_t28: Fail # Inherited from dart2js
 Language/13_Libraries_and_Scripts/1_Imports_A05_t01: Fail # Inherited from dart2js
 Language/13_Libraries_and_Scripts/3_Parts_A03_t02: Fail # Inherited from dart2js
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t21: Fail # Inherited from dart2js
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t22: Fail # Inherited from dart2js
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t23: Fail # Inherited from dart2js
 Language/13_Libraries_and_Scripts/4_Scripts_A03_t01: Fail # http://dartbug.com/5519
 Language/13_Libraries_and_Scripts/4_Scripts_A03_t03: Fail # http://dartbug.com/5519
 Language/13_Libraries_and_Scripts/5_URIs_A01_t01: Fail # Inherited from dart2js
@@ -357,21 +378,12 @@
 LibTest/core/Date/Date.fromString_A03_t01: Pass, OK # Issue co19 - 121 (currently passing due to co19 issues 373 and 374)
 LibTest/core/Date/toString_A02_t01: Fail, OK # inherited from VM
 LibTest/core/Date/year_A01_t01: Fail, OK # inherited from VM
-LibTest/core/LinkedHashMap/LinkedHashMap_class_A01_t01: Fail, OK # co19 issue 293
-LibTest/core/Map/getKeys_A01_t01: Fail, OK # co19 issue 293
-LibTest/core/Map/getKeys_A01_t02: Fail, OK # co19 issue 293
-LibTest/core/Map/getValues_A01_t01: Fail, OK # co19 issue 293
-LibTest/core/Map/getValues_A01_t02: Fail, OK # co19 issue 287
-LibTest/core/Map/getValues_A01_t02: Fail, OK # co19 issue 293
 LibTest/core/Match/operator_subscript_A01_t01: Fail # inherited from VM
 LibTest/core/Match/operator_subscript_A01_t01: Fail, OK # co19 issue 294
 LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A02_t01: Fail # inherited from VM
 LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A02_t01: Fail, OK # co19 issue 294
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A01_t01: Fail # Inherited from dart2js
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A02_t01: Fail # Inherited from dart2js
 LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A03_t01: Fail # inherited from VM
 LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A04_t01: Fail # inherited from VM
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A06_t01: Fail # Inherited from dart2js
 LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A06_t02: Fail
 LibTest/core/RegExp/Pattern_semantics/firstMatch_DecimalEscape_A01_t02: Fail # inherited from VM
 LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: Fail # inherited from VM
@@ -386,16 +398,12 @@
 LibTest/core/int/operator_left_shift_A01_t02: Fail, OK # co19 issue 129
 LibTest/core/int/toRadixString_A01_t01: Fail # inherited from VM
 LibTest/isolate/ReceivePort/receive_A01_t02: Fail, OK # co19 issue 276
-LibTest/isolate/SendPort/send_A02_t02: Fail, Timeout, OK # co19 issue 293
-LibTest/isolate/SendPort/send_A02_t03: Fail, Timeout, OK # co19 issue 293
-LibTest/isolate/SendPort/send_A02_t04: Fail, OK # co19 issue 293
 LibTest/isolate/isolate_api/port_A01_t01: Skip # Times out.
 LibTest/isolate/isolate_api/spawnUri_A01_t01: Fail, OK # Problems with the test: encoded file name
 LibTest/isolate/isolate_api/spawnUri_A01_t02: Fail, OK # Problems with the test: encoded file name
 LibTest/isolate/isolate_api/spawnUri_A01_t03: Fail, OK # Problems with the test: encoded file name
 LibTest/isolate/isolate_api/spawnUri_A01_t04: Fail, OK # Problems with the test: encoded file name
 LibTest/isolate/isolate_api/spawnUri_A01_t05: Fail, OK # Problems with the test: encoded file name
-LibTest/math/Random/nextDouble_A01_t01: Fail # co19 issue 334
 LibTest/math/exp_A01_t01: Fail # Issue co19 - 44
 LibTest/math/pow_A01_t01: Fail # Inherited from VM.
 LibTest/math/pow_A11_t01: Fail # Inherited from VM.
@@ -403,15 +411,15 @@
 LibTest/math/sin_A01_t01: Fail # Inherited from VM.
 LibTest/math/tan_A01_t01: Fail # Issue co19 - 44
 
-
-LibTest/math/parseDouble_A01_t01: Fail, OK # co19 issue 317
-LibTest/math/parseInt_A01_t01: Fail, OK # co19 issue 317
-LibTest/math/parseInt_A02_t01: Fail, OK # co19 issue 317
-
-LibTest/core/StringBuffer/addAll_A02_t01:  Fail, OK # co19 issue 355
-LibTest/core/StringBuffer/add_A02_t01:  Fail, OK # co19 issue 355
 LibTest/core/StringBuffer/isEmpty_A01_t01:  Fail, OK # co19 issue 355
-LibTest/core/StringBuffer/clear_A02_t01: Fail, OK # co19 issue 355
+
+[ $compiler == dart2dart && $minified ]
+Language/11_Expressions/33_Argument_Definition_Test_A03_t01: Fail # TODO(dart2dart-team): Please triage this failure.
+Language/11_Expressions/33_Argument_Definition_Test_A03_t02: Fail # TODO(dart2dart-team): Please triage this failure.
+
+Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t02: Fail, OK # co19 issue 396
+Language/11_Expressions/17_Getter_Invocation_A02_t01: Fail, OK # co19 issue 396
+Language/11_Expressions/18_Assignment_A05_t02: Fail, OK # co19 issue 396
 
 
 [ $compiler == dart2dart && $system == windows ]
@@ -426,218 +434,8 @@
 LibTest/math/atan_A01_t01: Fail, OK # co19 issue 44
 
 [ $compiler == dart2dart ]
-# Inherited from VM. Co19 issues due to library changes
-
-LibTest/core/Queue/some_A01_t06: Fail # behavior of some is undefined when underlying iterable changes, co19 issue 357
-LibTest/core/Queue/every_A01_t06: Fail # behavior of every is undefined when underlying iterable changes, co19 issue 357
-LibTest/core/Queue/forEach_A01_t04: Fail # behavior of forEach is undefined when underlying iterable changes, co19 issue 357
-
-LibTest/core/List/List_A02_t01: Fail # List constructors, co19 issue 358
-
-LibTest/core/List/last_A02_t01: Fail # List.last throws a StateError, co19 issue 359
-
-LibTest/core/double/toInt_A01_t03: Fail # conversion to integer throws UnsupportedError for NaN/Infinity now, co19 issue 360
-LibTest/core/double/toInt_A01_t04: Fail # conversion to integer throws UnsupportedError for NaN/Infinity now, co19 issue 360
-
-LibTest/core/double/operator_truncating_division_A01_t01: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/operator_truncating_division_A01_t03: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/operator_truncating_division_A01_t04: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/operator_truncating_division_A01_t05: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/operator_truncating_division_A01_t06: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/isNaN_A01_t03: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/double_class_A01_t01: Fail # ~/ returns ints, co19 issue 361
-
-LibTest/core/Match/end_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/group_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/group_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groupCount_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groups_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groups_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/operator_subscript_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/pattern_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/start_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/str_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/allMatches_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/firstMatch_A03_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/hasMatch_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/hasMatch_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/ignoreCase_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/multiLine_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/pattern_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A03_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A04_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A03_t03: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A06_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Disjunction_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/RegExp_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/RegExp_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/stringMatch_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/stringMatch_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/contains_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/replaceAll_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/replaceFirst_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/split_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/split_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-
-LibTest/core/Set/some_A01_t03: Fail # some -> any, co19 issue 363
-LibTest/core/Set/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/Set/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A02_t01: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t05: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t03: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t04: Fail # some -> any, co19 issue 363
-
-LibTest/core/List/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A02_t01: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A04_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t03: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t04: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t05: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t06: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t03: Fail # filter->where, co19 issue 364
-
-Language/12_Statements/06_For/2_For_in_A01_t01: Fail # iterator-change, co19 issue 365
-Language/12_Statements/06_For/2_For_in_A01_t05: Fail # iterator-change, co19 issue 365
-Language/12_Statements/07_While_A02_t01: Fail # iterator-change, co19 issue 365
-Language/12_Statements/08_Do_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_hasNext_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_next_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_next_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/List.from_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_hasNext_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_hasNext_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/Queue.from_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/RegExp/allMatches_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Set/Set.from_A01_t02: Fail # iterator-change, co19 issue 365
-
 LibTest/core/Date/operator_equality_A01_t01: Fail # DateTime.== now looks at timezone, co19 issue 379
 
-LibTest/core/Completer/Completer_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A03_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/future_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/Future.immediate_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t08: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t09: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/hasValue_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/isComplete_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A02_t02: Fail # Future is in async library. co19 issue 367
-
-LibTest/core/Future/chain_A02_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t04: Fail # Future is in async library. co19 issue 367
-
-LibTest/core/Expect/setEquals_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Expect/setEquals_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/List/List.from_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/List/addAll_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addFirst_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addFirst_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addLast_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addLast_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/add_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/add_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/clear_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t03: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t04: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t05: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/first_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/first_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t03: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t05: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/isEmpty_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/last_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/last_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/length_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeFirst_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeFirst_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeLast_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeLast_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Set/Set.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-Language/14_Types/4_Interface_Types_A08_t06: Fail # Moved collection classes from core to collection. co19 issue 371.
-
 Language/14_Types/6_Type_dynamic_A03_t01: Fail # Renamed Date to DateTime (issue 373, 374)
 LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t01: Fail # Renamed Date to DateTime (issue 373, 374)
 LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t02: Fail # Renamed Date to DateTime (issue 373, 374)
@@ -686,26 +484,6 @@
 LibTest/core/Strings/concatAll_A01_t01: Fail # Strings class has been removed. co19 issue 380
 LibTest/core/Strings/concatAll_A04_t01: Fail # Strings class has been removed. co19 issue 380
 
-LibTest/core/RegExp/RegExp_A01_t03: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t03: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/IllegalJSRegExpException/toString_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/IllegalJSRegExpException/IllegalJSRegExpException_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-
-LibTest/core/Map/containsKey_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/operator_subscript_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/operator_subscripted_assignment_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/remove_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/add_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/addAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/contains_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/containsAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/intersection_A03_t01: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/isSubsetOf_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/remove_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/removeAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-
-LibTest/core/Map/forEach_A01_t07: Fail # Doesn't expect concurrent modification error (issue 376).
-
 LibTest/core/String/charCodes_A01_t01: Fail # Deprecated string members removed (issue 382).
 LibTest/core/String/charCodeAt_A02_t01: Fail # Deprecated string members removed (issue 382).
 LibTest/core/String/charCodeAt_A03_t01: Fail # Deprecated string members removed (issue 382).
@@ -741,3 +519,13 @@
 LibTest/core/double/truncate_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 389
 
 LibTest/core/List/getRange_A02_t01: Fail # issue 391
+
+Language/11_Expressions/05_Strings/1_String_Interpolation_A03_t02: Fail # Issue 397
+Language/11_Expressions/05_Strings/1_String_Interpolation_A04_t02: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t01: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t02: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t03: Fail # Issue 397
+LibTest/core/Iterable/where_A01_t07: Fail # Issue 397
+LibTest/core/List/addLast_A01_t01: Fail # Issue 397
+LibTest/core/List/addLast_A01_t03: Fail # Issue 397
+LibTest/core/List/addLast_A02_t01: Fail # Issue 397
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index fec2e34..ccd55df 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -2,6 +2,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.
 
+
+[ $compiler == dart2js && $runtime == jsshell ]
+LibTest/isolate/isolate_api/spawnUri_A02_t01: Crash # TODO(ahe): Please triage this crash.
+
+
 # Crashes first, please. Then untriaged bugs. There is a section below
 # for co19 bugs.
 [ $compiler == dart2js ]
@@ -14,15 +19,10 @@
 Language/05_Variables/05_Variables_A05_t08: Fail # TODO(ahe): Please triage this failure.
 Language/05_Variables/05_Variables_A05_t09: Fail # TODO(ahe): Please triage this failure.
 Language/05_Variables/05_Variables_A05_t10: Fail # TODO(ahe): Please triage this failure.
-Language/05_Variables/05_Variables_A07_t01: Fail # TODO(ahe): Please triage this failure.
-Language/05_Variables/05_Variables_A07_t02: Fail # TODO(ahe): Please triage this failure.
-Language/05_Variables/05_Variables_A07_t03: Fail # TODO(ahe): Please triage this failure.
-Language/05_Variables/05_Variables_A07_t04: Fail # TODO(ahe): Please triage this failure.
 Language/05_Variables/05_Variables_A07_t05: Fail # TODO(ahe): Please triage this failure.
 Language/05_Variables/05_Variables_A07_t06: Fail # TODO(ahe): Please triage this failure.
 Language/05_Variables/05_Variables_A07_t07: Fail # TODO(ahe): Please triage this failure.
 Language/05_Variables/05_Variables_A07_t08: Fail # TODO(ahe): Please triage this failure.
-Language/05_Variables/05_Variables_A07_t10: 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.
@@ -43,10 +43,10 @@
 Language/07_Classes/6_Constructors_A01_t04: Fail # TODO(ahe): Please triage this failure.
 Language/07_Classes/6_Constructors_A01_t05: Fail # TODO(ahe): Please triage this failure.
 Language/07_Classes/6_Constructors_A01_t06: Fail # TODO(ahe): Please triage this failure.
-Language/11_Expressions/01_Constants_A05_t01: Fail # TODO(ahe): Please triage this failure.
 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_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.
@@ -55,15 +55,16 @@
 Language/11_Expressions/11_Instance_Creation/1_New_A02_t07: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/11_Instance_Creation/2_Const_A01_t02: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/11_Instance_Creation/2_Const_A03_t01: Fail # TODO(ahe): Please triage this failure.
+Language/11_Expressions/11_Instance_Creation/2_Const_A11_t01: Fail # TODO(ahe): Please triage this failure.
+Language/11_Expressions/11_Instance_Creation/2_Const_A11_t03: Fail # TODO(ahe): Please triage this failure.
+Language/11_Expressions/11_Instance_Creation_A05_t02: Fail # TODO(ahe): Please triage this failure.
+Language/11_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t10: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/17_Getter_Invocation_A02_t01: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/18_Assignment_A05_t02: Fail # TODO(ahe): Please triage this failure.
-Language/11_Expressions/18_Assignment_A05_t04: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/18_Assignment_A05_t05: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/30_Identifier_Reference_A04_t09: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/30_Identifier_Reference_A05_t01: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/30_Identifier_Reference_A05_t12: Fail # TODO(ahe): Please triage this failure.
-Language/11_Expressions/31_Type_Test_A01_t02: Fail # TODO(ahe): Please triage this failure.
-Language/11_Expressions/31_Type_Test_A01_t04: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/31_Type_Test_A04_t01: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/32_Type_Cast_A02_t03: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/32_Type_Cast_A03_t01: Fail # TODO(ahe): Please triage this failure.
@@ -71,19 +72,20 @@
 Language/11_Expressions/32_Type_Cast_A05_t01: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/32_Type_Cast_A05_t02: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/32_Type_Cast_A05_t04: Fail # TODO(ahe): Please triage this failure.
+Language/12_Statements/02_Expression_Statements_A01_t08: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/03_Variable_Declaration_A04_t02: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/03_Variable_Declaration_A04_t03: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/03_Variable_Declaration_A04_t04: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/03_Variable_Declaration_A04_t05: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/03_Variable_Declaration_A04_t06: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/03_Variable_Declaration_A04_t07: Fail # TODO(ahe): Please triage this failure.
+Language/12_Statements/03_Variable_Declaration_A04_t08: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/04_Local_Function_Declaration_A01_t01: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/04_Local_Function_Declaration_A02_t02: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/06_For_A01_t11: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/06_For_A01_t12: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/09_Switch_A02_t01: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/09_Switch_A02_t02: Fail # TODO(ahe): Please triage this failure.
-Language/12_Statements/09_Switch_A02_t03: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/09_Switch_A03_t01: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/09_Switch_A03_t02: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/09_Switch_A04_t01: Fail # TODO(ahe): Please triage this failure.
@@ -96,16 +98,14 @@
 Language/12_Statements/12_Labels_A03_t04: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/14_Continue_A02_t12: Fail # TODO(ahe): Please triage this failure.
 Language/12_Statements/14_Continue_A02_t13: Fail # TODO(ahe): Please triage this failure.
+Language/13_Libraries_and_Scripts/13_Libraries_and_Scripts_A05_t03: Fail # TODO(ahe): Please triage this failure.
+Language/13_Libraries_and_Scripts/1_Imports_A02_t12: Fail # TODO(ahe): Please triage this failure.
 Language/13_Libraries_and_Scripts/1_Imports_A02_t14: Fail # TODO(ahe): Please triage this failure.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t16: Fail # TODO(ahe): Please triage this failure.
-Language/13_Libraries_and_Scripts/1_Imports_A02_t17: Fail # TODO(ahe): Please triage this failure.
+Language/13_Libraries_and_Scripts/1_Imports_A02_t15: Fail # TODO(ahe): Please triage this failure.
 Language/13_Libraries_and_Scripts/1_Imports_A02_t28: Fail # TODO(ahe): Please triage this failure.
+Language/13_Libraries_and_Scripts/1_Imports_A02_t29: Fail # TODO(ahe): Please triage this failure.
 Language/13_Libraries_and_Scripts/1_Imports_A05_t01: Fail # TODO(ahe): Please triage this failure.
 Language/13_Libraries_and_Scripts/3_Parts_A03_t02: Fail # TODO(ahe): Please triage this failure.
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t20: Fail # TODO(ahe): Please triage this failure.
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t21: Fail # TODO(ahe): Please triage this failure.
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t22: Fail # TODO(ahe): Please triage this failure.
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t23: Fail # TODO(ahe): Please triage this failure.
 Language/13_Libraries_and_Scripts/5_URIs_A01_t01: Fail # TODO(ahe): Please triage this failure.
 Language/13_Libraries_and_Scripts/5_URIs_A01_t11: Fail # TODO(ahe): Please triage this failure.
 Language/13_Libraries_and_Scripts/5_URIs_A01_t21: Fail # TODO(ahe): Please triage this failure.
@@ -113,26 +113,71 @@
 Language/13_Libraries_and_Scripts/5_URIs_A01_t25: Fail # TODO(ahe): Please triage this failure.
 Language/14_Types/5_Function_Types_A01_t10: Pass # co19 issue 392, issue 9058
 Language/14_Types/5_Function_Types_A02_t06: Pass # co19 issue 392, issue 9058
-Language/14_Types/5_Function_Types_A04_t01: Fail # TODO(ahe): Please triage this failure.
 Language/15_Reference/1_Lexical_Rules/1_Reserved_Words_A40_t04: Fail # TODO(ahe): Please triage this failure.
-Language/15_Reference/1_Lexical_Rules_A01_t09: Fail # TODO(ahe): Please triage this failure.
-Language/15_Reference/1_Lexical_Rules_A01_t11: Fail # TODO(ahe): Please triage this failure.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A01_t01: Fail # TODO(ahe): Please triage this failure.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A02_t01: Fail # TODO(ahe): Please triage this failure.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A06_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/Future.delayed_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/Future.delayed_A01_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/Future.delayed_A02_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/asStream_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/asStream_A01_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/asStream_A02_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/catchError_A03_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/catchError_A03_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/catchError_A03_t03: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/forEach_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/forEach_A02_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/forEach_A03_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/then_A01_t03: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/then_A02_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/then_A02_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/then_A03_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/then_A04_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/wait_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/wait_A01_t04: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/wait_A01_t05: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/wait_A01_t06: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/wait_A02_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/wait_A02_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/whenComplete_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/whenComplete_A02_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/whenComplete_A03_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/whenComplete_A04_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/async/Future/whenComplete_A04_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/collection/Queue/iterator_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/collection/Queue/iterator_current_A01_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/collection/Queue/iterator_moveNext_A01_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/core/List/List_A01_t02: Fail # TODO(ahe): Please triage this failure.
 LibTest/core/double/INFINITY_A01_t04: Fail # TODO(ahe): Please triage this failure.
 LibTest/core/double/NEGATIVE_INFINITY_A01_t04: Fail # TODO(ahe): Please triage this failure.
 LibTest/core/double/parse_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/core/double/toStringAsExponential_A02_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/core/int/toStringAsExponential_A02_t01: Fail # TODO(ahe): Please triage this failure.
 LibTest/math/pow_A01_t01: Fail # TODO(ahe): Please triage this failure.
 LibTest/math/pow_A11_t01: Fail # TODO(ahe): Please triage this failure.
 LibTest/math/pow_A13_t01: Fail # TODO(ahe): Please triage this failure.
 
+
+[ $compiler == dart2js && $runtime == jsshell ]
+Language/11_Expressions/12_Spawning_an_Isolate_A01_t01: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/SendPort/send_A02_t05: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/SendPort/send_A02_t06: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/isolate_api/spawnFunction_A01_t01: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/isolate_api/spawnFunction_A01_t02: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/isolate_api/spawnFunction_A01_t03: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/isolate_api/spawnFunction_A01_t04: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/isolate_api/spawnFunction_A01_t05: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/isolate_api/spawnFunction_A03_t01: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/isolate_api/spawnUri_A02_t02: Fail, Pass # TODO(ahe): Please triage this failure.
+LibTest/isolate/isolate_api/spawnUri_A02_t03: Fail, Pass # TODO(ahe): Please triage this failure.
+
+
+[ $compiler == dart2js && $runtime == jsshell && $system == macos ]
+LibTest/math/cos_A01_t01: Fail # TODO(ahe): Please triage this failure.
+
+
+[ $compiler == dart2js ]
 LibTest/isolate/ReceivePort/receive_A01_t02: Fail # Issue 6750
 
-LibTest/core/StringBuffer/addAll_A02_t01:  Fail, OK # co19 issue 355
-LibTest/core/StringBuffer/add_A02_t01:  Fail, OK # co19 issue 355
 LibTest/core/StringBuffer/isEmpty_A01_t01:  Fail, OK # co19 issue 355
-LibTest/core/StringBuffer/clear_A02_t01: Fail, OK # co19 issue 355
 
 Language/07_Classes/6_Constructors/2_Factories_A01_t05: Fail # Partially implemented rediriecting constructors makes this fail.
 
@@ -176,11 +221,6 @@
 LibTest/math/sin_A01_t01: Fail # TODO(ahe): Please triage this failure.
 LibTest/math/tan_A01_t01: Fail # TODO(ahe): Please triage this failure.
 
-[ $compiler == dart2js ]
-LibTest/math/parseDouble_A02_t01: Fail, OK # co19 issue 317
-LibTest/math/parseInt_A01_t01: Fail, OK # co19 issue 317
-LibTest/math/parseInt_A02_t01: Fail, OK # co19 issue 317
-
 [ $compiler == dart2js && $runtime == jsshell ]
 LibTest/core/Map/Map_class_A01_t04: Pass, Slow # Issue 8096
 Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A03_t01: Fail # TODO(ngeoaffray): Please triage these failure.
@@ -193,7 +233,6 @@
 LibTest/math/asin_A01_t01: Fail # TODO(ngeoaffray): Please triage these failure.
 
 [ $compiler == dart2js && $minified ]
-
 # These tests assume that the invocation mirror gets the original name of the
 # method, but that information is not present when minifying.  They could be
 # fixed by using the invocation mirror to invoke a method on a different object
@@ -225,7 +264,6 @@
 Language/11_Expressions/11_Instance_Creation/2_Const_A09_t02: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/11_Instance_Creation/2_Const_A09_t03: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/11_Instance_Creation_A05_t01: Fail # TODO(ahe): Please triage this failure.
-Language/11_Expressions/11_Instance_Creation_A05_t02: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/19_Conditional_A04_t03: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/20_Logical_Boolean_Expressions_A03_t01: Fail # TODO(ahe): Please triage this failure.
 Language/11_Expressions/27_Unary_Expressions_A02_t03: Fail # TODO(ahe): Please triage this failure.
@@ -242,9 +280,11 @@
 LibTest/core/AssertionError/line_A01_t02: Fail # TODO(ahe): Please triage this failure.
 LibTest/core/AssertionError/url_A01_t01: Fail # TODO(ahe): Please triage this failure.
 LibTest/core/Map/putIfAbsent_A01_t04: Fail # TODO(ahe): Please triage this failure.
-LibTest/core/Queue/iterator_hasNext_A01_t01: Fail # TODO(ahe): Please triage this failure.
-LibTest/core/String/contains_A01_t01: Fail # TODO(ahe): Please triage this failure.
-LibTest/core/String/contains_A01_t03: Fail # TODO(ahe): Please triage this failure.
+LibTest/core/Match/pattern_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/core/Match/str_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/core/RegExp/RegExp_A01_t02: Fail # TODO(ahe): Please triage this failure.
+LibTest/core/RegExp/allMatches_A01_t01: Fail # TODO(ahe): Please triage this failure.
+LibTest/core/Set/intersection_A03_t01: Fail # TODO(ahe): Please triage this failure.
 LibTest/core/TypeError/column_A01_t01: Fail # TODO(ahe): Please triage this failure.
 LibTest/core/TypeError/dstName_A01_t01: Fail # TODO(ahe): Please triage this failure.
 LibTest/core/TypeError/dstType_A01_t01: Fail # TODO(ahe): Please triage this failure.
@@ -279,18 +319,10 @@
 LibTest/isolate/SendPort/send_A02_t02: Fail, OK # co19 issue 293
 LibTest/isolate/SendPort/send_A02_t03: Fail, OK # co19 issue 293
 LibTest/isolate/SendPort/send_A02_t04: Fail, OK # co19 issue 293
-LibTest/core/LinkedHashMap/LinkedHashMap_class_A01_t01: Fail, OK # co19 issue 293
-LibTest/core/Map/getKeys_A01_t01: Fail, OK # co19 issue 293
-LibTest/core/Map/getKeys_A01_t02: Fail, OK # co19 issue 293
-LibTest/core/Map/getValues_A01_t02: Fail, OK # co19 issue 293
-LibTest/core/Map/getValues_A01_t01: Fail, OK # co19 issue 293
 
-LibTest/core/RegExp/allMatches_A01_t01: Fail, OK # co19 issue 294
 LibTest/core/RegExp/firstMatch_A01_t01: Fail, OK # co19 issue 294
 LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A04_t01: Fail, OK # co19 issue 294
 
-LibTest/core/Map/getValues_A01_t02: Fail, OK # co19 issue 287
-
 LibTest/core/int/isOdd_A01_t01: Fail, OK # co19 issue 277
 LibTest/core/int/isEven_A01_t01: Fail, OK # co19 issue 277
 
@@ -308,7 +340,6 @@
 LibTest/isolate/SendPort/send_A02_t03: Fail # Compile-time error: error: not a compile-time constant
 
 Language/11_Expressions/01_Constants_A18_t03: Fail # Compile-time error: unexpected token 'equals'
-Language/11_Expressions/22_Equality_A02_t03: Fail # Compile-time error: unexpected token 'equals'
 Language/11_Expressions/05_Strings_A20_t01: Fail # Runtime error: Expect.identical(expected: <abyr, abyr
 LibTest/isolate/isolate_api/spawnUri_A02_t01: Fail # Runtime error: Expect.throws() fails
 LibTest/isolate/isolate_api/spawnUri_A01_t01: Fail # Runtime error: UnsupportedError: Currently spawnUri is not supported without web workers.
@@ -327,18 +358,8 @@
 
 LibTest/core/Date/toString_A02_t01: Fail # Argument error. Year 999999 is out of range. Needs to be specified (and then potentially reported to co19): issue 1878.
 
-LibTest/core/Match/pattern_A01_t01: Fail, OK # co19 issue 212
-LibTest/core/Match/str_A01_t01: Fail, OK # co19 issue 212
-LibTest/core/RegExp/allMatches_A01_t01: Fail, OK # co19 issue 212
 LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A04_t01: Fail, OK # co19 issue 212
 
-LibTest/math/Random/nextDouble_A01_t01: Fail # co19 issue 334
-
-[ $compiler == dart2js && $checked ]
-LibTest/core/Queue/addLast_A01_t01: Slow, Pass
-LibTest/core/Queue/add_A01_t01: Slow, Pass
-LibTest/core/Queue/iterator_hasNext_A01_t01: Slow, Pass
-
 
 #
 # Issues with co19 test suite.
@@ -349,9 +370,6 @@
 #
 [ $compiler == dart2js ]
 Language/11_Expressions/11_Instance_Creation/1_New_A01_t04: Fail, OK # co19 issue 241
-Language/11_Expressions/22_Equality_A01_t19: Fail, OK # co19 issue 241
-Language/11_Expressions/22_Equality_A01_t20: Fail, OK # co19 issue 241
-Language/11_Expressions/32_Type_Cast_A01_t04: Fail, OK # co19 issue 241
 
 Language/11_Expressions/22_Equality_A01_t01: Fail, OK # Function declaration takes precedence over function expression.
 
@@ -371,203 +389,6 @@
 Language/03_Overview/2_Privacy_A01_t11: Pass, OK # co19 issue 316
 Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A03_t01: Pass, OK # co19 issue 316
 
-LibTest/core/Queue/some_A01_t06: Fail # behavior of some is undefined when underlying iterable changes, co19 issue 357
-LibTest/core/Queue/every_A01_t06: Fail # behavior of every is undefined when underlying iterable changes, co19 issue 357
-LibTest/core/Queue/forEach_A01_t04: Fail # behavior of forEach is undefined when underlying iterable changes, co19 issue 357
-
-LibTest/core/List/List_A02_t01: Fail # List constructors, co19 issue 358
-
-LibTest/core/List/last_A02_t01: Fail # List.last throws a StateError, co19 issue 359
-
-LibTest/core/double/toInt_A01_t03: Fail # conversion to integer throws UnsupportedError for NaN/Infinity now, co19 issue 360
-LibTest/core/double/toInt_A01_t04: Fail # conversion to integer throws UnsupportedError for NaN/Infinity now, co19 issue 360
-
-LibTest/core/Match/end_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/group_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/group_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groupCount_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groups_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groups_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/operator_subscript_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/operator_subscript_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/pattern_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/start_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/str_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/allMatches_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/firstMatch_A03_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/hasMatch_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/hasMatch_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/ignoreCase_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/multiLine_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/pattern_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A03_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A04_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A03_t03: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A06_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Disjunction_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/RegExp_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/RegExp_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/stringMatch_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/stringMatch_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/contains_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/replaceAll_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/replaceFirst_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/split_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/split_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-
-LibTest/core/Set/some_A01_t03: Fail # some -> any, co19 issue 363
-LibTest/core/Set/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/Set/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A02_t01: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t05: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t03: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t04: Fail # some -> any, co19 issue 363
-
-LibTest/core/List/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A02_t01: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A04_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t03: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t04: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t05: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t06: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t03: Fail # filter->where, co19 issue 364
-
-Language/12_Statements/06_For/2_For_in_A01_t01: Fail # iterator-change, co19 issue 365
-Language/12_Statements/06_For/2_For_in_A01_t05: Fail # iterator-change, co19 issue 365
-Language/12_Statements/07_While_A02_t01: Fail # iterator-change, co19 issue 365
-Language/12_Statements/08_Do_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_hasNext_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_next_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_next_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/List.from_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_hasNext_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_hasNext_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/Queue.from_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/RegExp/allMatches_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Set/Set.from_A01_t02: Fail # iterator-change, co19 issue 365
-
-LibTest/core/Completer/Completer_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A03_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/future_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/Future.immediate_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t08: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t09: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/hasValue_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/isComplete_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A02_t02: Fail # Future is in async library. co19 issue 367
-
-LibTest/core/Expect/setEquals_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Expect/setEquals_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/List/List.from_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/List/addAll_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addFirst_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addFirst_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addLast_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addLast_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/add_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/add_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/clear_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t03: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t04: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t05: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/first_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/first_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t03: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t05: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/isEmpty_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/last_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/last_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/length_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeFirst_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeFirst_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeLast_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeLast_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Set/Set.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-
 LibTest/core/Date/operator_equality_A01_t01: Fail # DateTime.== now looks at timezone, co19 issue 379.
 
 LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t01: Fail # Renamed Date to DateTime (issue 373, 374)
@@ -621,11 +442,6 @@
 LibTest/core/Strings/concatAll_A01_t01: Fail # Strings class has been removed. co19 issue 380
 LibTest/core/Strings/concatAll_A04_t01: Fail # Strings class has been removed. co19 issue 380
 
-LibTest/core/RegExp/RegExp_A01_t03: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t03: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/IllegalJSRegExpException/toString_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/IllegalJSRegExpException/IllegalJSRegExpException_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-
 LibTest/core/StringBuffer/addAll_A01_t02: Fail # StringBuffer renamed add to write. co19 issue 388.
 LibTest/core/StringBuffer/add_A01_t02: Fail # StringBuffer renamed add to write. co19 issue 388.
 LibTest/core/StringBuffer/add_A01_t01: Fail # StringBuffer renamed add to write. co19 issue 388.
@@ -645,17 +461,10 @@
 Language/11_Expressions/05_Strings/1_String_Interpolation_A03_t01: Fail # StringBuffer renamed add to write. co19 issue 388.
 Language/11_Expressions/05_Strings/1_String_Interpolation_A04_t01: Fail # StringBuffer renamed add to write. co19 issue 388.
 
-LibTest/core/double/operator_truncating_division_A01_t01: Fail # truncate/ceil/floor/round returns ints, issue 361
-LibTest/core/double/operator_truncating_division_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 361
-LibTest/core/double/operator_truncating_division_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 361
-LibTest/core/double/operator_truncating_division_A01_t05: Fail # truncate/ceil/floor/round returns ints, issue 361
-LibTest/core/double/operator_truncating_division_A01_t06: Fail # truncate/ceil/floor/round returns ints, issue 361
-
 LibTest/core/double/ceil_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/ceil_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/floor_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/floor_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 389
-LibTest/core/double/isNaN_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/round_A01_t02: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/round_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/truncate_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 389
@@ -663,20 +472,32 @@
 
 LibTest/core/List/getRange_A02_t01: Fail # issue 391
 
+Language/11_Expressions/05_Strings/1_String_Interpolation_A03_t02: Fail # Issue 397
+Language/11_Expressions/05_Strings/1_String_Interpolation_A04_t02: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t01: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t02: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t03: Fail # Issue 397
+LibTest/core/Iterable/where_A01_t07: Fail # Issue 397
+LibTest/core/List/addLast_A01_t01: Fail # Issue 397
+LibTest/core/List/addLast_A01_t03: Fail # Issue 397
+LibTest/core/List/addLast_A02_t01: Fail # Issue 397
+
+
 # Issues with co19 test suite in checked mode.
 [ $compiler == dart2js && $checked ]
-LibTest/isolate/SendPort/call_A01_t01: Fail # Future is in async library. co19 issue 367
-
 LibTest/core/Set/intersection_A01_t01: Fail # issue 390
 LibTest/core/Set/intersection_A01_t02: Fail # issue 390
 LibTest/core/Set/intersection_A01_t03: Fail # issue 390
 
-# Issues with co19 test suite in unchecked mode.
-[ $compiler == dart2js && $unchecked ]
-LibTest/core/Set/intersection_A03_t01: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377). Passes in checked mode due to Issue 390.
+# Issues with co19 test suite in browsers.
+[ $compiler == dart2js && $browser ]
+Language/15_Reference/1_Lexical_Rules_A01_t10: Fail, OK # co19 issue 395
 
-LibTest/core/Future/chain_A02_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t04: Fail # Future is in async library. co19 issue 367
+# Issues with co19 test suite in minified mode.
+[ $compiler == dart2js && $minified ]
+Language/11_Expressions/18_Assignment_A05_t04: Fail, OK # co19 issue 396
+Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A01_t02: Fail, OK # co19 issue 396
+
 
 [ $compiler == dart2js && $jscl ]
 LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A04_t01: Fail, Pass # issue 3333
@@ -686,11 +507,8 @@
 Language/11_Expressions/03_Numbers_A01_t09: Fail, OK # Requires bigint.
 LibTest/core/Date/Date_A01_t03: Fail, OK # co19 issue 180
 LibTest/core/Date/year_A01_t01: Fail, OK # Requires big int.
-LibTest/core/Match/pattern_A01_t01: Fail, OK # Bad test, allMatches return an Iterable.
-LibTest/core/Match/str_A01_t01: Fail, OK # Bad test, allMatches return an Iterable.
 LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: Fail, OK # This is not rejected by V8.
 LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A04_t01: Fail, OK # co19 issue 92.
-LibTest/core/RegExp/allMatches_A01_t01: Fail, OK #  Bad test, allMatches return an Iterable.
 LibTest/core/RegExp/firstMatch_A01_t01: Fail, OK # Bad test, use Match.regexp, not Match.pattern.
 LibTest/core/double/toRadixString_A01_t01: Fail, OK # Unimplemented test stub.
 LibTest/core/int/compareTo_A01_t01: Fail, OK # Requires big int.
@@ -712,7 +530,6 @@
 LibTest/math/asin_A01_t01: Fail, OK # co19 issue 44
 LibTest/math/atan_A01_t01: Fail, OK # co19 issue 44
 
-
 #
 # The following tests are failing. Please add the error message
 # (either a compiler error or exception message). The error messages
@@ -767,13 +584,8 @@
 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_t05: Fail # Checks that reassigning a final required parameter produces a compile-time error.
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t06: Fail # Checks that a functionSignature parameter cannot be final.
 Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t07: Fail # Checks that a functionSignature parameter cannot be declared as variable.
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t06: Fail # Checks that an optional positional parameter can be final.  Reassigning it should produce a compile-time error.
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t07: Fail # Checks that an optional positional parameter can be constant.  Reassigning it should produce a compile-time error.
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t01: Fail # Checks that it is a compile-time error if the name of a positional optional parameter begins with an '_' character.
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t02: Fail # Checks that it is a compile-time error if the name of a positional optional parameter begins with an '_' character.
 Language/06_Functions/2_Formal_Parameters_A03_t01: Fail # Checks that it is a compile-time error if a required parameter is declared as a constant variable.
 Language/06_Functions/2_Formal_Parameters_A03_t02: Fail # Checks that it is a compile-time error if a required parameter is declared as a constant typed variable.
 Language/06_Functions/2_Formal_Parameters_A03_t05: Fail # Checks that it is a compile-time error if an optional named parameter is declared as a constant typed variable.
@@ -837,7 +649,6 @@
 Language/14_Types/4_Interface_Types_A10_t07: Fail # http://dartbug.com/5022
 Language/14_Types/4_Interface_Types_A10_t08: Fail # http://dartbug.com/5022
 Language/14_Types/4_Interface_Types_A10_t09: Fail # http://dartbug.com/5022
-Language/14_Types/5_Function_Types_A06_t01: Fail # http://dartbug.com/5022
 
 Language/13_Libraries_and_Scripts/4_Scripts_A03_t01: Fail # http://dartbug.com/5683
 Language/13_Libraries_and_Scripts/4_Scripts_A03_t03: Fail # http://dartbug.com/5683
@@ -849,7 +660,6 @@
 # Unexpected runtime errors.
 #
 [ $compiler == dart2js ]
-Language/14_Types/4_Interface_Types_A08_t06: Fail # class Queue cannot be resolved.
 
 Language/14_Types/4_Interface_Types_A11_t04: Fail # http://dartbug.com/5020
 Language/14_Types/4_Interface_Types_A12_t10: Fail # http://dartbug.com/5020
@@ -865,21 +675,6 @@
 Language/14_Types/3_Type_Declarations/1_Typedef_A07_t03: Fail # dartbug.com/7202
 Language/14_Types/3_Type_Declarations/1_Typedef_A07_t04: Fail # dartbug.com/7202
 
-LibTest/core/Map/containsKey_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/operator_subscript_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/operator_subscripted_assignment_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/remove_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/add_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/addAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/contains_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/remove_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/removeAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/isSubsetOf_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/containsAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-
-
-LibTest/core/Map/forEach_A01_t07: Fail # Doesn't expect concurrent modification error (issue 376).
-
 LibTest/core/String/charCodes_A01_t01: Fail # Deprecated string members removed (issue 382).
 LibTest/core/String/charCodeAt_A02_t01: Fail # Deprecated string members removed (issue 382).
 LibTest/core/String/charCodeAt_A03_t01: Fail # Deprecated string members removed (issue 382).
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index 1b41d78..c1845be 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -2,27 +2,88 @@
 # 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.
 
+
+[ $runtime == vm ]
+Language/11_Expressions/33_Argument_Definition_Test_A02_t02: Crash, Pass # http://dartbug.com/9597
+
+
+[ $compiler == none && $runtime == vm && $unchecked ]
+Language/11_Expressions/11_Instance_Creation_A05_t02: Fail # TODO(vm-team): Please triage this failure.
+
+
+[ $compiler == none && $runtime == vm && $checked ]
+LibTest/core/AssertionError/line_A01_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/core/Set/intersection_A03_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/core/TypeError/line_A01_t01: Fail # TODO(vm-team): Please triage this failure.
+
+
+
+[ $compiler == none && $runtime == vm ]
+Language/05_Variables/05_Variables_A07_t01: Fail # TODO(vm-team): Please triage this failure.
+Language/05_Variables/05_Variables_A07_t02: Fail # TODO(vm-team): Please triage this failure.
+Language/05_Variables/05_Variables_A07_t03: Fail # TODO(vm-team): Please triage this failure.
+Language/05_Variables/05_Variables_A07_t04: Fail # TODO(vm-team): Please triage this failure.
+Language/05_Variables/05_Variables_A07_t10: Fail # TODO(vm-team): Please triage this failure.
+Language/06_Functions/2_Formal_Parameters/1_Required_Formals_A02_t05: Fail # TODO(vm-team): Please triage this failure.
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t06: Fail # TODO(vm-team): Please triage this failure.
+Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t04: Fail # TODO(vm-team): Please triage this failure.
+Language/11_Expressions/01_Constants_A18_t06: Fail # TODO(vm-team): Please triage this failure.
+Language/11_Expressions/14_Function_Invocation/3_Unqualified_Invocation_A01_t10: Fail # TODO(vm-team): Please triage this failure.
+Language/12_Statements/03_Variable_Declaration_A04_t08: Fail # TODO(vm-team): Please triage this failure.
+Language/13_Libraries_and_Scripts/1_Imports_A02_t12: Fail # TODO(vm-team): Please triage this failure.
+Language/13_Libraries_and_Scripts/1_Imports_A02_t15: Fail # TODO(vm-team): Please triage this failure.
+Language/15_Reference/1_Lexical_Rules_A01_t10: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/Future.delayed_A01_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/Future.delayed_A01_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/Future.delayed_A02_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/asStream_A01_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/asStream_A01_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/asStream_A02_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/catchError_A03_t03: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/forEach_A01_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/forEach_A02_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/forEach_A03_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/then_A01_t03: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/then_A02_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/then_A02_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/then_A03_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/then_A04_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t04: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t05: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/wait_A01_t06: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/wait_A02_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/wait_A02_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A01_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A02_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A03_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A04_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/async/Future/whenComplete_A04_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/collection/Queue/iterator_A01_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/collection/Queue/iterator_current_A01_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/collection/Queue/iterator_moveNext_A01_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/core/List/List_A01_t02: Fail # TODO(vm-team): Please triage this failure.
+LibTest/core/double/toStringAsExponential_A02_t01: Fail # TODO(vm-team): Please triage this failure.
+LibTest/core/int/toStringAsExponential_A02_t01: Fail # TODO(vm-team): Please triage this failure.
+
+
 [ $compiler == none && $runtime == vm && $checked ]
 LibTest/core/Strings/concatAll_A04_t01: Fail, OK # checks for ArgumentError. TypeError is ok too. co19 issue 366
 LibTest/core/Strings/join_A04_t01: Fail, OK # checks for ArgumentError. TypeError is ok too. co19 issue 366
 
 LibTest/core/int/operator_division_A01_t01: Fail # ~/ returns ints, issue 361
 
+
 [ $compiler == none && $runtime == vm ]
 Language/13_Libraries_and_Scripts/1_Imports_A02_t21: Crash # Dart issue 6060
 Language/13_Libraries_and_Scripts/1_Imports_A02_t22: Crash # Dart issue 6060
 
 Language/13_Libraries_and_Scripts/1_Imports_A04_t03: Fail # co19 issue 385
 Language/13_Libraries_and_Scripts/2_Exports_A05_t01: Fail # co19 issue 385
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t20: Fail # co19 issue 387
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t21: Fail # co19 issue 387
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t22: Fail # co19 issue 387
-Language/13_Libraries_and_Scripts/4_Scripts_A01_t23: Fail # co19 issue 387
 
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A01_t10: Fail # co19 issue 348
-Language/07_Classes/3_Setters_A04_t01: Fail # co19 issue 383
-Language/07_Classes/3_Setters_A04_t04: Fail # co19 issue 383
-Language/07_Classes/3_Setters_A04_t05: Fail # co19 issue 383
 Language/07_Classes/4_Abstract_Instance_Members_A03_t02: Fail # Dart issue 978
 Language/07_Classes/4_Abstract_Instance_Members_A03_t03: Fail # Dart issue 978
 Language/07_Classes/4_Abstract_Instance_Members_A03_t04: Fail # Dart issue 978
@@ -35,12 +96,9 @@
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A04_t03: Fail # Dart issue 811
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A05_t01: Fail # Dart issue 811
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A05_t02: Fail # Dart issue 811
-Language/08_Interfaces/5_Superinterfaces_A01_t02: Fail # Dart issue 7245
 Language/11_Expressions/01_Constants_A03_t01: Fail # Dart issue 5214
-Language/11_Expressions/01_Constants_A05_t01: Fail # Dart issue 5832
 Language/11_Expressions/01_Constants_A06_t01: Fail # Dart issue 5214
 Language/11_Expressions/01_Constants_A14_t01: Fail # Dart issue 5214
-Language/11_Expressions/01_Constants_A20_t03: Fail # Dart issue 6556
 Language/11_Expressions/05_Strings/1_String_Interpolation_A01_t04: Fail # Dart issue 7246
 Language/11_Expressions/05_Strings/1_String_Interpolation_A01_t05: Fail # Dart issue 7246
 Language/11_Expressions/05_Strings/1_String_Interpolation_A01_t06: Fail # Dart issue 7246
@@ -50,18 +108,12 @@
 Language/11_Expressions/11_Instance_Creation/1_New_A02_t05: Fail # Dart issue 7247
 Language/11_Expressions/11_Instance_Creation/1_New_A09_t09: Fail # Dart issue 1372
 Language/11_Expressions/11_Instance_Creation/2_Const_A10_t01: Fail # Dart issue 5775
-Language/11_Expressions/17_Getter_Invocation_A02_t01: Fail # Dart issue 6449
-Language/11_Expressions/18_Assignment_A05_t02: Fail # Dart issue 6449
-Language/11_Expressions/18_Assignment_A05_t04: Fail, OK # co19 issue 350.
-Language/11_Expressions/18_Assignment_A05_t05: Fail # Dart issue 6449
 Language/11_Expressions/19_Conditional_A01_t14: Fail # Dart issue 7251
 Language/11_Expressions/19_Conditional_A01_t15: Fail # Dart issue 7252
 Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t14: Fail # Dart issue 7251
 Language/11_Expressions/20_Logical_Boolean_Expressions_A01_t15: Fail # Dart issue 7251
 Language/11_Expressions/21_Bitwise_Expressions_A01_t16: Fail # Dart issue 7251
 Language/11_Expressions/21_Bitwise_Expressions_A01_t17: Fail # Dart issue 7251
-Language/11_Expressions/22_Equality_A01_t19: Fail # co19 issue 356
-Language/11_Expressions/22_Equality_A01_t20: Fail # co19 issue 356
 Language/11_Expressions/22_Equality_A01_t23: Fail # Dart issue 7254
 Language/11_Expressions/22_Equality_A01_t24: Fail # Dart issue 7254
 Language/11_Expressions/23_Relational_Expressions_A01_t22: Fail # Dart issue 7256
@@ -85,17 +137,12 @@
 Language/11_Expressions/30_Identifier_Reference_A05_t02: Fail # Dart issue 2492
 Language/11_Expressions/30_Identifier_Reference_A07_t01: Fail # Dart issue 7257
 Language/11_Expressions/30_Identifier_Reference_A08_t02: Fail # Dart issue 5802
-Language/11_Expressions/31_Type_Test_A01_t02: Fail # Dart issue 7258
-Language/11_Expressions/31_Type_Test_A01_t04: Fail # Dart issue 7258
-Language/11_Expressions/32_Type_Cast_A01_t04: Fail # co19 issue 356
-Language/12_Statements/02_Expression_Statements_A01_t08: Fail # co19 issue 370 (map literals need 2 type args)
 Language/12_Statements/03_Variable_Declaration_A04_t07: Fail # Dart issue 7305
 Language/12_Statements/04_Local_Function_Declaration_A02_t02: Fail # Dart issue 5773
 Language/12_Statements/06_For_A01_t11: Fail # Dart issue 5675
 Language/12_Statements/09_Switch_A01_t02: Fail # Dart issue 2238
 Language/12_Statements/09_Switch_A02_t01: Fail # Dart issue 7306
 Language/12_Statements/09_Switch_A02_t02: Fail # Dart issue 7307
-Language/12_Statements/09_Switch_A02_t03: Fail # Dart issue 7308
 Language/12_Statements/09_Switch_A03_t01: Fail # Dart issue 7307
 Language/12_Statements/09_Switch_A03_t02: Fail # Dart issue 7307
 Language/12_Statements/09_Switch_A04_t01: Fail # Dart issue 6897
@@ -106,7 +153,6 @@
 Language/12_Statements/10_Try_A11_t01: Fail # Dart issue 430
 Language/12_Statements/12_Labels_A01_t03: Fail # Dart issue 2238
 Language/13_Libraries_and_Scripts/13_Libraries_and_Scripts_A05_t04: Fail # Dart issue 5839
-Language/13_Libraries_and_Scripts/1_Imports_A02_t29: Fail # Dart issue 6783
 Language/13_Libraries_and_Scripts/1_Imports_A05_t01: Fail # Dart issue 3206
 Language/13_Libraries_and_Scripts/2_Exports_A04_t02: Fail # Dart issue 6134
 Language/13_Libraries_and_Scripts/2_Exports_A04_t03: Fail # Dart issue 6134
@@ -119,16 +165,7 @@
 Language/13_Libraries_and_Scripts/5_URIs_A01_t21: Fail # Dart issue 6352
 Language/14_Types/5_Function_Types_A01_t10: Fail # co19 issue 392
 Language/14_Types/5_Function_Types_A02_t06: Fail # co19 issue 392
-Language/14_Types/5_Function_Types_A04_t01: Fail # Dart issue 6921
-Language/14_Types/5_Function_Types_A06_t01: Fail # Dart issue 1604
-Language/15_Reference/1_Lexical_Rules_A01_t09: Fail # Dart issue 2687
-Language/15_Reference/1_Lexical_Rules_A01_t11: Fail # Dart issue 2687
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A01_t01: Fail # co19 issue 353
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A02_t01: Fail # co19 issue 353
-LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A06_t01: Fail # co19 issue 353
 LibTest/core/double/parse_A02_t01: Fail # Dart issue 1929
-LibTest/isolate/isolate_api/spawnUri_A01_t03: Fail # Dart issue 5222
-LibTest/isolate/isolate_api/spawnUri_A01_t04: Fail # Dart issue 5222
 LibTest/math/pow_A01_t01: Fail # Dart issue 7318
 LibTest/math/pow_A11_t01: Fail # Dart issue 449
 LibTest/math/pow_A13_t01: Fail # Dart issue 449
@@ -142,131 +179,23 @@
 Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t02: Fail # Dart issue 5802
 Language/05_Variables/1_Evaluation_of_Implicit_Variable_Getters_A01_t05: Fail # Dart issue 5894
 
-LibTest/core/Queue/some_A01_t06: Fail # behavior of some is undefined when underlying iterable changes, co19 issue 357
-LibTest/core/Queue/every_A01_t06: Fail # behavior of every is undefined when underlying iterable changes, co19 issue 357
-LibTest/core/Queue/forEach_A01_t04: Fail # behavior of forEach is undefined when underlying iterable changes, co19 issue 357
-
-LibTest/core/List/List_A02_t01: Fail # List constructors, co19 issue 358
-
-LibTest/core/List/last_A02_t01: Fail # List.last throws a StateError, co19 issue 359
-
 LibTest/core/double/truncate_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/truncate_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/ceil_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/ceil_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 389
-LibTest/core/double/double_class_A01_t01: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/floor_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/floor_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/round_A01_t02: Fail # truncate/ceil/floor/round returns ints, issue 389
 LibTest/core/double/round_A01_t04: Fail # truncate/ceil/floor/round returns ints, issue 389
-LibTest/core/double/isNaN_A01_t03: Fail # truncate/ceil/floor/round returns ints, issue 389
-
-LibTest/core/double/toInt_A01_t03: Fail # conversion to integer throws UnsupportedError for NaN/Infinity now, co19 issue 360
-LibTest/core/double/toInt_A01_t04: Fail # conversion to integer throws UnsupportedError for NaN/Infinity now, co19 issue 360
-
-LibTest/core/double/operator_truncating_division_A01_t01: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/operator_truncating_division_A01_t03: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/operator_truncating_division_A01_t04: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/operator_truncating_division_A01_t05: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/operator_truncating_division_A01_t06: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/isNaN_A01_t03: Fail # ~/ returns ints, co19 issue 361
-LibTest/core/double/double_class_A01_t01: Fail # ~/ returns ints, co19 issue 361
-
-LibTest/core/Match/end_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/group_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/group_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groupCount_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groups_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/groups_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/operator_subscript_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/pattern_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/start_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/Match/str_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/allMatches_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/firstMatch_A03_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/hasMatch_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/hasMatch_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/ignoreCase_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/multiLine_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/pattern_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A03_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Assertion_A04_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A03_t03: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A06_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/Pattern_semantics/firstMatch_Disjunction_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/RegExp_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/RegExp_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/stringMatch_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/RegExp/stringMatch_A02_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/contains_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/replaceAll_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/replaceFirst_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/split_A01_t01: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-LibTest/core/String/split_A01_t02: Fail # Regexp multiLine, ignoreCase -> isMultiLine, isCaseSensitive, co19 issue 362
-
-LibTest/core/Set/some_A01_t03: Fail # some -> any, co19 issue 363
-LibTest/core/Set/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/Set/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A02_t01: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/List/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t05: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t03: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t02: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t01: Fail # some -> any, co19 issue 363
-LibTest/core/Queue/some_A01_t04: Fail # some -> any, co19 issue 363
-
-LibTest/core/List/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A02_t01: Fail # filter->where, co19 issue 364
-LibTest/core/List/filter_A04_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t03: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t04: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t05: Fail # filter->where, co19 issue 364
-LibTest/core/Queue/filter_A01_t06: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t01: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t02: Fail # filter->where, co19 issue 364
-LibTest/core/Set/filter_A01_t03: Fail # filter->where, co19 issue 364
-
-Language/12_Statements/06_For/2_For_in_A01_t01: Fail # iterator-change, co19 issue 365
-Language/12_Statements/06_For/2_For_in_A01_t05: Fail # iterator-change, co19 issue 365
-Language/12_Statements/07_While_A02_t01: Fail # iterator-change, co19 issue 365
-Language/12_Statements/08_Do_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_hasNext_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_next_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/iterator_next_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/List/List.from_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_hasNext_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_hasNext_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/iterator_next_A02_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Queue/Queue.from_A01_t02: Fail # iterator-change, co19 issue 365
-LibTest/core/RegExp/allMatches_A01_t01: Fail # iterator-change, co19 issue 365
-LibTest/core/Set/Set.from_A01_t02: Fail # iterator-change, co19 issue 365
 
 LibTest/core/Date/operator_equality_A01_t01: Fail # DateTime.== now looks at timezone, co19 issue 379
 
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t01: Fail # issue 6085
-Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t02: Fail # issue 6085
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t03: Fail # issue 6085
 
 
-LibTest/math/parseDouble_A01_t01: Fail, OK # co19 issue 317
-LibTest/math/parseInt_A01_t01: Fail, OK # co19 issue 317
-LibTest/math/parseInt_A02_t01: Fail, OK # co19 issue 317
-
 [ $compiler == none && $runtime == vm && $checked ]
 Language/12_Statements/09_Switch_A05_t01: Fail # TODO(vm-team): Please triage this failure.
 
-Language/11_Expressions/11_Instance_Creation_A05_t02: Fail # co19 issue 234
 
 [ $compiler == none && $runtime == vm ]
 Language/11_Expressions/01_Constants_A16_t01: Fail # Not properly reporting exception in initializer expressions
@@ -302,8 +231,6 @@
 Language/11_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A05_t01: Fail # issue 1604.
 
 LibTest/core/List/every_A03_t01: Skip # Promise removed (co19 issue #79)
-LibTest/core/List/filter_A03_t01: Skip # Promise removed (co19 issue #79)
-LibTest/core/List/some_A03_t01: Skip # Promise removed (co19 issue #79)
 
 LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A03_t01: Fail
 LibTest/core/RegExp/Pattern_semantics/firstMatch_Atom_A02_t01: Fail
@@ -314,6 +241,7 @@
 
 LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterEscape_A06_t02: Fail
 
+
 [ $compiler == none && $runtime == vm ]
 LibTest/core/Date/Date.fromString_A03_t01: Pass # Issue co19 - 121  (currently passing due to co19 issues 373 and 374)
 LibTest/core/Match/operator_subscript_A01_t01: Fail
@@ -323,6 +251,7 @@
 LibTest/core/double/toRadixString_A01_t01: Fail # Issue 463
 LibTest/core/int/toRadixString_A01_t01: Fail # Issue 461
 
+
 [ $compiler == none && $runtime == vm ]
 LibTest/math/sin_A01_t01: Fail, OK # Issue co19 - 44
 
@@ -334,29 +263,26 @@
 LibTest/math/atan_A01_t01: Fail, OK # Issue co19 - 44
 LibTest/math/tan_A01_t01: Fail, OK  # Issue co19 - 44
 
+
 [ $compiler == none && $runtime == vm && $system == linux ]
 LibTest/math/exp_A01_t01: Fail
 
+
 [ $compiler == none && $runtime == vm && $system == linux && $arch == ia32 ]
 LibTest/math/sin_A01_t01: Fail
 LibTest/math/tan_A01_t01: Fail
 
+
 [ $compiler == none && $runtime == vm && $arch == x64 && $mode == debug ]
 LibTest/core/Map/Map_class_A01_t04: Skip # Timeout
 
-[ $compiler == none && $runtime == vm ]
 
+[ $compiler == none && $runtime == vm ]
 LibTest/core/Date/toString_A02_t01: Fail # Argument error. Year 999999 is out of range. Needs to be specified (and then potentially reported to co19): issue 1878.
 LibTest/core/Date/year_A01_t01: Fail # Year out of range. Needs to be specified: issue 8808. Possibly a co19 bug.
 
 LibTest/isolate/SendPort/send_A02_t02: Skip # co19 issue 293
 LibTest/isolate/SendPort/send_A02_t03: Skip # co19 issue 293
-LibTest/isolate/SendPort/send_A02_t04: Fail, OK # co19 issue 293
-LibTest/core/LinkedHashMap/LinkedHashMap_class_A01_t01: Fail, OK # co19 issue 293
-LibTest/core/Map/getKeys_A01_t01: Fail, OK # co19 issue 293
-LibTest/core/Map/getKeys_A01_t02: Fail, OK # co19 issue 293
-LibTest/core/Map/getValues_A01_t02: Fail, OK # co19 issue 293
-LibTest/core/Map/getValues_A01_t01: Fail, OK # co19 issue 293
 
 LibTest/core/Match/operator_subscript_A01_t01: Fail, OK # co19 issue 294
 LibTest/core/RegExp/firstMatch_A01_t01: Fail, OK # co19 issue 294
@@ -366,9 +292,6 @@
 Language/11_Expressions/07_Maps_A07_t03: Fail, OK # co19 issue 287
 Language/11_Expressions/07_Maps_A04_t02: Fail, OK # co19 issue 287
 
-LibTest/core/Map/getValues_A01_t02: Fail, OK # co19 issue 287
-
-LibTest/math/Random/nextDouble_A01_t01: Fail # co19 issue 334
 
 [ $compiler == none && $runtime == vm ]
 LibTest/core/String/contains_A01_t03: Skip # Times out.
@@ -385,13 +308,8 @@
 Language/07_Classes/07_Classes_A02_t31: Fail
 Language/11_Expressions/05_Strings_A20_t01: Fail
 LibTest/isolate/ReceivePort/receive_A01_t02: Fail
-LibTest/isolate/isolate_api/spawnUri_A01_t03: Crash
-LibTest/isolate/isolate_api/spawnUri_A01_t04: Crash
 
-LibTest/core/StringBuffer/addAll_A02_t01:  Fail, OK # co19 issue 355
-LibTest/core/StringBuffer/add_A02_t01:  Fail, OK # co19 issue 355
 LibTest/core/StringBuffer/isEmpty_A01_t01:  Fail, OK # co19 issue 355
-LibTest/core/StringBuffer/clear_A02_t01: Fail, OK # co19 issue 355
 
 # parameter name or type expected
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A15_t07: Fail
@@ -404,135 +322,13 @@
 [ $compiler == none && $runtime == vm && $mode == debug ]
 LibTest/isolate/isolate_api/spawnFunction_A02_t01: Crash
 
+
 [ $compiler == none && $runtime == vm ]
-LibTest/core/Completer/Completer_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/completeException_A03_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/complete_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Completer/future_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/Future.immediate_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t08: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A01_t09: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A02_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/chain_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/exception_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/handleException_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/hasValue_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/isComplete_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/then_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A01_t07: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A03_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t02: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/value_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t03: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t04: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A01_t06: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A02_t01: Fail # Future is in async library. co19 issue 367
-LibTest/core/Futures/wait_A02_t02: Fail # Future is in async library. co19 issue 367
-
-LibTest/core/Expect/setEquals_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Expect/setEquals_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashMap/HashMap_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/HashSet/HashSet_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/LinkedHashMap/LinkedHashMap_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/List/List.from_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/List/addAll_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/Queue_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addAll_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addFirst_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addFirst_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addLast_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/addLast_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/add_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/add_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/clear_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t03: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t04: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/every_A01_t05: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/first_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/first_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t02: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t03: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/forEach_A01_t05: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/isEmpty_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/last_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/last_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/length_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeFirst_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeFirst_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeLast_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Queue/removeLast_A02_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-LibTest/core/Set/Set.from_A01_t01: Fail # Moved collection classes from core to collection. co19 issue 371.
-
 LibTest/core/Strings/join_A01_t01: Fail # Strings class has been removed. co19 issue 380
 LibTest/core/Strings/join_A04_t01: Fail # Strings class has been removed. co19 issue 380
 LibTest/core/Strings/concatAll_A01_t01: Fail # Strings class has been removed. co19 issue 380
 LibTest/core/Strings/concatAll_A04_t01: Fail # Strings class has been removed. co19 issue 380
 
-LibTest/core/RegExp/RegExp_A01_t03: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t03: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/IllegalJSRegExpException/toString_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-LibTest/core/IllegalJSRegExpException/IllegalJSRegExpException_A01_t01: Fail # IllegalJSRegExpException has been removed. co19 issue 375.
-
-LibTest/core/Map/containsKey_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/operator_subscript_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/operator_subscripted_assignment_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Map/remove_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/add_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/addAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/contains_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/remove_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/removeAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-LibTest/core/Set/isSubsetOf_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377).
-
-LibTest/core/Map/forEach_A01_t07: Fail # Doesn't expect concurrent modification error (issue 376).
-
 LibTest/core/String/charCodes_A01_t01: Fail # Deprecated string members removed (issue 382).
 LibTest/core/String/charCodeAt_A02_t01: Fail # Deprecated string members removed (issue 382).
 LibTest/core/String/charCodeAt_A03_t01: Fail # Deprecated string members removed (issue 382).
@@ -580,7 +376,6 @@
 LibTest/core/Date/toUtc_A01_t01: Fail # Renamed Date to DateTime (issue 373, 374)
 LibTest/core/Date/weekday_A01_t01: Fail # Renamed Date to DateTime (issue 373, 374)
 
-
 LibTest/core/StringBuffer/addAll_A01_t02: Fail # StringBuffer renamed add to write. co19 issue 388.
 LibTest/core/StringBuffer/add_A01_t02: Fail # StringBuffer renamed add to write. co19 issue 388.
 LibTest/core/StringBuffer/add_A01_t01: Fail # StringBuffer renamed add to write. co19 issue 388.
@@ -602,33 +397,34 @@
 
 LibTest/core/List/getRange_A02_t01: Fail # issue 391
 
-[ $compiler == none && $runtime == vm && $unchecked ]
-LibTest/core/Future/chain_A02_t05: Fail # Future is in async library. co19 issue 367
-LibTest/core/Future/transform_A02_t04: Fail # Future is in async library. co19 issue 367
+Language/11_Expressions/05_Strings/1_String_Interpolation_A03_t02: Fail # Issue 397
+Language/11_Expressions/05_Strings/1_String_Interpolation_A04_t02: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t01: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t02: Fail # Issue 397
+Language/11_Expressions/11_Instance_Creation/1_New_A08_t03: Fail # Issue 397
+LibTest/core/Iterable/where_A01_t07: Fail # Issue 397
+LibTest/core/List/addLast_A01_t01: Fail # Issue 397
+LibTest/core/List/addLast_A01_t03: Fail # Issue 397
+LibTest/core/List/addLast_A02_t01: Fail # Issue 397
+
 
 [ $compiler == none && $runtime == vm && $checked ]
-LibTest/isolate/SendPort/call_A01_t01: Fail # Future is in async library. co19 issue 367
-Language/14_Types/4_Interface_Types_A08_t06: Fail # Moved collection classes from core to collection. co19 issue 371.
-
-LibTest/core/Set/containsAll_A01_t02: Fail # issue 390
 LibTest/core/Set/intersection_A01_t01: Fail # issue 390
 LibTest/core/Set/intersection_A01_t02: Fail # issue 390
 LibTest/core/Set/intersection_A01_t03: Fail # issue 390
 
-[ $compiler == none && $runtime == vm && $unchecked ]
-LibTest/core/Set/containsAll_A01_t02: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377). Succeedes in checked mode due to Issue 390.
-LibTest/core/Set/intersection_A03_t01: Fail # Doesn't expect null to be allowed in Set or Map keys (issue 377). Succeedes in checked mode due to Issue 390.
-
-
 
 [ $compiler == none && $arch == simarm ]
 *: Skip
 
+
 [ $compiler == none && $arch == arm ]
 *: Skip
 
+
 [ $compiler == none && $arch == simmips ]
 *: Skip
 
+
 [ $compiler == none && $arch == mips ]
 *: Skip
diff --git a/tests/compiler/dart2js/dead_bailout_target_test.dart b/tests/compiler/dart2js/dead_bailout_target_test.dart
index aa3c865..c4d55db 100644
--- a/tests/compiler/dart2js/dead_bailout_target_test.dart
+++ b/tests/compiler/dart2js/dead_bailout_target_test.dart
@@ -35,7 +35,13 @@
   // 'getInterceptor'. The environment for the second bailout contains
   // the interceptor of [:a.length:], but since the bailout is
   // removed, the interceptor is removed too.
-  Expect.isTrue(!generated.contains('getInterceptor'));
+  if (generated.contains(r'getInterceptor(a).$is')) {
+    // If we have an interceptor for a type check, it should be the only one.
+    checkNumberOfMatches(
+        new RegExp('getInterceptor').allMatches(generated).iterator, 1);
+  } else {
+    Expect.isTrue(!generated.contains('getInterceptor'));
+  }
 
   generated = compileAll(TEST);
   
diff --git a/tests/compiler/dart2js/mirrors_metadata_test.dart b/tests/compiler/dart2js/mirrors_metadata_test.dart
new file mode 100644
index 0000000..7fd8589
--- /dev/null
+++ b/tests/compiler/dart2js/mirrors_metadata_test.dart
@@ -0,0 +1,85 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+import 'dart:uri';
+import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart';
+import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart';
+import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart';
+import '../../../sdk/lib/_internal/compiler/implementation/source_file_provider.dart';
+import 'mock_compiler.dart';
+
+const String SOURCE = '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.runCompiler(null);
+  return new Dart2JsMirrorSystem(compiler);
+}
+
+void validateDeclarationComment(String code,
+                                String text,
+                                String trimmedText,
+                                bool isDocComment,
+                                List<String> declarationNames) {
+  MirrorSystem mirrors = createMirrorSystem(code);
+  LibraryMirror library = mirrors.libraries[SOURCE];
+  Expect.isNotNull(library);
+  for (String declarationName in declarationNames) {
+    DeclarationMirror declaration = library.members[declarationName];
+    Expect.isNotNull(declaration);
+    List<InstanceMirror> metadata = declaration.metadata;
+    Expect.isNotNull(metadata);
+    Expect.equals(1, metadata.length);
+    Expect.isTrue(metadata[0] is CommentInstanceMirror);
+    CommentInstanceMirror commentMetadata = metadata[0];
+    Expect.equals(text, commentMetadata.text);
+    Expect.equals(trimmedText, commentMetadata.trimmedText);
+    Expect.equals(isDocComment, commentMetadata.isDocComment);
+  }
+}
+
+void testDeclarationComment(String declaration, List<String> declarationNames) {
+  String text = 'Single line comment';
+  String comment = '// $text';
+  String code = '$comment\n$declaration';
+  validateDeclarationComment(code, comment, text, false, declarationNames);
+
+  comment = '/// $text';
+  code = '$comment\n$declaration';
+  validateDeclarationComment(code, comment, text, true, declarationNames);
+
+  text = 'Multiline comment';
+  comment = '/* $text*/';
+  code = '$comment$declaration';
+  validateDeclarationComment(code, comment, text, false, declarationNames);
+
+  comment = '/** $text*/';
+  code = '$comment$declaration';
+  validateDeclarationComment(code, comment, text, true, declarationNames);
+}
+
+void main() {
+  testDeclarationComment('var field;', ['field']);
+  testDeclarationComment('int field;', ['field']);
+  testDeclarationComment('int field = 0;', ['field']);
+  testDeclarationComment('int field1, field2;', ['field1', 'field2']);
+  testDeclarationComment('final field = 0;', ['field']);
+  testDeclarationComment('final int field = 0;', ['field']);
+  testDeclarationComment('final field1 = 0, field2 = 0;', ['field1', 'field2']);
+  testDeclarationComment('final int field1 = 0, field2 = 0;',
+                         ['field1', 'field2']);
+  testDeclarationComment('const field = 0;', ['field']);
+  testDeclarationComment('const int field = 0;', ['field']);
+  testDeclarationComment('const field1 = 0, field2 = 0;', ['field1', 'field2']);
+  testDeclarationComment('const int field1 = 0, field2 = 0;',
+                         ['field1', 'field2']);
+}
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index adbdc76..f340a47 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -123,7 +123,8 @@
   }
   class ObjectInterceptor {
   }
-  getInterceptor(x) {}''';
+  getInterceptor(x) {}
+  getNativeInterceptor(x) {}''';
 
 const String DEFAULT_CORELIB = r'''
   print(var obj) {}
@@ -167,14 +168,18 @@
                 bool enableMinification: false,
                 bool enableConcreteTypeInference: false,
                 int maxConcreteTypeSize: 5,
-                bool analyzeAll: false})
+                bool analyzeAll: false,
+                bool analyzeOnly: false,
+                bool preserveComments: false})
       : warnings = [], errors = [],
         sourceFiles = new Map<String, SourceFile>(),
         super(enableTypeAssertions: enableTypeAssertions,
               enableMinification: enableMinification,
               enableConcreteTypeInference: enableConcreteTypeInference,
               maxConcreteTypeSize: maxConcreteTypeSize,
-              analyzeAll: analyzeAll) {
+              analyzeAll: analyzeAll,
+              analyzeOnly: analyzeOnly,
+              preserveComments: preserveComments) {
     coreLibrary = createLibrary("core", coreSource);
     // We need to set the assert method to avoid calls with a 'null'
     // target being interpreted as a call to assert.
diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status
index 0116aec..b95b7af 100644
--- a/tests/compiler/dart2js_extra/dart2js_extra.status
+++ b/tests/compiler/dart2js_extra/dart2js_extra.status
@@ -40,7 +40,3 @@
 
 [ $runtime == none ]
 timer_negative_test: Fail, OK # A negative runtime test.
-
-[ $compiler == none && $runtime == drt ]
-timer_test: Fail # http://dartbug.com/2264
-mirror_test: Fail # http://dartbug.com/2264
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 94108e9..a69582f 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -7,3 +7,8 @@
 
 [ $compiler == dart2js ]
 native_null_closure_frog_test: Fail
+native_mixin_test: Fail           # Issue 9629
+native_mixin_field_test: Fail     # Issue 9629
+native_mixin_multiple_test: Fail  # Issue 9629
+native_no_such_method_exception4_frog_test: Fail  # Issue 9631
+native_no_such_method_exception5_frog_test: Fail  # Issue 9631
diff --git a/tests/compiler/dart2js_native/downcast_test.dart b/tests/compiler/dart2js_native/downcast_test.dart
new file mode 100644
index 0000000..c2960bf
--- /dev/null
+++ b/tests/compiler/dart2js_native/downcast_test.dart
@@ -0,0 +1,78 @@
+// 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 for downcasts on native classes.
+
+interface J {
+}
+
+interface I extends J {
+  I read();
+  write(I x);
+}
+
+// Native implementation.
+
+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" {
+}
+
+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) {
+  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);
+A.prototype.read = function() { return this._x; };
+A.prototype.write = function(x) { this._x = x; };
+makeA = function(){return new A};
+makeB = function(){return new B};
+""";
+
+class C {}
+
+bool _check(a, b) => identical(a, b);
+
+main() {
+  setup();
+
+  var a1 = makeA();
+  var b1 = makeB();
+  var ob = new Object();
+
+  Expect.throws(() => ob as J);
+  Expect.throws(() => ob as I);
+  Expect.throws(() => ob as A);
+  Expect.throws(() => ob as B);
+  Expect.throws(() => ob as C);
+
+  // Use b1 first to prevent a1 is checks patching the A prototype.
+  Expect.equals(b1, b1 as J);
+  Expect.equals(b1, b1 as I);
+  Expect.equals(b1, b1 as A);
+  Expect.equals(b1, b1 as B);
+
+  Expect.equals(a1, a1 as J);
+  Expect.equals(a1, a1 as I);
+  Expect.equals(a1, a1 as A);
+  Expect.throws(() => a1 as B);
+  Expect.throws(() => a1 as C);
+}
diff --git a/tests/compiler/dart2js_native/native_method_inlining_test.dart b/tests/compiler/dart2js_native/native_method_inlining_test.dart
new file mode 100644
index 0000000..f9d34e8
--- /dev/null
+++ b/tests/compiler/dart2js_native/native_method_inlining_test.dart
@@ -0,0 +1,95 @@
+// 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 that native methods with unnamed optional arguments are called with the
+// number of arguments in the call site AND the call site is inlined.
+
+class A native "*A" {
+  int foo([x, y, z]) native;
+}
+
+class B {
+  static var g;
+  work(a) {
+    g = 'Sandwich';  // Tag to identify compiled JavaScript method.
+    A x = makeA();
+    // Call sites that are searched for in compiled JavaScript.
+    x.foo();
+    x.foo(1);
+    x.foo(2, 10);
+    return x.foo(3, 10, 30);
+  }
+}
+
+A makeA() native;
+
+String findMethodTextContaining(instance, string) native;
+
+void setup() native r"""
+function A() {}
+A.prototype.foo = function () { return arguments.length; };
+
+makeA = function(){return new A;};
+
+findMethodTextContaining = function (instance, string) {
+  var proto = Object.getPrototypeOf(instance);
+  var keys = Object.keys(proto);
+  for (var i = 0; i < keys.length; i++) {
+    var name = keys[i];
+    var member = proto[name];
+    var s = String(member);
+    if (s.indexOf(string)>0) return s;
+  }
+};
+""";
+
+
+bool get isCheckedMode {
+  int i = 0;
+  try {
+    i = 'a';
+  } catch (e) {
+    return true;
+  }
+  return false;
+}
+
+void match(String s, String pattern1) {
+  var pattern2 = pattern1.replaceAll(' ', '');
+  Expect.isTrue(s.contains(pattern1) || s.contains(pattern2),
+      "$pattern1 or $pattern2");
+}
+
+test() {
+  var a = makeA();
+
+  Expect.equals(0, a.foo());
+  Expect.equals(1, a.foo(10));
+  Expect.equals(2, a.foo(10, 20));
+  Expect.equals(3, a.foo(10, 20, 30));
+
+  var b = new B();
+  var r = b.work(a);
+  Expect.equals(3, r);
+
+  String text = findMethodTextContaining(b, 'Sandwich');
+  Expect.isNotNull(text, 'No method found containing "Sandwich"');
+
+  if (isCheckedMode) {
+    // TODO: inlining in checked mode.
+    //  t1.foo$3(x, 3, 10, 30)  or  y.EL(z,3,10,30)
+    match(text, r', 3, 10, 30)');
+  } else {
+    // Direct (inlined) calls don't have $3 or minified names.
+    match(text, r'.foo()');
+    match(text, r'.foo(1)');
+    match(text, r'.foo(2, 10)');
+    match(text, r'.foo(3, 10, 30)');
+  }
+}
+
+main() {
+  setup();
+  test();
+}
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 fbdd8fb..964b5c7 100644
--- a/tests/compiler/dart2js_native/native_named_constructors2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_named_constructors2_frog_test.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.
 
-// Hidden native class wwith named constructors and static methods.
+// Native class wwith named constructors and static methods.
 
 
 class A native "*A" {
@@ -16,7 +16,7 @@
 
   static A _construct(v) { return makeA(v); }
 
-  foo() native 'return this._x;';
+  foo() native;
 }
 
 makeA(v) native;
@@ -24,6 +24,7 @@
 void setup() native """
 // This code is all inside 'setup' and so not accesible from the global scope.
 function A(arg) { this._x = arg; }
+A.prototype.foo = function() { return this._x; };
 makeA = function(arg) { return new A(arg); }
 """;
 
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 e13fd46..8148db3 100644
--- a/tests/compiler/dart2js_native/native_named_constructors3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_named_constructors3_frog_test.dart
@@ -17,7 +17,7 @@
   // Only functions with zero parameters are allowed with "native r'...'".
   factory A.nativeConstructor() native r'return makeA(102);';
 
-  foo() native 'return this._x;';
+  foo() native;
 }
 
 makeA(v) native;
@@ -25,6 +25,7 @@
 void setup() native """
 // This code is all inside 'setup' and so not accesible from the global scope.
 function A(arg) { this._x = arg; }
+A.prototype.foo = function(){ return this._x; }
 makeA = function(arg) { return new A(arg); }
 """;
 
diff --git a/tests/compiler/dart2js_native/native_null_frog_test.dart b/tests/compiler/dart2js_native/native_null_frog_test.dart
index 44d3724..71066b6 100644
--- a/tests/compiler/dart2js_native/native_null_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_null_frog_test.dart
@@ -2,20 +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.
 
-// Test that parameters in native methods are not mangled. This test is needed
-// until we change all libraries to using the JS foreign element.
+// Test for values of some basic types.
 
 class A native "*A" {
-  returnNull() native "return null;";
-  returnUndefined() native "return undefined;";
-  returnEmptyString() native "return '';";
-  returnZero() native "return 0;";
+  returnNull() native;
+  returnUndefined() native;
+  returnEmptyString() native;
+  returnZero() native;
 }
 
 A makeA() native;
 
 void setup() native """
 function A() {}
+A.prototype.returnNull = function() { return null; };
+A.prototype.returnUndefined = function() { return void 0; };
+A.prototype.returnEmptyString = function() { return ""; };
+A.prototype.returnZero = function() { return 0; };
 makeA = function(){return new A;};
 """;
 
diff --git a/tests/corelib/collection_test.dart b/tests/corelib/collection_test.dart
index 8ef81f7..86f1114 100644
--- a/tests/corelib/collection_test.dart
+++ b/tests/corelib/collection_test.dart
@@ -8,13 +8,12 @@
 
 class CollectionTest {
   CollectionTest(Collection collection) {
-    testReduce(collection);
+    testFold(collection);
   }
 
-  void testReduce(Collection collection) {
-    Expect.equals(28, collection.reduce(0, (prev, element) => prev + element));
-    Expect.equals(
-        3024, collection.reduce(1, (prev, element) => prev * element));
+  void testFold(Collection collection) {
+    Expect.equals(28, collection.fold(0, (prev, element) => prev + element));
+    Expect.equals(3024, collection.fold(1, (prev, element) => prev * element));
   }
 }
 
diff --git a/tests/corelib/list_map_test.dart b/tests/corelib/list_map_test.dart
index ca30d4a..31d3439 100644
--- a/tests/corelib/list_map_test.dart
+++ b/tests/corelib/list_map_test.dart
@@ -116,6 +116,7 @@
     testOp((i) => i.max(), "max");
     testOp((i) => i.min(), "min");
     testOp((i) => i.reduce(0, (a, b) => a + b), "reduce-sum");
+    testOp((i) => i.fold(0, (a, b) => a + b), "fold-sum");
     testOp((i) => i.join("-"), "join-");
     testOp((i) => i.join(""), "join");
     testOp((i) => i.join(), "join-null");
diff --git a/tests/corelib/list_reversed_test.dart b/tests/corelib/list_reversed_test.dart
index 6055b3a..99f7b99 100644
--- a/tests/corelib/list_reversed_test.dart
+++ b/tests/corelib/list_reversed_test.dart
@@ -107,6 +107,7 @@
     testOp((i) => i.max(), "max");
     testOp((i) => i.min(), "min");
     testOp((i) => i.reduce(0, (a, b) => a + b), "reduce-sum");
+    testOp((i) => i.fold(0, (a, b) => a + b), "fold-sum");
     testOp((i) => i.join("-"), "join-");
     testOp((i) => i.join(""), "join");
     testOp((i) => i.join(), "join-null");
diff --git a/tests/corelib/map_keys_test.dart b/tests/corelib/map_keys_test.dart
index 9297f03..8b3a833 100644
--- a/tests/corelib/map_keys_test.dart
+++ b/tests/corelib/map_keys_test.dart
@@ -36,7 +36,7 @@
   Expect.isFalse(map5.keys is List);
   Expect.equals(2, map5.keys.length);
   Expect.isTrue(map5.keys.first == "foo" || map5.keys.first == "bar");
-  Expect.isTrue(map5.keys.last == "foo" || map5.keys.first == "bar");
+  Expect.isTrue(map5.keys.last == "foo" || map5.keys.last == "bar");
   Expect.notEquals(map5.keys.first, map5.keys.last);
 
   Expect.isTrue(map6.keys is Iterable);
diff --git a/tests/corelib/map_test.dart b/tests/corelib/map_test.dart
index d405471..9fb2bca 100644
--- a/tests/corelib/map_test.dart
+++ b/tests/corelib/map_test.dart
@@ -14,8 +14,25 @@
   testMapLiteral();
   testNullValue();
   testTypes();
+
+  testWeirdStringKeys(new Map());
+  testWeirdStringKeys(new Map<String, String>());
+  testWeirdStringKeys(new HashMap());
+  testWeirdStringKeys(new HashMap<String, String>());
+  testWeirdStringKeys(new LinkedHashMap());
+  testWeirdStringKeys(new LinkedHashMap<String, String>());
+  testWeirdStringKeys(new SplayTreeMap());
+  testWeirdStringKeys(new SplayTreeMap<String, String>());
+
+  testNumericKeys(new Map());
+  testNumericKeys(new Map<num, String>());
+  testNumericKeys(new HashMap());
+  testNumericKeys(new HashMap<num, String>());
+  testNumericKeys(new LinkedHashMap());
+  testNumericKeys(new LinkedHashMap<num, String>());
 }
 
+
 void test(Map map) {
   testDeletedElement(map);
   testMap(map, 1, 2, 3, 4, 5, 6, 7, 8);
@@ -134,52 +151,52 @@
   Expect.equals(true, map.containsValue(value1));
 
   // Test Map.forEach.
-  Map other_map = new Map();
+  Map otherMap = new Map();
   void testForEachMap(key, value) {
-    other_map[key] = value;
+    otherMap[key] = value;
   }
   map.forEach(testForEachMap);
-  Expect.equals(true, other_map.containsKey(key1));
-  Expect.equals(true, other_map.containsKey(key2));
-  Expect.equals(true, other_map.containsValue(value1));
-  Expect.equals(true, other_map.containsValue(value2));
-  Expect.equals(2, other_map.length);
+  Expect.equals(true, otherMap.containsKey(key1));
+  Expect.equals(true, otherMap.containsKey(key2));
+  Expect.equals(true, otherMap.containsValue(value1));
+  Expect.equals(true, otherMap.containsValue(value2));
+  Expect.equals(2, otherMap.length);
 
-  other_map.clear();
-  Expect.equals(0, other_map.length);
+  otherMap.clear();
+  Expect.equals(0, otherMap.length);
 
   // Test Collection.keys.
   void testForEachCollection(value) {
-    other_map[value] = value;
+    otherMap[value] = value;
   }
   Iterable keys = map.keys;
   keys.forEach(testForEachCollection);
-  Expect.equals(true, other_map.containsKey(key1));
-  Expect.equals(true, other_map.containsKey(key2));
-  Expect.equals(true, other_map.containsValue(key1));
-  Expect.equals(true, other_map.containsValue(key2));
-  Expect.equals(true, !other_map.containsKey(value1));
-  Expect.equals(true, !other_map.containsKey(value2));
-  Expect.equals(true, !other_map.containsValue(value1));
-  Expect.equals(true, !other_map.containsValue(value2));
-  Expect.equals(2, other_map.length);
-  other_map.clear();
-  Expect.equals(0, other_map.length);
+  Expect.equals(true, otherMap.containsKey(key1));
+  Expect.equals(true, otherMap.containsKey(key2));
+  Expect.equals(true, otherMap.containsValue(key1));
+  Expect.equals(true, otherMap.containsValue(key2));
+  Expect.equals(true, !otherMap.containsKey(value1));
+  Expect.equals(true, !otherMap.containsKey(value2));
+  Expect.equals(true, !otherMap.containsValue(value1));
+  Expect.equals(true, !otherMap.containsValue(value2));
+  Expect.equals(2, otherMap.length);
+  otherMap.clear();
+  Expect.equals(0, otherMap.length);
 
   // Test Collection.values.
   Iterable values = map.values;
   values.forEach(testForEachCollection);
-  Expect.equals(true, !other_map.containsKey(key1));
-  Expect.equals(true, !other_map.containsKey(key2));
-  Expect.equals(true, !other_map.containsValue(key1));
-  Expect.equals(true, !other_map.containsValue(key2));
-  Expect.equals(true, other_map.containsKey(value1));
-  Expect.equals(true, other_map.containsKey(value2));
-  Expect.equals(true, other_map.containsValue(value1));
-  Expect.equals(true, other_map.containsValue(value2));
-  Expect.equals(2, other_map.length);
-  other_map.clear();
-  Expect.equals(0, other_map.length);
+  Expect.equals(true, !otherMap.containsKey(key1));
+  Expect.equals(true, !otherMap.containsKey(key2));
+  Expect.equals(true, !otherMap.containsValue(key1));
+  Expect.equals(true, !otherMap.containsValue(key2));
+  Expect.equals(true, otherMap.containsKey(value1));
+  Expect.equals(true, otherMap.containsKey(value2));
+  Expect.equals(true, otherMap.containsValue(value1));
+  Expect.equals(true, otherMap.containsValue(value2));
+  Expect.equals(2, otherMap.length);
+  otherMap.clear();
+  Expect.equals(0, otherMap.length);
 
   // Test Map.putIfAbsent.
   map.clear();
@@ -245,7 +262,7 @@
 }
 
 void testTypes() {
-  Map<int> map;
+  Map<int, dynamic> map;
   testMap(Map map) {
     map[42] = "text";
     map[43] = "text";
@@ -264,3 +281,87 @@
   testMap(new SplayTreeMap<num, String>(Comparable.compare));
   testMap(new SplayTreeMap<num, String>((num a, num b) => a.compareTo(b)));
 }
+
+void testWeirdStringKeys(Map map) {
+  // Test weird keys.
+  var weirdKeys = const [
+      'hasOwnProperty',
+      'constructor',
+      'toLocaleString',
+      'propertyIsEnumerable',
+      '__defineGetter__',
+      '__defineSetter__',
+      '__lookupGetter__',
+      '__lookupSetter__',
+      'isPrototypeOf',
+      'toString',
+      'valueOf',
+      '__proto__',
+      '__count__',
+      '__parent__',
+      ''];
+  Expect.isTrue(map.isEmpty);
+  for (var key in weirdKeys) {
+    Expect.isFalse(map.containsKey(key));
+    Expect.equals(null, map[key]);
+    var value = 'value:$key';
+    map[key] = value;
+    Expect.isTrue(map.containsKey(key));
+    Expect.equals(value, map[key]);
+    Expect.equals(value, map.remove(key));
+    Expect.isFalse(map.containsKey(key));
+    Expect.equals(null, map[key]);
+  }
+  Expect.isTrue(map.isEmpty);
+
+}
+
+void testNumericKeys(Map map) {
+  var numericKeys = const [
+      double.INFINITY,
+      double.NEGATIVE_INFINITY,
+      0,
+      0.0,
+      -0.0 ];
+
+  Expect.isTrue(map.isEmpty);
+  for (var key in numericKeys) {
+    Expect.isFalse(map.containsKey(key));
+    Expect.equals(null, map[key]);
+    var value = 'value:$key';
+    map[key] = value;
+    Expect.isTrue(map.containsKey(key));
+    Expect.equals(value, map[key]);
+    Expect.equals(value, map.remove(key));
+    Expect.isFalse(map.containsKey(key));
+    Expect.equals(null, map[key]);
+  }
+  Expect.isTrue(map.isEmpty);
+
+  // Test NaN.
+  var nan = double.NAN;
+  Expect.isFalse(map.containsKey(nan));
+  Expect.equals(null, map[nan]);
+
+  map[nan] = 'value:0';
+  Expect.isFalse(map.containsKey(nan));
+  Expect.equals(null, map[nan]);
+  Expect.equals(1, map.length);
+
+  map[nan] = 'value:1';
+  Expect.isFalse(map.containsKey(nan));
+  Expect.equals(null, map[nan]);
+  Expect.equals(2, map.length);
+
+  Expect.equals(null, map.remove(nan));
+  Expect.equals(2, map.length);
+
+  var count = 0;
+  map.forEach((key, value) {
+    if (key.isNaN) count++;
+  });
+  Expect.equals(2, count);
+
+  map.clear();
+  Expect.isTrue(map.isEmpty);
+}
diff --git a/tests/corelib/map_values_test.dart b/tests/corelib/map_values_test.dart
index 699a2cc..dee7e23 100644
--- a/tests/corelib/map_values_test.dart
+++ b/tests/corelib/map_values_test.dart
@@ -36,7 +36,7 @@
   Expect.isFalse(map5.values is List);
   Expect.equals(2, map5.values.length);
   Expect.isTrue(map5.values.first == 43 || map5.values.first == 500);
-  Expect.isTrue(map5.values.last == 43 || map5.values.first == 500);
+  Expect.isTrue(map5.values.last == 43 || map5.values.last == 500);
   Expect.notEquals(map5.values.first, map5.values.last);
 
   Expect.isTrue(map6.values is Iterable);
diff --git a/tests/html/async_test.dart b/tests/html/async_test.dart
new file mode 100644
index 0000000..1d7768f
--- /dev/null
+++ b/tests/html/async_test.dart
@@ -0,0 +1,78 @@
+library async_test;
+
+import '../../pkg/unittest/lib/unittest.dart';
+import '../../pkg/unittest/lib/html_config.dart';
+
+import 'dart:async';
+import 'dart:isolate';
+import 'dart:html';
+
+oneshotTimerIsolate() {
+  port.receive((msg, replyTo) {
+    expect(msg, 'START');
+    new Timer(const Duration(milliseconds: 10), () {
+      replyTo.send('DONE');
+    });
+  });
+}
+
+periodicTimerIsolate() {
+  port.receive((msg, replyTo) {
+    expect(msg, 'START');
+    int counter = 0;
+    new Timer.periodic(const Duration(milliseconds: 10), (timer) {
+      if (counter == 3) {
+        counter = 1024;
+        timer.cancel();
+        // Wait some more time to be sure callback won't be invoked any
+        // more.
+        new Timer(const Duration(milliseconds: 30), () {
+          replyTo.send('DONE');
+        });
+        return;
+      }
+      assert(counter < 3);
+      counter++;
+    });
+  });
+}
+
+cancellingIsolate() {
+  port.receive((msg, replyTo) {
+    expect(msg, 'START');
+    final oneshot = new Timer(const Duration(milliseconds: 30), () {
+      fail('Should never be invoked');
+    });
+    bool shot = false;
+    var periodic;
+    periodic = new Timer.periodic(const Duration(milliseconds: 10), (timer) {
+      expect(shot, isFalse);
+      shot = true;
+      expect(timer, same(periodic));
+      periodic.cancel();
+      oneshot.cancel();
+      // Wait some more time to be sure callbacks won't be invoked any
+      // more.
+      new Timer(const Duration(milliseconds: 50), () {
+        replyTo.send('DONE');
+      });
+    });
+  });
+}
+
+main() {
+  useHtmlConfiguration();
+
+  test('one shot timer in pure isolate', () {
+    expect(spawnFunction(oneshotTimerIsolate).call('START'),
+           completion('DONE'));
+  });
+  test('periodic timer in pure isolate', () {
+    expect(spawnFunction(periodicTimerIsolate).call('START'),
+           completion('DONE'));
+  });
+  test('cancellation in pure isolate', () {
+    expect(spawnFunction(cancellingIsolate).call('START'),
+           completion('DONE'));
+  });
+}
diff --git a/tests/html/dom_isolates_test.dart b/tests/html/dom_isolates_test.dart
index 7ce1386..39092bc 100644
--- a/tests/html/dom_isolates_test.dart
+++ b/tests/html/dom_isolates_test.dart
@@ -36,15 +36,19 @@
   useHtmlConfiguration();
 
   test('Simple DOM isolate test', () {
-    spawnDomFunction(childDomIsolate).then((sendPort) {
-      expect(sendPort.call('check'), completion('${window.location}'));
-    });
+    spawnDomFunction(childDomIsolate).then(expectAsync1(
+        (sendPort) {
+            expect(sendPort.call('check'), completion('${window.location}'));
+        }
+    ));
   });
 
   test('Nested DOM isolates test', () {
-    spawnDomFunction(trampolineIsolate).then((sendPort) {
-      expect(sendPort.call('check'), completion('${window.location}'));
-    });
+    spawnDomFunction(trampolineIsolate).then(expectAsync1(
+        (sendPort) {
+            expect(sendPort.call('check'), completion('${window.location}'));
+        }
+    ));
   });
 
   test('Spawn DOM isolate from pure', () {
@@ -52,6 +56,14 @@
            completion('${window.location}'));
   });
 
+  test('Spawn DOM by uri', () {
+    spawnDomUri('dom_isolates_test.dart.child_isolate.dart').then(expectAsync1(
+        (sendPort) {
+            expect(sendPort.call('check'), completion('${window.location}'));
+        }
+    ));
+  });
+
   test('Not function', () {
       expect(() => spawnDomFunction(42), throws);
   });
diff --git a/tests/html/dom_isolates_test.dart.child_isolate.dart b/tests/html/dom_isolates_test.dart.child_isolate.dart
new file mode 100644
index 0000000..31e97d2
--- /dev/null
+++ b/tests/html/dom_isolates_test.dart.child_isolate.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file
+
+import 'dart:html';
+import 'dart:isolate';
+
+main() {
+  port.receive((msg, replyTo) {
+    if (msg != 'check') {
+      replyTo.send('wrong msg: $msg');
+    }
+    replyTo.send('${window.location}');
+    port.close();
+  });
+}
diff --git a/tests/html/element_classes_test.dart b/tests/html/element_classes_test.dart
index 10b4111..f499916c 100644
--- a/tests/html/element_classes_test.dart
+++ b/tests/html/element_classes_test.dart
@@ -73,7 +73,7 @@
   });
 
   test('where', () {
-    expect(makeClassSet().where((c) => c.contains('a')).toSet(),
+    expect(makeClassSet().where((c) => c.contains('a')).toList(),
         orderedEquals(['bar', 'baz']));
   });
 
diff --git a/tests/html/html.status b/tests/html/html.status
index f8c058d..8d0d460 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -15,9 +15,11 @@
 [ $compiler == dart2js && $runtime == ie10 ]
 indexeddb_3_test: Pass, Timeout, Slow # Issue: http://dartbug.com/9437
 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
 
 # Layout tests are only supported on DRT.
 [ $runtime == ie9 || $runtime == ie10 || $runtime == safari || $runtime == ff || $runtime == chrome || $runtime == opera ]
@@ -26,7 +28,7 @@
 [ $runtime == chrome ]
 touchevent_test/supported: Fail
 
-[ $runtime == chrome && $system == windows ]
+[ $runtime == chrome && ($system == windows || $system == macos)]
 audiocontext_test: Skip # Issue 9566
 
 [$runtime == drt || $runtime == dartium || $runtime == chrome]
@@ -106,6 +108,7 @@
 
 [ $runtime == ie9 ]
 blob_constructor_test: Fail
+document_test/document: Pass, Fail # BUG(9654) need per-instance patching
 dom_constructors_test: Fail
 dromaeo_smoke_test: Skip #TODO(efortuna): investigating.
 element_test/click: Fail                # IE does not support firing this event.
diff --git a/tests/html/mouse_event_test.dart b/tests/html/mouse_event_test.dart
new file mode 100644
index 0000000..4be967b
--- /dev/null
+++ b/tests/html/mouse_event_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 mouse_event_test;
+import '../../pkg/unittest/lib/unittest.dart';
+import '../../pkg/unittest/lib/html_config.dart';
+import 'dart:html';
+
+main() {
+  useHtmlConfiguration();
+
+  test('relatedTarget', () {
+    var event = new MouseEvent('mouseout');
+    expect(event.relatedTarget, isNull);
+  });
+}
diff --git a/tests/html/node_test.dart b/tests/html/node_test.dart
index 7a2161a..7b4b17d 100644
--- a/tests/html/node_test.dart
+++ b/tests/html/node_test.dart
@@ -178,12 +178,6 @@
       expect(node.nodes.last, isHRElement);
     });
 
-    test('addLast', () {
-      var node = makeNode();
-      node.nodes.addLast(new Element.tag('hr'));
-      expect(node.nodes.last, isHRElement);
-    });
-
     test('iterator', () {
       var nodes = [];
       var node = makeNodeWithChildren();
diff --git a/tests/html/streams_test.dart b/tests/html/streams_test.dart
index 843e1c7..3d3f16c 100644
--- a/tests/html/streams_test.dart
+++ b/tests/html/streams_test.dart
@@ -87,13 +87,10 @@
       subscription.onData((_) {});
     }, throws);
 
-    expect(() {
-      subscription.pause();
-    }, throws);
-
-    expect(() {
-      subscription.resume();
-    }, throws);
+    // Calling these after a cancel does nothing.
+    subscription.cancel();
+    subscription.pause();
+    subscription.resume();
   });
 
   test('pause/resume', () {
@@ -131,10 +128,8 @@
     helper.pulse();
     expect(callCount, 3);
 
-    // Not paused.
-    expect(() {
-      subscription.resume();
-    }, throws);
+    // Not paused, but resuming once too often is ok.
+    subscription.resume();
   });
 
   test('onData', () {
@@ -199,6 +194,10 @@
     stream.reduce(null, (a, b) => null).then((_) {});
   });
 
+  test('fold', () {
+    stream.fold(null, (a, b) => null).then((_) {});
+  });
+
   test('contains', () {
     stream.contains((_) => true).then((_) {});
   });
diff --git a/tests/html/webgl_1_test.dart b/tests/html/webgl_1_test.dart
index 32c076a..098df06 100644
--- a/tests/html/webgl_1_test.dart
+++ b/tests/html/webgl_1_test.dart
@@ -6,52 +6,54 @@
 import '../../pkg/unittest/lib/unittest.dart';
 import '../../pkg/unittest/lib/html_individual_config.dart';
 import 'dart:html';
+import 'dart:web_gl';
+import 'dart:web_gl' as gl;
 
-// Test that WebGL is present in dart:html API
+// Test that WebGL is present in dart:web_gl API
 
 main() {
   useHtmlIndividualConfiguration();
 
   group('supported', () {
     test('supported', () {
-      expect(WebGLRenderingContext.supported, isTrue);
+      expect(RenderingContext.supported, isTrue);
     });
   });
 
   group('functional', () {
     test('unsupported fails', () {
       var canvas = new CanvasElement();
-      var gl = canvas.getContext3d();
-      if (WebGLRenderingContext.supported) {
-        expect(gl, isNotNull);
-        expect(gl, new isInstanceOf<WebGLRenderingContext>());
+      var context = canvas.getContext3d();
+      if (RenderingContext.supported) {
+        expect(context, isNotNull);
+        expect(context, new isInstanceOf<RenderingContext>());
       } else {
-        expect(gl, isNull);
+        expect(context, isNull);
       }
     });
 
-    if (WebGLRenderingContext.supported) {
+    if (RenderingContext.supported) {
       test('simple', () {
         var canvas = new CanvasElement();
-        var gl = canvas.getContext('experimental-webgl');
-        var shader = gl.createShader(WebGLRenderingContext.VERTEX_SHADER);
-        gl.shaderSource(shader, 'void main() { }');
-        gl.compileShader(shader);
-        var success =
-            gl.getShaderParameter(shader, WebGLRenderingContext.COMPILE_STATUS);
+        var context = canvas.getContext('experimental-webgl');
+        var shader = context.createShader(gl.VERTEX_SHADER);
+        context.shaderSource(shader, 'void main() { }');
+        context.compileShader(shader);
+        var success = context.getShaderParameter(shader, gl.COMPILE_STATUS);
         expect(success, isTrue);
       });
 
       test('getContext3d', () {
         var canvas = new CanvasElement();
-        var gl = canvas.getContext3d();
-        expect(gl, isNotNull);
-        expect(gl, new isInstanceOf<WebGLRenderingContext>());
+        var context = canvas.getContext3d();
+        expect(context, isNotNull);
+        expect(context, new isInstanceOf<RenderingContext>());
 
-        gl = canvas.getContext3d(depth: false);
-        expect(gl, isNotNull);
-        expect(gl, new isInstanceOf<WebGLRenderingContext>());
+        context = canvas.getContext3d(depth: false);
+        expect(context, isNotNull);
+        expect(context, new isInstanceOf<RenderingContext>());
       });
     }
   });
 }
+
diff --git a/tests/html/websocket_test.dart b/tests/html/websocket_test.dart
index 1738ece..752856c 100644
--- a/tests/html/websocket_test.dart
+++ b/tests/html/websocket_test.dart
@@ -24,5 +24,18 @@
         expect(socket, isWebSocket);
         }, expectation);
     });
+
+    if (WebSocket.supported) {
+      test('echo', () {
+        var socket = new WebSocket('ws://${window.location.host}/ws', 'chat');
+        socket.onOpen.first.then((_) {
+          socket.send('hello!');
+        });
+
+        return socket.onMessage.first.then((MessageEvent e) {
+          expect(e.data, 'hello!');
+        });
+      });
+    }
   });
 }
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index 5ac2302..13a11b8 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -3,14 +3,15 @@
 # BSD-style license that can be found in the LICENSE file.
 
 [ $compiler == dart2js && $csp && $runtime == drt && $unchecked ]
-mandel_isolate_stream_test: Fail, Crash # Bug in v8, http://dartbug.com/9407
-nested_spawn_stream2_test: Fail, Crash # Bug in v8, http://dartbug.com/9407
-count_test: Fail, Crash # Bug in v8, http://dartbug.com/9407
-count_stream_test: Fail, Crash # Bug in v8, http://dartbug.com/9407
-mandel_isolate_test: Fail, Crash # Bug in v8, http://dartbug.com/9407
-message_test: Fail, Crash # Bug in v8, http://dartbug.com/9407
-mint_maker_test: Fail, Crash # Bug in v8, http://dartbug.com/9407
-
+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.
@@ -34,6 +35,7 @@
 spawn_uri_test: Skip # uses a .js extension (not for dartium)
 spawn_uri_negative_test: Skip # ditto
 spawn_uri_vm_test: Skip # not implemented in dartium yet.
+spawn_uri_nested_vm_test: Skip # not implemented in dartium yet.
 spawn_uri_vm_negative_test: Skip
 
 [ $compiler == dartc ]
@@ -93,6 +95,7 @@
 spawn_uri_test: Skip # dart2js does not support spawnUri yet
 spawn_uri_negative_test: Skip # ditto
 spawn_uri_vm_test: Skip # test uses a ".dart" suffix that only works in vm.
+spawn_uri_nested_vm_test: Skip # test uses a ".dart" suffix that only works in vm.
 spawn_uri_vm_negative_test: Skip # ditto above.
 isolate2_negative_test: Fail, Pass # Issue 7769
 
@@ -101,6 +104,7 @@
 spawn_uri_test: Fail, OK # loading another file is not supported in d8
 spawn_uri_vm_negative_test: Skip # ditto above.
 spawn_uri_vm_test: Skip # test uses a ".dart" suffix that only works in vm.
+spawn_uri_nested_vm_test: Skip # test uses a ".dart" suffix that only works in vm.
 
 [ $compiler == dart2js && $runtime == none ]
 *: Fail, Pass # TODO(ahe): Triage these tests.
diff --git a/tests/isolate/spawn_uri_nested_child1_vm_isolate.dart b/tests/isolate/spawn_uri_nested_child1_vm_isolate.dart
new file mode 100644
index 0000000..e1e709d
--- /dev/null
+++ b/tests/isolate/spawn_uri_nested_child1_vm_isolate.dart
@@ -0,0 +1,25 @@
+// 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.
+
+// Example of nested spawning of isolates from a URI
+// Note: the following comment is used by test.dart to additionally compile the
+// other isolate's code.
+library NestedSpawnUriChild1Library;
+import 'dart:isolate';
+import '../../pkg/unittest/lib/unittest.dart';
+
+main() {
+  ReceivePort port2 = new ReceivePort();
+  port2.receive((msg, SendPort replyTo) {
+    port2.close();
+  });
+
+  SendPort s = spawnUri('spawn_uri_nested_child2_vm_isolate.dart');
+  s.send('hi', port2.toSendPort());
+
+  port.receive((message, SendPort replyTo) {
+    var result = message;
+    replyTo.send(result);
+  });
+}
diff --git a/tests/isolate/spawn_uri_nested_child2_vm_isolate.dart b/tests/isolate/spawn_uri_nested_child2_vm_isolate.dart
new file mode 100644
index 0000000..87efa5b
--- /dev/null
+++ b/tests/isolate/spawn_uri_nested_child2_vm_isolate.dart
@@ -0,0 +1,11 @@
+// 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.
+
+// Child isolate code to be spawned from a URI to this file.
+library NestedSpawnUriChild2Library;
+import 'dart:isolate';
+
+void main() {
+  port.receive((msg, reply) => reply.send('re: $msg'));
+}
diff --git a/tests/isolate/spawn_uri_nested_vm_test.dart b/tests/isolate/spawn_uri_nested_vm_test.dart
new file mode 100644
index 0000000..e292789
--- /dev/null
+++ b/tests/isolate/spawn_uri_nested_vm_test.dart
@@ -0,0 +1,19 @@
+// 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.
+
+// Example of nested spawning of isolates from a URI
+// Note: the following comment is used by test.dart to additionally compile the
+// other isolate's code.
+// OtherScripts=spawn_uri_nested_child1_vm_isolate.dart, spawn_uri_nested_child2_vm_isolate.dart
+library NestedSpawnUriLibrary;
+import 'dart:isolate';
+import '../../pkg/unittest/lib/unittest.dart';
+
+main() {
+  test('isolate fromUri - nested send and reply', () {
+    var port = spawnUri('spawn_uri_nested_child1_vm_isolate.dart');
+  
+    port.call([1, 2]).then((result) => print(result));
+  });
+}
diff --git a/tests/language/call_property_test.dart b/tests/language/call_property_test.dart
new file mode 100644
index 0000000..27a658d
--- /dev/null
+++ b/tests/language/call_property_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.
+
+// Test that a class with a [call] property does not implement [Function] or
+// a typedef of function type.
+
+class Call {
+  int get call => 0;
+}
+
+typedef void F();
+
+main() {
+  Expect.isFalse(new Call() is Function);
+  Expect.isFalse(new Call() is F);
+}
\ No newline at end of file
diff --git a/tests/language/closure_type_variable_test.dart b/tests/language/closure_type_variable_test.dart
new file mode 100644
index 0000000..4f73267
--- /dev/null
+++ b/tests/language/closure_type_variable_test.dart
@@ -0,0 +1,16 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that the type argument is available inside a closure.
+
+class A<T> {
+  foo() {
+    bar() => T;
+    return bar();
+  }
+}
+
+main() {
+  Expect.equals(new A<int>().foo(), int);
+}
diff --git a/tests/language/f_bounded_quantification3_test.dart b/tests/language/f_bounded_quantification3_test.dart
new file mode 100644
index 0000000..6c6f81c
--- /dev/null
+++ b/tests/language/f_bounded_quantification3_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test for F-Bounded Quantification.
+
+class FBound1<F1 extends FBound1<F1, F2>, F2 extends FBound2<F1, F2>> {
+  Test() {
+    new FBound1<F1, F2>();
+    new FBound2<F1, F2>();
+  }
+}
+
+class FBound2<F1 extends FBound1<F1, F2>, F2 extends FBound2<F1, F2>> {
+  Test() {
+    new FBound1<F1, F2>();
+    new FBound2<F1, F2>();
+  }
+}
+
+class Bar extends FBound1<Bar, Baz> {}
+
+class Baz extends FBound2<Bar, Baz> {}
+
+main() {
+  new FBound1<Bar, Baz>().Test();
+  new FBound2<Bar, Baz>().Test();
+}
diff --git a/tests/language/inline_super_field_lib.dart b/tests/language/inline_super_field_lib.dart
new file mode 100644
index 0000000..dbc3ea6
--- /dev/null
+++ b/tests/language/inline_super_field_lib.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library inline_super_field_lib;
+
+// The comment is inserted to ensure that the offset of [bar] is not within
+// the length of the [:inline_super_field_test.dart] script.
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+var i = 0;
+
+class M1 {
+  final bar = ++i;
+}
diff --git a/tests/language/inline_super_field_test.dart b/tests/language/inline_super_field_test.dart
new file mode 100644
index 0000000..2daa34d
--- /dev/null
+++ b/tests/language/inline_super_field_test.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that source maps use the correct compilation unit when super class
+// fields from another compilation unit are inlined.
+
+library inline_super_field_test;
+
+import "inline_super_field_lib.dart";
+
+class S {
+}
+
+class C extends S with M1 { }
+
+void main() {
+  var c = new C();
+  Expect.equals(1, c.bar);
+}
\ No newline at end of file
diff --git a/tests/language/inlined_throw_test.dart b/tests/language/inlined_throw_test.dart
new file mode 100644
index 0000000..1b1afe1
--- /dev/null
+++ b/tests/language/inlined_throw_test.dart
@@ -0,0 +1,179 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Dart test program to test check that we don't fail to compile when an
+// inlinable method contains a throw.
+
+var x = false;
+
+bool called;
+
+bool callMeTrue() {
+  called = true;
+  return true;
+}
+
+bool callMeFalse() {
+  called = true;
+  return false;
+}
+
+void callMe() {
+  called = true;
+}
+
+testCallThenThrow(fn) {
+  called = false;
+  Expect.throws(() => fn());
+  Expect.isTrue(called);
+}
+
+testCall(fn) {
+  called = false;
+  fn();
+  Expect.isTrue(called);
+}
+
+testNoThrow(fn) {
+  called = false;
+  Expect.throws(() => fn());
+  Expect.isFalse(called);
+}
+
+kast(x) {
+  throw x;
+}
+
+ternary(a, b, c) {
+  if (x == 2) throw "ternary";
+}
+
+hest() => kast("hest");
+hest2() { return kast("hest2"); }
+foo() => true || kast("foo");
+bar() => false || kast("foo");
+barc() => callMeTrue() || kast("foo");
+barCallThrow() => callMeFalse() || kast("foo");
+baz(x) => x ? kast("baz") : 0;
+bazc() => callMeFalse() ? kast("baz") : 0;
+bazCallThrow() => callMeTrue() ? kast("baz") : 0;
+fizz(x) => x ? 0 : kast("baz");
+fizzc() => callMeTrue() ? 0 : kast("baz");
+fizzCallThrow() => callMeFalse() ? 0 : kast("baz");
+fuzz() => kast("baz") ? 0 : 1;
+farce() => !kast("baz");
+unary() => ~(kast("baz"));
+boo() {
+  callMe();
+  x = kast("boo");
+}
+yo() {
+  throw kast("yo");
+}
+hoo() {
+  x[kast("hoo")] = 0;
+  x[kast("hoo")];
+  kast("hoo").x = 0;
+  kast("hoo").x;
+}
+
+switcheroo() {
+  switch (kast("switcheroo")) {
+    case 0:
+      boo();
+  }
+}
+
+interpole() => "inter${kast('tada!')}pole";
+interpoleCallThrow() => "inter${callMeTrue()}...${kast('tada!')}pole";
+
+call1() => ternary(0, kast("call1"), 1);
+call2() => ternary(kast("call2"), 0, 1);
+call3() => ternary(0, 1, kast("call3"));
+call1c() => ternary(callMe(), kast("call1"), 1);
+call3c() => ternary(callMeTrue(), 1, kast("call3"));
+call4c() => ternary(0, callMeTrue(), kast("call3"));
+
+sendSet() {
+  var x = kast("sendSet");
+}
+
+sendSetCallThrow() {
+  var x = callMe(), y = kast("sendSet");
+}
+
+isSend() => kast("isSend") is int;
+
+vile() {
+  while (kast("vile")) {
+    callMe();
+  }
+}
+
+dovile() {
+  var x = 0;
+  do {
+    callMe();
+    x = 1;
+  } while (kast("vile"));
+  print(x);
+}
+
+dovileBreak() {
+  var x = 0;
+  do {
+    callMe();
+    x = 1;
+    break;
+  } while (kast("vile"));
+  return(x);
+}
+
+dovileContinue() {
+  var x = 0;
+  do {
+    callMe();
+    x = 1;
+    continue;
+  } while (kast("vile"));
+  return(x);
+}
+
+main() {
+  Expect.throws(hest);
+  Expect.throws(hest2);
+  foo();
+  Expect.throws(bar);
+  testCall(barc);
+  testCallThenThrow(barCallThrow);
+  Expect.equals(0, baz(false));
+  Expect.throws(() => baz(true));
+  testCall(bazc);
+  testCallThenThrow(bazCallThrow);
+  Expect.throws(() => fizz(false));
+  testCall(fizzc);
+  testCallThenThrow(fizzCallThrow);
+  Expect.throws(fuzz);
+  Expect.throws(farce);
+  Expect.throws(unary);
+  testCallThenThrow(boo);
+  Expect.throws(yo);
+  Expect.throws(hoo);
+  Expect.throws(switcheroo);
+  Expect.throws(interpole);
+  testCallThenThrow(interpoleCallThrow);
+  Expect.throws(call1);
+  Expect.throws(call2);
+  Expect.throws(call3);
+  testCallThenThrow(call1c);
+  testCallThenThrow(call3c);
+  testCallThenThrow(call4c);
+  Expect.throws(sendSet);
+  testCallThenThrow(sendSetCallThrow);
+  Expect.throws(isSend);
+  testNoThrow(vile);
+  testCallThenThrow(dovile);
+  testCall(dovileBreak);
+  testCallThenThrow(dovileContinue);
+}
diff --git a/tests/language/issue9602_other.dart b/tests/language/issue9602_other.dart
new file mode 100644
index 0000000..a189b77
--- /dev/null
+++ b/tests/language/issue9602_other.dart
@@ -0,0 +1,10 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test case for http://dartbug.com/9602
+library issue9602_other;
+
+class M {
+  var _field;
+}
diff --git a/tests/language/issue9602_test.dart b/tests/language/issue9602_test.dart
new file mode 100644
index 0000000..88ef87a
--- /dev/null
+++ b/tests/language/issue9602_test.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test case for http://dartbug.com/9602
+library issue9602;
+import 'issue9602_other.dart';
+
+class C extends Object with M {
+}
+
+main() {
+  new C();
+}
diff --git a/tests/language/issue9664_test.dart b/tests/language/issue9664_test.dart
new file mode 100644
index 0000000..b8b3c2d
--- /dev/null
+++ b/tests/language/issue9664_test.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for http://dartbug.com/9664
+
+main() {
+  while (true ? true : true) break;
+}
diff --git a/tests/language/language.status b/tests/language/language.status
index c0234d1..f937659 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -15,7 +15,11 @@
 # 2) File a bug on each architecture for the failure due to the language change.
 # 3) Update the language/src directory with the updated test.
 
+[ $compiler == dart2dart ]
+closure_type_variable_test: Fail # Type variable used as expression (dartbug.com/6282)
+
 [ $compiler == none ]
+closure_type_variable_test: Fail # Type variable used as expression (dartbug.com/6282)
 built_in_identifier_prefix_test: Fail # http://dartbug.com/6970
 library_juxtaposition_test: Fail # Issue 6877
 gc_test: Pass, Fail # Issue 1487
diff --git a/tests/language/private_mixin2_test.dart b/tests/language/private_mixin2_test.dart
new file mode 100644
index 0000000..f01a2c9
--- /dev/null
+++ b/tests/language/private_mixin2_test.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Dart test for testing access to private fields on mixins.
+
+library private_mixin2;
+
+import 'private_other_mixin2.lib';
+
+void main() {
+  var c1 = new C1();
+  Expect.throws(() => c1._field, (e) => e is NoSuchMethodError);
+  Expect.throws(() => c1.field, (e) => e is NoSuchMethodError);
+
+  var c2 = new C2();
+  Expect.throws(() => c2._field, (e) => e is NoSuchMethodError);
+  Expect.equals(42, c2.field);
+}
\ No newline at end of file
diff --git a/tests/language/private_other_mixin2.lib b/tests/language/private_other_mixin2.lib
new file mode 100644
index 0000000..c23e7b5
--- /dev/null
+++ b/tests/language/private_other_mixin2.lib
@@ -0,0 +1,15 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Dart test for testing access to private fields on mixins.
+
+library private_mixin2_other;
+
+class C1 {
+  int _field = 42;
+}
+
+class C2 extends Object with C1 {
+  int get field => _field;
+}
\ No newline at end of file
diff --git a/tests/language/range_analysis_test.dart b/tests/language/range_analysis_test.dart
index 8a4a59f..a8b0203 100644
--- a/tests/language/range_analysis_test.dart
+++ b/tests/language/range_analysis_test.dart
@@ -24,8 +24,8 @@
 // Check that range analysis does not erroneously remove overflow check.
 test2() {
   var width = 1073741823;
-  print(foo(width - 5000, width - 1));
-  print(foo(width - 5000, width));
+  Expect.equals(width - 1, foo(width - 5000, width - 1));
+  Expect.equals(width, foo(width - 5000, width));
 }
 
 foo(n, w) {
@@ -37,7 +37,83 @@
   return x;
 }
 
+
+// Test detection of unsatisfiable constraints.
+f(a, b) {
+  if (a < b) {
+    if (a > b) {
+      throw "unreachable";
+    }
+    return 2;
+  }
+  return 3;
+}
+
+f1(a, b) {
+  if (a < b) {
+    if (a > b - 1) {
+      throw "unreachable";
+    }
+    return 2;
+  }
+  return 3;
+}
+
+f2(a, b) {
+  if (a < b) {
+    if (a > b - 2) {
+      return 2;
+    }
+    throw "unreachable";
+  }
+  return 3;
+}
+
+g() {
+  var i;
+  for (i = 0; i < 10; i++) {
+    if (i < 0) throw "unreachable";
+  }
+  return i;
+}
+
+h(n) {
+  var i;
+  for (i = 0; i < n; i++) {
+    if (i < 0) throw "unreachable";
+    var j = i - 1;
+    if (j >= n - 1) throw "unreachable"; 
+  }
+  return i;
+}
+
+
+test3() {
+  test_fun(fun) {
+    Expect.equals(2, fun(0, 1));
+    Expect.equals(3, fun(0, 0));
+    for (var i = 0; i < 2000; i++) fun(0, 1);
+    Expect.equals(2, fun(0, 1));
+    Expect.equals(3, fun(0, 0));
+  }
+  
+  test_fun(f);
+  test_fun(f1);
+  test_fun(f2);
+
+  Expect.equals(10, g());
+  for (var i = 0; i < 2000; i++) g();
+  Expect.equals(10, g());
+
+
+  Expect.equals(10, h(10));
+  for (var i = 0; i < 2000; i++) h(10);
+  Expect.equals(10, h(10));
+}
+
+
 main() {
   test1();
   test2();
-}
\ No newline at end of file
+  test3();
+}
diff --git a/tests/language/type_cast_vm_test.dart b/tests/language/type_cast_vm_test.dart
index 22e3437..d61f036 100644
--- a/tests/language/type_cast_vm_test.dart
+++ b/tests/language/type_cast_vm_test.dart
@@ -5,6 +5,15 @@
 //
 // Dart test program testing type casts.
 
+checkTopFunction(String expected, StackTrace stacktrace) {
+  var topLine = stacktrace.toString().split("\n")[0];
+  int startPos = topLine.lastIndexOf("/");
+  int endPos = topLine.lastIndexOf(")");
+  String subs = topLine.substring(startPos + 1, endPos);
+  Expect.equals(expected, subs);
+}
+
+
 // Test that the initializer expression gets properly skipped.
 bool b = "foo" as double;
 
@@ -13,20 +22,13 @@
     int result = 0;
     try {
       var i = "hello" as int;  // Throws a CastError
-    } on TypeError catch (error) {
+    } on TypeError catch (error, stacktrace) {
       result = 1;
       Expect.isTrue(error is CastError);
       Expect.equals("int", error.dstType);
       Expect.equals("String", error.srcType);
       Expect.equals("type cast", error.dstName);
-      int pos = error.url.lastIndexOf("/", error.url.length);
-      if (pos == -1) {
-        pos = error.url.lastIndexOf("\\", error.url.length);
-      }
-      String subs = error.url.substring(pos + 1, error.url.length);
-      Expect.equals("type_cast_vm_test.dart", subs);
-      Expect.equals(15, error.line);
-      Expect.equals(23, error.column);
+      checkTopFunction("type_cast_vm_test.dart:24:23", stacktrace);
     }
     return result;
   }
@@ -55,20 +57,13 @@
     }
     try {
       int i = f("hello" as int);  // Throws a CastError
-    } on TypeError catch (error) {
+    } on TypeError catch (error, stacktrace) {
       result = 1;
       Expect.isTrue(error is CastError);
       Expect.equals("int", error.dstType);
       Expect.equals("String", error.srcType);
       Expect.equals("type cast", error.dstName);
-      int pos = error.url.lastIndexOf("/", error.url.length);
-      if (pos == -1) {
-        pos = error.url.lastIndexOf("\\", error.url.length);
-      }
-      String subs = error.url.substring(pos + 1, error.url.length);
-      Expect.equals("type_cast_vm_test.dart", subs);
-      Expect.equals(57, error.line);
-      Expect.equals(25, error.column);
+      checkTopFunction("type_cast_vm_test.dart:59:25", stacktrace);
     }
     return result;
   }
@@ -80,43 +75,30 @@
     }
     try {
       int i = f("hello");
-    } on TypeError catch (error) {
+    } on TypeError catch (error, stacktrace) {
       result = 1;
       Expect.isTrue(error is CastError);
       Expect.equals("int", error.dstType);
       Expect.equals("String", error.srcType);
       Expect.equals("type cast", error.dstName);
-      int pos = error.url.lastIndexOf("/", error.url.length);
-      if (pos == -1) {
-        pos = error.url.lastIndexOf("\\", error.url.length);
-      }
-      String subs = error.url.substring(pos + 1, error.url.length);
-      Expect.equals("type_cast_vm_test.dart", subs);
-      Expect.equals(79, error.line);
-      Expect.equals(16, error.column);
+      checkTopFunction("type_cast_vm_test.dart:74:16", stacktrace);
     }
     return result;
   }
 
   static var field = "hello";
+
   static testField() {
     int result = 0;
     Expect.equals(5, (field as String).length);
     try {
       field as int;  // Throws a CastError
-    } on TypeError catch (error) {
+    } on TypeError catch (error, stacktrace) {
       result = 1;
       Expect.equals("int", error.dstType);
       Expect.equals("String", error.srcType);
       Expect.equals("type cast", error.dstName);
-      int pos = error.url.lastIndexOf("/", error.url.length);
-      if (pos == -1) {
-        pos = error.url.lastIndexOf("\\", error.url.length);
-      }
-      String subs = error.url.substring(pos + 1, error.url.length);
-      Expect.equals("type_cast_vm_test.dart", subs);
-      Expect.equals(106, error.line);
-      Expect.equals(13, error.column);
+      checkTopFunction("type_cast_vm_test.dart:95:13", stacktrace);
     }
     return result;
   }
@@ -129,19 +111,12 @@
     anyFunction = null as Function;  // No error.
     try {
       var i = f as int;  // Throws a TypeError if type checks are enabled.
-    } on TypeError catch (error) {
+    } on TypeError catch (error, stacktrace) {
       result = 1;
       Expect.equals("int", error.dstType);
       Expect.equals("() => dynamic", error.srcType);
       Expect.equals("type cast", error.dstName);
-      int pos = error.url.lastIndexOf("/", error.url.length);
-      if (pos == -1) {
-        pos = error.url.lastIndexOf("\\", error.url.length);
-      }
-      String subs = error.url.substring(pos + 1, error.url.length);
-      Expect.equals("type_cast_vm_test.dart", subs);
-      Expect.equals(131, error.line);
-      Expect.equals(17, error.column);
+      checkTopFunction("type_cast_vm_test.dart:113:17", stacktrace);
     }
     return result;
   }
diff --git a/tests/language/unconditional_break.dart b/tests/language/unconditional_break.dart
new file mode 100644
index 0000000..63ec511
--- /dev/null
+++ b/tests/language/unconditional_break.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.
+
+// Test to ensure that we get don't exceptions in the SSA verifier when
+// generating phi for the return value of an inlined function that contains a
+// loop that always breaks.
+doWhileBreak() {
+  do {
+    break;
+  } while (true);
+}
+
+main() {
+  doWhileBreak();
+}
diff --git a/tests/lib/async/slow_consumer2_test.dart b/tests/lib/async/slow_consumer2_test.dart
index a239a91..25dbf95 100644
--- a/tests/lib/async/slow_consumer2_test.dart
+++ b/tests/lib/async/slow_consumer2_test.dart
@@ -19,10 +19,15 @@
   final int bufferSize;
   final List bufferedData = [];
   int usedBufferSize = 0;
+  int finalCount;
 
   SlowConsumer(int this.bytesPerSecond, int this.bufferSize);
 
   Future consume(Stream stream) {
+    return addStream(stream).then((_) => close());
+  }
+
+  Future addStream(Stream stream) {
     Completer result = new Completer();
     var subscription;
     subscription = stream.listen(
@@ -44,9 +49,16 @@
           });
         }
       },
-      onDone: () { result.complete(receivedCount); });
+      onDone: () {
+        finalCount = receivedCount;
+        result.complete(receivedCount);
+      });
     return result.future;
   }
+
+  Future close() {
+    return new Future.immediate(finalCount);
+  }
 }
 
 class DataProvider {
diff --git a/tests/lib/async/slow_consumer3_test.dart b/tests/lib/async/slow_consumer3_test.dart
index 6def12f..8dde399 100644
--- a/tests/lib/async/slow_consumer3_test.dart
+++ b/tests/lib/async/slow_consumer3_test.dart
@@ -19,10 +19,15 @@
   final int bufferSize;
   final List bufferedData = [];
   int usedBufferSize = 0;
+  int finalCount;
 
   SlowConsumer(int this.bytesPerSecond, int this.bufferSize);
 
   Future consume(Stream stream) {
+    return addStream(stream).then((_) => close());
+  }
+
+  Future addStream(Stream stream) {
     Completer result = new Completer();
     var subscription;
     subscription = stream.listen(
@@ -44,9 +49,16 @@
           });
         }
       },
-      onDone: () { result.complete(receivedCount); });
+      onDone: () {
+        finalCount = receivedCount;
+        result.complete(receivedCount);
+      });
     return result.future;
   }
+
+  Future close() {
+    return new Future.immediate(finalCount);
+  }
 }
 
 Stream<List> dataGenerator(int bytesTotal, int chunkSize) {
diff --git a/tests/lib/async/slow_consumer_test.dart b/tests/lib/async/slow_consumer_test.dart
index 9bc05bf..b8ae7f9 100644
--- a/tests/lib/async/slow_consumer_test.dart
+++ b/tests/lib/async/slow_consumer_test.dart
@@ -16,10 +16,15 @@
 class SlowConsumer extends StreamConsumer {
   var current = new Future.immediate(0);
   final int bytesPerSecond;
+  int finalCount;
 
   SlowConsumer(int this.bytesPerSecond);
 
   Future consume(Stream stream) {
+    return addStream(stream).then((_) => close());
+  }
+
+  Future addStream(Stream stream) {
     bool done = false;
     Completer completer = new Completer();
     var subscription;
@@ -40,10 +45,17 @@
         },
       onDone: () {
         done = true;
-        current.then((count) { completer.complete(count); });
+        current.then((count) {
+          finalCount = count;
+          completer.complete(count);
+        });
       });
     return completer.future;
   }
+
+  Future close() {
+    return new Future.immediate(finalCount);
+  }
 }
 
 class DataProvider {
diff --git a/tests/lib/async/stream_controller_async_test.dart b/tests/lib/async/stream_controller_async_test.dart
index 2e329d3..98fd749 100644
--- a/tests/lib/async/stream_controller_async_test.dart
+++ b/tests/lib/async/stream_controller_async_test.dart
@@ -11,11 +11,11 @@
 import 'event_helper.dart';
 
 testController() {
-  // Test reduce
-  test("StreamController.reduce", () {
+  // Test fold
+  test("StreamController.fold", () {
     StreamController c = new StreamController.broadcast();
     Stream stream = c.stream;
-    stream.reduce(0, (a,b) => a + b)
+    stream.fold(0, (a,b) => a + b)
      .then(expectAsync1((int v) {
         Expect.equals(42, v);
     }));
@@ -24,10 +24,10 @@
     c.close();
   });
 
-  test("StreamController.reduce throws", () {
+  test("StreamController.fold throws", () {
     StreamController c = new StreamController.broadcast();
     Stream stream = c.stream;
-    stream.reduce(0, (a,b) { throw "Fnyf!"; })
+    stream.fold(0, (a,b) { throw "Fnyf!"; })
      .catchError(expectAsync1((e) { Expect.equals("Fnyf!", e.error); }));
     c.add(42);
   });
@@ -50,20 +50,20 @@
 }
 
 testSingleController() {
-  test("Single-subscription StreamController.reduce", () {
+  test("Single-subscription StreamController.fold", () {
     StreamController c = new StreamController();
     Stream stream = c.stream;
-    stream.reduce(0, (a,b) => a + b)
+    stream.fold(0, (a,b) => a + b)
     .then(expectAsync1((int v) { Expect.equals(42, v); }));
     c.add(10);
     c.add(32);
     c.close();
   });
 
-  test("Single-subscription StreamController.reduce throws", () {
+  test("Single-subscription StreamController.fold throws", () {
     StreamController c = new StreamController();
     Stream stream = c.stream;
-    stream.reduce(0, (a,b) { throw "Fnyf!"; })
+    stream.fold(0, (a,b) { throw "Fnyf!"; })
             .catchError(expectAsync1((e) { Expect.equals("Fnyf!", e.error); }));
     c.add(42);
   });
@@ -449,6 +449,7 @@
   testFuture("min", (s, act) => s.min((a, b) => act(b)));
   testFuture("max", (s, act) => s.max((a, b) => act(b)));
   testFuture("reduce", (s, act) => s.reduce(0, (a,b) => act(b)));
+  testFuture("fold", (s, act) => s.fold(0, (a,b) => act(b)));
 }
 
 main() {
diff --git a/tests/lib/async/stream_periodic4_test.dart b/tests/lib/async/stream_periodic4_test.dart
index 518673f..5b6eda3 100644
--- a/tests/lib/async/stream_periodic4_test.dart
+++ b/tests/lib/async/stream_periodic4_test.dart
@@ -8,32 +8,54 @@
 import "dart:async";
 import '../../../pkg/unittest/lib/unittest.dart';
 
-watchMs(Stopwatch watch) {
-  int microsecs = watch.elapsedMicroseconds;
-  // Give it some slack. The Stopwatch is more precise than the timers. This
-  // means that we sometimes get 3995 microseconds instead of 4+ milliseconds.
-  // 200 microseconds should largely account for this discrepancy.
-  return (microsecs + 200) ~/ 1000;
+int iteration = 0;
+
+void runTest(period, maxElapsed, pauseDuration) {
+  print("Iteration: $iteration");
+  var myIteration = iteration;
+  iteration++;
+
+  Function done = expectAsync0(() { });
+
+  Stopwatch watch = new Stopwatch()..start();
+  Stream stream = new Stream.periodic(period, (x) => x);
+  var subscription;
+  subscription = stream.take(5).listen((i) {
+    if (watch.elapsed > maxElapsed) {
+      // Test failed in this configuration. Try with more time (or give up
+      // if we reached an unreasonable maxElapsed).
+      if (maxElapsed > const Duration(seconds: 2)) {
+        // Give up.
+        expect(true, false);
+      } else {
+        subscription.cancel();
+        print("Cancelling subscription of iteration: $myIteration");
+        // Call 'done' ourself, since it won't be invoked in the onDone handler.
+        runTest(period * 2, maxElapsed * 2, pauseDuration * 2);
+        print("Invoking done of iteration inside listener: $myIteration");
+        done();
+        return;
+      }
+    }
+    watch.reset();
+    if (i == 2) {
+      subscription.pause();
+      watch.stop();
+      new Timer(pauseDuration, () {
+        watch.start();
+        subscription.resume();
+      });
+    }
+  }, onDone: () {
+    print("Invoking done of iteration: $myIteration");
+    done();
+  });
 }
 
 main() {
   test("stream-periodic4", () {
-    Stopwatch watch = new Stopwatch()..start();
-    Stream stream = new Stream.periodic(const Duration(milliseconds: 5),
-                                        (x) => x);
-    var subscription;
-    subscription = stream.take(10).listen((i) {
-      int ms = watchMs(watch);
-      expect(ms, lessThan(100));
-      watch.reset();
-      if (i == 2) {
-        subscription.pause();
-        watch.stop();
-        new Timer(const Duration(milliseconds: 150), () {
-          watch.start();
-          subscription.resume();
-        });
-      }
-    }, onDone: expectAsync0(() { }));
+    runTest(const Duration(milliseconds: 2),
+            const Duration(milliseconds: 8),
+            const Duration(milliseconds: 10));
   });
 }
diff --git a/tests/lib/crypto/base64_test.dart b/tests/lib/crypto/base64_test.dart
index 0070a50..ff53c9e 100644
--- a/tests/lib/crypto/base64_test.dart
+++ b/tests/lib/crypto/base64_test.dart
@@ -6,12 +6,17 @@
 library base64_test;
 
 import 'dart:crypto';
+import 'dart:math';
 
 // Data from http://tools.ietf.org/html/rfc4648.
 var inputs =
-    const [ '', 'f', 'fo', 'foo', 'foob', 'fooba', 'foobar' ];
+    const [ '', 'f', 'fo', 'foo', 'foob', 'fooba', 'foobar'];
 var results =
-    const [ '', 'Zg==', 'Zm8=', 'Zm9v', 'Zm9vYg==', 'Zm9vYmE=', 'Zm9vYmFy' ];
+    const [ '', 'Zg==', 'Zm8=', 'Zm9v', 'Zm9vYg==', 'Zm9vYmE=', 'Zm9vYmFy'];
+
+// Test data with only zeroes.
+var inputsWithZeroes = [[0, 0, 0], [0, 0], [0], []];
+var resultsWithZeroes = ['AAAA', 'AAA=', 'AA==', ''];
 
 var longLine =
     "Man is distinguished, not only by his reason, but by this singular "
@@ -43,13 +48,106 @@
     "ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm"
     "5hbCBwbGVhc3VyZS4=";
 
-void main() {
+testEncoder() {
   for (var i = 0; i < inputs.length; i++) {
-    var enc = CryptoUtils.bytesToBase64(inputs[i].codeUnits);
-    Expect.equals(results[i], enc);
+    Expect.equals(results[i], CryptoUtils.bytesToBase64(inputs[i].codeUnits));
   }
-  Expect.equals(CryptoUtils.bytesToBase64(longLine.codeUnits, 76),
-                longLineResult);
+  for (var i = 0; i < inputsWithZeroes.length; i++) {
+    Expect.equals(resultsWithZeroes[i],
+        CryptoUtils.bytesToBase64(inputsWithZeroes[i]));
+  }
+  Expect.equals(
+      CryptoUtils.bytesToBase64(longLine.codeUnits, addLineSeparator : true),
+      longLineResult);
   Expect.equals(CryptoUtils.bytesToBase64(longLine.codeUnits),
                 longLineResultNoBreak);
 }
+
+testDecoder() {
+  for (var i = 0; i < results.length; i++) {
+    Expect.equals(inputs[i],
+        new String.fromCharCodes(CryptoUtils.base64StringToBytes(results[i])));
+  }
+  for (var i = 0; i < resultsWithZeroes.length; i++) {
+    Expect.listEquals(inputsWithZeroes[i],
+        CryptoUtils.base64StringToBytes(resultsWithZeroes[i]));
+  }
+  var longLineDecoded = CryptoUtils.base64StringToBytes(longLineResult);
+  Expect.equals(new String.fromCharCodes(longLineDecoded), longLine);
+  var longLineResultNoBreak = CryptoUtils.base64StringToBytes(longLineResult);
+  Expect.equals(new String.fromCharCodes(longLineResultNoBreak), longLine);
+}
+
+testDecoderForMalformedInput() {
+  Expect.throws(() {
+      CryptoUtils.base64StringToBytes('AB~', ignoreInvalidCharacters: false);
+    }, (e) => e is FormatException);
+
+  Expect.throws(() {
+    CryptoUtils.base64StringToBytes('A');
+  }, (e) => e is FormatException);
+
+  Expect.listEquals('f'.codeUnits,
+      CryptoUtils.base64StringToBytes('~~Zg==@@@',
+          ignoreInvalidCharacters: true));
+}
+
+testUrlSafeEncodeDecode() {
+  List<int> decUrlSafe = CryptoUtils.base64StringToBytes('-_A=');
+  List<int> dec = CryptoUtils.base64StringToBytes('+/A=');
+  Expect.listEquals(decUrlSafe, dec);
+  Expect.equals('-_A=', CryptoUtils.bytesToBase64(dec, urlSafe: true));
+  Expect.equals('+/A=', CryptoUtils.bytesToBase64(dec));
+}
+
+testEncodeDecodeLists() {
+  for (int i = 0; i < 10; i++) {
+    for (int j = 0; j < 256 - i; j++) {
+      List<int> x = new List<int>(i);
+      for (int k = 0; k < i; k++) {
+        x[k] = j;
+      }
+      var enc = CryptoUtils.bytesToBase64(x);
+      var dec = CryptoUtils.base64StringToBytes(enc);
+      Expect.listEquals(x, dec);
+    }
+  }
+}
+
+fillRandom(List<int> l) {
+  var random = new Random(0xBABE);
+  for(int j=0; j < l.length; j++) {
+    l[j] = random.nextInt(255);
+  }
+}
+
+testPerformance() {
+    var l = new List<int>(1024);
+    var iters = 5000;
+    fillRandom(l);
+    String enc;
+    var w = new Stopwatch()..start();
+    for( int i = 0; i < iters; ++i ) {
+      enc = CryptoUtils.bytesToBase64(l);
+    }
+    int ms = w.elapsedMilliseconds;
+    int perSec = (iters * l.length) * 1000 ~/ ms;
+    // print("Encode 1024 bytes for $iters times: $ms msec. $perSec b/s");
+    w..reset();
+    for( int i = 0; i < iters; ++i ) {
+      CryptoUtils.base64StringToBytes(enc);
+    }
+    ms = w.elapsedMilliseconds;
+    perSec = (iters * l.length) * 1000 ~/ ms;
+    // print('''Decode into ${l.length} bytes for $iters
+    //     times: $ms msec. $perSec b/s''');
+}
+
+void main() {
+  testEncoder();
+  testDecoder();
+  testDecoderForMalformedInput();
+  testEncodeDecodeLists();
+  testUrlSafeEncodeDecode();
+  testPerformance();
+}
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 8ef5e6e..00a3fc5 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -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.
 
-async/stream_periodic4_test: Pass, Fail # Issue http://dartbug.com/9367
+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.
 [ $compiler == dart2js  || $compiler == dart2dart ]
@@ -90,7 +90,6 @@
 async/run_async4_test: Pass, Fail # http://dartbug.com/9013
 
 [ $compiler == none && $runtime == drt ]
-async/deferred/deferred_api_test: Fail # http://dartbug.com/2264
 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)
diff --git a/tests/standalone/debugger/basic_debugger_test.dart b/tests/standalone/debugger/basic_debugger_test.dart
index e2a91be..ed415a4 100644
--- a/tests/standalone/debugger/basic_debugger_test.dart
+++ b/tests/standalone/debugger/basic_debugger_test.dart
@@ -30,13 +30,11 @@
 
 // Expected debugger events and commands.
 var testScript = [
-  Breakpoint(),  // Expect a breakpoint event.
   MatchFrame(0, "main"),  // Top frame in trace is function "main".
   Step(),
-  Breakpoint(function: "main"),
+  MatchFrame(0, "main"),  // Should still be in "main".
   SetBreakpoint(15),  // Set breakpoint a line 15, in function bar.
   Resume(),
-  Breakpoint(function: "bar"),
   MatchFrames(["bar", "foo", "main"]),
   MatchFrame(1, "foo"),
   Resume(),
diff --git a/tests/standalone/debugger/debug_lib.dart b/tests/standalone/debugger/debug_lib.dart
index cf244b4..7d3b8ec 100644
--- a/tests/standalone/debugger/debug_lib.dart
+++ b/tests/standalone/debugger/debug_lib.dart
@@ -154,53 +154,45 @@
 }
 
 
-class BreakpointEvent {
-  String functionName;
-  var template = { "event": "paused", "params": { "reason": "breakpoint" }};
+class Command {
+  var template;
 
-  BreakpointEvent({String function: null}) {
-    functionName = function;
+  void send(Debugger debugger) {
+    debugger.sendMessage(template);
   }
 
-  void match(Debugger debugger) {
-    var msg = debugger.currentMessage;
-    if (!matchMaps(template, msg)) {
-      debugger.error("message does not match $template");
-    }
-    var name = getJsonValue(msg, "params:callFrames[0]:functionName");
-    if (name == "main") {
-      // Extract script url of debugged script.
-      var scriptUrl = getJsonValue(msg, "params:callFrames[0]:location:url");
-      assert(scriptUrl != null);
-      debugger.scriptUrl = scriptUrl;
-    }
-    if (functionName != null) {
-      var name = getJsonValue(msg, "params:callFrames[0]:functionName");
-      if (functionName != name) {
-        debugger.error("expected function name $functionName but got $name");
-      }
+  void matchResponse(Debugger debugger) {
+    Map response = debugger.currentMessage;
+    var id = template["id"];
+    assert(id != null && id >= 0);
+    if (response["id"] != id) {
+      debugger.error("Expected messaged id $id but got ${response["id"]}.");
     }
   }
 }
 
-Breakpoint({String function}) {
-  return new BreakpointEvent(function: function);
-}
 
-class Matcher {
-  void match(Debugger debugger);
-}
-
-class FrameMatcher extends Matcher {
+class FrameMatcher extends Command {
   int frameIndex;
   List<String> functionNames;
 
-  FrameMatcher(this.frameIndex, this.functionNames);
+  FrameMatcher(this.frameIndex, this.functionNames) {
+    template = {"id": 0, "command": "getStackTrace", "params": {"isolateId": 0}};
+  }
 
-  void match(Debugger debugger) {
+  void matchResponse(Debugger debugger) {
+    super.matchResponse(debugger);
     var msg = debugger.currentMessage;
-    List frames = getJsonValue(msg, "params:callFrames");
+    List frames = getJsonValue(msg, "result:callFrames");
     assert(frames != null);
+    if (debugger.scriptUrl == null) {
+      var name = frames[0]["functionName"];
+      if (name == "main") {
+        // Extract script url of debugged script.
+        debugger.scriptUrl = frames[0]["location"]["url"];
+        assert(debugger.scriptUrl != null);
+      }
+    }
     if (frames.length < functionNames.length) {
       debugger.error("stack trace not long enough "
                      "to match ${functionNames.length} frames");
@@ -208,12 +200,8 @@
     }
     for (int i = 0; i < functionNames.length; i++) {
       var idx = i + frameIndex;
-      var property = "params:callFrames[$idx]:functionName";
-      var name = getJsonValue(msg, property);
-      if (name == null) {
-        debugger.error("property '$property' not found");
-        return;
-      }
+      var name = frames[idx]["functionName"];
+      assert(name != null);
       if (name != functionNames[i]) {
         debugger.error("call frame $idx: "
           "expected function name '${functionNames[i]}' but found '$name'");
@@ -233,42 +221,23 @@
 }
 
 
-class Command {
-  var template;
-  Command();
-  Command.resume() {
+class RunCommand extends Command {
+  RunCommand.resume() {
     template = {"id": 0, "command": "resume", "params": {"isolateId": 0}};
   }
-  Command.step() {
+  RunCommand.step() {
     template = {"id": 0, "command": "stepOver", "params": {"isolateId": 0}};
   }
-  Map makeMsg(int cmdId, int isolateId) {
-    template["id"] = cmdId;
-    if ((template["params"] != null)
-        && (template["params"]["isolateId"] != null)) {
-      template["params"]["isolateId"] = isolateId;
-    }
-    return template;
-  }
-
   void send(Debugger debugger) {
-    template["id"] = debugger.seqNr;
-    template["params"]["isolateId"] = debugger.isolateId;
     debugger.sendMessage(template);
-  }
-
-  void matchResponse(Debugger debugger) {
-    Map response = debugger.currentMessage;
-    var id = template["id"];
-    assert(id != null && id >= 0);
-    if (response["id"] != id) {
-      debugger.error("Expected messaged id $id but got ${response["id"]}.");
-    }
+    debugger.isPaused = false;
   }
 }
 
-Resume() => new Command.resume();
-Step() => new Command.step();
+
+Resume() => new RunCommand.resume();
+Step() => new RunCommand.step();
+
 
 class SetBreakpointCommand extends Command {
   int line;
@@ -279,29 +248,29 @@
                             "url": null,
                             "line": null }};
   }
+
   void send(Debugger debugger) {
     assert(debugger.scriptUrl != null);
     template["params"]["url"] = debugger.scriptUrl;
     template["params"]["line"] = line;
-    super.send(debugger);
+    debugger.sendMessage(template);
   }
 }
 
 SetBreakpoint(int line) => new SetBreakpointCommand(line);
 
 
-// A debug script is a list of Event, Matcher and Command objects.
+// A debug script is a list of Command objects.
 class DebugScript {
   List entries;
-  int currentIndex;
-  DebugScript(List this.entries) : currentIndex = 0;
-  get currentEntry {
-    if (currentIndex < entries.length) return entries[currentIndex];
-    return null;
+  DebugScript(List scriptEntries) {
+    entries = new List.from(scriptEntries.reversed);
+    entries.add(MatchFrame(0, "main"));
   }
-  advance() {
-    currentIndex++;
-  }
+  bool get isEmpty => entries.isEmpty;
+  get currentEntry => entries.last;
+  advance() => entries.removeLast();
+  add(entry) => entries.add(entry);
 }
 
 
@@ -322,6 +291,7 @@
   String scriptUrl = null;
   bool shutdownEventSeen = false;
   int isolateId = 0;
+  bool isPaused = false;
 
   Debugger(this.targetProcess, this.portNumber) {
     stdin.listen((_) {});
@@ -344,10 +314,8 @@
     });
   }
 
-  // Handle debugger events for which there is no explicit
-  // entry in the debug script, for example isolate create and
-  // shutdown events, breakpoint resolution events, etc.
-  bool handleImplicitEvents(Map<String,dynamic> msg) {
+  // Handle debugger events, updating the debugger state.
+  void handleEvent(Map<String,dynamic> msg) {
     if (msg["event"] == "isolate") {
       if (msg["params"]["reason"] == "created") {
         isolateId = msg["params"]["id"];
@@ -356,27 +324,31 @@
       } else if (msg["params"]["reason"] == "shutdown") {
         print("Debuggee isolate id ${msg["params"]["id"]} shut down.");
         shutdownEventSeen = true;
-        if (script.currentEntry != null) {
+        if (!script.isEmpty) {
           error("Premature isolate shutdown event seen.");
         }
       }
-      return true;
     } else if (msg["event"] == "breakpointResolved") {
       // Ignore the event. We may want to maintain a table of
       // breakpoints in the future.
-      return true;
+    } else if (msg["event"] == "paused") {
+      isPaused = true;
+    } else {
+      error("unknown debugger event received");
     }
-    return false;
   }
 
   // Handle one JSON message object and match it to the
   // expected events and responses in the debugging script.
   void handleMessage(Map<String,dynamic> receivedMsg) {
     currentMessage = receivedMsg;
-    var isHandled = handleImplicitEvents(receivedMsg);
-    if (isHandled) return;
-
-    if (receivedMsg["id"] != null) {
+    if (receivedMsg["event"] != null) {
+      handleEvent(receivedMsg);
+      if (errorsDetected) {
+        error("Error while handling debugger event");
+        error("Event received from debug target: $receivedMsg");
+      }
+    } else if (receivedMsg["id"] != null) {
       // This is a response to the last command we sent.
       assert(lastCommand != null);
       lastCommand.matchResponse(this);
@@ -385,25 +357,6 @@
         error("Error while matching response to debugger command");
         error("Response received from debug target: $receivedMsg");
       }
-      return;
-    }
-
-    // This message must be an event that is expected by the script.
-    assert(receivedMsg["event"] != null);
-    if ((script.currentEntry == null) || (script.currentEntry is Command)) {
-      // Error: unexpected event received.
-      error("unexpected event received: $receivedMsg");
-      return;
-    } else {
-      // Match received message with expected event.
-      script.currentEntry.match(this);
-      if (errorsDetected) return;
-      script.advance();
-      while (script.currentEntry is Matcher) {
-        script.currentEntry.match(this);
-        if (errorsDetected) return;
-        script.advance();
-      }
     }
   }
 
@@ -430,7 +383,7 @@
       var msgObj = JSON.parse(msg);
       handleMessage(msgObj);
       if (errorsDetected) {
-        error("Error while handling script entry ${script.currentIndex}");
+        error("Error while handling script entry");
         error("Message received from debug target: $msg");
         close(killDebugee: true);
         return;
@@ -439,7 +392,7 @@
         close();
         return;
       }
-      sendNextCommand();
+      if (isPaused) sendNextCommand();
       msg = responses.getNextMessage();
     }
   }
@@ -451,6 +404,12 @@
 
   // Send a debugger command to the target VM.
   void sendMessage(Map<String,dynamic> msg) {
+    if (msg["id"] != null) {
+      msg["id"] = seqNr;
+    }
+    if (msg["params"] != null && msg["params"]["isolateId"] != null) {
+      msg["params"]["isolateId"] = isolateId;
+    }
     String jsonMsg = JSON.stringify(msg);
     if (verboseWire) print("SEND: $jsonMsg");
     socket.write(jsonMsg);
@@ -465,10 +424,9 @@
 
   void openConnection() {
     Socket.connect("127.0.0.1", portNumber).then((s) {
-      socket = s;
-      var stringStream = socket.transform(new StringDecoder());
-      stringStream.listen(
-          (str) {
+        this.socket = s;
+        var stringStream = socket.transform(new StringDecoder());
+        stringStream.listen((str) {
             try {
               responses.append(str);
               handleMessages();
@@ -485,6 +443,10 @@
             print("Error '$e' detected in input stream from debug target");
             close(killDebugee: true);
           });
+      },
+      onError: (asyncErr) {
+        print("Error while connecting to debugee: $asyncErr");
+        close(killDebugee: true);
       });
   }
 
@@ -492,7 +454,7 @@
     if (errorsDetected) {
       for (int i = 0; i < errors.length; i++) print(errors[i]);
     }
-    socket.close();
+    if (socket != null) socket.close();
     if (killDebugee) {
       targetProcess.kill();
       print("Target process killed");
diff --git a/tests/standalone/io/dart_std_io_pipe_script.dart b/tests/standalone/io/dart_std_io_pipe_script.dart
new file mode 100644
index 0000000..1299645
--- /dev/null
+++ b/tests/standalone/io/dart_std_io_pipe_script.dart
@@ -0,0 +1,35 @@
+// 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.
+//
+// Utility script to echo stdin to stdout or stderr or both.
+
+import "dart:io";
+
+main() {
+  var options = new Options();
+  if (stdioType(stdin) is !StdioType) exit(1);
+  if (stdioType(stdout) is !StdioType) exit(1);
+  if (stdioType(stderr) is !StdioType) exit(1);
+  if (stdioType(stdin).name != options.arguments[1]) {
+    throw stdioType(stdin).name;
+  }
+  if (stdioType(stdout).name != options.arguments[2]) {
+    throw stdioType(stdout).name;
+  }
+  if (stdioType(stderr).name != options.arguments[3]) {
+    throw stdioType(stderr).name;
+  }
+  if (options.arguments.length > 0) {
+    if (options.arguments[0] == "0") {
+      stdin.pipe(stdout);
+    } else if (options.arguments[0] == "1") {
+      stdin.pipe(stderr);
+    } else if (options.arguments[0] == "2") {
+      stdin.listen((data) {
+        stdout.writeBytes(data);
+        stderr.writeBytes(data);
+      });
+    }
+  }
+}
diff --git a/tests/standalone/io/dart_std_io_pipe_test.dart b/tests/standalone/io/dart_std_io_pipe_test.dart
index daf5c09..4310d78 100644
--- a/tests/standalone/io/dart_std_io_pipe_test.dart
+++ b/tests/standalone/io/dart_std_io_pipe_test.dart
@@ -40,7 +40,12 @@
   String redirectOutFile = "${dir.path}/redirect";
   String executable = new Options().executable;
   List args =
-      [executable, dartScript, type, pipeOutFile, redirectOutFile];
+      [executable,
+       dartScript,
+       type,
+       pipeOutFile,
+       redirectOutFile,
+       devNull ? "terminal" : "file"];
   var future = Process.start(shellScript, args);
   future.then((process) {
     process.exitCode.then((exitCode) {
@@ -105,9 +110,10 @@
     shellScript = new File("../tests/standalone/io/dart_std_io_pipe_test.sh");
   }
   // Get the Dart script file which echoes stdin to stdout or stderr or both.
-  var scriptFile = new File("tests/standalone/io/process_std_io_script.dart");
+  var scriptFile = new File("tests/standalone/io/dart_std_io_pipe_script.dart");
   if (!scriptFile.existsSync()) {
-    scriptFile = new File("../tests/standalone/io/process_std_io_script.dart");
+    scriptFile =
+        new File("../tests/standalone/io/dart_std_io_pipe_script.dart");
   }
 
   // Run the shell script.
diff --git a/tests/standalone/io/dart_std_io_pipe_test.sh b/tests/standalone/io/dart_std_io_pipe_test.sh
index 9677dc7..7caa1ed 100755
--- a/tests/standalone/io/dart_std_io_pipe_test.sh
+++ b/tests/standalone/io/dart_std_io_pipe_test.sh
@@ -6,8 +6,12 @@
 # $3: Argument to dart echoing script (0, 1 or 2)
 # $4: File for output from piping stdout and stderr
 # $5: File prefix for output from redirecting stdout and stderr to a file.
+# $6: Stdio type of stdin
 
 # Test piping and stdio file redirection.
-echo "Hello" | $1 $2 $3 2>&1 | cat - > $4
-$1 $2 $3 < $4 > $5.stdout 2> $5.stderr
-$1 $2 $3 < $4 >> $5.stdout 2>> $5.stderr
+echo "Hello" | $1 $2 $3 pipe pipe pipe 2>&1 | cat - > $4
+$1 $2 $3 $6 file file < $4 > $5.stdout 2> $5.stderr
+$1 $2 $3 $6 file file < $4 >> $5.stdout 2>> $5.stderr
+$1 $2 $3 $6 terminal terminal < $4 > /dev/null 2> /dev/null
+$1 $2 $3 $6 terminal pipe < $4 2>&1 > /dev/null
+$1 $2 $3 $6 terminal terminal < $4 > /dev/null 2>&1
diff --git a/tests/standalone/io/directory_test.dart b/tests/standalone/io/directory_test.dart
index d6eac48..db5903d 100644
--- a/tests/standalone/io/directory_test.dart
+++ b/tests/standalone/io/directory_test.dart
@@ -244,6 +244,98 @@
     Expect.isFalse(d.existsSync());
   }
 
+  static void testDeleteLinkSync() {
+    Directory tmp = new Directory("").createTempSync();
+    var path = "${tmp.path}${Platform.pathSeparator}";
+    Directory d = new Directory("${path}target");
+    d.createSync();
+    Link l = new Link("${path}symlink");
+    l.createSync("${path}target");
+    Expect.isTrue(d.existsSync());
+    Expect.isTrue(l.existsSync());
+    new Directory(l.path).deleteSync(recursive: true);
+    Expect.isTrue(d.existsSync());
+    Expect.isFalse(l.existsSync());
+    d.deleteSync();
+    Expect.isFalse(d.existsSync());
+    tmp.deleteSync();
+  }
+
+  static void testDeleteLinkAsFileSync() {
+    Directory tmp = new Directory("").createTempSync();
+    var path = "${tmp.path}${Platform.pathSeparator}";
+    Directory d = new Directory("${path}target");
+    d.createSync();
+    Link l = new Link("${path}symlink");
+    l.createSync("${path}target");
+    Expect.isTrue(d.existsSync());
+    Expect.isTrue(l.existsSync());
+    new Link(l.path).deleteSync();
+    Expect.isTrue(d.existsSync());
+    Expect.isFalse(l.existsSync());
+    d.deleteSync();
+    Expect.isFalse(d.existsSync());
+    tmp.deleteSync();
+  }
+
+  static void testDeleteBrokenLinkAsFileSync() {
+    Directory tmp = new Directory("").createTempSync();
+    var path = "${tmp.path}${Platform.pathSeparator}";
+    Directory d = new Directory("${path}target");
+    d.createSync();
+    Link l = new Link("${path}symlink");
+    l.createSync("${path}target");
+    d.deleteSync();
+    Expect.isFalse(d.existsSync());
+    Expect.isTrue(l.existsSync());
+    new Link(l.path).deleteSync();
+    Expect.isFalse(l.existsSync());
+    Expect.isFalse(d.existsSync());
+    tmp.deleteSync();
+  }
+
+  static void testListBrokenLinkSync() {
+    Directory tmp = new Directory("").createTempSync();
+    var path = "${tmp.path}${Platform.pathSeparator}";
+    Directory d = new Directory("${path}target");
+    d.createSync();
+    Link l = new Link("${path}symlink");
+    l.createSync("${path}target");
+    d.deleteSync();
+    int count = 0;
+    tmp.list(followLinks: true).listen(
+        (file) {
+          count++;
+          Expect.isTrue(file is Link);
+        },
+        onDone: () {
+          Expect.equals(1, count);
+          l.deleteSync();
+          tmp.deleteSync();
+        });
+  }
+
+  static void testListLinkSync() {
+    Directory tmp = new Directory("").createTempSync();
+    var path = "${tmp.path}${Platform.pathSeparator}";
+    Directory d = new Directory("${path}target");
+    d.createSync();
+    Link l = new Link("${path}symlink");
+    l.createSync("${path}target");
+    int count = 0;
+    tmp.list(followLinks: true).listen(
+        (file) {
+          count++;
+          Expect.isTrue(file is Directory);
+        },
+        onDone: () {
+          Expect.equals(2, count);
+          l.deleteSync();
+          d.deleteSync();
+          tmp.deleteSync();
+        });
+  }
+
   static void testCreateTemp([String template = ""]) {
     var port = new ReceivePort();
     Directory dir = new Directory(template);
@@ -314,6 +406,11 @@
     testDeleteTooLongNameSync();
     testExistsCreateDelete();
     testExistsCreateDeleteSync();
+    testDeleteLinkSync();
+    testDeleteLinkAsFileSync();
+    testDeleteBrokenLinkAsFileSync();
+    testListBrokenLinkSync();
+    testListLinkSync();
     testCreateTemp();
     testCreateDeleteTemp();
     testCurrent();
diff --git a/tests/standalone/io/file_error_test.dart b/tests/standalone/io/file_error_test.dart
index c7b07e9..f026d16 100644
--- a/tests/standalone/io/file_error_test.dart
+++ b/tests/standalone/io/file_error_test.dart
@@ -453,6 +453,27 @@
   });
 }
 
+testReadSyncBigInt() {
+  createTestFile((file, port) {
+    var bigint = 100000000000000000000000000000000000000000;
+    var openedFile = file.openSync();
+    Expect.throws(() => openedFile.readSync(bigint),
+                  (e) => e is FileIOException);
+    openedFile.closeSync();
+    port.send(null);
+  });
+}
+
+testReadSyncClosedFile() {
+  createTestFile((file, port) {
+    var openedFile = file.openSync();
+    openedFile.closeSync();
+    Expect.throws(() => openedFile.readSync(1),
+                  (e) => e is FileIOException);
+    port.send(null);
+  });
+}
+
 main() {
   testOpenNonExistent();
   testDeleteNonExistent();
@@ -469,4 +490,6 @@
   testOperateOnClosedFile();
   testRepeatedlyCloseFile();
   testRepeatedlyCloseFileSync();
+  testReadSyncBigInt();
+  testReadSyncClosedFile();
 }
diff --git a/tests/standalone/io/file_read_special_device_test.dart b/tests/standalone/io/file_read_special_device_test.dart
new file mode 100644
index 0000000..3855395
--- /dev/null
+++ b/tests/standalone/io/file_read_special_device_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+void openAndWriteScript(String script) {
+  var options = new Options();
+  var dir = new Path(options.script).directoryPath;
+  script = "$dir/$script";
+  var executable = options.executable;
+  var file = script;  // Use script as file.
+  Process.start("bash", ["-c", "$executable $script < $file"]).then((process) {
+    process.exitCode
+        .then((exitCode) {
+          Expect.equals(0, exitCode);
+        });
+  });
+}
+
+void testReadStdio() {
+  openAndWriteScript("file_read_stdio_script.dart");
+}
+
+void main() {
+  testReadStdio();
+}
diff --git a/tests/standalone/io/file_read_stdio_script.dart b/tests/standalone/io/file_read_stdio_script.dart
new file mode 100644
index 0000000..0c58343
--- /dev/null
+++ b/tests/standalone/io/file_read_stdio_script.dart
@@ -0,0 +1,11 @@
+// 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';
+
+void main() {
+  var expected = new File(new Options().script).readAsStringSync();
+  var stdin = new File('/dev/fd/0').readAsStringSync();
+  Expect.equals(expected, stdin);
+}
diff --git a/tests/standalone/io/file_system_links_test.dart b/tests/standalone/io/file_system_links_test.dart
index a1bd0af..7c3cdc7 100644
--- a/tests/standalone/io/file_system_links_test.dart
+++ b/tests/standalone/io/file_system_links_test.dart
@@ -206,15 +206,17 @@
   var doesNotExist = 'this_thing_does_not_exist';
   new File(x).createSync();
   createLink(doesNotExist, link, () {
-    Expect.throws(() => temp.listSync(recursive: true),
-                  (e) => e is DirectoryIOException);
+    temp.listSync(recursive: true);  // No exceptions.
     var files = [];
     var dirs = [];
+    var links = [];
     var errors = [];
     temp.list(recursive: true).listen(
         (entity) {
           if (entity is File) {
             files.add(entity.path);
+          } else if (entity is Link) {
+            links.add(entity.path);
           } else {
             Expect.isTrue(entity is Directory);
             dirs.add(entity.path);
@@ -224,9 +226,10 @@
         onDone: () {
           Expect.equals(1, files.length);
           Expect.isTrue(files[0].endsWith(x));
+          Expect.equals(1, links.length);
+          Expect.isTrue(links[0].endsWith(link));
           Expect.equals(0, dirs.length);
-          Expect.equals(1, errors.length);
-          Expect.isTrue(errors[0].toString().contains(link));
+          Expect.equals(0, errors.length);
           temp.deleteSync(recursive: true);
           keepAlive.close();
         });
diff --git a/tests/standalone/io/http_auth_test.dart b/tests/standalone/io/http_auth_test.dart
index c6acccb..d1a706a 100644
--- a/tests/standalone/io/http_auth_test.dart
+++ b/tests/standalone/io/http_auth_test.dart
@@ -98,7 +98,7 @@
         .then((HttpClientRequest request) => request.close())
         .then((HttpClientResponse response) {
           Expect.equals(HttpStatus.UNAUTHORIZED, response.statusCode);
-          return response.reduce(null, (x, y) {});
+          return response.fold(null, (x, y) {});
         });
     }
 
@@ -128,7 +128,7 @@
         .then((HttpClientRequest request) => request.close())
         .then((HttpClientResponse response) {
           Expect.equals(HttpStatus.OK, response.statusCode);
-          return response.reduce(null, (x, y) {});
+          return response.fold(null, (x, y) {});
         });
     }
 
@@ -181,7 +181,7 @@
         .then((HttpClientRequest request) => request.close())
         .then((HttpClientResponse response) {
           Expect.equals(HttpStatus.OK, response.statusCode);
-          return response.reduce(null, (x, y) {});
+          return response.fold(null, (x, y) {});
         });
     }
 
diff --git a/tests/standalone/io/http_compression_test.dart b/tests/standalone/io/http_compression_test.dart
index ce3f9c9..c347023 100644
--- a/tests/standalone/io/http_compression_test.dart
+++ b/tests/standalone/io/http_compression_test.dart
@@ -28,7 +28,7 @@
                           response.headers.value(HttpHeaders.CONTENT_ENCODING));
             response
                 .transform(new ZLibInflater())
-                .reduce([], (list, b) {
+                .fold([], (list, b) {
                   list.addAll(b);
                   return list;
                 }).then((list) {
diff --git a/tests/standalone/io/http_keep_alive_test.dart b/tests/standalone/io/http_keep_alive_test.dart
index 30373e8..ad20ea8 100644
--- a/tests/standalone/io/http_keep_alive_test.dart
+++ b/tests/standalone/io/http_keep_alive_test.dart
@@ -14,7 +14,7 @@
   return client.get("localhost", port, "/?chunked=$chunked&length=$length")
       .then((request) => request.close())
       .then((response) {
-        return response.reduce(0, (bytes, data) => bytes + data.length)
+        return response.fold(0, (bytes, data) => bytes + data.length)
             .then((bytes) {
               Expect.equals(length, bytes);
             });
diff --git a/tests/standalone/io/http_proxy_test.dart b/tests/standalone/io/http_proxy_test.dart
index 945189d..173c3c0 100644
--- a/tests/standalone/io/http_proxy_test.dart
+++ b/tests/standalone/io/http_proxy_test.dart
@@ -28,7 +28,7 @@
         var response = request.response;
         requestCount++;
         // Check whether a proxy or direct connection is expected.
-        bool direct = directRequestPaths.reduce(
+        bool direct = directRequestPaths.fold(
             false,
             (prev, path) => prev ? prev : path == request.uri.path);
         if (!direct && proxyHops > 0) {
diff --git a/tests/standalone/io/http_session_test.dart b/tests/standalone/io/http_session_test.dart
index 69f6a6b..5648bd059 100644
--- a/tests/standalone/io/http_session_test.dart
+++ b/tests/standalone/io/http_session_test.dart
@@ -8,7 +8,7 @@
 const SESSION_ID = "DARTSESSID";
 
 String getSessionId(List<Cookie> cookies) {
-  var id = cookies.reduce(null, (last, cookie) {
+  var id = cookies.fold(null, (last, cookie) {
     if (last != null) return last;
     if (cookie.name.toUpperCase() == SESSION_ID) {
       Expect.isTrue(cookie.httpOnly);
@@ -30,7 +30,7 @@
       return request.close();
     })
     .then((response) {
-      return response.reduce(getSessionId(response.cookies), (v, _) => v);
+      return response.fold(getSessionId(response.cookies), (v, _) => v);
     });
 }
 
diff --git a/tests/standalone/io/https_client_certificate_test.dart b/tests/standalone/io/https_client_certificate_test.dart
index 1066c01..62144046 100644
--- a/tests/standalone/io/https_client_certificate_test.dart
+++ b/tests/standalone/io/https_client_certificate_test.dart
@@ -31,8 +31,8 @@
         .then((response) {
           Expect.equals('CN=localhost', response.certificate.subject);
           Expect.equals('CN=myauthority', response.certificate.issuer);
-          return response.reduce(<int>[],
-                                 (message, data) => message..addAll(data));
+          return response.fold(<int>[],
+                               (message, data) => message..addAll(data));
         })
         .then((message) {
           String received = new String.fromCharCodes(message);
diff --git a/tests/standalone/io/secure_client_raw_server_test.dart b/tests/standalone/io/secure_client_raw_server_test.dart
index 4bf20c1..7b63775 100644
--- a/tests/standalone/io/secure_client_raw_server_test.dart
+++ b/tests/standalone/io/secure_client_raw_server_test.dart
@@ -44,7 +44,7 @@
             }
             break;
           case RawSocketEvent.READ_CLOSED:
-            dataToWrite = readChunks.reduce(<int>[], (list, x) {
+            dataToWrite = readChunks.fold(<int>[], (list, x) {
               list.addAll(x);
               return list;
             });
diff --git a/tests/standalone/io/secure_client_server_test.dart b/tests/standalone/io/secure_client_server_test.dart
index f0e44a8..75cdd77 100644
--- a/tests/standalone/io/secure_client_server_test.dart
+++ b/tests/standalone/io/secure_client_server_test.dart
@@ -20,7 +20,7 @@
                                  5,
                                  CERTIFICATE).then((server) {
     server.listen((SecureSocket client) {
-      client.reduce(<int>[], (message, data) => message..addAll(data))
+      client.fold(<int>[], (message, data) => message..addAll(data))
           .then((message) {
             client.writeBytes(message);
             client.close();
@@ -34,7 +34,7 @@
   return SecureSocket.connect(HOST_NAME, server.port).then((socket) {
     socket.write("Hello server.");
     socket.close();
-    return socket.reduce(<int>[], (message, data) => message..addAll(data))
+    return socket.fold(<int>[], (message, data) => message..addAll(data))
         .then((message) {
           Expect.listEquals("Hello server.".codeUnits, message);
           return server;
diff --git a/tests/standalone/io/secure_multiple_client_server_test.dart b/tests/standalone/io/secure_multiple_client_server_test.dart
index 27527b1..4700fcd 100644
--- a/tests/standalone/io/secure_multiple_client_server_test.dart
+++ b/tests/standalone/io/secure_multiple_client_server_test.dart
@@ -20,7 +20,7 @@
                                  5,
                                  CERTIFICATE).then((server) {
     server.listen((SecureSocket client) {
-      client.reduce(<int>[], (message, data) => message..addAll(data))
+      client.fold(<int>[], (message, data) => message..addAll(data))
           .then((message) {
             String received = new String.fromCharCodes(message);
             Expect.isTrue(received.contains("Hello from client "));
@@ -37,7 +37,7 @@
   return SecureSocket.connect(HOST_NAME, server.port).then((socket) {
     socket.writeBytes("Hello from client $name".codeUnits);
     socket.close();
-    return socket.reduce(<int>[], (message, data) => message..addAll(data))
+    return socket.fold(<int>[], (message, data) => message..addAll(data))
         .then((message) {
           Expect.listEquals("Welcome, client $name".codeUnits, message);
           return server;
diff --git a/tests/standalone/io/secure_session_resume_test.dart b/tests/standalone/io/secure_session_resume_test.dart
index 97f0ade..83ec1cc 100644
--- a/tests/standalone/io/secure_session_resume_test.dart
+++ b/tests/standalone/io/secure_session_resume_test.dart
@@ -29,7 +29,7 @@
                                  5,
                                  CERTIFICATE).then((server) {
     server.listen((SecureSocket client) {
-      client.reduce(<int>[], (message, data) => message..addAll(data))
+      client.fold(<int>[], (message, data) => message..addAll(data))
           .then((message) {
             String received = new String.fromCharCodes(message);
             Expect.isTrue(received.contains("Hello from client "));
@@ -46,7 +46,7 @@
   return SecureSocket.connect(HOST_NAME, server.port).then((socket) {
     socket.write("Hello from client $name");
     socket.close();
-    return socket.reduce(<int>[], (message, data) => message..addAll(data))
+    return socket.fold(<int>[], (message, data) => message..addAll(data))
         .then((message) {
           Expect.listEquals("Welcome, client $name".codeUnits, message);
           return server;
diff --git a/tests/standalone/io/secure_socket_bad_certificate_test.dart b/tests/standalone/io/secure_socket_bad_certificate_test.dart
index c2581f8..5cb4145 100644
--- a/tests/standalone/io/secure_socket_bad_certificate_test.dart
+++ b/tests/standalone/io/secure_socket_bad_certificate_test.dart
@@ -51,7 +51,7 @@
         Expect.isTrue(acceptCertificate);
         socket.write("GET / HTTP/1.0\r\nHost: $host\r\n\r\n");
         socket.close();
-        return socket.reduce(<int>[], (message, data)  => message..addAll(data))
+        return socket.fold(<int>[], (message, data)  => message..addAll(data))
             .then((message) {
               String received = new String.fromCharCodes(message);
               Expect.isTrue(received.contains('</body></html>'));
diff --git a/tests/standalone/io/sleep_test.dart b/tests/standalone/io/sleep_test.dart
new file mode 100644
index 0000000..d953bf9
--- /dev/null
+++ b/tests/standalone/io/sleep_test.dart
@@ -0,0 +1,19 @@
+// 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";
+
+test(int milliseconds) {
+  var watch = new Stopwatch();
+  watch.start();
+  sleep(new Duration(milliseconds: milliseconds));
+  watch.stop();
+  Expect.isTrue(watch.elapsedMilliseconds + 1 >= milliseconds);
+}
+
+main() {
+  test(1);
+  test(10);
+  test(100);
+}
diff --git a/tests/standalone/io/string_decoder_test.dart b/tests/standalone/io/string_decoder_test.dart
index 5833fd4..f2ff9e00 100644
--- a/tests/standalone/io/string_decoder_test.dart
+++ b/tests/standalone/io/string_decoder_test.dart
@@ -17,7 +17,7 @@
 
   var decoder = new StringDecoder(Encoding.UTF_8, '?'.codeUnitAt(0));
   var stream = controller.stream.transform(decoder);
-  stream.reduce(
+  stream.fold(
       new StringBuffer(),
       (b, e) {
         b.write(e);
diff --git a/tests/standalone/io/zlib_test.dart b/tests/standalone/io/zlib_test.dart
index 87626f1..0c50fc3 100644
--- a/tests/standalone/io/zlib_test.dart
+++ b/tests/standalone/io/zlib_test.dart
@@ -12,7 +12,7 @@
     var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
     var controller = new StreamController();
     controller.stream.transform(new ZLibDeflater(gzip: false, level: level))
-        .reduce([], (buffer, data) {
+        .fold([], (buffer, data) {
           buffer.addAll(data);
           return buffer;
         })
@@ -52,7 +52,7 @@
   var port = new ReceivePort();
   var controller = new StreamController();
   controller.stream.transform(new ZLibDeflater(gzip: false, level: 6))
-      .reduce([], (buffer, data) {
+      .fold([], (buffer, data) {
         buffer.addAll(data);
         return buffer;
       })
@@ -70,7 +70,7 @@
   var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
   var controller = new StreamController();
   controller.stream.transform(new ZLibDeflater())
-      .reduce([], (buffer, data) {
+      .fold([], (buffer, data) {
         buffer.addAll(data);
         return buffer;
       })
@@ -116,7 +116,7 @@
     controller.stream
       .transform(new ZLibDeflater(gzip: gzip, level: level))
       .transform(new ZLibInflater())
-        .reduce([], (buffer, data) {
+        .fold([], (buffer, data) {
           buffer.addAll(data);
           return buffer;
         })
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 9ca9922..4872967 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -11,10 +11,7 @@
 [ $runtime == vm ]
 package/package_isolate_test: Fail # http://dartbug.com/7520.
 io/raw_server_socket_cancel_test: Pass, Fail, Timeout # Issue 8675
-
-# Fails with a connection refused error on the buildbot.
-# Issue 8232.
-debugger/basic_debugger_test: Skip
+debugger/basic_debugger_test: Skip # Issue 8232.
 
 [ $runtime == vm && $checked ]
 # These tests have type errors on purpose.
@@ -27,7 +24,6 @@
 # checked mode with no benefit. Skip.
 io/file_fuzz_test: Skip
 io/directory_fuzz_test: Skip
-io/process_exit_negative_test: Pass, Crash # Issue 9403
 
 [ $runtime == vm && $system == macos ]
 io/regress_7191_test: Pass, Timeout # http://dartbug.com/8091
@@ -50,6 +46,7 @@
 
 [ $runtime == vm && $system == windows ]
 io/file_system_links_test: Skip  # No links on Windows.
+io/file_read_special_device_test: Skip  # No special unix devices on Windows.
 
 [ $compiler == none && $runtime == drt ]
 typed_data_isolate_test: Skip # This test uses dart:io
diff --git a/tests/standalone/typed_data_test.dart b/tests/standalone/typed_data_test.dart
index 665e05c..cdbf3bf 100644
--- a/tests/standalone/typed_data_test.dart
+++ b/tests/standalone/typed_data_test.dart
@@ -279,6 +279,40 @@
   validate(false);
 }
 
+testViewCreation() {
+  var bytes = new Uint8List(1024);
+  var view = new ByteData.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Uint8List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Int8List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Uint8ClampedList.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Uint16List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Int16List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Uint32List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Int32List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Uint64List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Int64List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Float32List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+  view = new Float64List.view(bytes, 24);
+  Expect.equals(1000, view.lengthInBytes);
+}
+
+testWhere() {
+  var bytes = new Uint8List(13);
+  bytes.setRange(0, 5, [1, 1, 1, 1, 1]);
+  Expect.equals(5, bytes.where((v) => v > 0).length);
+}
+
 main() {
   for (int i = 0; i < 2000; i++) {
     testCreateUint8TypedData();
@@ -335,5 +369,7 @@
   testTypedDataRange(true);
   testUnsignedTypedDataRange(true);
   testExternalClampedUnsignedTypedDataRange(true);
+  testViewCreation();
+  testWhere();
 }
 
diff --git a/tests/standalone/typed_data_view_test.dart b/tests/standalone/typed_data_view_test.dart
index 4608923..4ac855b 100644
--- a/tests/standalone/typed_data_view_test.dart
+++ b/tests/standalone/typed_data_view_test.dart
@@ -15,7 +15,7 @@
   }
 }
 
-main() {
+testView() {
   var list = new Int8List(128);
   for (var i = 0; i < list.length; i++) {
     list[i] = 42;
@@ -42,3 +42,41 @@
   var dlist = new Float64List.view(ba, 0, 8);
   validate(dlist, 1.4260258159703532e-105);
 }
+
+testSetters() {
+  var blist = new ByteData(128);
+  blist.setInt8(0, 0xffff);
+  Expect.equals(-1, blist.getInt8(0));
+  blist.setUint8(0, 0xffff);
+  Expect.equals(0xff, blist.getUint8(0));
+  blist.setInt16(0, 0xffffffff);
+  Expect.equals(-1, blist.getInt16(0));
+  blist.setUint16(0, 0xffffffff);
+  Expect.equals(0xffff, blist.getUint16(0));
+  blist.setInt32(0, 0xffffffffffff);
+  Expect.equals(-1, blist.getInt32(0));
+  blist.setUint32(0, 0xffffffffffff);
+  Expect.equals(0xffffffff, blist.getUint32(0));
+  blist.setInt64(0, 0xffffffffffffffffff);
+  Expect.equals(-1, blist.getInt64(0));
+  blist.setUint64(0, 0xffffffffffffffffff);
+  Expect.equals(0xffffffffffffffff, blist.getUint64(0));
+  blist.setInt32(0, 18446744073709551614);
+  Expect.equals(-2, blist.getInt32(0));
+  blist.setUint32(0, 18446744073709551614);
+  Expect.equals(0xfffffffe, blist.getUint32(0));
+  blist.setInt64(0, 18446744073709551614);
+  Expect.equals(-2, blist.getInt64(0));
+  blist.setUint64(0, 18446744073709551614);
+  Expect.equals(0xfffffffffffffffe, blist.getUint64(0));
+
+  blist.setFloat32(0, 18446744073709551614.0);
+  Expect.equals(18446744073709551614.0, blist.getFloat32(0));
+  blist.setFloat64(0, 18446744073709551614.0);
+  Expect.equals(18446744073709551614.0, blist.getFloat64(0));
+}
+
+main() {
+  testView();
+  testSetters();
+}
diff --git a/tests/utils/utils.status b/tests/utils/utils.status
index 4d6e186..efd167c 100644
--- a/tests/utils/utils.status
+++ b/tests/utils/utils.status
@@ -6,10 +6,12 @@
 dummy_compiler_test: Slow, Pass
 recursive_import_test: Slow, Pass
 
+[ $compiler == dart2js && $checked ]
+dummy_compiler_test: Slow, Fail # http://dartbug.com/9687
+
 [ $compiler == none && $runtime == drt ]
 dummy_compiler_test: Skip # http://dartbug.com/7233
-recursive_import_test: Fail # http://dartbug.com/2264
-dart2js_test: Fail # http://dartbug.com/2264
+dart2js_test: Skip # Uses dart:io.
 
 [ $compiler == dart2js && $browser ]
 *: Skip
diff --git a/tools/VERSION b/tools/VERSION
index 3c009d7..d329f9a 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
 MAJOR 0
 MINOR 4
-BUILD 4
-PATCH 4
+BUILD 5
+PATCH 0
diff --git a/tools/build.py b/tools/build.py
index d2bf1bc..886749f 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -224,6 +224,81 @@
   return os.path.relpath(os.curdir, start=os.pardir)
 
 
+def FilterEmptyXcodebuildSections(process):
+  """
+  Filter output from xcodebuild so empty sections are less verbose.
+
+  The output from xcodebuild looks like this:
+
+Build settings from command line:
+    SYMROOT = .../xcodebuild
+
+=== BUILD AGGREGATE TARGET samples OF PROJECT dart WITH CONFIGURATION ...
+Check dependencies
+
+
+=== BUILD AGGREGATE TARGET upload_sdk OF PROJECT dart WITH CONFIGURATION ...
+Check dependencies
+
+PhaseScriptExecution "Action \"upload_sdk_py\"" xcodebuild/dart.build/...
+    cd ...
+    /bin/sh -c .../xcodebuild/dart.build/ReleaseIA32/upload_sdk.build/...
+
+
+** BUILD SUCCEEDED **
+
+  """
+
+  def is_empty_chunk(chunk):
+    empty_chunk = ['Check dependencies', '', '']
+    return not chunk or (len(chunk) == 4 and chunk[1:] == empty_chunk)
+
+  def unbuffered(callable):
+    # Use iter to disable buffering in for-in.
+    return iter(callable, '')
+
+  section = None
+  chunk = []
+  # Is stdout a terminal which supports colors?
+  is_fancy_tty = False
+  clr_eol = None
+  if sys.stdout.isatty():
+    term = os.getenv('TERM', 'dumb')
+    # The capability "clr_eol" means clear the line from cursor to end
+    # of line.  See man pages for tput and terminfo.
+    try:
+      clr_eol = subprocess.check_output(['tput', '-T' + term, 'el'],
+                                        stderr=subprocess.STDOUT)
+      if clr_eol:
+        is_fancy_tty = True
+    except subprocess.CalledProcessError:
+      is_fancy_tty = False
+  for line in unbuffered(process.stdout.readline):
+    line = line.rstrip()
+    if line.startswith('=== BUILD ') or line.startswith('** BUILD '):
+      if not is_empty_chunk(chunk):
+        print '\n'.join(chunk)
+      section = line
+      if is_fancy_tty:
+        # If stdout is a terminal, emit "progress" information.  The
+        # progress information is the first line of the current chunk.
+        # After printing the line, move the cursor back to the
+        # beginning of the line.  This has two effects: First, if the
+        # chunk isn't empty, the first line will be overwritten
+        # (avoiding duplication).  Second, the next segment line will
+        # overwrite it too avoid long scrollback.  clr_eol ensures
+        # that there is no trailing garbage when a shorter line
+        # overwrites a longer line.
+        print '%s%s\r' % (clr_eol, section),
+      chunk = []
+    if not section:
+      print line
+    else:
+      chunk.append(line)
+  if not is_empty_chunk(chunk):
+    print '\n'.join(chunk)
+
+
 def Main():
   utils.ConfigureJava()
   # Parse the options.
@@ -241,6 +316,7 @@
   else:
     target = args[0]
 
+  filter_xcodebuild_output = False
   # Remember path
   old_path = os.environ['PATH']
   # Build the targets for each requested configuration.
@@ -249,6 +325,7 @@
       for arch in options.arch:
         build_config = utils.GetBuildConf(mode, arch)
         if HOST_OS == 'macos':
+          filter_xcodebuild_output = True
           project_file = 'dart.xcodeproj'
           if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()):
             project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName()
@@ -316,7 +393,16 @@
               print k + " = " + v
 
         print ' '.join(args)
-        process = subprocess.Popen(args)
+        process = None
+        if filter_xcodebuild_output:
+          process = subprocess.Popen(args,
+                                     stdin=None,
+                                     bufsize=1, # Line buffered.
+                                     stdout=subprocess.PIPE,
+                                     stderr=subprocess.STDOUT)
+          FilterEmptyXcodebuildSections(process)
+        else:
+          process = subprocess.Popen(args, stdin=None)
         process.wait()
         if process.returncode != 0:
           print "BUILD FAILED"
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index af590d0..c3aeed9 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -209,6 +209,7 @@
                   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'))
diff --git a/tools/dom/PRESUBMIT.py b/tools/dom/PRESUBMIT.py
new file mode 100644
index 0000000..84ce197
--- /dev/null
+++ b/tools/dom/PRESUBMIT.py
@@ -0,0 +1,60 @@
+# 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.
+
+"""
+Presubmit tests for dom tools.
+
+This file is run by git_cl or gcl when an upload or submit happens with
+any files at this level or lower are in the change list.
+
+See: http://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
+"""
+
+
+import os
+
+
+def _AnySdkFiles(input_api):
+  """ Returns true if any of the changed files are in the sdk, meaning we should
+  check that docs.dart was run.
+  """
+  for f in input_api.change.AffectedFiles():
+    if f.LocalPath().find('sdk') > -1:
+      return True
+  return False
+
+
+def CheckChangeOnUpload(input_api, output_api):
+  results = []
+  # TODO(amouravski): uncomment this check once docs.dart is faster.
+  #  if _AnySdkFiles(input_api):
+  #    results.extend(CheckDocs(input_api, output_api))
+  return results
+
+
+def CheckChangeOnCommit(input_api, output_api):
+  results = []
+  if _AnySdkFiles(input_api):
+    results.extend(CheckDocs(input_api, output_api))
+  return results
+
+
+def CheckDocs(input_api, output_api):
+  """Ensure that documentation has been generated if it needs to be generated.
+
+  Prompts with a warning if documentation needs to be generated.
+  """
+  results = []
+
+  cmd = [os.path.join(input_api.PresubmitLocalPath(), 'dom.py'), 'test_docs']
+
+  try:
+    input_api.subprocess.check_output(cmd,
+                                      stderr=input_api.subprocess.STDOUT)
+  except (OSError, input_api.subprocess.CalledProcessError), e:
+    results.append(output_api.PresubmitPromptWarning(
+        ('Docs test failed!%s\nYou should run `dom.py docs`' % (
+            e if input_api.verbose else ''))))
+
+  return results
diff --git a/tools/dom/docs/test/docs_test.dart b/tools/dom/docs/test/docs_test.dart
index e87b2f6..3133fe7 100644
--- a/tools/dom/docs/test/docs_test.dart
+++ b/tools/dom/docs/test/docs_test.dart
@@ -14,38 +14,42 @@
 final testJsonPath = scriptDir.append('test.json').canonicalize();
 
 main() {
-  test('Ensure that docs.json is up to date', () {
+  group('docs', () {
     var oldJson = new File.fromPath(json_path);
     var testJson = new File.fromPath(testJsonPath);
 
-    // We should find a json file where we expect it.
-    expect(oldJson.existsSync(), isTrue);
-
-    // Save the last modified time to check it at the end.
-    var oldJsonModified = oldJson.lastModifiedSync();
-
-    // There should be no test file yet.
-    if (testJson.existsSync()) testJson.deleteSync();
-    expect(testJson.existsSync(), isFalse);
-
-    expect(convert(lib_path, testJsonPath)
-        .then((bool anyErrors) {
-      expect(anyErrors, isFalse);
-
-      // We should have a file now.
-      expect(testJson.existsSync(), isTrue);
-
-      // Ensure that there's nothing different between the new JSON and old.
-      expect(testJson.readAsStringSync(), equals(oldJson.readAsStringSync()));
-
-      // Ensure that the old JSON file didn't actually change.
-      expect(oldJsonModified, equals(oldJson.lastModifiedSync()));
-
+    tearDown(() {
       // Clean up.
       if (testJson.existsSync()) {
         testJson.deleteSync();
       }
-      expect(testJson.existsSync(), isFalse);
-    }), completes);
+      assert(!testJson.existsSync());
+    });
+
+    test('Ensure that docs.json is up to date', () {
+      // We should find a json file where we expect it.
+      expect(oldJson.existsSync(), isTrue);
+
+      // Save the last modified time to check it at the end.
+      var oldJsonModified = oldJson.lastModifiedSync();
+
+      // There should be no test file yet.
+      if (testJson.existsSync()) testJson.deleteSync();
+      assert(!testJson.existsSync());
+
+      expect(convert(lib_path, testJsonPath)
+          .then((bool anyErrors) {
+        expect(anyErrors, isFalse);
+
+        // We should have a file now.
+        expect(testJson.existsSync(), isTrue);
+
+        // Ensure that there's nothing different between the new JSON and old.
+        expect(testJson.readAsStringSync(), equals(oldJson.readAsStringSync()));
+
+        // Ensure that the old JSON file didn't actually change.
+        expect(oldJsonModified, equals(oldJson.lastModifiedSync()));
+      }), completes);
+    });
   });
 }
diff --git a/tools/dom/dom.py b/tools/dom/dom.py
index e45d820..d9e7588 100755
--- a/tools/dom/dom.py
+++ b/tools/dom/dom.py
@@ -34,7 +34,7 @@
 
 def analyze():
   ''' Runs the dart analyzer. '''
-  call([
+  return call([
     os.path.join(dart_out_dir, 'dart-sdk', 'bin', 'dart_analyzer'),
     os.path.join('tests', 'html', 'element_test.dart'),
     '--dart-sdk', 'sdk',
@@ -43,7 +43,7 @@
 
 def build():
   ''' Builds the Dart binary '''
-  call([
+  return call([
     os.path.join('tools', 'build.py'),
     '--mode=release',
     '--arch=ia32',
@@ -54,7 +54,7 @@
   compile_dart2js(argv.pop(0), True)
 
 def dartc():
-  call([
+  return call([
     os.path.join('tools', 'test.py'),
     '-m',
     'release',
@@ -64,6 +64,21 @@
     'none'
   ])
 
+def docs():
+  return call([
+    os.path.join(dart_out_dir, 'dart-sdk', 'bin', 'dart'),
+    '--package-root=%s' % os.path.join(dart_out_dir, 'packages/'),
+    os.path.join('tools', 'dom', 'docs', 'bin', 'docs.dart'),
+  ])
+
+def test_docs():
+  return call([
+    os.path.join('tools', 'test.py'),
+    '--mode=release',
+    '--checked',
+    'docs'
+  ])
+
 def compile_dart2js(dart_file, checked):
   out_file = dart_file + '.js'
   dart2js_path = os.path.join(dart_out_dir, 'dart-sdk', 'bin', 'dart2js')
@@ -82,14 +97,12 @@
 
 def gen():
   os.chdir(os.path.join('tools', 'dom', 'scripts'))
-  call([
-    'go.sh',
-  ])
+  return call(os.path.join(os.getcwd(), 'go.sh'))
 
 def http_server():
   print('Browse tests at '
       '\033[94mhttp://localhost:5400/root_build/generated_tests/\033[0m')
-  call([
+  return call([
     utils.DartBinary(),
     os.path.join('tools', 'testing', 'dart', 'http_server.dart'),
     '--port=5400',
@@ -103,7 +116,7 @@
   dart_file = os.path.join('samples', 'swarm', 'swarm.dart')
   out_file = compile_dart2js(dart_file, False)
 
-  subprocess.call([
+  return call([
     'du',
     '-kh',
     '--apparent-size',
@@ -139,11 +152,17 @@
     print(
         'Test commands should be followed by tests to run. Defaulting to html')
     cmd.append('html')
-  call(cmd)
+  return call(cmd)
 
 def call(args):
-  print (' '.join(args))
-  subprocess.call(args)
+  print ' '.join(args)
+  pipe = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+  output, error = pipe.communicate()
+  if output:
+    print output
+  if error:
+    print error
+  return pipe.returncode
 
 def init_dir():
   ''' Makes sure that we're always rooted in the dart root folder.'''
@@ -157,8 +176,10 @@
   'build': [build, 'Build dart in release mode'],
   'dart2js': [dart2js, 'Run dart2js on the .dart file specified'],
   'dartc': [dartc, 'Runs dartc in release mode'],
+  'docs': [docs, 'Generates docs.json'],
   'gen': [gen, 'Re-generate DOM generated files (run go.sh)'],
   'size_check': [size_check, 'Check the size of dart2js compiled Swarm'],
+  'test_docs': [test_docs, 'Tests docs.dart'],
   'test_chrome': [test_chrome, 'Run tests in checked mode in Chrome.\n'
       '\t\tOptionally provide name of test to run.'],
   'test_drt': [test_drt, 'Run tests in checked mode in DumpRenderTree.\n'
@@ -170,10 +191,12 @@
 }
 
 def main(argv):
+  success = True
   argv.pop(0)
 
   if not argv:
     help()
+    success = False
 
   while (argv):
     init_dir()
@@ -181,8 +204,12 @@
 
     if not command in commands:
       help();
-      return
-    commands[command][0]()
+      success = False
+      break
+    returncode = commands[command][0]()
+    success = success and not bool(returncode)
+
+  sys.exit(not success)
 
 if __name__ == '__main__':
   main(sys.argv)
diff --git a/tools/dom/scripts/dartdomgenerator.py b/tools/dom/scripts/dartdomgenerator.py
index b5f63cc..149ae86 100755
--- a/tools/dom/scripts/dartdomgenerator.py
+++ b/tools/dom/scripts/dartdomgenerator.py
@@ -29,7 +29,8 @@
 
 _logger = logging.getLogger('dartdomgenerator')
 
-_libraries = ['chrome', 'html', 'indexed_db', 'svg', 'web_audio', 'web_sql']
+_libraries = ['chrome', 'html', 'indexed_db', 'svg', 'web_audio', 'web_gl',
+    'web_sql']
 
 class GeneratorOptions(object):
   def __init__(self, templates, database, type_registry, renamer):
diff --git a/tools/dom/scripts/dartgenerator.py b/tools/dom/scripts/dartgenerator.py
index 12c9c83..fdac363 100755
--- a/tools/dom/scripts/dartgenerator.py
+++ b/tools/dom/scripts/dartgenerator.py
@@ -47,6 +47,9 @@
     if database.HasInterface(stripped_type_name):
       return True
 
+    if database.HasEnum(stripped_type_name):
+      return True
+
     dart_template_match = self._dart_templates_re.match(type_name)
     if dart_template_match:
       # Dart templates
diff --git a/tools/dom/scripts/database.py b/tools/dom/scripts/database.py
index 387cc3f..69e1963 100755
--- a/tools/dom/scripts/database.py
+++ b/tools/dom/scripts/database.py
@@ -42,6 +42,7 @@
       os.makedirs(root_dir)
     self._all_interfaces = {}
     self._interfaces_to_delete = []
+    self._enums = {}
     self._idlparser = idlparser.IDLParser(idlparser.FREMONTCUT_SYNTAX)
 
   def Clone(self):
@@ -49,6 +50,7 @@
     new_database._all_interfaces = copy.deepcopy(self._all_interfaces)
     new_database._interfaces_to_delete = copy.deepcopy(
         self._interfaces_to_delete)
+    new_database._enums = copy.deepcopy(self._enums)
     return new_database
 
   def Delete(self):
@@ -234,3 +236,12 @@
         continue
       for parent_interface in self.Hierarchy(self.GetInterface(parent.type.id)):
         yield parent_interface
+
+  def HasEnum(self, enum_name):
+    return enum_name in self._enums
+
+  def GetEnum(self, enum_name):
+    return self._enums[enum_name]
+
+  def AddEnum(self, enum):
+    self._enums[enum.id] = enum
diff --git a/tools/dom/scripts/databasebuilder.py b/tools/dom/scripts/databasebuilder.py
index 96e724d..60565a1 100755
--- a/tools/dom/scripts/databasebuilder.py
+++ b/tools/dom/scripts/databasebuilder.py
@@ -459,6 +459,9 @@
     for implStmt in idl_file.implementsStatements:
       self._impl_stmts.append((implStmt, import_options))
 
+    for enum in idl_file.enums:
+      self._database.AddEnum(enum)
+
 
   def _is_node_enabled(self, node, idl_defines):
     if not 'Conditional' in node.ext_attrs:
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index a76fb64..2258962 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -691,9 +691,9 @@
       # 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"
-                "|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')",
+                "|Framebuffer|Renderbuffer|Texture')",
       "@Returns('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array"
-                "|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')",
+                "|Framebuffer|Renderbuffer|Texture')",
     ],
 
     'XMLHttpRequest.response': [
@@ -1544,6 +1544,11 @@
       return SequenceIDLTypeInfo(type_name, TypeData('Sequence'), item_info)
 
     if not type_name in _idl_type_registry:
+      if self._database.HasEnum(type_name):
+        return PrimitiveIDLTypeInfo(
+            type_name,
+            TypeData(clazz='Primitive', dart_type='String', native_type='String'))
+
       interface = self._database.GetInterface(type_name)
       if 'Callback' in interface.ext_attrs:
         return CallbackIDLTypeInfo(type_name, TypeData('Callback',
diff --git a/tools/dom/scripts/htmlrenamer.py b/tools/dom/scripts/htmlrenamer.py
index f2480b4..8b696d6 100644
--- a/tools/dom/scripts/htmlrenamer.py
+++ b/tools/dom/scripts/htmlrenamer.py
@@ -45,7 +45,7 @@
     'SVGElement': 'SvgElement', # Manual to avoid name conflicts.
     'SVGException': 'SvgException', # Manual of avoid conflict with Exception.
     'SVGSVGElement': 'SvgSvgElement', # Manual to avoid name conflicts.
-    'WebGLVertexArrayObjectOES': 'WebGLVertexArrayObject',
+    'WebGLVertexArrayObjectOES': 'VertexArrayObject',
     'WebKitAnimationEvent': 'AnimationEvent',
     'WebKitCSSKeyframeRule': 'CssKeyframeRule',
     'WebKitCSSKeyframesRule': 'CssKeyframesRule',
@@ -683,6 +683,8 @@
         return 'indexed_db'
       if 'SQL_DATABASE' in interface.ext_attrs['Conditional']:
         return 'web_sql'
+      if 'WEBGL' in interface.ext_attrs['Conditional']:
+        return 'web_gl'
 
     return 'html'
 
@@ -695,6 +697,7 @@
     # Strip off any standard prefixes.
     name = re.sub(r'^SVG', '', type_name)
     name = re.sub(r'^IDB', '', name)
+    name = re.sub(r'^WebGL', '', name)
 
     return self._CamelCaseName(name)
 
diff --git a/tools/dom/scripts/idlnode.py b/tools/dom/scripts/idlnode.py
index 006006d..dc57042 100755
--- a/tools/dom/scripts/idlnode.py
+++ b/tools/dom/scripts/idlnode.py
@@ -259,6 +259,7 @@
     self.implementsStatements = self._convert_all(ast, 'ImplStmt',
       IDLImplementsStatement)
     self.typeDefs = self._convert_all(ast, 'TypeDef', IDLTypeDef)
+    self.enums = self._convert_all(ast, 'Enum', IDLEnum)
     for module in modules:
       self.interfaces.extend(module.interfaces)
       self.implementsStatements.extend(module.implementsStatements)
@@ -274,6 +275,7 @@
     self._convert_annotations(ast)
     self.interfaces = self._convert_all(ast, 'Interface', IDLInterface)
     self.typeDefs = self._convert_all(ast, 'TypeDef', IDLTypeDef)
+    self.enums = self._convert_all(ast, 'Enum', IDLNode)
     self.implementsStatements = self._convert_all(ast, 'ImplStmt',
       IDLImplementsStatement)
 
@@ -378,6 +380,14 @@
     return label
 
 
+class IDLEnum(IDLNode):
+  """IDLNode for 'enum [id] { [string]+ }'"""
+  def __init__(self, ast):
+    IDLNode.__init__(self, ast)
+    self._convert_annotations(ast)
+    # TODO(antonm): save enum values.
+
+
 class IDLTypeDef(IDLNode):
   """IDLNode for 'typedef [type] [id]' declarations."""
   def __init__(self, ast):
diff --git a/tools/dom/scripts/idlparser.py b/tools/dom/scripts/idlparser.py
index e3c47b3..3535360 100755
--- a/tools/dom/scripts/idlparser.py
+++ b/tools/dom/scripts/idlparser.py
@@ -74,7 +74,7 @@
 
     def Enum():
       def StringLiteral():
-        return re.compile(r'"\w+"')
+        return re.compile(r'"\w*"')
 
       return ['enum', Id, '{', MAYBE(MANY(StringLiteral, ',')), '}', ';']
 
diff --git a/tools/dom/scripts/idlrenderer.py b/tools/dom/scripts/idlrenderer.py
index aa2e139..78661e7 100755
--- a/tools/dom/scripts/idlrenderer.py
+++ b/tools/dom/scripts/idlrenderer.py
@@ -53,15 +53,21 @@
     elif isinstance(node, IDLFile):
       w(node.modules)
       w(node.interfaces)
+      w(node.enums)
+      w(node.typeDefs)
     elif isinstance(node, IDLModule):
       wsp(node.annotations)
       wsp(node.ext_attrs)
       wln('module %s {' % node.id)
       begin_indent()
       w(node.interfaces)
+      w(node.enums)
       w(node.typeDefs)
       end_indent()
       wln('};')
+    elif isinstance(node, IDLEnum):
+      w('enum %s {}' % node.id)
+      # TODO(antonm): emit values as well.
     elif isinstance(node, IDLInterface):
       if node.annotations:
         wln(node.annotations)
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index 1559cc7..99c27e7 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -262,6 +262,7 @@
   'indexed_db': {},
   'svg': _svg_element_constructors,
   'web_audio': {},
+  'web_gl': {},
   'web_sql': {},
 }
 
@@ -282,6 +283,10 @@
     'provider_name': 'document',
     'constructor_name': '$dom_createElement'
   },
+  'web_gl': {
+    'provider_name': 'document',
+    'constructor_name': '$dom_createElement'
+  },
   'web_sql': {
     'provider_name': 'document',
     'constructor_name': '$dom_createElement'
diff --git a/tools/dom/src/CssClassSet.dart b/tools/dom/src/CssClassSet.dart
index 473c037..29aa860 100644
--- a/tools/dom/src/CssClassSet.dart
+++ b/tools/dom/src/CssClassSet.dart
@@ -62,6 +62,11 @@
       dynamic combine(dynamic previousValue, String element)) {
     return readClasses().reduce(initialValue, combine);
   }
+
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, String element)) {
+    return readClasses().fold(initialValue, combine);
+  }
   // interface Collection - END
 
   // interface Set - BEGIN
diff --git a/tools/dom/src/EventStreamProvider.dart b/tools/dom/src/EventStreamProvider.dart
index a74e998..f5a9407 100644
--- a/tools/dom/src/EventStreamProvider.dart
+++ b/tools/dom/src/EventStreamProvider.dart
@@ -41,9 +41,7 @@
   }
 
   void cancel() {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_canceled) return;
 
     _unlisten();
     // Clear out the target to indicate this is complete.
@@ -71,9 +69,7 @@
   void onDone(void handleDone()) {}
 
   void pause([Future resumeSignal]) {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
+    if (_canceled) return;
     ++_pauseCount;
     _unlisten();
 
@@ -85,12 +81,7 @@
   bool get _paused => _pauseCount > 0;
 
   void resume() {
-    if (_canceled) {
-      throw new StateError("Subscription has been canceled.");
-    }
-    if (!_paused) {
-      throw new StateError("Subscription is not paused.");
-    }
+    if (_canceled || !_paused) return;
     --_pauseCount;
     _tryResume();
   }
diff --git a/tools/dom/src/Timer.dart b/tools/dom/src/Timer.dart
deleted file mode 100644
index da98db5..0000000
--- a/tools/dom/src/Timer.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of html;
-
-// TODO(antonm): support not DOM isolates too.
-class _Timer implements Timer {
-  final canceller;
-
-  _Timer(this.canceller);
-
-  void cancel() { canceller(); }
-}
-
-get _timerFactoryClosure => (int milliSeconds, void callback(Timer timer), bool repeating) {
-  var maker;
-  var canceller;
-  if (repeating) {
-    maker = window._setInterval;
-    canceller = window._clearInterval;
-  } else {
-    maker = window._setTimeout;
-    canceller = window._clearTimeout;
-  }
-  Timer timer;
-  final int id = maker(() { callback(timer); }, milliSeconds);
-  timer = new _Timer(() { canceller(id); });
-  return timer;
-};
-
-class _PureIsolateTimer implements Timer {
-  final ReceivePort _port = new ReceivePort();
-  SendPort _sendPort; // Effectively final.
-
-  _PureIsolateTimer(int milliSeconds, callback, repeating) {
-    _sendPort = _port.toSendPort();
-    _port.receive((msg, replyTo) {
-      assert(msg == _TIMER_PING);
-      callback(this);
-      if (!repeating) _cancel();
-    });
-    _HELPER_ISOLATE_PORT.then((port) {
-      port.send([_NEW_TIMER, milliSeconds, repeating], _sendPort);
-    });
-  }
-
-  void cancel() {
-    _cancel();
-    _HELPER_ISOLATE_PORT.then((port) {
-      port.send([_CANCEL_TIMER], _sendPort);
-    });
-  }
-
-  void _cancel() {
-    _port.close();
-  }
-}
-
-get _pureIsolateTimerFactoryClosure =>
-    ((int milliSeconds, void callback(Timer time), bool repeating) =>
-        new _PureIsolateTimer(milliSeconds, callback, repeating));
diff --git a/tools/dom/src/WebGLConstants.dart b/tools/dom/src/WebGLConstants.dart
new file mode 100644
index 0000000..85b7551
--- /dev/null
+++ b/tools/dom/src/WebGLConstants.dart
@@ -0,0 +1,302 @@
+// 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 dom.web_gl;
+
+const int ACTIVE_ATTRIBUTES = RenderingContext.ACTIVE_ATTRIBUTES;
+const int ACTIVE_TEXTURE = RenderingContext.ACTIVE_TEXTURE;
+const int ACTIVE_UNIFORMS = RenderingContext.ACTIVE_UNIFORMS;
+const int ALIASED_LINE_WIDTH_RANGE = RenderingContext.ALIASED_LINE_WIDTH_RANGE;
+const int ALIASED_POINT_SIZE_RANGE = RenderingContext.ALIASED_POINT_SIZE_RANGE;
+const int ALPHA = RenderingContext.ALPHA;
+const int ALPHA_BITS = RenderingContext.ALPHA_BITS;
+const int ALWAYS = RenderingContext.ALWAYS;
+const int ARRAY_BUFFER = RenderingContext.ARRAY_BUFFER;
+const int ARRAY_BUFFER_BINDING = RenderingContext.ARRAY_BUFFER_BINDING;
+const int ATTACHED_SHADERS = RenderingContext.ATTACHED_SHADERS;
+const int BACK = RenderingContext.BACK;
+const int BLEND = RenderingContext.BLEND;
+const int BLEND_COLOR = RenderingContext.BLEND_COLOR;
+const int BLEND_DST_ALPHA = RenderingContext.BLEND_DST_ALPHA;
+const int BLEND_DST_RGB = RenderingContext.BLEND_DST_RGB;
+const int BLEND_EQUATION = RenderingContext.BLEND_EQUATION;
+const int BLEND_EQUATION_ALPHA = RenderingContext.BLEND_EQUATION_ALPHA;
+const int BLEND_EQUATION_RGB = RenderingContext.BLEND_EQUATION_RGB;
+const int BLEND_SRC_ALPHA = RenderingContext.BLEND_SRC_ALPHA;
+const int BLEND_SRC_RGB = RenderingContext.BLEND_SRC_RGB;
+const int BLUE_BITS = RenderingContext.BLUE_BITS;
+const int BOOL = RenderingContext.BOOL;
+const int BOOL_VEC2 = RenderingContext.BOOL_VEC2;
+const int BOOL_VEC3 = RenderingContext.BOOL_VEC3;
+const int BOOL_VEC4 = RenderingContext.BOOL_VEC4;
+const int BROWSER_DEFAULT_WEBGL = RenderingContext.BROWSER_DEFAULT_WEBGL;
+const int BUFFER_SIZE = RenderingContext.BUFFER_SIZE;
+const int BUFFER_USAGE = RenderingContext.BUFFER_USAGE;
+const int BYTE = RenderingContext.BYTE;
+const int CCW = RenderingContext.CCW;
+const int CLAMP_TO_EDGE = RenderingContext.CLAMP_TO_EDGE;
+const int COLOR_ATTACHMENT0 = RenderingContext.COLOR_ATTACHMENT0;
+const int COLOR_BUFFER_BIT = RenderingContext.COLOR_BUFFER_BIT;
+const int COLOR_CLEAR_VALUE = RenderingContext.COLOR_CLEAR_VALUE;
+const int COLOR_WRITEMASK = RenderingContext.COLOR_WRITEMASK;
+const int COMPILE_STATUS = RenderingContext.COMPILE_STATUS;
+const int COMPRESSED_TEXTURE_FORMATS = RenderingContext.COMPRESSED_TEXTURE_FORMATS;
+const int CONSTANT_ALPHA = RenderingContext.CONSTANT_ALPHA;
+const int CONSTANT_COLOR = RenderingContext.CONSTANT_COLOR;
+const int CONTEXT_LOST_WEBGL = RenderingContext.CONTEXT_LOST_WEBGL;
+const int CULL_FACE = RenderingContext.CULL_FACE;
+const int CULL_FACE_MODE = RenderingContext.CULL_FACE_MODE;
+const int CURRENT_PROGRAM = RenderingContext.CURRENT_PROGRAM;
+const int CURRENT_VERTEX_ATTRIB = RenderingContext.CURRENT_VERTEX_ATTRIB;
+const int CW = RenderingContext.CW;
+const int DECR = RenderingContext.DECR;
+const int DECR_WRAP = RenderingContext.DECR_WRAP;
+const int DELETE_STATUS = RenderingContext.DELETE_STATUS;
+const int DEPTH_ATTACHMENT = RenderingContext.DEPTH_ATTACHMENT;
+const int DEPTH_BITS = RenderingContext.DEPTH_BITS;
+const int DEPTH_BUFFER_BIT = RenderingContext.DEPTH_BUFFER_BIT;
+const int DEPTH_CLEAR_VALUE = RenderingContext.DEPTH_CLEAR_VALUE;
+const int DEPTH_COMPONENT = RenderingContext.DEPTH_COMPONENT;
+const int DEPTH_COMPONENT16 = RenderingContext.DEPTH_COMPONENT16;
+const int DEPTH_FUNC = RenderingContext.DEPTH_FUNC;
+const int DEPTH_RANGE = RenderingContext.DEPTH_RANGE;
+const int DEPTH_STENCIL = RenderingContext.DEPTH_STENCIL;
+const int DEPTH_STENCIL_ATTACHMENT = RenderingContext.DEPTH_STENCIL_ATTACHMENT;
+const int DEPTH_TEST = RenderingContext.DEPTH_TEST;
+const int DEPTH_WRITEMASK = RenderingContext.DEPTH_WRITEMASK;
+const int DITHER = RenderingContext.DITHER;
+const int DONT_CARE = RenderingContext.DONT_CARE;
+const int DST_ALPHA = RenderingContext.DST_ALPHA;
+const int DST_COLOR = RenderingContext.DST_COLOR;
+const int DYNAMIC_DRAW = RenderingContext.DYNAMIC_DRAW;
+const int ELEMENT_ARRAY_BUFFER = RenderingContext.ELEMENT_ARRAY_BUFFER;
+const int ELEMENT_ARRAY_BUFFER_BINDING = RenderingContext.ELEMENT_ARRAY_BUFFER_BINDING;
+const int EQUAL = RenderingContext.EQUAL;
+const int FASTEST = RenderingContext.FASTEST;
+const int FLOAT = RenderingContext.FLOAT;
+const int FLOAT_MAT2 = RenderingContext.FLOAT_MAT2;
+const int FLOAT_MAT3 = RenderingContext.FLOAT_MAT3;
+const int FLOAT_MAT4 = RenderingContext.FLOAT_MAT4;
+const int FLOAT_VEC2 = RenderingContext.FLOAT_VEC2;
+const int FLOAT_VEC3 = RenderingContext.FLOAT_VEC3;
+const int FLOAT_VEC4 = RenderingContext.FLOAT_VEC4;
+const int FRAGMENT_SHADER = RenderingContext.FRAGMENT_SHADER;
+const int FRAMEBUFFER = RenderingContext.FRAMEBUFFER;
+const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = RenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME;
+const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = RenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE;
+const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = RenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE;
+const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = RenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL;
+const int FRAMEBUFFER_BINDING = RenderingContext.FRAMEBUFFER_BINDING;
+const int FRAMEBUFFER_COMPLETE = RenderingContext.FRAMEBUFFER_COMPLETE;
+const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = RenderingContext.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = RenderingContext.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
+const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = RenderingContext.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+const int FRAMEBUFFER_UNSUPPORTED = RenderingContext.FRAMEBUFFER_UNSUPPORTED;
+const int FRONT = RenderingContext.FRONT;
+const int FRONT_AND_BACK = RenderingContext.FRONT_AND_BACK;
+const int FRONT_FACE = RenderingContext.FRONT_FACE;
+const int FUNC_ADD = RenderingContext.FUNC_ADD;
+const int FUNC_REVERSE_SUBTRACT = RenderingContext.FUNC_REVERSE_SUBTRACT;
+const int FUNC_SUBTRACT = RenderingContext.FUNC_SUBTRACT;
+const int GENERATE_MIPMAP_HINT = RenderingContext.GENERATE_MIPMAP_HINT;
+const int GEQUAL = RenderingContext.GEQUAL;
+const int GREATER = RenderingContext.GREATER;
+const int GREEN_BITS = RenderingContext.GREEN_BITS;
+const int HALF_FLOAT_OES = RenderingContext.HALF_FLOAT_OES;
+const int HIGH_FLOAT = RenderingContext.HIGH_FLOAT;
+const int HIGH_INT = RenderingContext.HIGH_INT;
+const int INCR = RenderingContext.INCR;
+const int INCR_WRAP = RenderingContext.INCR_WRAP;
+const int INT = RenderingContext.INT;
+const int INT_VEC2 = RenderingContext.INT_VEC2;
+const int INT_VEC3 = RenderingContext.INT_VEC3;
+const int INT_VEC4 = RenderingContext.INT_VEC4;
+const int INVALID_ENUM = RenderingContext.INVALID_ENUM;
+const int INVALID_FRAMEBUFFER_OPERATION = RenderingContext.INVALID_FRAMEBUFFER_OPERATION;
+const int INVALID_OPERATION = RenderingContext.INVALID_OPERATION;
+const int INVALID_VALUE = RenderingContext.INVALID_VALUE;
+const int INVERT = RenderingContext.INVERT;
+const int KEEP = RenderingContext.KEEP;
+const int LEQUAL = RenderingContext.LEQUAL;
+const int LESS = RenderingContext.LESS;
+const int LINEAR = RenderingContext.LINEAR;
+const int LINEAR_MIPMAP_LINEAR = RenderingContext.LINEAR_MIPMAP_LINEAR;
+const int LINEAR_MIPMAP_NEAREST = RenderingContext.LINEAR_MIPMAP_NEAREST;
+const int LINES = RenderingContext.LINES;
+const int LINE_LOOP = RenderingContext.LINE_LOOP;
+const int LINE_STRIP = RenderingContext.LINE_STRIP;
+const int LINE_WIDTH = RenderingContext.LINE_WIDTH;
+const int LINK_STATUS = RenderingContext.LINK_STATUS;
+const int LOW_FLOAT = RenderingContext.LOW_FLOAT;
+const int LOW_INT = RenderingContext.LOW_INT;
+const int LUMINANCE = RenderingContext.LUMINANCE;
+const int LUMINANCE_ALPHA = RenderingContext.LUMINANCE_ALPHA;
+const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_COMBINED_TEXTURE_IMAGE_UNITS;
+const int MAX_CUBE_MAP_TEXTURE_SIZE = RenderingContext.MAX_CUBE_MAP_TEXTURE_SIZE;
+const int MAX_FRAGMENT_UNIFORM_VECTORS = RenderingContext.MAX_FRAGMENT_UNIFORM_VECTORS;
+const int MAX_RENDERBUFFER_SIZE = RenderingContext.MAX_RENDERBUFFER_SIZE;
+const int MAX_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_TEXTURE_IMAGE_UNITS;
+const int MAX_TEXTURE_SIZE = RenderingContext.MAX_TEXTURE_SIZE;
+const int MAX_VARYING_VECTORS = RenderingContext.MAX_VARYING_VECTORS;
+const int MAX_VERTEX_ATTRIBS = RenderingContext.MAX_VERTEX_ATTRIBS;
+const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = RenderingContext.MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+const int MAX_VERTEX_UNIFORM_VECTORS = RenderingContext.MAX_VERTEX_UNIFORM_VECTORS;
+const int MAX_VIEWPORT_DIMS = RenderingContext.MAX_VIEWPORT_DIMS;
+const int MEDIUM_FLOAT = RenderingContext.MEDIUM_FLOAT;
+const int MEDIUM_INT = RenderingContext.MEDIUM_INT;
+const int MIRRORED_REPEAT = RenderingContext.MIRRORED_REPEAT;
+const int NEAREST = RenderingContext.NEAREST;
+const int NEAREST_MIPMAP_LINEAR = RenderingContext.NEAREST_MIPMAP_LINEAR;
+const int NEAREST_MIPMAP_NEAREST = RenderingContext.NEAREST_MIPMAP_NEAREST;
+const int NEVER = RenderingContext.NEVER;
+const int NICEST = RenderingContext.NICEST;
+const int NONE = RenderingContext.NONE;
+const int NOTEQUAL = RenderingContext.NOTEQUAL;
+const int NO_ERROR = RenderingContext.NO_ERROR;
+const int ONE = RenderingContext.ONE;
+const int ONE_MINUS_CONSTANT_ALPHA = RenderingContext.ONE_MINUS_CONSTANT_ALPHA;
+const int ONE_MINUS_CONSTANT_COLOR = RenderingContext.ONE_MINUS_CONSTANT_COLOR;
+const int ONE_MINUS_DST_ALPHA = RenderingContext.ONE_MINUS_DST_ALPHA;
+const int ONE_MINUS_DST_COLOR = RenderingContext.ONE_MINUS_DST_COLOR;
+const int ONE_MINUS_SRC_ALPHA = RenderingContext.ONE_MINUS_SRC_ALPHA;
+const int ONE_MINUS_SRC_COLOR = RenderingContext.ONE_MINUS_SRC_COLOR;
+const int OUT_OF_MEMORY = RenderingContext.OUT_OF_MEMORY;
+const int PACK_ALIGNMENT = RenderingContext.PACK_ALIGNMENT;
+const int POINTS = RenderingContext.POINTS;
+const int POLYGON_OFFSET_FACTOR = RenderingContext.POLYGON_OFFSET_FACTOR;
+const int POLYGON_OFFSET_FILL = RenderingContext.POLYGON_OFFSET_FILL;
+const int POLYGON_OFFSET_UNITS = RenderingContext.POLYGON_OFFSET_UNITS;
+const int RED_BITS = RenderingContext.RED_BITS;
+const int RENDERBUFFER = RenderingContext.RENDERBUFFER;
+const int RENDERBUFFER_ALPHA_SIZE = RenderingContext.RENDERBUFFER_ALPHA_SIZE;
+const int RENDERBUFFER_BINDING = RenderingContext.RENDERBUFFER_BINDING;
+const int RENDERBUFFER_BLUE_SIZE = RenderingContext.RENDERBUFFER_BLUE_SIZE;
+const int RENDERBUFFER_DEPTH_SIZE = RenderingContext.RENDERBUFFER_DEPTH_SIZE;
+const int RENDERBUFFER_GREEN_SIZE = RenderingContext.RENDERBUFFER_GREEN_SIZE;
+const int RENDERBUFFER_HEIGHT = RenderingContext.RENDERBUFFER_HEIGHT;
+const int RENDERBUFFER_INTERNAL_FORMAT = RenderingContext.RENDERBUFFER_INTERNAL_FORMAT;
+const int RENDERBUFFER_RED_SIZE = RenderingContext.RENDERBUFFER_RED_SIZE;
+const int RENDERBUFFER_STENCIL_SIZE = RenderingContext.RENDERBUFFER_STENCIL_SIZE;
+const int RENDERBUFFER_WIDTH = RenderingContext.RENDERBUFFER_WIDTH;
+const int RENDERER = RenderingContext.RENDERER;
+const int REPEAT = RenderingContext.REPEAT;
+const int REPLACE = RenderingContext.REPLACE;
+const int RGB = RenderingContext.RGB;
+const int RGB565 = RenderingContext.RGB565;
+const int RGB5_A1 = RenderingContext.RGB5_A1;
+const int RGBA = RenderingContext.RGBA;
+const int RGBA4 = RenderingContext.RGBA4;
+const int SAMPLER_2D = RenderingContext.SAMPLER_2D;
+const int SAMPLER_CUBE = RenderingContext.SAMPLER_CUBE;
+const int SAMPLES = RenderingContext.SAMPLES;
+const int SAMPLE_ALPHA_TO_COVERAGE = RenderingContext.SAMPLE_ALPHA_TO_COVERAGE;
+const int SAMPLE_BUFFERS = RenderingContext.SAMPLE_BUFFERS;
+const int SAMPLE_COVERAGE = RenderingContext.SAMPLE_COVERAGE;
+const int SAMPLE_COVERAGE_INVERT = RenderingContext.SAMPLE_COVERAGE_INVERT;
+const int SAMPLE_COVERAGE_VALUE = RenderingContext.SAMPLE_COVERAGE_VALUE;
+const int SCISSOR_BOX = RenderingContext.SCISSOR_BOX;
+const int SCISSOR_TEST = RenderingContext.SCISSOR_TEST;
+const int SHADER_TYPE = RenderingContext.SHADER_TYPE;
+const int SHADING_LANGUAGE_VERSION = RenderingContext.SHADING_LANGUAGE_VERSION;
+const int SHORT = RenderingContext.SHORT;
+const int SRC_ALPHA = RenderingContext.SRC_ALPHA;
+const int SRC_ALPHA_SATURATE = RenderingContext.SRC_ALPHA_SATURATE;
+const int SRC_COLOR = RenderingContext.SRC_COLOR;
+const int STATIC_DRAW = RenderingContext.STATIC_DRAW;
+const int STENCIL_ATTACHMENT = RenderingContext.STENCIL_ATTACHMENT;
+const int STENCIL_BACK_FAIL = RenderingContext.STENCIL_BACK_FAIL;
+const int STENCIL_BACK_FUNC = RenderingContext.STENCIL_BACK_FUNC;
+const int STENCIL_BACK_PASS_DEPTH_FAIL = RenderingContext.STENCIL_BACK_PASS_DEPTH_FAIL;
+const int STENCIL_BACK_PASS_DEPTH_PASS = RenderingContext.STENCIL_BACK_PASS_DEPTH_PASS;
+const int STENCIL_BACK_REF = RenderingContext.STENCIL_BACK_REF;
+const int STENCIL_BACK_VALUE_MASK = RenderingContext.STENCIL_BACK_VALUE_MASK;
+const int STENCIL_BACK_WRITEMASK = RenderingContext.STENCIL_BACK_WRITEMASK;
+const int STENCIL_BITS = RenderingContext.STENCIL_BITS;
+const int STENCIL_BUFFER_BIT = RenderingContext.STENCIL_BUFFER_BIT;
+const int STENCIL_CLEAR_VALUE = RenderingContext.STENCIL_CLEAR_VALUE;
+const int STENCIL_FAIL = RenderingContext.STENCIL_FAIL;
+const int STENCIL_FUNC = RenderingContext.STENCIL_FUNC;
+const int STENCIL_INDEX = RenderingContext.STENCIL_INDEX;
+const int STENCIL_INDEX8 = RenderingContext.STENCIL_INDEX8;
+const int STENCIL_PASS_DEPTH_FAIL = RenderingContext.STENCIL_PASS_DEPTH_FAIL;
+const int STENCIL_PASS_DEPTH_PASS = RenderingContext.STENCIL_PASS_DEPTH_PASS;
+const int STENCIL_REF = RenderingContext.STENCIL_REF;
+const int STENCIL_TEST = RenderingContext.STENCIL_TEST;
+const int STENCIL_VALUE_MASK = RenderingContext.STENCIL_VALUE_MASK;
+const int STENCIL_WRITEMASK = RenderingContext.STENCIL_WRITEMASK;
+const int STREAM_DRAW = RenderingContext.STREAM_DRAW;
+const int SUBPIXEL_BITS = RenderingContext.SUBPIXEL_BITS;
+const int TEXTURE = RenderingContext.TEXTURE;
+const int TEXTURE0 = RenderingContext.TEXTURE0;
+const int TEXTURE1 = RenderingContext.TEXTURE1;
+const int TEXTURE10 = RenderingContext.TEXTURE10;
+const int TEXTURE11 = RenderingContext.TEXTURE11;
+const int TEXTURE12 = RenderingContext.TEXTURE12;
+const int TEXTURE13 = RenderingContext.TEXTURE13;
+const int TEXTURE14 = RenderingContext.TEXTURE14;
+const int TEXTURE15 = RenderingContext.TEXTURE15;
+const int TEXTURE16 = RenderingContext.TEXTURE16;
+const int TEXTURE17 = RenderingContext.TEXTURE17;
+const int TEXTURE18 = RenderingContext.TEXTURE18;
+const int TEXTURE19 = RenderingContext.TEXTURE19;
+const int TEXTURE2 = RenderingContext.TEXTURE2;
+const int TEXTURE20 = RenderingContext.TEXTURE20;
+const int TEXTURE21 = RenderingContext.TEXTURE21;
+const int TEXTURE22 = RenderingContext.TEXTURE22;
+const int TEXTURE23 = RenderingContext.TEXTURE23;
+const int TEXTURE24 = RenderingContext.TEXTURE24;
+const int TEXTURE25 = RenderingContext.TEXTURE25;
+const int TEXTURE26 = RenderingContext.TEXTURE26;
+const int TEXTURE27 = RenderingContext.TEXTURE27;
+const int TEXTURE28 = RenderingContext.TEXTURE28;
+const int TEXTURE29 = RenderingContext.TEXTURE29;
+const int TEXTURE3 = RenderingContext.TEXTURE3;
+const int TEXTURE30 = RenderingContext.TEXTURE30;
+const int TEXTURE31 = RenderingContext.TEXTURE31;
+const int TEXTURE4 = RenderingContext.TEXTURE4;
+const int TEXTURE5 = RenderingContext.TEXTURE5;
+const int TEXTURE6 = RenderingContext.TEXTURE6;
+const int TEXTURE7 = RenderingContext.TEXTURE7;
+const int TEXTURE8 = RenderingContext.TEXTURE8;
+const int TEXTURE9 = RenderingContext.TEXTURE9;
+const int TEXTURE_2D = RenderingContext.TEXTURE_2D;
+const int TEXTURE_BINDING_2D = RenderingContext.TEXTURE_BINDING_2D;
+const int TEXTURE_BINDING_CUBE_MAP = RenderingContext.TEXTURE_BINDING_CUBE_MAP;
+const int TEXTURE_CUBE_MAP = RenderingContext.TEXTURE_CUBE_MAP;
+const int TEXTURE_CUBE_MAP_NEGATIVE_X = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X;
+const int TEXTURE_CUBE_MAP_NEGATIVE_Y = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y;
+const int TEXTURE_CUBE_MAP_NEGATIVE_Z = RenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z;
+const int TEXTURE_CUBE_MAP_POSITIVE_X = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X;
+const int TEXTURE_CUBE_MAP_POSITIVE_Y = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y;
+const int TEXTURE_CUBE_MAP_POSITIVE_Z = RenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z;
+const int TEXTURE_MAG_FILTER = RenderingContext.TEXTURE_MAG_FILTER;
+const int TEXTURE_MIN_FILTER = RenderingContext.TEXTURE_MIN_FILTER;
+const int TEXTURE_WRAP_S = RenderingContext.TEXTURE_WRAP_S;
+const int TEXTURE_WRAP_T = RenderingContext.TEXTURE_WRAP_T;
+const int TRIANGLES = RenderingContext.TRIANGLES;
+const int TRIANGLE_FAN = RenderingContext.TRIANGLE_FAN;
+const int TRIANGLE_STRIP = RenderingContext.TRIANGLE_STRIP;
+const int UNPACK_ALIGNMENT = RenderingContext.UNPACK_ALIGNMENT;
+const int UNPACK_COLORSPACE_CONVERSION_WEBGL = RenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL;
+const int UNPACK_FLIP_Y_WEBGL = RenderingContext.UNPACK_FLIP_Y_WEBGL;
+const int UNPACK_PREMULTIPLY_ALPHA_WEBGL = RenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL;
+const int UNSIGNED_BYTE = RenderingContext.UNSIGNED_BYTE;
+const int UNSIGNED_INT = RenderingContext.UNSIGNED_INT;
+const int UNSIGNED_SHORT = RenderingContext.UNSIGNED_SHORT;
+const int UNSIGNED_SHORT_4_4_4_4 = RenderingContext.UNSIGNED_SHORT_4_4_4_4;
+const int UNSIGNED_SHORT_5_5_5_1 = RenderingContext.UNSIGNED_SHORT_5_5_5_1;
+const int UNSIGNED_SHORT_5_6_5 = RenderingContext.UNSIGNED_SHORT_5_6_5;
+const int VALIDATE_STATUS = RenderingContext.VALIDATE_STATUS;
+const int VENDOR = RenderingContext.VENDOR;
+const int VERSION = RenderingContext.VERSION;
+const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = RenderingContext.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING;
+const int VERTEX_ATTRIB_ARRAY_ENABLED = RenderingContext.VERTEX_ATTRIB_ARRAY_ENABLED;
+const int VERTEX_ATTRIB_ARRAY_NORMALIZED = RenderingContext.VERTEX_ATTRIB_ARRAY_NORMALIZED;
+const int VERTEX_ATTRIB_ARRAY_POINTER = RenderingContext.VERTEX_ATTRIB_ARRAY_POINTER;
+const int VERTEX_ATTRIB_ARRAY_SIZE = RenderingContext.VERTEX_ATTRIB_ARRAY_SIZE;
+const int VERTEX_ATTRIB_ARRAY_STRIDE = RenderingContext.VERTEX_ATTRIB_ARRAY_STRIDE;
+const int VERTEX_ATTRIB_ARRAY_TYPE = RenderingContext.VERTEX_ATTRIB_ARRAY_TYPE;
+const int VERTEX_SHADER = RenderingContext.VERTEX_SHADER;
+const int VIEWPORT = RenderingContext.VIEWPORT;
+const int ZERO = RenderingContext.ZERO;
diff --git a/tools/dom/src/WrappedList.dart b/tools/dom/src/WrappedList.dart
index eb255ce..171dd7e 100644
--- a/tools/dom/src/WrappedList.dart
+++ b/tools/dom/src/WrappedList.dart
@@ -30,6 +30,9 @@
   dynamic reduce(initialValue, combine(previousValue, E element)) =>
       _list.reduce(initialValue, combine);
 
+  dynamic fold(initialValue, combine(previousValue, E element)) =>
+      _list.fold(initialValue, combine);
+
   bool every(bool f(E element)) => _list.every(f);
 
   String join([String separator]) => _list.join(separator);
@@ -99,8 +102,6 @@
 
   void set length(int newLength) { _list.length = newLength; }
 
-  void addLast(E value) { _list.add(value); }
-
   Iterable<E> get reversed => _list.reversed;
 
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
diff --git a/tools/dom/src/dart2js_Conversions.dart b/tools/dom/src/dart2js_Conversions.dart
index 7e9ee41..8ced5ef 100644
--- a/tools/dom/src/dart2js_Conversions.dart
+++ b/tools/dom/src/dart2js_Conversions.dart
@@ -25,6 +25,9 @@
 }
 
 EventTarget _convertNativeToDart_EventTarget(e) {
+  if (e == null) {
+    return null;
+  }
   // Assume it's a Window if it contains the setInterval property.  It may be
   // from a different frame - without a patched prototype - so we cannot
   // rely on Dart type checking.
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index 8bcab03..aeb3775 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -59,7 +59,8 @@
 
   static window() native "Utils_window";
   static forwardingPrint(String message) native "Utils_forwardingPrint";
-  static void spawnDomFunction(Function topLevelFunction, int replyTo) native "Utils_spawnDomFunction";
+  static void spawnDomFunction(Function f, int replyTo) native "Utils_spawnDomFunction";
+  static void spawnDomUri(String uri, int replyTo) native "Utils_spawnDomUri";
   static int _getNewIsolateId() native "Utils_getNewIsolateId";
   static bool shadowRootSupported(Document document) native "Utils_shadowRootSupported";
 }
@@ -131,9 +132,29 @@
   bool get isEmpty => Maps.isEmpty(this);
 }
 
-final Future<SendPort> _HELPER_ISOLATE_PORT =
+final Future<SendPort> __HELPER_ISOLATE_PORT =
     spawnDomFunction(_helperIsolateMain);
 
+// Tricky part.
+// Once __HELPER_ISOLATE_PORT gets resolved, it will still delay in .then
+// and to delay Timer.run is used. However, Timer.run will try to register
+// another Timer and here we got stuck: event cannot be posted as then
+// callback is not executed because it's delayed with timer.
+// Therefore once future is resolved, it's unsafe to call .then on it
+// in Timer code.
+SendPort __SEND_PORT;
+
+_sendToHelperIsolate(msg, SendPort replyTo) {
+  if (__SEND_PORT != null) {
+    __SEND_PORT.send(msg, replyTo);
+  } else {
+    __HELPER_ISOLATE_PORT.then((port) {
+      __SEND_PORT = port;
+      __SEND_PORT.send(msg, replyTo);
+    });
+  }
+}
+
 final _TIMER_REGISTRY = new Map<SendPort, Timer>();
 
 const _NEW_TIMER = 'NEW_TIMER';
@@ -147,10 +168,10 @@
     if (cmd == _NEW_TIMER) {
       final duration = new Duration(milliseconds: msg[1]);
       bool periodic = msg[2];
-      final callback = () { replyTo.send(_TIMER_PING); };
+      ping() { replyTo.send(_TIMER_PING); };
       _TIMER_REGISTRY[replyTo] = periodic ?
-          new Timer.periodic(duration, callback) :
-          new Timer(duration, callback);
+          new Timer.periodic(duration, (_) { ping(); }) :
+          new Timer(duration, ping);
     } else if (cmd == _CANCEL_TIMER) {
       _TIMER_REGISTRY.remove(replyTo).cancel();
     } else if (cmd == _PRINT) {
@@ -163,9 +184,66 @@
 
 final _printClosure = window.console.log;
 final _pureIsolatePrintClosure = (s) {
-  _HELPER_ISOLATE_PORT.then((sendPort) {
-    sendPort.send([_PRINT, s]);
-  });
+  _sendToHelperIsolate([_PRINT, s], null);
 };
 
 final _forwardingPrintClosure = _Utils.forwardingPrint;
+
+class _Timer implements Timer {
+  final canceller;
+
+  _Timer(this.canceller);
+
+  void cancel() { canceller(); }
+}
+
+get _timerFactoryClosure => (int milliSeconds, void callback(Timer timer), bool repeating) {
+  var maker;
+  var canceller;
+  if (repeating) {
+    maker = window._setInterval;
+    canceller = window._clearInterval;
+  } else {
+    maker = window._setTimeout;
+    canceller = window._clearTimeout;
+  }
+  Timer timer;
+  final int id = maker(() { callback(timer); }, milliSeconds);
+  timer = new _Timer(() { canceller(id); });
+  return timer;
+};
+
+class _PureIsolateTimer implements Timer {
+  final ReceivePort _port = new ReceivePort();
+  SendPort _sendPort; // Effectively final.
+
+  static SendPort _SEND_PORT;
+
+  _PureIsolateTimer(int milliSeconds, callback, repeating) {
+    _sendPort = _port.toSendPort();
+    _port.receive((msg, replyTo) {
+      assert(msg == _TIMER_PING);
+      callback(this);
+      if (!repeating) _cancel();
+    });
+
+    _send([_NEW_TIMER, milliSeconds, repeating]);
+  }
+
+  void cancel() {
+    _cancel();
+    _send([_CANCEL_TIMER]);
+  }
+
+  void _cancel() {
+    _port.close();
+  }
+
+  _send(msg) {
+    _sendToHelperIsolate(msg, _sendPort);
+  }
+}
+
+get _pureIsolateTimerFactoryClosure =>
+    ((int milliSeconds, void callback(Timer time), bool repeating) =>
+        new _PureIsolateTimer(milliSeconds, callback, repeating));
diff --git a/tools/dom/src/native_DOMPublic.dart b/tools/dom/src/native_DOMPublic.dart
index 5044945..4034d91 100644
--- a/tools/dom/src/native_DOMPublic.dart
+++ b/tools/dom/src/native_DOMPublic.dart
@@ -4,8 +4,7 @@
 
 part of html;
 
-// This API is exploratory.
-Future<SendPort> spawnDomFunction(Function topLevelFunction) {
+_makeSendPortFuture(spawnRequest) {
   final completer = new Completer<SendPort>();
   final port = new ReceivePort();
   port.receive((result, _) {
@@ -13,10 +12,17 @@
     port.close();
   });
   // TODO: SendPort.hashCode is ugly way to access port id.
-  _Utils.spawnDomFunction(topLevelFunction, port.toSendPort().hashCode);
+  spawnRequest(port.toSendPort().hashCode);
   return completer.future;
 }
 
+// This API is exploratory.
+Future<SendPort> spawnDomFunction(Function f) =>
+    _makeSendPortFuture((portId) { _Utils.spawnDomFunction(f, portId); });
+
+Future<SendPort> spawnDomUri(String uri) =>
+    _makeSendPortFuture((portId) { _Utils.spawnDomUri(uri, portId); });
+
 // testRunner implementation.
 // FIXME: provide a separate lib for testRunner.
 
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index 18c1ee2..fa10608 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -20,6 +20,7 @@
 // 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:_js_helper' show convertDartClosureToJS, Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
 import 'dart:_isolate_helper' show IsolateNatives;
 import 'dart:_foreign_helper' show JS;
@@ -40,7 +41,6 @@
 part '$AUXILIARY_DIR/Point.dart';
 part '$AUXILIARY_DIR/ReadyState.dart';
 part '$AUXILIARY_DIR/Rectangle.dart';
-part '$AUXILIARY_DIR/Timer.dart';
 part '$AUXILIARY_DIR/_HttpRequestUtils.dart';
 part '$AUXILIARY_DIR/Isolates.dart';
 part '$AUXILIARY_DIR/Microtask.dart';
diff --git a/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
new file mode 100644
index 0000000..4d1ccdf
--- /dev/null
+++ b/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
@@ -0,0 +1,15 @@
+// DO NOT EDIT - unless you are editing documentation as per:
+// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
+// Auto-generated dart:web_gl library.
+
+library dart.dom.web_gl;
+
+import 'dart:collection';
+import 'dart:html';
+import 'dart:html_common';
+import 'dart:_js_helper' show Creates, JSName, Null, Returns, convertDartClosureToJS;
+import 'dart:_foreign_helper' show JS;
+
+part '$AUXILIARY_DIR/WebGLConstants.dart';
+
+$!GENERATED_DART_FILES
diff --git a/tools/dom/templates/html/dartium/html_dartium.darttemplate b/tools/dom/templates/html/dartium/html_dartium.darttemplate
index b512499..c84c791 100644
--- a/tools/dom/templates/html/dartium/html_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/html_dartium.darttemplate
@@ -17,6 +17,7 @@
 import 'dart:math';
 import 'dart:nativewrappers';
 import 'dart:typeddata' as _typeddata;
+import 'dart:web_gl' as gl;
 import 'dart:web_sql';
 // Not actually used, but imported since dart:html can generate these objects.
 import 'dart:svg' as svg;
@@ -38,7 +39,6 @@
 part '$AUXILIARY_DIR/Point.dart';
 part '$AUXILIARY_DIR/ReadyState.dart';
 part '$AUXILIARY_DIR/Rectangle.dart';
-part '$AUXILIARY_DIR/Timer.dart';
 part '$AUXILIARY_DIR/WrappedList.dart';
 part '$AUXILIARY_DIR/_HttpRequestUtils.dart';
 part '$AUXILIARY_DIR/shared_FactoryProviders.dart';
diff --git a/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate b/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate
new file mode 100644
index 0000000..fb6d6b0
--- /dev/null
+++ b/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate
@@ -0,0 +1,15 @@
+// DO NOT EDIT
+// Auto-generated dart:web_gl library.
+
+library dart.dom.web_gl;
+
+import 'dart:async';
+import 'dart:collection';
+import 'dart:html';
+import 'dart:html_common';
+import 'dart:nativewrappers';
+import 'dart:typeddata' as _typeddata;
+
+part '$AUXILIARY_DIR/WebGLConstants.dart';
+
+$!GENERATED_DART_FILES
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index a868eb0..6d34148 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -137,8 +137,6 @@
     return value;
   }
 
-  Element addLast(Element value) => add(value);
-
   Iterator<Element> get iterator => toList().iterator;
 
   void addAll(Iterable<Element> iterable) {
@@ -164,6 +162,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Element element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
     throw new UnimplementedError();
   }
@@ -391,10 +394,6 @@
     throw new UnsupportedError('');
   }
 
-  void addLast(Element value) {
-    throw new UnsupportedError('');
-  }
-
   Iterator<Element> get iterator => new _FrozenElementListIterator(this);
 
   void addAll(Iterable<Element> iterable) {
@@ -414,6 +413,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Element element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
     throw new UnsupportedError('');
   }
diff --git a/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
index 02aabe9e..50b23ad 100644
--- a/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
@@ -11,7 +11,7 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @Experimental
-  WebGLRenderingContext getContext3d({alpha: true, depth: true, stencil: false,
+  gl.RenderingContext getContext3d({alpha: true, depth: true, stencil: false,
     antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) {
 
     var options = {
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index 56d2d11..bd9eeb2 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -63,11 +63,6 @@
     _this.append(value);
   }
 
-  void addLast(Node value) {
-    _this.append(value);
-  }
-
-
   void addAll(Iterable<Node> iterable) {
     if (iterable is _ChildNodeListLazy) {
       if (!identical(iterable._this, _this)) {
@@ -155,6 +150,11 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue,
+      dynamic combine(dynamic previousValue, Node element)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
   String join([String separator]) {
     return IterableMixinWorkaround.joinList(this, separator);
   }
diff --git a/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate b/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
index 93da127..1e4b239 100644
--- a/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
@@ -22,6 +22,13 @@
     }
     final event = document.$dom_createEvent(eventType);
 $if DART2JS
+    // If polyfilling, then flip these because we'll flip them back to match
+    // the W3C standard:
+    // http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY
+    if (JS('bool', '#.deltaY === undefined', event)) {
+      deltaX = -deltaX;
+      deltaY = -deltaY;
+    }
     if (event._hasInitWheelEvent) {
       var modifiers = [];
       if (ctrlKey) {
@@ -57,6 +64,11 @@
           screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
           metaKey, button, relatedTarget, axis);
     } else {
+$else
+    // Dartium always needs these flipped because we're essentially always
+    // polyfilling (see similar dart2js code as well)
+    deltaX = -deltaX;
+    deltaY = -deltaY;
 $endif
       // Fallthrough for Dartium.
       event.$dom_initMouseEvent(type, canBubble, cancelable, view, detail,
@@ -76,6 +88,14 @@
 $!MEMBERS
 
 $if DART2JS
+  /**
+   * The amount that is expected to scroll vertically, in units determined by
+   * [deltaMode].
+   *
+   * See also:
+   *
+   * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
+   */
   @DomName('WheelEvent.deltaY')
   num get deltaY {
     if (JS('bool', '#.deltaY !== undefined', this)) {
@@ -83,7 +103,7 @@
       return this._deltaY;
     } else if (JS('bool', '#.wheelDelta !== undefined', this)) {
       // Chrome and IE
-      return this._wheelDelta;
+      return -this._wheelDelta;
     } else if (JS('bool', '#.detail !== undefined', this)) {
       // Firefox
 
@@ -93,10 +113,10 @@
         var detail = this._detail;
         // Firefox is normally the number of lines to scale (normally 3)
         // so multiply it by 40 to get pixels to move, matching IE & WebKit.
-        if (detail < 100) {
-          return detail * 40;
+        if (detail.abs() < 100) {
+          return -detail * 40;
         }
-        return detail;
+        return -detail;
       }
       return 0;
     }
@@ -104,6 +124,14 @@
         'deltaY is not supported');
   }
 
+  /**
+   * The amount that is expected to scroll horizontally, in units determined by
+   * [deltaMode].
+   *
+   * See also:
+   *
+   * * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
+   */
   @DomName('WheelEvent.deltaX')
   num get deltaX {
     if (JS('bool', '#.deltaX !== undefined', this)) {
@@ -111,7 +139,7 @@
       return this._deltaX;
     } else if (JS('bool', '#.wheelDeltaX !== undefined', this)) {
       // Chrome
-      return this._wheelDeltaX;
+      return -this._wheelDeltaX;
     } else if (JS('bool', '#.detail !== undefined', this)) {
       // Firefox and IE.
       // IE will have detail set but will not set axis.
@@ -124,9 +152,9 @@
         // Firefox is normally the number of lines to scale (normally 3)
         // so multiply it by 40 to get pixels to move, matching IE & WebKit.
         if (detail < 100) {
-          return detail * 40;
+          return -detail * 40;
         }
-        return detail;
+        return -detail;
       }
       return 0;
     }
@@ -193,9 +221,26 @@
       int deltaMode) native;
 
 $else
+  /**
+   * The amount that is expected to scroll horizontally, in units determined by
+   * [deltaMode].
+   *
+   * See also:
+   *
+   * * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
+   */
   @DomName('WheelEvent.deltaX')
-  num get deltaX => $dom_wheelDeltaX;
+  num get deltaX => -$dom_wheelDeltaX;
+
+  /**
+   * The amount that is expected to scroll vertically, in units determined by
+   * [deltaMode].
+   *
+   * See also:
+   *
+   * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
+   */
   @DomName('WheelEvent.deltaY')
-  num get deltaY => $dom_wheelDeltaY;
+  num get deltaY => -$dom_wheelDeltaY;
 $endif
 }
diff --git a/tools/dom/templates/immutable_list_mixin.darttemplate b/tools/dom/templates/immutable_list_mixin.darttemplate
index 11aed32..81c72e2 100644
--- a/tools/dom/templates/immutable_list_mixin.darttemplate
+++ b/tools/dom/templates/immutable_list_mixin.darttemplate
@@ -18,6 +18,10 @@
     return IterableMixinWorkaround.reduce(this, initialValue, combine);
   }
 
+  dynamic fold(dynamic initialValue, dynamic combine(dynamic, $E)) {
+    return IterableMixinWorkaround.fold(this, initialValue, combine);
+  }
+
 $if DEFINE_CONTAINS
   bool contains($E element) => IterableMixinWorkaround.contains(this, element);
 $else
@@ -83,10 +87,6 @@
     throw new UnsupportedError("Cannot add to immutable List.");
   }
 
-  void addLast($E value) {
-    throw new UnsupportedError("Cannot add to immutable List.");
-  }
-
   void addAll(Iterable<$E> iterable) {
     throw new UnsupportedError("Cannot add to immutable List.");
   }
diff --git a/tools/testing/dart/browser_test.dart b/tools/testing/dart/browser_test.dart
index 5e7c715..cb8fd7d 100644
--- a/tools/testing/dart/browser_test.dart
+++ b/tools/testing/dart/browser_test.dart
@@ -49,12 +49,6 @@
 </html>
 """;
 
-String wrapDartTestInLibrary(Path testRelativeToDart) =>
-"""
-library libraryWrapper;
-part '/$testRelativeToDart';
-""";
-
 String dartTestWrapper(bool usePackageImport, String libraryPathComponent) {
   // Tests inside "pkg" import unittest using "package:". All others use a
   // relative path. The imports need to agree, so use a matching form here.
diff --git a/tools/testing/dart/co19_test.dart b/tools/testing/dart/co19_test.dart
index f2ec040..9b38c59 100644
--- a/tools/testing/dart/co19_test.dart
+++ b/tools/testing/dart/co19_test.dart
@@ -32,7 +32,7 @@
     const <String>['-mrelease,debug', '-rvm', '-cnone', '--checked'],
     const <String>['-mrelease', '-rnone', '-cdartc'],
     const <String>['-mrelease', '-rvm', '-cdart2dart'],
-    const <String>['-mrelease', '-rd8', '-cdart2js', '--use-sdk'],
+    const <String>['-mrelease', '-rd8,jsshell', '-cdart2js', '--use-sdk'],
     const <String>['-mrelease', '-rd8', '-cdart2js', '--use-sdk', '--checked']];
 
 void main() {
diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart
index 08c26f6..feffa4c 100644
--- a/tools/testing/dart/http_server.dart
+++ b/tools/testing/dart/http_server.dart
@@ -26,6 +26,8 @@
 ///                directory (i.e. '$BuildDirectory/X').
 /// /FOO/packages/BAR: This will serve the corresponding file from the packages
 ///                    directory (i.e. '$BuildDirectory/packages/BAR')
+/// /ws: This will upgrade the connection to a WebSocket connection and echo
+///      all data back to the client.
 ///
 /// In case a path does not refer to a file but rather to a directory, a
 /// directory listing will be displayed.
@@ -132,6 +134,8 @@
       httpServer.listen((HttpRequest request) {
         if (request.uri.path == "/echo") {
           _handleEchoRequest(request, request.response);
+        } else if (request.uri.path == '/ws') {
+          _handleWebSocketRequest(request);
         } else {
           _handleFileOrDirectoryRequest(
               request, request.response, allowedPort);
@@ -186,6 +190,21 @@
     });
   }
 
+  void _handleWebSocketRequest(HttpRequest request) {
+    WebSocketTransformer.upgrade(request).then((websocket) {
+      websocket.listen((data) {
+        websocket.send(data);
+        websocket.close();
+      }, onError: (e) {
+        DebugLogger.warning(
+            'HttpServer: error while echoing to WebSocket: $e');
+      });
+    }).catchError((e) {
+      DebugLogger.warning(
+          'HttpServer: error while transforming to WebSocket: $e');
+    });
+  }
+
   Path _getFilePathFromRequestPath(String urlRequestPath) {
     // Go to the top of the file to see an explanation of the URL path scheme.
     var requestPath = new Path(urlRequestPath.substring(1)).canonicalize();
diff --git a/tools/testing/dart/test_progress.dart b/tools/testing/dart/test_progress.dart
index 7733217..af5caf6 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -61,6 +61,12 @@
 
 List<String> _buildFailureOutput(TestCase test,
                                  [Formatter formatter = const Formatter()]) {
+
+  List<String> getLinesWithoutCarriageReturn(List<int> output) {
+    return decodeUtf8(output).replaceAll('\r\n', '\n')
+        .replaceAll('\r', '\n').split('\n');
+  }
+
   List<String> output = new List<String>();
   output.add('');
   output.add(formatter.failed('FAILED: ${test.configurationString}'
@@ -98,13 +104,14 @@
       output.add('DRT pixel test failed! stdout is not printed because it '
                  'contains binary data!');
     } else {
-      output.add(decodeUtf8(test.lastCommandOutput.stdout));
+      output.addAll(
+          getLinesWithoutCarriageReturn(test.lastCommandOutput.stdout));
     }
   }
   if (!test.lastCommandOutput.stderr.isEmpty) {
     output.add('');
     output.add('stderr:');
-    output.add(decodeUtf8(test.lastCommandOutput.stderr));
+    output.addAll(getLinesWithoutCarriageReturn(test.lastCommandOutput.stderr));
   }
   if (test is BrowserTestCase) {
     // Additional command for rerunning the steps locally after the fact.
@@ -504,9 +511,11 @@
   }
 
   void allDone() {
-    if (!_failureSummary.isEmpty && stepName != null) {
+    if (!_failureSummary.isEmpty) {
       print('@@@STEP_FAILURE@@@');
-      print('@@@BUILD_STEP $stepName failures@@@');
+      if (stepName != null) {
+        print('@@@BUILD_STEP $stepName failures@@@');
+      }
       for (String line in _failureSummary) {
         print(line);
       }
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 4246405..24c71dc 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -872,15 +872,6 @@
     dartWrapper.closeSync();
   }
 
-  void _createLibraryWrapperFile(Path dartLibraryFilename, filePath) {
-    File file = new File(dartLibraryFilename.toNativePath());
-    RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE);
-    var requestPath = new Path(PREFIX_DARTDIR)
-        .join(filePath.relativeTo(TestUtils.dartDir()));
-    dartLibrary.writeStringSync(wrapDartTestInLibrary(requestPath));
-    dartLibrary.closeSync();
-  }
-
   /**
    * The [StandardTestSuite] has support for tests that
    * compile a test from Dart to JavaScript, and then run the resulting
@@ -903,12 +894,6 @@
     Path filePath = info.filePath;
     String filename = filePath.toString();
     bool isWebTest = optionsFromFile['containsDomImport'];
-    bool isLibraryDefinition = optionsFromFile['isLibraryDefinition'];
-    if (isWrappingRequired
-        && !isLibraryDefinition && optionsFromFile['containsSourceOrImport']) {
-      print('Warning for $filename: Browser tests require #library '
-            'in any file that uses #import, #source, or #resource');
-    }
 
     final String compiler = configuration['compiler'];
     final String runtime = configuration['runtime'];
@@ -930,15 +915,8 @@
 
       String htmlPath = '$tempDir/test.html';
       if (isWrappingRequired && !isWebTest) {
-        // test.dart will import the dart test directly, if it is a library,
-        // or indirectly through test_as_library.dart, if it is not.
-        Path dartLibraryFilename = filePath;
-        if (!isLibraryDefinition) {
-          dartLibraryFilename = new Path(tempDir).append(
-              'test_as_library.dart');
-          _createLibraryWrapperFile(dartLibraryFilename, filePath);
-        }
-        _createWrapperFile(dartWrapperFilename, dartLibraryFilename);
+        // test.dart will import the dart test.
+        _createWrapperFile(dartWrapperFilename, filePath);
       } else {
         dartWrapperFilename = filename;
         // TODO(whesse): Once test.py is retired, adjust the relative path in
@@ -1355,10 +1333,6 @@
     RegExp domImportRegExp =
         new RegExp(r"^[#]?import.*dart:(html|web_audio|indexed_db|svg|web_sql)",
         multiLine: true);
-    RegExp libraryDefinitionRegExp =
-        new RegExp(r"^[#]?library[\( ]", multiLine: true);
-    RegExp sourceOrImportRegExp =
-        new RegExp("^(#source|#import|part)[ \t]+[\('\"]", multiLine: true);
 
     var bytes = new File.fromPath(filePath).readAsBytesSync();
     String contents = decodeUtf8(bytes);
@@ -1418,8 +1392,6 @@
     Match isolateMatch = isolateStubsRegExp.firstMatch(contents);
     String isolateStubs = isolateMatch != null ? isolateMatch[1] : '';
     bool containsDomImport = domImportRegExp.hasMatch(contents);
-    bool isLibraryDefinition = libraryDefinitionRegExp.hasMatch(contents);
-    bool containsSourceOrImport = sourceOrImportRegExp.hasMatch(contents);
     int numStaticTypeAnnotations = 0;
     for (var i in staticTypeRegExp.allMatches(contents)) {
       numStaticTypeAnnotations++;
@@ -1455,8 +1427,6 @@
              "subtestNames": subtestNames,
              "isolateStubs": isolateStubs,
              "containsDomImport": containsDomImport,
-             "isLibraryDefinition": isLibraryDefinition,
-             "containsSourceOrImport": containsSourceOrImport,
              "numStaticTypeAnnotations": numStaticTypeAnnotations,
              "numCompileTimeAnnotations": numCompileTimeAnnotations };
   }
@@ -1508,11 +1478,8 @@
 
       // Using stderr.writeString to avoid breaking dartc/junit_tests
       // which parses the output of the --list option.
-
-      // Removed the print below. Tracking of this should be done in the bug
-      // and not in the developer's terminals.
-      // stderr.writeln(
-      //    "Warning: deprecated @dynamic-type-error tag used in $filePath");
+      stderr.writeln(
+          "Warning: deprecated @dynamic-type-error tag used in $filePath");
     }
 
     return {
@@ -1528,8 +1495,6 @@
       "subtestNames": <String>[],
       "isolateStubs": '',
       "containsDomImport": false,
-      "isLibraryDefinition": false,
-      "containsSourceOrImport": false,
       "numStaticTypeAnnotations": 0,
       "numCompileTimeAnnotations": 0,
     };
diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart
index 5405e3a..a4fbe43 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -37,7 +37,7 @@
 
   List<String> excludedLibraries = <String>[];
   List<String> includedLibraries = <String>[];
-  Path pkgPath;
+  Path packageRoot;
   String version;
 
   // Parse the command-line arguments.
@@ -64,8 +64,8 @@
           includedLibraries.add(arg.substring('--include-lib='.length));
         } else if (arg.startsWith('--out=')) {
           outputDir = new Path(arg.substring('--out='.length));
-        } else if (arg.startsWith('--pkg=')) {
-          pkgPath = new Path(arg.substring('--pkg='.length));
+        } else if (arg.startsWith('--package-root=')) {
+          packageRoot = new Path(arg.substring('--package-root='.length));
         } else if (arg.startsWith('--version=')) {
           version = arg.substring('--version='.length);
         } else {
@@ -147,10 +147,15 @@
 
     // TODO(amouravski): make apidoc use roughly the same flow as bin/dartdoc.
     Future.wait([copiedStatic, copiedApiDocStatic, htmlDiff])
-      .then((_) => apidoc.documentLibraries(apidocLibraries, libPath, pkgPath))
+      .then((_) => apidoc.documentLibraries( apidocLibraries, libPath,
+            packageRoot))
       .then((_) => compileScript(mode, outputDir, libPath))
       .then((_) => print(apidoc.status))
-      .catchError((e) => print('Error: generation failed: ${e.error}'))
+      .catchError((e) {
+        print('Error: generation failed: ${e}');
+        apidoc.cleanup();
+        exit(1);
+      })
       .whenComplete(() => apidoc.cleanup());
   });
 }
diff --git a/utils/apidoc/apidoc.gyp b/utils/apidoc/apidoc.gyp
index 2500ed0..f3f484a 100644
--- a/utils/apidoc/apidoc.gyp
+++ b/utils/apidoc/apidoc.gyp
@@ -51,7 +51,7 @@
             'apidoc.dart',
             '--out=<(PRODUCT_DIR)/api_docs',
             '--version=<!@(["python", "../../tools/print_version.py"])',
-            '--pkg=<(PRODUCT_DIR)/packages',
+            '--package-root=<(PRODUCT_DIR)/packages',
             '--mode=static',
             '--exclude-lib=analyzer_experimental',
             '--exclude-lib=browser',
diff --git a/utils/pub/command_cache.dart b/utils/pub/command_cache.dart
index c3a3a3d..eb77fd2 100644
--- a/utils/pub/command_cache.dart
+++ b/utils/pub/command_cache.dart
@@ -14,24 +14,24 @@
 
 
 /// Handles the `cache` pub command.
-class CacheCommand extends PubCommand { 
+class CacheCommand extends PubCommand {
   String get description => "Inspect the system cache.";
   String get usage => 'pub cache list';
   bool get requiresEntrypoint => false;
-  
+
   Future onRun() {
     if (commandOptions.rest.length != 1) {
       log.error('The cache command expects one argument.');
       this.printUsage();
       exit(exit_codes.USAGE);
     }
-    
+
     if ((commandOptions.rest[0] != 'list')) {
       log.error('Unknown cache command "${commandOptions.rest[0]}".');
       this.printUsage();
       exit(exit_codes.USAGE);
     }
-    
+
     // TODO(keertip): Add flag to list packages from non default sources
     var packagesObj = <String, Map>{};
     for (var package in cache.sources.defaultSource.getCachedPackages()) {
@@ -44,6 +44,6 @@
     // TODO(keertip): Add support for non-JSON format
     // and check for --format flag
     log.message(json.stringify({'packages': packagesObj}));
-  }  
+  }
 }
 
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index a0e69a9..3eed22c 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -328,7 +328,7 @@
 /// Reads and discards all output from [stream]. Returns a [Future] that
 /// completes when the stream is closed.
 Future drainStream(Stream stream) {
-  return stream.reduce(null, (x, y) {});
+  return stream.fold(null, (x, y) {});
 }
 
 /// Returns a [EventSink] that pipes all data to [consumer] and a [Future] that
diff --git a/utils/pub/safe_http_server.dart b/utils/pub/safe_http_server.dart
index 64adf5b..7fd522b 100644
--- a/utils/pub/safe_http_server.dart
+++ b/utils/pub/safe_http_server.dart
@@ -134,9 +134,11 @@
   void writeBytes(List<int> data) => _inner.writeBytes(data);
   Future<HttpResponse> consume(Stream<List<int>> stream) =>
     _inner.consume(stream);
+  Future<HttpResponse> addStream(Stream<List<int>> stream) =>
+    _inner.addStream(stream);
   Future<HttpResponse> writeStream(Stream<List<int>> stream) =>
     _inner.writeStream(stream);
-  void close() => _inner.close();
+  Future close() => _inner.close();
   void write(Object obj) => _inner.write(obj);
   void writeAll(Iterable objects) => _inner.writeAll(objects);
   void writeCharCode(int charCode) => _inner.writeCharCode(charCode);
diff --git a/utils/pub/sdk.dart b/utils/pub/sdk.dart
index 7f6b149..3222c9e 100644
--- a/utils/pub/sdk.dart
+++ b/utils/pub/sdk.dart
@@ -56,4 +56,4 @@
   return new Version(
       int.parse(match[1]), int.parse(match[2]), int.parse(match[3]),
       build: build);
-}
\ No newline at end of file
+}
diff --git a/utils/tests/pub/lish/archives_and_uploads_a_package_test.dart b/utils/tests/pub/lish/archives_and_uploads_a_package_test.dart
new file mode 100644
index 0000000..b699d2f4
--- /dev/null
+++ b/utils/tests/pub/lish/archives_and_uploads_a_package_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 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('archives and uploads a package', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+    handleUploadForm(server);
+    handleUpload(server);
+
+    server.handle('GET', '/create', (request) {
+      request.response.write(json.stringify({
+        'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
+      }));
+      request.response.close();
+    });
+
+    // TODO(rnystrom): The confirm line is run together with this one because
+    // in normal usage, the user will have entered a newline on stdin which
+    // gets echoed to the terminal. Do something better here?
+    expect(pub.nextLine(), completion(equals(
+        'Looks great! Are you ready to upload your package (y/n)?'
+        ' Package test_pkg 1.0.0 uploaded!')));
+    pub.shouldExit(0);
+  });
+
+  // TODO(nweiz): Once a multipart/form-data parser in Dart exists, we should
+  // test that "pub lish" chooses the correct files to publish.
+}
diff --git a/utils/tests/pub/lish/cloud_storage_upload_doesnt_redirect_test.dart b/utils/tests/pub/lish/cloud_storage_upload_doesnt_redirect_test.dart
new file mode 100644
index 0000000..0fecead
--- /dev/null
+++ b/utils/tests/pub/lish/cloud_storage_upload_doesnt_redirect_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration("cloud storage upload doesn't redirect", () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+    handleUploadForm(server);
+
+    server.handle('POST', '/upload', (request) {
+      return drainStream(request).then((_) {
+        // Don't set the location header.
+        request.response.close();
+      });
+    });
+
+    expect(pub.nextErrLine(),
+        completion(equals('Failed to upload the package.')));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/cloud_storage_upload_provides_an_error_test.dart b/utils/tests/pub/lish/cloud_storage_upload_provides_an_error_test.dart
new file mode 100644
index 0000000..6ec271c
--- /dev/null
+++ b/utils/tests/pub/lish/cloud_storage_upload_provides_an_error_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 'dart:io';
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('cloud storage upload provides an error', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+    handleUploadForm(server);
+
+    server.handle('POST', '/upload', (request) {
+      return drainStream(request).then((_) {
+        request.response.statusCode = 400;
+        request.response.headers.contentType =
+            new ContentType('application', 'xml');
+        request.response.write('<Error><Message>Your request sucked.'
+            '</Message></Error>');
+        request.response.close();
+      });
+    });
+
+    // TODO(nweiz): This should use the server's error message once the client
+    // can parse the XML.
+    expect(pub.nextErrLine(),
+        completion(equals('Failed to upload the package.')));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/force_cannot_be_combined_with_dry_run_test.dart b/utils/tests/pub/lish/force_cannot_be_combined_with_dry_run_test.dart
new file mode 100644
index 0000000..088f636
--- /dev/null
+++ b/utils/tests/pub/lish/force_cannot_be_combined_with_dry_run_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.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/exit_codes.dart' as exit_codes;
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('--force cannot be combined with --dry-run', () {
+    schedulePub(args: ['lish', '--force', '--dry-run'],
+        error: "Cannot use both --force and --dry-run.",
+        exitCode: exit_codes.USAGE);
+  });
+}
diff --git a/utils/tests/pub/lish/force_does_not_publish_if_there_are_errors_test.dart b/utils/tests/pub/lish/force_does_not_publish_if_there_are_errors_test.dart
new file mode 100644
index 0000000..e599c26
--- /dev/null
+++ b/utils/tests/pub/lish/force_does_not_publish_if_there_are_errors_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.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('--force does not publish if there are errors', () {
+    var pkg = packageMap("test_pkg", "1.0.0");
+    pkg.remove("homepage");
+    d.dir(appPath, [d.pubspec(pkg)]).create();
+
+    var server = new ScheduledServer();
+    var pub = startPublish(server, args: ['--force']);
+
+    pub.shouldExit(0);
+    expect(pub.remainingStderr(), completion(contains(
+        "Sorry, your package is missing a requirement and can't be "
+        "published yet.")));
+  });
+}
diff --git a/utils/tests/pub/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart b/utils/tests/pub/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart
new file mode 100644
index 0000000..9bf4aa3
--- /dev/null
+++ b/utils/tests/pub/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('--force publishes if there are no warnings or errors', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server, args: ['--force']);
+
+    handleUploadForm(server);
+    handleUpload(server);
+
+    server.handle('GET', '/create', (request) {
+      request.response.write(json.stringify({
+        'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
+      }));
+      request.response.close();
+    });
+
+    pub.shouldExit(0);
+    expect(pub.remainingStdout(), completion(contains(
+        'Package test_pkg 1.0.0 uploaded!')));
+  });
+}
diff --git a/utils/tests/pub/lish/force_publishes_if_there_are_warnings_test.dart b/utils/tests/pub/lish/force_publishes_if_there_are_warnings_test.dart
new file mode 100644
index 0000000..c4d3616
--- /dev/null
+++ b/utils/tests/pub/lish/force_publishes_if_there_are_warnings_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 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('--force publishes if there are warnings', () {
+    var pkg = packageMap("test_pkg", "1.0.0");
+    pkg["author"] = "Nathan Weizenbaum";
+    d.dir(appPath, [d.pubspec(pkg)]).create();
+
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server, args: ['--force']);
+
+    handleUploadForm(server);
+    handleUpload(server);
+
+    server.handle('GET', '/create', (request) {
+      request.response.write(json.stringify({
+        'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
+      }));
+      request.response.close();
+    });
+
+    pub.shouldExit(0);
+    expect(pub.remainingStderr(), completion(contains(
+        'Suggestions:\n* Author "Nathan Weizenbaum" in pubspec.yaml'
+        ' should have an email address\n'
+        '  (e.g. "name <email>").')));
+    expect(pub.remainingStdout(), completion(contains(
+        'Package test_pkg 1.0.0 uploaded!')));
+  });
+}
diff --git a/utils/tests/pub/lish/package_creation_provides_a_malformed_error_test.dart b/utils/tests/pub/lish/package_creation_provides_a_malformed_error_test.dart
new file mode 100644
index 0000000..bbcc4d3
--- /dev/null
+++ b/utils/tests/pub/lish/package_creation_provides_a_malformed_error_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('package creation provides a malformed error', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+    handleUploadForm(server);
+    handleUpload(server);
+
+    var body = {'error': 'Your package was too boring.'};
+    server.handle('GET', '/create', (request) {
+      request.response.statusCode = 400;
+      request.response.write(json.stringify(body));
+      request.response.close();
+    });
+
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/package_creation_provides_a_malformed_success_test.dart b/utils/tests/pub/lish/package_creation_provides_a_malformed_success_test.dart
new file mode 100644
index 0000000..635e11d
--- /dev/null
+++ b/utils/tests/pub/lish/package_creation_provides_a_malformed_success_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('package creation provides a malformed success', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+    handleUploadForm(server);
+    handleUpload(server);
+
+    var body = {'success': 'Your package was awesome.'};
+    server.handle('GET', '/create', (request) {
+      request.response.write(json.stringify(body));
+      request.response.close();
+    });
+
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/package_creation_provides_an_error_test.dart b/utils/tests/pub/lish/package_creation_provides_an_error_test.dart
new file mode 100644
index 0000000..2298e70
--- /dev/null
+++ b/utils/tests/pub/lish/package_creation_provides_an_error_test.dart
@@ -0,0 +1,39 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('package creation provides an error', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+    handleUploadForm(server);
+    handleUpload(server);
+
+    server.handle('GET', '/create', (request) {
+      request.response.statusCode = 400;
+      request.response.write(json.stringify({
+        'error': {'message': 'Your package was too boring.'}
+      }));
+      request.response.close();
+    });
+
+    expect(pub.nextErrLine(),
+        completion(equals('Your package was too boring.')));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/package_creation_provides_invalid_json_test.dart b/utils/tests/pub/lish/package_creation_provides_invalid_json_test.dart
new file mode 100644
index 0000000..c4a1be5
--- /dev/null
+++ b/utils/tests/pub/lish/package_creation_provides_invalid_json_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.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('package creation provides invalid JSON', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+    handleUploadForm(server);
+    handleUpload(server);
+
+    server.handle('GET', '/create', (request) {
+      request.response.write('{not json');
+      request.response.close();
+    });
+
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals('{not json')));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/package_validation_has_a_warning_and_continues_test.dart b/utils/tests/pub/lish/package_validation_has_a_warning_and_continues_test.dart
new file mode 100644
index 0000000..4883fe5
--- /dev/null
+++ b/utils/tests/pub/lish/package_validation_has_a_warning_and_continues_test.dart
@@ -0,0 +1,41 @@
+// 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:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('package validation has a warning and continues', () {
+    var pkg = packageMap("test_pkg", "1.0.0");
+    pkg["author"] = "Nathan Weizenbaum";
+    d.dir(appPath, [d.pubspec(pkg)]).create();
+
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+    pub.writeLine("y");
+    handleUploadForm(server);
+    handleUpload(server);
+
+    server.handle('GET', '/create', (request) {
+      request.response.write(json.stringify({
+        'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
+      }));
+      request.response.close();
+    });
+
+    pub.shouldExit(0);
+    expect(pub.remainingStdout(),
+        completion(contains('Package test_pkg 1.0.0 uploaded!')));
+  });
+}
diff --git a/utils/tests/pub/lish/package_validation_has_a_warning_and_is_canceled_test.dart b/utils/tests/pub/lish/package_validation_has_a_warning_and_is_canceled_test.dart
new file mode 100644
index 0000000..e998bd9
--- /dev/null
+++ b/utils/tests/pub/lish/package_validation_has_a_warning_and_is_canceled_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.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('package validation has a warning and is canceled', () {
+    var pkg = packageMap("test_pkg", "1.0.0");
+    pkg["author"] = "Nathan Weizenbaum";
+    d.dir(appPath, [d.pubspec(pkg)]).create();
+
+    var server = new ScheduledServer();
+    var pub = startPublish(server);
+
+    pub.writeLine("n");
+    pub.shouldExit(0);
+    expect(pub.remainingStderr(),
+        completion(contains("Package upload canceled.")));
+  });
+}
diff --git a/utils/tests/pub/lish/package_validation_has_an_error_test.dart b/utils/tests/pub/lish/package_validation_has_an_error_test.dart
new file mode 100644
index 0000000..d656117
--- /dev/null
+++ b/utils/tests/pub/lish/package_validation_has_an_error_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.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('package validation has an error', () {
+    var pkg = packageMap("test_pkg", "1.0.0");
+    pkg.remove("homepage");
+    d.dir(appPath, [d.pubspec(pkg)]).create();
+
+    var server = new ScheduledServer();
+    var pub = startPublish(server);
+
+    pub.shouldExit(0);
+    expect(pub.remainingStderr(), completion(contains(
+        "Sorry, your package is missing a requirement and can't be published "
+        "yet.")));
+  });
+}
\ No newline at end of file
diff --git a/utils/tests/pub/lish/preview_package_validation_has_a_warning_test.dart b/utils/tests/pub/lish/preview_package_validation_has_a_warning_test.dart
new file mode 100644
index 0000000..401d3b9
--- /dev/null
+++ b/utils/tests/pub/lish/preview_package_validation_has_a_warning_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('preview package validation has a warning', () {
+    var pkg = packageMap("test_pkg", "1.0.0");
+    pkg["author"] = "Nathan Weizenbaum";
+    d.dir(appPath, [d.pubspec(pkg)]).create();
+
+    var server = new ScheduledServer();
+    var pub = startPublish(server, args: ['--dry-run']);
+
+    pub.shouldExit(0);
+    expect(pub.remainingStderr(), completion(contains(
+        'Suggestions:\n* Author "Nathan Weizenbaum" in pubspec.yaml should '
+            'have an email address\n'
+        '  (e.g. "name <email>").\n\n'
+        'Package has 1 warning.')));
+  });
+}
diff --git a/utils/tests/pub/lish/preview_package_validation_has_no_warnings_test.dart b/utils/tests/pub/lish/preview_package_validation_has_no_warnings_test.dart
new file mode 100644
index 0000000..82ead77
--- /dev/null
+++ b/utils/tests/pub/lish/preview_package_validation_has_no_warnings_test.dart
@@ -0,0 +1,30 @@
+// 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:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('preview package validation has no warnings', () {
+    var pkg = packageMap("test_pkg", "1.0.0");
+    pkg["author"] = "Nathan Weizenbaum <nweiz@google.com>";
+    d.dir(appPath, [d.pubspec(pkg)]).create();
+
+    var server = new ScheduledServer();
+    var pub = startPublish(server, args: ['--dry-run']);
+
+    pub.shouldExit(0);
+    expect(pub.remainingStderr(),
+        completion(contains('Package has 0 warnings.')));
+  });
+}
diff --git a/utils/tests/pub/lish/upload_form_fields_has_a_non_string_value_test.dart b/utils/tests/pub/lish/upload_form_fields_has_a_non_string_value_test.dart
new file mode 100644
index 0000000..e1143d6
--- /dev/null
+++ b/utils/tests/pub/lish/upload_form_fields_has_a_non_string_value_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('upload form fields has a non-string value', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+
+    var body = {
+      'url': 'http://example.com/upload',
+      'fields': {'field': 12}
+    };
+    handleUploadForm(server, body);
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/upload_form_fields_is_not_a_map_test.dart b/utils/tests/pub/lish/upload_form_fields_is_not_a_map_test.dart
new file mode 100644
index 0000000..09d0745
--- /dev/null
+++ b/utils/tests/pub/lish/upload_form_fields_is_not_a_map_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.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('upload form fields is not a map', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+
+    var body = {'url': 'http://example.com/upload', 'fields': 12};
+    handleUploadForm(server, body);
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/upload_form_is_missing_fields_test.dart b/utils/tests/pub/lish/upload_form_is_missing_fields_test.dart
new file mode 100644
index 0000000..8883a87
--- /dev/null
+++ b/utils/tests/pub/lish/upload_form_is_missing_fields_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.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('upload form is missing fields', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+
+    var body = {'url': 'http://example.com/upload'};
+    handleUploadForm(server, body);
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/upload_form_is_missing_url_test.dart b/utils/tests/pub/lish/upload_form_is_missing_url_test.dart
new file mode 100644
index 0000000..aaad952
--- /dev/null
+++ b/utils/tests/pub/lish/upload_form_is_missing_url_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('upload form is missing url', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+
+    var body = {
+      'fields': {
+        'field1': 'value1',
+        'field2': 'value2'
+      }
+    };
+
+    handleUploadForm(server, body);
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/upload_form_provides_an_error_test.dart b/utils/tests/pub/lish/upload_form_provides_an_error_test.dart
new file mode 100644
index 0000000..6a3b2a1
--- /dev/null
+++ b/utils/tests/pub/lish/upload_form_provides_an_error_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.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('upload form provides an error', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      request.response.statusCode = 400;
+      request.response.write(json.stringify({
+        'error': {'message': 'your request sucked'}
+      }));
+      request.response.close();
+    });
+
+    expect(pub.nextErrLine(), completion(equals('your request sucked')));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/upload_form_provides_invalid_json_test.dart b/utils/tests/pub/lish/upload_form_provides_invalid_json_test.dart
new file mode 100644
index 0000000..3f2c486
--- /dev/null
+++ b/utils/tests/pub/lish/upload_form_provides_invalid_json_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('upload form provides invalid JSON', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      request.response.write('{not json');
+      request.response.close();
+    });
+
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals('{not json')));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/upload_form_url_is_not_a_string_test.dart b/utils/tests/pub/lish/upload_form_url_is_not_a_string_test.dart
new file mode 100644
index 0000000..521d612
--- /dev/null
+++ b/utils/tests/pub/lish/upload_form_url_is_not_a_string_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  initConfig();
+  setUp(d.validPackage.create);
+
+  integration('upload form url is not a string', () {
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+
+    var body = {
+      'url': 12,
+      'fields': {
+        'field1': 'value1',
+        'field2': 'value2'
+      }
+    };
+
+    handleUploadForm(server, body);
+    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
+    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
+    pub.shouldExit(1);
+  });
+}
diff --git a/utils/tests/pub/lish/utils.dart b/utils/tests/pub/lish/utils.dart
new file mode 100644
index 0000000..3f21f92
--- /dev/null
+++ b/utils/tests/pub/lish/utils.dart
@@ -0,0 +1,54 @@
+// 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 lish.utils;
+
+import 'dart:io';
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../test_pub.dart';
+
+void handleUploadForm(ScheduledServer server, [Map body]) {
+  server.handle('GET', '/packages/versions/new.json', (request) {
+    return server.url.then((url) {
+      expect(request.headers.value('authorization'),
+          equals('Bearer access token'));
+
+      if (body == null) {
+        body = {
+          'url': url.resolve('/upload').toString(),
+          'fields': {
+            'field1': 'value1',
+            'field2': 'value2'
+          }
+        };
+      }
+
+      request.response.headers.contentType =
+          new ContentType("application", "json");
+      request.response.write(json.stringify(body));
+      request.response.close();
+    });
+  });
+}
+
+void handleUpload(ScheduledServer server) {
+  server.handle('POST', '/upload', (request) {
+    // TODO(nweiz): Once a multipart/form-data parser in Dart exists, validate
+    // that the request body is correctly formatted. See issue 6952.
+    return drainStream(request).then((_) {
+      return server.url;
+    }).then((url) {
+      request.response.statusCode = 302;
+      request.response.headers.set(
+          'location', url.resolve('/create').toString());
+      request.response.close();
+    });
+  });
+}
+
diff --git a/utils/tests/pub/oauth2/utils.dart b/utils/tests/pub/oauth2/utils.dart
new file mode 100644
index 0000000..c0b7e97
--- /dev/null
+++ b/utils/tests/pub/oauth2/utils.dart
@@ -0,0 +1,62 @@
+// 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 oauth2.utils;
+
+import 'dart:io';
+import 'dart:json' as json;
+import 'dart:uri';
+
+import 'package:http/http.dart' as http;
+import 'package:scheduled_test/scheduled_process.dart';
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../../../pub/utils.dart';
+import '../test_pub.dart';
+
+void authorizePub(ScheduledProcess pub, ScheduledServer server,
+    [String accessToken="access token"]) {
+  // TODO(rnystrom): The confirm line is run together with this one because
+  // in normal usage, the user will have entered a newline on stdin which
+  // gets echoed to the terminal. Do something better here?
+  expect(pub.nextLine(), completion(equals(
+      'Looks great! Are you ready to upload your package (y/n)? '
+      'Pub needs your authorization to upload packages on your behalf.')));
+
+  expect(pub.nextLine().then((line) {
+    var match = new RegExp(r'[?&]redirect_uri=([0-9a-zA-Z%+-]+)[$&]')
+        .firstMatch(line);
+    expect(match, isNotNull);
+
+    var redirectUrl = Uri.parse(decodeUriComponent(match.group(1)));
+    redirectUrl = addQueryParameters(redirectUrl, {'code': 'access code'});
+    return (new http.Request('GET', redirectUrl)..followRedirects = false)
+      .send();
+  }).then((response) {
+    expect(response.headers['location'],
+        equals('http://pub.dartlang.org/authorized'));
+  }), completes);
+
+  handleAccessTokenRequest(server, accessToken);
+}
+
+void handleAccessTokenRequest(ScheduledServer server, String accessToken) {
+  server.handle('POST', '/token', (request) {
+    return new ByteStream(request).toBytes().then((bytes) {
+      var body = new String.fromCharCodes(bytes);
+      expect(body, matches(new RegExp(r'(^|&)code=access\+code(&|$)')));
+
+      request.response.headers.contentType =
+          new ContentType("application", "json");
+      request.response.write(json.stringify({
+        "access_token": accessToken,
+        "token_type": "bearer"
+      }));
+      request.response.close();
+    });
+  });
+}
+
diff --git a/utils/tests/pub/oauth2/with_a_malformed_credentials_authenticates_again_test.dart b/utils/tests/pub/oauth2/with_a_malformed_credentials_authenticates_again_test.dart
new file mode 100644
index 0000000..d9d5389
--- /dev/null
+++ b/utils/tests/pub/oauth2/with_a_malformed_credentials_authenticates_again_test.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../../../pub/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  integration('with a malformed credentials.json, authenticates again and '
+      'saves credentials.json', () {
+    d.validPackage.create();
+
+    var server = new ScheduledServer();
+    d.dir(cachePath, [
+      d.file('credentials.json', '{bad json')
+    ]).create();
+
+    var pub = startPublish(server);
+    confirmPublish(pub);
+    authorizePub(pub, server, "new access token");
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      expect(request.headers.value('authorization'),
+          equals('Bearer new access token'));
+
+      request.response.close();
+    });
+
+    // After we give pub an invalid response, it should crash. We wait for it to
+    // do so rather than killing it so it'll write out the credentials file.
+    pub.shouldExit(1);
+
+    d.credentialsFile(server, 'new access token').validate();
+  });
+}
\ No newline at end of file
diff --git a/utils/tests/pub/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart b/utils/tests/pub/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart
new file mode 100644
index 0000000..976903c
--- /dev/null
+++ b/utils/tests/pub/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../../../pub/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  integration('with a pre-existing credentials.json does not authenticate', () {
+    d.validPackage.create();
+
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+    confirmPublish(pub);
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      expect(request.headers.value('authorization'),
+          equals('Bearer access token'));
+
+      request.response.close();
+    });
+
+    pub.kill();
+  });
+}
\ No newline at end of file
diff --git a/utils/tests/pub/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart b/utils/tests/pub/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart
new file mode 100644
index 0000000..20cb0e5
--- /dev/null
+++ b/utils/tests/pub/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart
@@ -0,0 +1,54 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../../../pub/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  // Regression test for issue 8849.
+  integration('with a server-rejected refresh token, authenticates again and '
+      'saves credentials.json', () {
+    d.validPackage.create();
+
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token',
+        refreshToken: 'bad refresh token',
+        expiration: new DateTime.now().subtract(new Duration(hours: 1)))
+        .create();
+
+    var pub = startPublish(server);
+    confirmPublish(pub);
+
+    server.handle('POST', '/token', (request) {
+      return new ByteStream(request).toBytes().then((bytes) {
+        var response = request.response;
+        response.statusCode = 400;
+        response.reasonPhrase = 'Bad request';
+        response.headers.contentType = new ContentType("application", "json");
+        response.write(json.stringify({"error": "invalid_request"}));
+        response.close();
+      });
+    });
+
+    authorizePub(pub, server, 'new access token');
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      expect(request.headers.value('authorization'),
+          equals('Bearer new access token'));
+
+      request.response.close();
+    });
+
+    pub.kill();
+  });
+}
\ No newline at end of file
diff --git a/utils/tests/pub/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart b/utils/tests/pub/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart
new file mode 100644
index 0000000..2526403
--- /dev/null
+++ b/utils/tests/pub/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../../../pub/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  integration('with an expired credentials.json, refreshes and saves the '
+      'refreshed access token to credentials.json', () {
+    d.validPackage.create();
+
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token',
+        refreshToken: 'refresh token',
+        expiration: new DateTime.now().subtract(new Duration(hours: 1)))
+        .create();
+
+    var pub = startPublish(server);
+    confirmPublish(pub);
+
+    server.handle('POST', '/token', (request) {
+      return new ByteStream(request).toBytes().then((bytes) {
+        var body = new String.fromCharCodes(bytes);
+        expect(body, matches(
+            new RegExp(r'(^|&)refresh_token=refresh\+token(&|$)')));
+
+        request.response.headers.contentType =
+            new ContentType("application", "json");
+        request.response.write(json.stringify({
+          "access_token": "new access token",
+          "token_type": "bearer"
+        }));
+        request.response.close();
+      });
+    });
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      expect(request.headers.value('authorization'),
+          equals('Bearer new access token'));
+
+      request.response.close();
+    });
+
+    pub.shouldExit();
+
+    d.credentialsFile(server, 'new access token', refreshToken: 'refresh token')
+        .validate();
+  });
+}
\ No newline at end of file
diff --git a/utils/tests/pub/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart b/utils/tests/pub/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart
new file mode 100644
index 0000000..3565951
--- /dev/null
+++ b/utils/tests/pub/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../../../pub/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  integration('with an expired credentials.json without a refresh token, '
+       'authenticates again and saves credentials.json', () {
+    d.validPackage.create();
+
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token',
+        expiration: new DateTime.now().subtract(new Duration(hours: 1)))
+        .create();
+
+    var pub = startPublish(server);
+    confirmPublish(pub);
+
+    expect(pub.nextErrLine(), completion(equals("Pub's authorization to upload "
+          "packages has expired and can't be automatically refreshed.")));
+    authorizePub(pub, server, "new access token");
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      expect(request.headers.value('authorization'),
+          equals('Bearer new access token'));
+
+      request.response.close();
+    });
+
+    // After we give pub an invalid response, it should crash. We wait for it to
+    // do so rather than killing it so it'll write out the credentials file.
+    pub.shouldExit(1);
+
+    d.credentialsFile(server, 'new access token').validate();
+  });
+}
diff --git a/utils/tests/pub/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart b/utils/tests/pub/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart
new file mode 100644
index 0000000..ff771e6
--- /dev/null
+++ b/utils/tests/pub/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart
@@ -0,0 +1,39 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../../../pub/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  integration('with no credentials.json, authenticates and saves '
+      'credentials.json', () {
+    d.validPackage.create();
+
+    var server = new ScheduledServer();
+    var pub = startPublish(server);
+    confirmPublish(pub);
+    authorizePub(pub, server);
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      expect(request.headers.value('authorization'),
+          equals('Bearer access token'));
+
+      request.response.close();
+    });
+
+    // After we give pub an invalid response, it should crash. We wait for it to
+    // do so rather than killing it so it'll write out the credentials file.
+    pub.shouldExit(1);
+
+    d.credentialsFile(server, 'access token').validate();
+  });
+}
\ No newline at end of file
diff --git a/utils/tests/pub/oauth2/with_server_rejected_credentials_authenticates_again_test.dart b/utils/tests/pub/oauth2/with_server_rejected_credentials_authenticates_again_test.dart
new file mode 100644
index 0000000..c607424
--- /dev/null
+++ b/utils/tests/pub/oauth2/with_server_rejected_credentials_authenticates_again_test.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+import 'dart:json' as json;
+
+import 'package:scheduled_test/scheduled_test.dart';
+import 'package:scheduled_test/scheduled_server.dart';
+
+import '../../../pub/io.dart';
+import '../../../pub/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+  integration('with server-rejected credentials, authenticates again and saves '
+      'credentials.json', () {
+    d.validPackage.create();
+    var server = new ScheduledServer();
+    d.credentialsFile(server, 'access token').create();
+    var pub = startPublish(server);
+
+    confirmPublish(pub);
+
+    server.handle('GET', '/packages/versions/new.json', (request) {
+      var response = request.response;
+      response.statusCode = 401;
+      response.headers.set('www-authenticate', 'Bearer error="invalid_token",'
+          ' error_description="your token sucks"');
+      response.write(json.stringify({
+        'error': {'message': 'your token sucks'}
+      }));
+      response.close();
+    });
+
+    expect(pub.nextErrLine(), completion(equals('OAuth2 authorization failed '
+        '(your token sucks).')));
+    // TODO(rnystrom): The confirm line is run together with this one because
+    // in normal usage, the user will have entered a newline on stdin which
+    // gets echoed to the terminal. Do something better here?
+    expect(pub.nextLine(), completion(equals(
+        'Looks great! Are you ready to upload your package (y/n)? '
+        'Pub needs your authorization to upload packages on your behalf.')));
+    pub.kill();
+  });
+}
diff --git a/utils/tests/pub/oauth2_test.dart b/utils/tests/pub/oauth2_test.dart
deleted file mode 100644
index dd35a9e..0000000
--- a/utils/tests/pub/oauth2_test.dart
+++ /dev/null
@@ -1,264 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library oauth2_test;
-
-import 'dart:io';
-import 'dart:json' as json;
-import 'dart:uri';
-
-import 'package:http/http.dart' as http;
-import 'package:scheduled_test/scheduled_process.dart';
-import 'package:scheduled_test/scheduled_test.dart';
-import 'package:scheduled_test/scheduled_server.dart';
-
-import '../../pub/io.dart';
-import '../../pub/utils.dart';
-import 'descriptor.dart' as d;
-import 'test_pub.dart';
-
-import 'dart:async';
-
-main() {
-  setUp(() => d.validPackage.create());
-
-  integration('with no credentials.json, authenticates and saves '
-      'credentials.json', () {
-    var server = new ScheduledServer();
-    var pub = startPublish(server);
-    confirmPublish(pub);
-    authorizePub(pub, server);
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      expect(request.headers.value('authorization'),
-          equals('Bearer access token'));
-
-      request.response.close();
-    });
-
-    // After we give pub an invalid response, it should crash. We wait for it to
-    // do so rather than killing it so it'll write out the credentials file.
-    pub.shouldExit(1);
-
-    d.credentialsFile(server, 'access token').validate();
-  });
-
-  integration('with a pre-existing credentials.json does not authenticate', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-    confirmPublish(pub);
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      expect(request.headers.value('authorization'),
-          equals('Bearer access token'));
-
-      request.response.close();
-    });
-
-    pub.kill();
-  });
-
-  integration('with an expired credentials.json, refreshes and saves the '
-      'refreshed access token to credentials.json', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token',
-        refreshToken: 'refresh token',
-        expiration: new DateTime.now().subtract(new Duration(hours: 1)))
-        .create();
-
-    var pub = startPublish(server);
-    confirmPublish(pub);
-
-    server.handle('POST', '/token', (request) {
-      return new ByteStream(request).toBytes().then((bytes) {
-        var body = new String.fromCharCodes(bytes);
-        expect(body, matches(
-            new RegExp(r'(^|&)refresh_token=refresh\+token(&|$)')));
-
-        request.response.headers.contentType =
-            new ContentType("application", "json");
-        request.response.write(json.stringify({
-          "access_token": "new access token",
-          "token_type": "bearer"
-        }));
-        request.response.close();
-      });
-    });
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      expect(request.headers.value('authorization'),
-          equals('Bearer new access token'));
-
-      request.response.close();
-    });
-
-    pub.shouldExit();
-
-    d.credentialsFile(server, 'new access token', refreshToken: 'refresh token')
-        .validate();
-  });
-
-  integration('with an expired credentials.json without a refresh token, '
-       'authenticates again and saves credentials.json', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token',
-        expiration: new DateTime.now().subtract(new Duration(hours: 1)))
-        .create();
-
-    var pub = startPublish(server);
-    confirmPublish(pub);
-
-    expect(pub.nextErrLine(), completion(equals("Pub's authorization to upload "
-          "packages has expired and can't be automatically refreshed.")));
-    authorizePub(pub, server, "new access token");
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      expect(request.headers.value('authorization'),
-          equals('Bearer new access token'));
-
-      request.response.close();
-    });
-
-    // After we give pub an invalid response, it should crash. We wait for it to
-    // do so rather than killing it so it'll write out the credentials file.
-    pub.shouldExit(1);
-
-    d.credentialsFile(server, 'new access token').validate();
-  });
-
-  integration('with a malformed credentials.json, authenticates again and '
-      'saves credentials.json', () {
-    var server = new ScheduledServer();
-    d.dir(cachePath, [
-      d.file('credentials.json', '{bad json')
-    ]).create();
-
-    var pub = startPublish(server);
-    confirmPublish(pub);
-    authorizePub(pub, server, "new access token");
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      expect(request.headers.value('authorization'),
-          equals('Bearer new access token'));
-
-      request.response.close();
-    });
-
-    // After we give pub an invalid response, it should crash. We wait for it to
-    // do so rather than killing it so it'll write out the credentials file.
-    pub.shouldExit(1);
-
-    d.credentialsFile(server, 'new access token').validate();
-  });
-
-  // Regression test for issue 8849.
-  integration('with a server-rejected refresh token, authenticates again and '
-      'saves credentials.json', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token',
-        refreshToken: 'bad refresh token',
-        expiration: new DateTime.now().subtract(new Duration(hours: 1)))
-        .create();
-
-    var pub = startPublish(server);
-    confirmPublish(pub);
-
-    server.handle('POST', '/token', (request) {
-      return new ByteStream(request).toBytes().then((bytes) {
-        var response = request.response;
-        response.statusCode = 400;
-        response.reasonPhrase = 'Bad request';
-        response.headers.contentType = new ContentType("application", "json");
-        response.write(json.stringify({"error": "invalid_request"}));
-        response.close();
-      });
-    });
-
-    authorizePub(pub, server, 'new access token');
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      expect(request.headers.value('authorization'),
-          equals('Bearer new access token'));
-
-      request.response.close();
-    });
-
-    pub.kill();
-  });
-
-  integration('with server-rejected credentials, authenticates again and saves '
-      'credentials.json', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      var response = request.response;
-      response.statusCode = 401;
-      response.headers.set('www-authenticate', 'Bearer error="invalid_token",'
-          ' error_description="your token sucks"');
-      response.write(json.stringify({
-        'error': {'message': 'your token sucks'}
-      }));
-      response.close();
-    });
-
-    expect(pub.nextErrLine(), completion(equals('OAuth2 authorization failed '
-        '(your token sucks).')));
-    // TODO(rnystrom): The confirm line is run together with this one because
-    // in normal usage, the user will have entered a newline on stdin which
-    // gets echoed to the terminal. Do something better here?
-    expect(pub.nextLine(), completion(equals(
-        'Looks great! Are you ready to upload your package (y/n)? '
-        'Pub needs your authorization to upload packages on your behalf.')));
-    pub.kill();
-  });
-}
-
-void authorizePub(ScheduledProcess pub, ScheduledServer server,
-    [String accessToken="access token"]) {
-  // TODO(rnystrom): The confirm line is run together with this one because
-  // in normal usage, the user will have entered a newline on stdin which
-  // gets echoed to the terminal. Do something better here?
-  expect(pub.nextLine(), completion(equals(
-      'Looks great! Are you ready to upload your package (y/n)? '
-      'Pub needs your authorization to upload packages on your behalf.')));
-
-  expect(pub.nextLine().then((line) {
-    var match = new RegExp(r'[?&]redirect_uri=([0-9a-zA-Z%+-]+)[$&]')
-        .firstMatch(line);
-    expect(match, isNotNull);
-
-    var redirectUrl = Uri.parse(decodeUriComponent(match.group(1)));
-    redirectUrl = addQueryParameters(redirectUrl, {'code': 'access code'});
-    return (new http.Request('GET', redirectUrl)..followRedirects = false)
-      .send();
-  }).then((response) {
-    expect(response.headers['location'],
-        equals('http://pub.dartlang.org/authorized'));
-  }), completes);
-
-  handleAccessTokenRequest(server, accessToken);
-}
-
-void handleAccessTokenRequest(ScheduledServer server, String accessToken) {
-  server.handle('POST', '/token', (request) {
-    return new ByteStream(request).toBytes().then((bytes) {
-      var body = new String.fromCharCodes(bytes);
-      expect(body, matches(new RegExp(r'(^|&)code=access\+code(&|$)')));
-
-      request.response.headers.contentType =
-          new ContentType("application", "json");
-      request.response.write(json.stringify({
-        "access_token": accessToken,
-        "token_type": "bearer"
-      }));
-      request.response.close();
-    });
-  });
-}
-
diff --git a/utils/tests/pub/pub_lish_test.dart b/utils/tests/pub/pub_lish_test.dart
deleted file mode 100644
index 065e8ab..0000000
--- a/utils/tests/pub/pub_lish_test.dart
+++ /dev/null
@@ -1,491 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library pub_lish_test;
-
-import 'dart:io';
-import 'dart:json' as json;
-
-import 'package:scheduled_test/scheduled_test.dart';
-import 'package:scheduled_test/scheduled_server.dart';
-
-import '../../pub/exit_codes.dart' as exit_codes;
-import '../../pub/io.dart';
-import 'descriptor.dart' as d;
-import 'test_pub.dart';
-
-void handleUploadForm(ScheduledServer server, [Map body]) {
-  server.handle('GET', '/packages/versions/new.json', (request) {
-    return server.url.then((url) {
-      expect(request.headers.value('authorization'),
-          equals('Bearer access token'));
-
-      if (body == null) {
-        body = {
-          'url': url.resolve('/upload').toString(),
-          'fields': {
-            'field1': 'value1',
-            'field2': 'value2'
-          }
-        };
-      }
-
-      request.response.headers.contentType =
-          new ContentType("application", "json");
-      request.response.write(json.stringify(body));
-      request.response.close();
-    });
-  });
-}
-
-void handleUpload(ScheduledServer server) {
-  server.handle('POST', '/upload', (request) {
-    // TODO(nweiz): Once a multipart/form-data parser in Dart exists, validate
-    // that the request body is correctly formatted. See issue 6952.
-    return drainStream(request).then((_) {
-      return server.url;
-    }).then((url) {
-      request.response.statusCode = 302;
-      request.response.headers.set(
-          'location', url.resolve('/create').toString());
-      request.response.close();
-    });
-  });
-}
-
-main() {
-  initConfig();
-  setUp(() => d.validPackage.create());
-
-  integration('archives and uploads a package', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-    handleUploadForm(server);
-    handleUpload(server);
-
-    server.handle('GET', '/create', (request) {
-      request.response.write(json.stringify({
-        'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
-      }));
-      request.response.close();
-    });
-
-    // TODO(rnystrom): The confirm line is run together with this one because
-    // in normal usage, the user will have entered a newline on stdin which
-    // gets echoed to the terminal. Do something better here?
-    expect(pub.nextLine(), completion(equals(
-        'Looks great! Are you ready to upload your package (y/n)?'
-        ' Package test_pkg 1.0.0 uploaded!')));
-    pub.shouldExit(0);
-  });
-
-  // TODO(nweiz): Once a multipart/form-data parser in Dart exists, we should
-  // test that "pub lish" chooses the correct files to publish.
-
-  integration('package validation has an error', () {
-    var pkg = packageMap("test_pkg", "1.0.0");
-    pkg.remove("homepage");
-    d.dir(appPath, [d.pubspec(pkg)]).create();
-
-    var server = new ScheduledServer();
-    var pub = startPublish(server);
-
-    pub.shouldExit(0);
-    expect(pub.remainingStderr(), completion(contains(
-        "Sorry, your package is missing a requirement and can't be published "
-        "yet.")));
-  });
-
-  integration('preview package validation has a warning', () {
-    var pkg = packageMap("test_pkg", "1.0.0");
-    pkg["author"] = "Nathan Weizenbaum";
-    d.dir(appPath, [d.pubspec(pkg)]).create();
-
-    var server = new ScheduledServer();
-    var pub = startPublish(server, args: ['--dry-run']);
-
-    pub.shouldExit(0);
-    expect(pub.remainingStderr(), completion(contains(
-        'Suggestions:\n* Author "Nathan Weizenbaum" in pubspec.yaml should '
-            'have an email address\n'
-        '  (e.g. "name <email>").\n\n'
-        'Package has 1 warning.')));
-  });
-
-  integration('preview package validation has no warnings', () {
-    var pkg = packageMap("test_pkg", "1.0.0");
-    pkg["author"] = "Nathan Weizenbaum <nweiz@google.com>";
-    d.dir(appPath, [d.pubspec(pkg)]).create();
-
-    var server = new ScheduledServer();
-    var pub = startPublish(server, args: ['--dry-run']);
-
-    pub.shouldExit(0);
-    expect(pub.remainingStderr(),
-        completion(contains('Package has 0 warnings.')));
-  });
-
-  integration('package validation has a warning and is canceled', () {
-    var pkg = packageMap("test_pkg", "1.0.0");
-    pkg["author"] = "Nathan Weizenbaum";
-    d.dir(appPath, [d.pubspec(pkg)]).create();
-
-    var server = new ScheduledServer();
-    var pub = startPublish(server);
-
-    pub.writeLine("n");
-    pub.shouldExit(0);
-    expect(pub.remainingStderr(),
-        completion(contains("Package upload canceled.")));
-  });
-
-  integration('package validation has a warning and continues', () {
-    var pkg = packageMap("test_pkg", "1.0.0");
-    pkg["author"] = "Nathan Weizenbaum";
-    d.dir(appPath, [d.pubspec(pkg)]).create();
-
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-    pub.writeLine("y");
-    handleUploadForm(server);
-    handleUpload(server);
-
-    server.handle('GET', '/create', (request) {
-      request.response.write(json.stringify({
-        'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
-      }));
-      request.response.close();
-    });
-
-    pub.shouldExit(0);
-    expect(pub.remainingStdout(),
-        completion(contains('Package test_pkg 1.0.0 uploaded!')));
-  });
-
-  integration('upload form provides an error', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      request.response.statusCode = 400;
-      request.response.write(json.stringify({
-        'error': {'message': 'your request sucked'}
-      }));
-      request.response.close();
-    });
-
-    expect(pub.nextErrLine(), completion(equals('your request sucked')));
-    pub.shouldExit(1);
-  });
-
-  integration('upload form provides invalid JSON', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-
-    server.handle('GET', '/packages/versions/new.json', (request) {
-      request.response.write('{not json');
-      request.response.close();
-    });
-
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals('{not json')));
-    pub.shouldExit(1);
-  });
-
-  integration('upload form is missing url', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-
-    var body = {
-      'fields': {
-        'field1': 'value1',
-        'field2': 'value2'
-      }
-    };
-
-    handleUploadForm(server, body);
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
-    pub.shouldExit(1);
-  });
-
-  integration('upload form url is not a string', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-
-    var body = {
-      'url': 12,
-      'fields': {
-        'field1': 'value1',
-        'field2': 'value2'
-      }
-    };
-
-    handleUploadForm(server, body);
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
-    pub.shouldExit(1);
-  });
-
-  integration('upload form is missing fields', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-
-    var body = {'url': 'http://example.com/upload'};
-    handleUploadForm(server, body);
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
-    pub.shouldExit(1);
-  });
-
-  integration('upload form fields is not a map', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-
-    var body = {'url': 'http://example.com/upload', 'fields': 12};
-    handleUploadForm(server, body);
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
-    pub.shouldExit(1);
-  });
-
-  integration('upload form fields has a non-string value', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-
-    var body = {
-      'url': 'http://example.com/upload',
-      'fields': {'field': 12}
-    };
-    handleUploadForm(server, body);
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
-    pub.shouldExit(1);
-  });
-
-  integration('cloud storage upload provides an error', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-    handleUploadForm(server);
-
-    server.handle('POST', '/upload', (request) {
-      return drainStream(request).then((_) {
-        request.response.statusCode = 400;
-        request.response.headers.contentType =
-            new ContentType('application', 'xml');
-        request.response.write('<Error><Message>Your request sucked.'
-            '</Message></Error>');
-        request.response.close();
-      });
-    });
-
-    // TODO(nweiz): This should use the server's error message once the client
-    // can parse the XML.
-    expect(pub.nextErrLine(),
-        completion(equals('Failed to upload the package.')));
-    pub.shouldExit(1);
-  });
-
-  integration("cloud storage upload doesn't redirect", () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-    handleUploadForm(server);
-
-    server.handle('POST', '/upload', (request) {
-      return drainStream(request).then((_) {
-        // Don't set the location header.
-        request.response.close();
-      });
-    });
-
-    expect(pub.nextErrLine(),
-        completion(equals('Failed to upload the package.')));
-    pub.shouldExit(1);
-  });
-
-  integration('package creation provides an error', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-    handleUploadForm(server);
-    handleUpload(server);
-
-    server.handle('GET', '/create', (request) {
-      request.response.statusCode = 400;
-      request.response.write(json.stringify({
-        'error': {'message': 'Your package was too boring.'}
-      }));
-      request.response.close();
-    });
-
-    expect(pub.nextErrLine(),
-        completion(equals('Your package was too boring.')));
-    pub.shouldExit(1);
-  });
-
-  integration('package creation provides invalid JSON', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-    handleUploadForm(server);
-    handleUpload(server);
-
-    server.handle('GET', '/create', (request) {
-      request.response.write('{not json');
-      request.response.close();
-    });
-
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals('{not json')));
-    pub.shouldExit(1);
-  });
-
-  integration('package creation provides a malformed error', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-    handleUploadForm(server);
-    handleUpload(server);
-
-    var body = {'error': 'Your package was too boring.'};
-    server.handle('GET', '/create', (request) {
-      request.response.statusCode = 400;
-      request.response.write(json.stringify(body));
-      request.response.close();
-    });
-
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
-    pub.shouldExit(1);
-  });
-
-  integration('package creation provides a malformed success', () {
-    var server = new ScheduledServer();
-    d.credentialsFile(server, 'access token').create();
-    var pub = startPublish(server);
-
-    confirmPublish(pub);
-    handleUploadForm(server);
-    handleUpload(server);
-
-    var body = {'success': 'Your package was awesome.'};
-    server.handle('GET', '/create', (request) {
-      request.response.write(json.stringify(body));
-      request.response.close();
-    });
-
-    expect(pub.nextErrLine(), completion(equals('Invalid server response:')));
-    expect(pub.nextErrLine(), completion(equals(json.stringify(body))));
-    pub.shouldExit(1);
-  });
-
-  group('--force', () {
-    setUp(() => d.validPackage.create());
-
-    integration('cannot be combined with --dry-run', () {
-      schedulePub(args: ['lish', '--force', '--dry-run'],
-          error: "Cannot use both --force and --dry-run.",
-          exitCode: exit_codes.USAGE);
-    });
-
-    integration('publishes if there are no warnings or errors', () {
-      var server = new ScheduledServer();
-      d.credentialsFile(server, 'access token').create();
-      var pub = startPublish(server, args: ['--force']);
-
-      handleUploadForm(server);
-      handleUpload(server);
-
-      server.handle('GET', '/create', (request) {
-        request.response.write(json.stringify({
-          'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
-        }));
-        request.response.close();
-      });
-
-      pub.shouldExit(0);
-      expect(pub.remainingStdout(), completion(contains(
-          'Package test_pkg 1.0.0 uploaded!')));
-    });
-
-    integration('publishes if there are warnings', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg["author"] = "Nathan Weizenbaum";
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      var server = new ScheduledServer();
-      d.credentialsFile(server, 'access token').create();
-      var pub = startPublish(server, args: ['--force']);
-
-      handleUploadForm(server);
-      handleUpload(server);
-
-      server.handle('GET', '/create', (request) {
-        request.response.write(json.stringify({
-          'success': {'message': 'Package test_pkg 1.0.0 uploaded!'}
-        }));
-        request.response.close();
-      });
-
-      pub.shouldExit(0);
-      expect(pub.remainingStderr(), completion(contains(
-          'Suggestions:\n* Author "Nathan Weizenbaum" in pubspec.yaml'
-          ' should have an email address\n'
-          '  (e.g. "name <email>").')));
-      expect(pub.remainingStdout(), completion(contains(
-          'Package test_pkg 1.0.0 uploaded!')));
-    });
-
-    integration('does not publish if there are errors', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg.remove("homepage");
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      var server = new ScheduledServer();
-      var pub = startPublish(server, args: ['--force']);
-
-      pub.shouldExit(0);
-      expect(pub.remainingStderr(), completion(contains(
-          "Sorry, your package is missing a requirement and can't be "
-          "published yet.")));
-    });
-  });
-}
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index e2dc335..f239de3d 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -10,7 +10,7 @@
 
 import 'dart:async';
 import 'dart:collection' show Queue;
-import 'dart:io';
+import 'dart:io' hide sleep;
 import 'dart:json' as json;
 import 'dart:math';
 import 'dart:uri';
diff --git a/utils/tests/pub/validator/compiled_dartdoc_test.dart b/utils/tests/pub/validator/compiled_dartdoc_test.dart
new file mode 100644
index 0000000..257d783
--- /dev/null
+++ b/utils/tests/pub/validator/compiled_dartdoc_test.dart
@@ -0,0 +1,54 @@
+// 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:scheduled_test/scheduled_test.dart';
+
+import '../../../pub/entrypoint.dart';
+import '../../../pub/validator.dart';
+import '../../../pub/validator/compiled_dartdoc.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator compiledDartdoc(Entrypoint entrypoint) =>
+  new CompiledDartdocValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('looks normal', () => expectNoValidationError(compiledDartdoc));
+
+    integration('has most but not all files from compiling dartdoc', () {
+      d.dir(appPath, [
+        d.dir("doc-out", [
+          d.file("nav.json", ""),
+          d.file("index.html", ""),
+          d.file("styles.css", ""),
+          d.file("dart-logo-small.png", "")
+        ])
+      ]).create();
+      expectNoValidationError(compiledDartdoc);
+    });
+  });
+
+  integration('should consider a package invalid if it contains compiled '
+      'dartdoc', () {
+    d.validPackage.create();
+
+    d.dir(appPath, [
+      d.dir('doc-out', [
+        d.file('nav.json', ''),
+        d.file('index.html', ''),
+        d.file('styles.css', ''),
+        d.file('dart-logo-small.png', ''),
+        d.file('client-live-nav.js', '')
+      ])
+    ]).create();
+
+    expectValidationWarning(compiledDartdoc);
+  });
+}
diff --git a/utils/tests/pub/validator/dependency_test.dart b/utils/tests/pub/validator/dependency_test.dart
new file mode 100644
index 0000000..de4d08e
--- /dev/null
+++ b/utils/tests/pub/validator/dependency_test.dart
@@ -0,0 +1,250 @@
+// 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:json' as json;
+
+import 'package:http/http.dart' as http;
+import 'package:http/testing.dart';
+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 '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator dependency(Entrypoint entrypoint) =>
+  new DependencyValidator(entrypoint);
+
+expectDependencyValidationError(String error) {
+  expect(schedulePackageValidation(dependency),
+      completion(pairOf(someElement(contains(error)), isEmpty)));
+}
+
+expectDependencyValidationWarning(String warning) {
+  expect(schedulePackageValidation(dependency),
+      completion(pairOf(isEmpty, someElement(contains(warning)))));
+}
+
+/// Sets up a test package with dependency [dep] and mocks a server with
+/// [hostedVersions] of the package available.
+setUpDependency(Map dep, {List<String> hostedVersions}) {
+  useMockClient(new MockClient((request) {
+    expect(request.method, equals("GET"));
+    expect(request.url.path, equals("/packages/foo.json"));
+
+    if (hostedVersions == null) {
+      return new Future.immediate(new http.Response("not found", 404));
+    } else {
+      return new Future.immediate(new http.Response(json.stringify({
+        "name": "foo",
+        "uploaders": ["nweiz@google.com"],
+        "versions": hostedVersions
+      }), 200));
+    }
+  }));
+
+  d.dir(appPath, [
+    d.libPubspec("test_pkg", "1.0.0", deps: [dep])
+  ]).create();
+}
+
+main() {
+  initConfig();
+
+  integration('should consider a package valid if it looks normal', () {
+    d.validPackage.create();
+    expectNoValidationError(dependency);
+  });
+
+  group('should consider a package invalid if it', () {
+    setUp(d.validPackage.create);
+
+    group('has a git dependency', () {
+      group('where a hosted version exists', () {
+        integration("and should suggest the hosted primary version", () {
+          setUpDependency({'git': 'git://github.com/dart-lang/foo'},
+              hostedVersions: ["3.0.0-pre", "2.0.0", "1.0.0"]);
+          expectDependencyValidationWarning('  foo: ">=2.0.0 <3.0.0"');
+        });
+
+        integration("and should suggest the hosted prerelease version if "
+                    "it's the only version available", () {
+          setUpDependency({'git': 'git://github.com/dart-lang/foo'},
+              hostedVersions: ["3.0.0-pre", "2.0.0-pre"]);
+          expectDependencyValidationWarning('  foo: ">=3.0.0-pre <4.0.0"');
+        });
+
+        integration("and should suggest a tighter constraint if primary is "
+                    "pre-1.0.0", () {
+          setUpDependency({'git': 'git://github.com/dart-lang/foo'},
+              hostedVersions: ["0.0.1", "0.0.2"]);
+          expectDependencyValidationWarning('  foo: ">=0.0.2 <0.0.3"');
+        });
+      });
+
+      group('where no hosted version exists', () {
+        integration("and should use the other source's version", () {
+          setUpDependency({
+            'git': 'git://github.com/dart-lang/foo',
+            'version': '>=1.0.0 <2.0.0'
+          });
+          expectDependencyValidationWarning('  foo: ">=1.0.0 <2.0.0"');
+        });
+
+        integration("and should use the other source's unquoted version if "
+                    "concrete", () {
+          setUpDependency({
+            'git': 'git://github.com/dart-lang/foo',
+            'version': '0.2.3'
+          });
+          expectDependencyValidationWarning('  foo: 0.2.3');
+        });
+      });
+    });
+
+    group('has a path dependency', () {
+      group('where a hosted version exists', () {
+        integration("and should suggest the hosted primary version", () {
+          setUpDependency({'path': path.join(sandboxDir, 'foo')},
+              hostedVersions: ["3.0.0-pre", "2.0.0", "1.0.0"]);
+          expectDependencyValidationError('  foo: ">=2.0.0 <3.0.0"');
+        });
+
+        integration("and should suggest the hosted prerelease version if "
+                    "it's the only version available", () {
+          setUpDependency({'path': path.join(sandboxDir, 'foo')},
+              hostedVersions: ["3.0.0-pre", "2.0.0-pre"]);
+          expectDependencyValidationError('  foo: ">=3.0.0-pre <4.0.0"');
+        });
+
+        integration("and should suggest a tighter constraint if primary is "
+                    "pre-1.0.0", () {
+          setUpDependency({'path': path.join(sandboxDir, 'foo')},
+              hostedVersions: ["0.0.1", "0.0.2"]);
+          expectDependencyValidationError('  foo: ">=0.0.2 <0.0.3"');
+        });
+      });
+
+      group('where no hosted version exists', () {
+        integration("and should use the other source's version", () {
+          setUpDependency({
+            'path': path.join(sandboxDir, 'foo'),
+            'version': '>=1.0.0 <2.0.0'
+          });
+          expectDependencyValidationError('  foo: ">=1.0.0 <2.0.0"');
+        });
+
+        integration("and should use the other source's unquoted version if "
+                    "concrete", () {
+          setUpDependency({
+            'path': path.join(sandboxDir, 'foo'),
+            'version': '0.2.3'
+          });
+          expectDependencyValidationError('  foo: 0.2.3');
+        });
+      });
+    });
+
+    group('has an unconstrained dependency', () {
+      group('and it should not suggest a version', () {
+        integration("if there's no lockfile", () {
+          d.dir(appPath, [
+            d.libPubspec("test_pkg", "1.0.0", deps: [
+              {'hosted': 'foo'}
+            ])
+          ]).create();
+
+          expect(schedulePackageValidation(dependency), completion(
+              pairOf(isEmpty, everyElement(isNot(contains("\n  foo:"))))));
+        });
+
+        integration("if the lockfile doesn't have an entry for the "
+            "dependency", () {
+          d.dir(appPath, [
+            d.libPubspec("test_pkg", "1.0.0", deps: [
+              {'hosted': 'foo'}
+            ]),
+            d.file("pubspec.lock", json.stringify({
+              'packages': {
+                'bar': {
+                  'version': '1.2.3',
+                  'source': 'hosted',
+                  'description': {
+                    'name': 'bar',
+                    'url': 'http://pub.dartlang.org'
+                  }
+                }
+              }
+            }))
+          ]).create();
+
+          expect(schedulePackageValidation(dependency), completion(
+              pairOf(isEmpty, everyElement(isNot(contains("\n  foo:"))))));
+        });
+      });
+
+      group('with a lockfile', () {
+        integration('and it should suggest a constraint based on the locked '
+            'version', () {
+          d.dir(appPath, [
+            d.libPubspec("test_pkg", "1.0.0", deps: [
+              {'hosted': 'foo'}
+            ]),
+            d.file("pubspec.lock", json.stringify({
+              'packages': {
+                'foo': {
+                  'version': '1.2.3',
+                  'source': 'hosted',
+                  'description': {
+                    'name': 'foo',
+                    'url': 'http://pub.dartlang.org'
+                  }
+                }
+              }
+            }))
+          ]).create();
+
+          expectDependencyValidationWarning('  foo: ">=1.2.3 <2.0.0"');
+        });
+
+        integration('and it should suggest a concrete constraint if the locked '
+            'version is pre-1.0.0', () {
+          d.dir(appPath, [
+            d.libPubspec("test_pkg", "1.0.0", deps: [
+              {'hosted': 'foo'}
+            ]),
+            d.file("pubspec.lock", json.stringify({
+              'packages': {
+                'foo': {
+                  'version': '0.1.2',
+                  'source': 'hosted',
+                  'description': {
+                    'name': 'foo',
+                    'url': 'http://pub.dartlang.org'
+                  }
+                }
+              }
+            }))
+          ]).create();
+
+          expectDependencyValidationWarning('  foo: ">=0.1.2 <0.1.3"');
+        });
+      });
+    });
+
+    integration('has a hosted dependency on itself', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0", deps: [
+          {'hosted': {'name': 'test_pkg', 'version': '>=1.0.0'}}
+        ])
+      ]).create();
+
+      expectValidationWarning(dependency);
+    });
+  });
+}
diff --git a/utils/tests/pub/validator/directory_test.dart b/utils/tests/pub/validator/directory_test.dart
new file mode 100644
index 0000000..987a7d4
--- /dev/null
+++ b/utils/tests/pub/validator/directory_test.dart
@@ -0,0 +1,46 @@
+// 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: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 '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator directory(Entrypoint entrypoint) =>
+  new DirectoryValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('looks normal', () => expectNoValidationError(directory));
+
+    integration('has a nested directory named "tools"', () {
+      d.dir(appPath, [
+        d.dir("foo", [d.dir("tools")])
+      ]).create();
+      expectNoValidationError(directory);
+    });
+  });
+
+  group('should consider a package invalid if it has a top-level directory '
+      'named', () {
+    setUp(d.validPackage.create);
+
+    var names = ["tools", "tests", "docs", "examples", "sample", "samples"];
+    for (var name in names) {
+      integration('"$name"', () {
+        d.dir(appPath, [d.dir(name)]).create();
+        expectValidationWarning(directory);
+      });
+    }
+  });
+}
diff --git a/utils/tests/pub/validator/lib_test.dart b/utils/tests/pub/validator/lib_test.dart
new file mode 100644
index 0000000..e5d21f6
--- /dev/null
+++ b/utils/tests/pub/validator/lib_test.dart
@@ -0,0 +1,62 @@
+// 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: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 '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator lib(Entrypoint entrypoint) => new LibValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('looks normal', () => expectNoValidationError(lib));
+
+    integration('has a non-Dart file in lib', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0"),
+        d.dir("lib", [
+          d.file("thing.txt", "woo hoo")
+        ])
+      ]).create();
+      expectNoValidationError(lib);
+    });
+  });
+
+  integration('should consider a package invalid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('has no lib directory', () {
+      schedule(() => deleteEntry(path.join(sandboxDir, appPath, "lib")));
+      expectValidationError(lib);
+    });
+
+    integration('has an empty lib directory', () {
+      schedule(() =>
+          deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart")));
+      expectValidationError(lib);
+    });
+
+    integration('has a lib directory containing only src', () {
+      schedule(() =>
+          deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart")));
+      d.dir(appPath, [
+        d.dir("lib", [
+          d.dir("src", [d.file("test_pkg.dart", "int i = 0;")])
+        ])
+      ]).create();
+      expectValidationError(lib);
+    });
+  });
+}
diff --git a/utils/tests/pub/validator/license_test.dart b/utils/tests/pub/validator/license_test.dart
new file mode 100644
index 0000000..35c9d7c
--- /dev/null
+++ b/utils/tests/pub/validator/license_test.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+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 '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator license(Entrypoint entrypoint) => new LicenseValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('looks normal', () => expectNoValidationError(license));
+
+    integration('has a COPYING file', () {
+      schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE')));
+      d.file(path.join(appPath, 'COPYING'), '').create();
+      expectNoValidationError(license);
+    });
+
+    integration('has a prefixed LICENSE file', () {
+      schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE')));
+      d.file(path.join(appPath, 'MIT_LICENSE'), '').create();
+      expectNoValidationError(license);
+    });
+
+    integration('has a suffixed LICENSE file', () {
+      schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE')));
+      d.file(path.join(appPath, 'LICENSE.md'), '').create();
+      expectNoValidationError(license);
+    });
+  });
+
+  integration('should consider a package invalid if it has no LICENSE file',
+      () {
+    d.validPackage.create();
+    schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE')));
+    expectValidationError(license);
+  });
+}
diff --git a/utils/tests/pub/validator/name_test.dart b/utils/tests/pub/validator/name_test.dart
new file mode 100644
index 0000000..9f0085b
--- /dev/null
+++ b/utils/tests/pub/validator/name_test.dart
@@ -0,0 +1,107 @@
+// 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: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 '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator name(Entrypoint entrypoint) => new NameValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('looks normal', () => expectNoValidationError(name));
+
+    integration('has a badly-named library in lib/src', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0"),
+        d.dir("lib", [
+          d.file("test_pkg.dart", "int i = 1;"),
+          d.dir("src", [d.file("8ball.dart", "int j = 2;")])
+        ])
+      ]).create();
+      expectNoValidationError(name);
+    });
+  });
+
+  group('should consider a package invalid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('has an empty package name', () {
+      d.dir(appPath, [d.libPubspec("", "1.0.0")]).create();
+      expectValidationError(name);
+    });
+
+    integration('has a package name with an invalid character', () {
+      d.dir(appPath, [d.libPubspec("test-pkg", "1.0.0")]).create();
+      expectValidationError(name);
+    });
+
+    integration('has a package name that begins with a number', () {
+      d.dir(appPath, [d.libPubspec("8ball", "1.0.0")]).create();
+      expectValidationError(name);
+    });
+
+    integration('has a package name that contains upper-case letters', () {
+      d.dir(appPath, [d.libPubspec("TestPkg", "1.0.0")]).create();
+      expectValidationWarning(name);
+    });
+
+    integration('has a package name that is a Dart reserved word', () {
+      d.dir(appPath, [d.libPubspec("final", "1.0.0")]).create();
+      expectValidationError(name);
+    });
+
+    integration('has a library name with an invalid character', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0"),
+        d.dir("lib", [d.file("test-pkg.dart", "int i = 0;")])
+      ]).create();
+      expectValidationWarning(name);
+    });
+
+    integration('has a library name that begins with a number', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0"),
+        d.dir("lib", [d.file("8ball.dart", "int i = 0;")])
+      ]).create();
+      expectValidationWarning(name);
+    });
+
+    integration('has a library name that contains upper-case letters', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0"),
+        d.dir("lib", [d.file("TestPkg.dart", "int i = 0;")])
+      ]).create();
+      expectValidationWarning(name);
+    });
+
+    integration('has a library name that is a Dart reserved word', () {
+      d.dir(appPath, [
+        d.libPubspec("test_pkg", "1.0.0"),
+        d.dir("lib", [d.file("for.dart", "int i = 0;")])
+      ]).create();
+      expectValidationWarning(name);
+    });
+
+    integration('has a single library named differently than the package', () {
+      schedule(() =>
+          deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart")));
+      d.dir(appPath, [
+        d.dir("lib", [d.file("best_pkg.dart", "int i = 0;")])
+      ]).create();
+      expectValidationWarning(name);
+    });
+  });
+}
diff --git a/utils/tests/pub/validator/pubspec_field_test.dart b/utils/tests/pub/validator/pubspec_field_test.dart
new file mode 100644
index 0000000..2ae8439
--- /dev/null
+++ b/utils/tests/pub/validator/pubspec_field_test.dart
@@ -0,0 +1,102 @@
+// 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:scheduled_test/scheduled_test.dart';
+
+import '../../../pub/entrypoint.dart';
+import '../../../pub/validator.dart';
+import '../../../pub/validator/pubspec_field.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator pubspecField(Entrypoint entrypoint) =>
+  new PubspecFieldValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('looks normal', () => expectNoValidationError(pubspecField));
+
+    integration('has "authors" instead of "author"', () {
+      var pkg = packageMap("test_pkg", "1.0.0");
+      pkg["authors"] = [pkg.remove("author")];
+      d.dir(appPath, [d.pubspec(pkg)]).create();
+      expectNoValidationError(pubspecField);
+    });
+  });
+
+  group('should consider a package invalid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('is missing the "homepage" field', () {
+      var pkg = packageMap("test_pkg", "1.0.0");
+      pkg.remove("homepage");
+      d.dir(appPath, [d.pubspec(pkg)]).create();
+
+      expectValidationError(pubspecField);
+    });
+
+    integration('is missing the "description" field', () {
+      var pkg = packageMap("test_pkg", "1.0.0");
+      pkg.remove("description");
+      d.dir(appPath, [d.pubspec(pkg)]).create();
+
+      expectValidationError(pubspecField);
+    });
+
+    integration('is missing the "author" field', () {
+      var pkg = packageMap("test_pkg", "1.0.0");
+      pkg.remove("author");
+      d.dir(appPath, [d.pubspec(pkg)]).create();
+
+      expectValidationError(pubspecField);
+    });
+
+    integration('has a single author without an email', () {
+      var pkg = packageMap("test_pkg", "1.0.0");
+      pkg["author"] = "Nathan Weizenbaum";
+      d.dir(appPath, [d.pubspec(pkg)]).create();
+
+      expectValidationWarning(pubspecField);
+    });
+
+    integration('has one of several authors without an email', () {
+      var pkg = packageMap("test_pkg", "1.0.0");
+      pkg.remove("author");
+      pkg["authors"] = [
+        "Bob Nystrom <rnystrom@google.com>",
+        "Nathan Weizenbaum",
+        "John Messerly <jmesserly@google.com>"
+      ];
+      d.dir(appPath, [d.pubspec(pkg)]).create();
+
+      expectValidationWarning(pubspecField);
+    });
+
+    integration('has a single author without a name', () {
+      var pkg = packageMap("test_pkg", "1.0.0");
+      pkg["author"] = "<nweiz@google.com>";
+      d.dir(appPath, [d.pubspec(pkg)]).create();
+
+      expectValidationWarning(pubspecField);
+    });
+
+    integration('has one of several authors without a name', () {
+      var pkg = packageMap("test_pkg", "1.0.0");
+      pkg.remove("author");
+      pkg["authors"] = [
+        "Bob Nystrom <rnystrom@google.com>",
+        "<nweiz@google.com>",
+        "John Messerly <jmesserly@google.com>"
+      ];
+      d.dir(appPath, [d.pubspec(pkg)]).create();
+
+      expectValidationWarning(pubspecField);
+    });
+  });
+}
diff --git a/utils/tests/pub/validator/size_test.dart b/utils/tests/pub/validator/size_test.dart
new file mode 100644
index 0000000..47c7d1e
--- /dev/null
+++ b/utils/tests/pub/validator/size_test.dart
@@ -0,0 +1,35 @@
+// 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:math' as math;
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../../../pub/entrypoint.dart';
+import '../../../pub/validator.dart';
+import '../../../pub/validator/size.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Function size(int size) {
+  return (entrypoint) =>
+      new SizeValidator(entrypoint, new Future.immediate(size));
+}
+
+main() {
+  initConfig();
+
+  setUp(d.validPackage.create);
+
+  integration('should consider a package valid if it is <= 10 MB', () {
+    expectNoValidationError(size(100));
+    expectNoValidationError(size(10 * math.pow(2, 20)));
+  });
+
+  integration('should consider a package invalid if it is more than 10 MB', () {
+    expectValidationError(size(10 * math.pow(2, 20) + 1));
+  });
+}
diff --git a/utils/tests/pub/validator/utf8_readme_test.dart b/utils/tests/pub/validator/utf8_readme_test.dart
new file mode 100644
index 0000000..8d63c78
--- /dev/null
+++ b/utils/tests/pub/validator/utf8_readme_test.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../../../pub/entrypoint.dart';
+import '../../../pub/validator.dart';
+import '../../../pub/validator/utf8_readme.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+Validator utf8Readme(Entrypoint entrypoint) =>
+  new Utf8ReadmeValidator(entrypoint);
+
+main() {
+  initConfig();
+
+  group('should consider a package valid if it', () {
+    setUp(d.validPackage.create);
+
+    integration('looks normal', () => expectNoValidationError(utf8Readme));
+
+    integration('has a non-primary readme with invalid utf-8', () {
+      d.dir(appPath, [
+        d.file("README", "Valid utf-8"),
+        d.binaryFile("README.invalid", [192])
+      ]).create();
+      expectNoValidationError(utf8Readme);
+    });
+  });
+
+  integration('should consider a package invalid if it has a README with '
+      'invalid utf-8', () {
+    d.validPackage.create();
+
+    d.dir(appPath, [
+      d.binaryFile("README", [192])
+    ]).create();
+    expectValidationWarning(utf8Readme);
+  });
+}
diff --git a/utils/tests/pub/validator/utils.dart b/utils/tests/pub/validator/utils.dart
new file mode 100644
index 0000000..64a6b47
--- /dev/null
+++ b/utils/tests/pub/validator/utils.dart
@@ -0,0 +1,23 @@
+// 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 validator.utils;
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../test_pub.dart';
+
+void expectNoValidationError(ValidatorCreator fn) {
+  expect(schedulePackageValidation(fn), completion(pairOf(isEmpty, isEmpty)));
+}
+
+void expectValidationError(ValidatorCreator fn) {
+  expect(schedulePackageValidation(fn),
+      completion(pairOf(isNot(isEmpty), anything)));
+}
+
+void expectValidationWarning(ValidatorCreator fn) {
+  expect(schedulePackageValidation(fn),
+      completion(pairOf(isEmpty, isNot(isEmpty))));
+}
diff --git a/utils/tests/pub/validator_test.dart b/utils/tests/pub/validator_test.dart
deleted file mode 100644
index 409a757..0000000
--- a/utils/tests/pub/validator_test.dart
+++ /dev/null
@@ -1,584 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library validator_test;
-
-import 'dart:async';
-import 'dart:io';
-import 'dart:json' as json;
-import 'dart:math' as math;
-
-import 'package:http/http.dart' as http;
-import 'package:http/testing.dart';
-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/compiled_dartdoc.dart';
-import '../../pub/validator/dependency.dart';
-import '../../pub/validator/directory.dart';
-import '../../pub/validator/lib.dart';
-import '../../pub/validator/license.dart';
-import '../../pub/validator/name.dart';
-import '../../pub/validator/pubspec_field.dart';
-import '../../pub/validator/size.dart';
-import '../../pub/validator/utf8_readme.dart';
-import 'descriptor.dart' as d;
-import 'test_pub.dart';
-
-void expectNoValidationError(ValidatorCreator fn) {
-  expect(schedulePackageValidation(fn), completion(pairOf(isEmpty, isEmpty)));
-}
-
-void expectValidationError(ValidatorCreator fn) {
-  expect(schedulePackageValidation(fn),
-      completion(pairOf(isNot(isEmpty), anything)));
-}
-
-void expectValidationWarning(ValidatorCreator fn) {
-  expect(schedulePackageValidation(fn),
-      completion(pairOf(isEmpty, isNot(isEmpty))));
-}
-
-expectDependencyValidationError(String error) {
-  expect(schedulePackageValidation(dependency),
-      completion(pairOf(someElement(contains(error)), isEmpty)));
-}
-
-expectDependencyValidationWarning(String warning) {
-  expect(schedulePackageValidation(dependency),
-      completion(pairOf(isEmpty, someElement(contains(warning)))));
-}
-
-Validator compiledDartdoc(Entrypoint entrypoint) =>
-  new CompiledDartdocValidator(entrypoint);
-
-Validator dependency(Entrypoint entrypoint) =>
-  new DependencyValidator(entrypoint);
-
-Validator directory(Entrypoint entrypoint) =>
-  new DirectoryValidator(entrypoint);
-
-Validator lib(Entrypoint entrypoint) => new LibValidator(entrypoint);
-
-Validator license(Entrypoint entrypoint) => new LicenseValidator(entrypoint);
-
-Validator name(Entrypoint entrypoint) => new NameValidator(entrypoint);
-
-Validator pubspecField(Entrypoint entrypoint) =>
-  new PubspecFieldValidator(entrypoint);
-
-Function size(int size) {
-  return (entrypoint) =>
-      new SizeValidator(entrypoint, new Future.immediate(size));
-}
-
-Validator utf8Readme(Entrypoint entrypoint) =>
-  new Utf8ReadmeValidator(entrypoint);
-
-void scheduleNormalPackage() {
-  d.validPackage.create();
-}
-
-/// Sets up a test package with dependency [dep] and mocks a server with
-/// [hostedVersions] of the package available.
-setUpDependency(Map dep, {List<String> hostedVersions}) {
-  useMockClient(new MockClient((request) {
-    expect(request.method, equals("GET"));
-    expect(request.url.path, equals("/packages/foo.json"));
-
-    if (hostedVersions == null) {
-      return new Future.immediate(new http.Response("not found", 404));
-    } else {
-      return new Future.immediate(new http.Response(json.stringify({
-        "name": "foo",
-        "uploaders": ["nweiz@google.com"],
-        "versions": hostedVersions
-      }), 200));
-    }
-  }));
-
-  d.dir(appPath, [
-    d.libPubspec("test_pkg", "1.0.0", deps: [dep])
-  ]).create();
-}
-
-main() {
-  initConfig();
-  group('should consider a package valid if it', () {
-    setUp(scheduleNormalPackage);
-
-    integration('looks normal', () {
-      d.dir(appPath, [d.libPubspec("test_pkg", "1.0.0")]).create();
-      expectNoValidationError(dependency);
-      expectNoValidationError(lib);
-      expectNoValidationError(license);
-      expectNoValidationError(name);
-      expectNoValidationError(pubspecField);
-    });
-
-    integration('has a COPYING file', () {
-      schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE')));
-      d.file(path.join(appPath, 'COPYING'), '').create();
-      expectNoValidationError(license);
-    });
-
-    integration('has a prefixed LICENSE file', () {
-      schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE')));
-      d.file(path.join(appPath, 'MIT_LICENSE'), '').create();
-      expectNoValidationError(license);
-    });
-
-    integration('has a suffixed LICENSE file', () {
-      schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE')));
-      d.file(path.join(appPath, 'LICENSE.md'), '').create();
-      expectNoValidationError(license);
-    });
-
-    integration('has "authors" instead of "author"', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg["authors"] = [pkg.remove("author")];
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-      expectNoValidationError(pubspecField);
-    });
-
-    integration('has a badly-named library in lib/src', () {
-      d.dir(appPath, [
-        d.libPubspec("test_pkg", "1.0.0"),
-        d.dir("lib", [
-          d.file("test_pkg.dart", "int i = 1;"),
-          d.dir("src", [d.file("8ball.dart", "int j = 2;")])
-        ])
-      ]).create();
-      expectNoValidationError(name);
-    });
-
-    integration('has a non-Dart file in lib', () {
-      d.dir(appPath, [
-        d.libPubspec("test_pkg", "1.0.0"),
-        d.dir("lib", [
-          d.file("thing.txt", "woo hoo")
-        ])
-      ]).create();
-      expectNoValidationError(lib);
-    });
-
-    integration('has a nested directory named "tools"', () {
-      d.dir(appPath, [
-        d.dir("foo", [d.dir("tools")])
-      ]).create();
-      expectNoValidationError(directory);
-    });
-
-    integration('is <= 10 MB', () {
-      expectNoValidationError(size(100));
-      expectNoValidationError(size(10 * math.pow(2, 20)));
-    });
-
-    integration('has most but not all files from compiling dartdoc', () {
-      d.dir(appPath, [
-        d.dir("doc-out", [
-          d.file("nav.json", ""),
-          d.file("index.html", ""),
-          d.file("styles.css", ""),
-          d.file("dart-logo-small.png", "")
-        ])
-      ]).create();
-      expectNoValidationError(compiledDartdoc);
-    });
-
-    integration('has a non-primary readme with invalid utf-8', () {
-      d.dir(appPath, [
-        d.file("README", "Valid utf-8"),
-        d.binaryFile("README.invalid", [192])
-      ]).create();
-      expectNoValidationError(utf8Readme);
-    });
-  });
-
-  group('should consider a package invalid if it', () {
-    setUp(scheduleNormalPackage);
-
-    integration('is missing the "homepage" field', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg.remove("homepage");
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      expectValidationError(pubspecField);
-    });
-
-    integration('is missing the "description" field', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg.remove("description");
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      expectValidationError(pubspecField);
-    });
-
-    integration('is missing the "author" field', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg.remove("author");
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      expectValidationError(pubspecField);
-    });
-
-    integration('has a single author without an email', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg["author"] = "Nathan Weizenbaum";
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      expectValidationWarning(pubspecField);
-    });
-
-    integration('has one of several authors without an email', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg.remove("author");
-      pkg["authors"] = [
-        "Bob Nystrom <rnystrom@google.com>",
-        "Nathan Weizenbaum",
-        "John Messerly <jmesserly@google.com>"
-      ];
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      expectValidationWarning(pubspecField);
-    });
-
-    integration('has a single author without a name', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg["author"] = "<nweiz@google.com>";
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      expectValidationWarning(pubspecField);
-    });
-
-    integration('has one of several authors without a name', () {
-      var pkg = packageMap("test_pkg", "1.0.0");
-      pkg.remove("author");
-      pkg["authors"] = [
-        "Bob Nystrom <rnystrom@google.com>",
-        "<nweiz@google.com>",
-        "John Messerly <jmesserly@google.com>"
-      ];
-      d.dir(appPath, [d.pubspec(pkg)]).create();
-
-      expectValidationWarning(pubspecField);
-    });
-
-    integration('has no LICENSE file', () {
-      schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE')));
-      expectValidationError(license);
-    });
-
-    integration('has an empty package name', () {
-      d.dir(appPath, [d.libPubspec("", "1.0.0")]).create();
-      expectValidationError(name);
-    });
-
-    integration('has a package name with an invalid character', () {
-      d.dir(appPath, [d.libPubspec("test-pkg", "1.0.0")]).create();
-      expectValidationError(name);
-    });
-
-    integration('has a package name that begins with a number', () {
-      d.dir(appPath, [d.libPubspec("8ball", "1.0.0")]).create();
-      expectValidationError(name);
-    });
-
-    integration('has a package name that contains upper-case letters', () {
-      d.dir(appPath, [d.libPubspec("TestPkg", "1.0.0")]).create();
-      expectValidationWarning(name);
-    });
-
-    integration('has a package name that is a Dart reserved word', () {
-      d.dir(appPath, [d.libPubspec("final", "1.0.0")]).create();
-      expectValidationError(name);
-    });
-
-    integration('has a library name with an invalid character', () {
-      d.dir(appPath, [
-        d.libPubspec("test_pkg", "1.0.0"),
-        d.dir("lib", [d.file("test-pkg.dart", "int i = 0;")])
-      ]).create();
-      expectValidationWarning(name);
-    });
-
-    integration('has a library name that begins with a number', () {
-      d.dir(appPath, [
-        d.libPubspec("test_pkg", "1.0.0"),
-        d.dir("lib", [d.file("8ball.dart", "int i = 0;")])
-      ]).create();
-      expectValidationWarning(name);
-    });
-
-    integration('has a library name that contains upper-case letters', () {
-      d.dir(appPath, [
-        d.libPubspec("test_pkg", "1.0.0"),
-        d.dir("lib", [d.file("TestPkg.dart", "int i = 0;")])
-      ]).create();
-      expectValidationWarning(name);
-    });
-
-    integration('has a library name that is a Dart reserved word', () {
-      d.dir(appPath, [
-        d.libPubspec("test_pkg", "1.0.0"),
-        d.dir("lib", [d.file("for.dart", "int i = 0;")])
-      ]).create();
-      expectValidationWarning(name);
-    });
-
-    integration('has a single library named differently than the package', () {
-      schedule(() =>
-          deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart")));
-      d.dir(appPath, [
-        d.dir("lib", [d.file("best_pkg.dart", "int i = 0;")])
-      ]).create();
-      expectValidationWarning(name);
-    });
-
-    integration('has no lib directory', () {
-      schedule(() => deleteEntry(path.join(sandboxDir, appPath, "lib")));
-      expectValidationError(lib);
-    });
-
-    integration('has an empty lib directory', () {
-      schedule(() =>
-          deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart")));
-      expectValidationError(lib);
-    });
-
-    integration('has a lib directory containing only src', () {
-      schedule(() =>
-          deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart")));
-      d.dir(appPath, [
-        d.dir("lib", [
-          d.dir("src", [d.file("test_pkg.dart", "int i = 0;")])
-        ])
-      ]).create();
-      expectValidationError(lib);
-    });
-
-    group('has a git dependency', () {
-      group('where a hosted version exists', () {
-        integration("and should suggest the hosted primary version", () {
-          setUpDependency({'git': 'git://github.com/dart-lang/foo'},
-              hostedVersions: ["3.0.0-pre", "2.0.0", "1.0.0"]);
-          expectDependencyValidationWarning('  foo: ">=2.0.0 <3.0.0"');
-        });
-
-        integration("and should suggest the hosted prerelease version if "
-                    "it's the only version available", () {
-          setUpDependency({'git': 'git://github.com/dart-lang/foo'},
-              hostedVersions: ["3.0.0-pre", "2.0.0-pre"]);
-          expectDependencyValidationWarning('  foo: ">=3.0.0-pre <4.0.0"');
-        });
-
-        integration("and should suggest a tighter constraint if primary is "
-                    "pre-1.0.0", () {
-          setUpDependency({'git': 'git://github.com/dart-lang/foo'},
-              hostedVersions: ["0.0.1", "0.0.2"]);
-          expectDependencyValidationWarning('  foo: ">=0.0.2 <0.0.3"');
-        });
-      });
-
-      group('where no hosted version exists', () {
-        integration("and should use the other source's version", () {
-          setUpDependency({
-            'git': 'git://github.com/dart-lang/foo',
-            'version': '>=1.0.0 <2.0.0'
-          });
-          expectDependencyValidationWarning('  foo: ">=1.0.0 <2.0.0"');
-        });
-
-        integration("and should use the other source's unquoted version if "
-                    "concrete", () {
-          setUpDependency({
-            'git': 'git://github.com/dart-lang/foo',
-            'version': '0.2.3'
-          });
-          expectDependencyValidationWarning('  foo: 0.2.3');
-        });
-      });
-    });
-
-    group('has a path dependency', () {
-      group('where a hosted version exists', () {
-        integration("and should suggest the hosted primary version", () {
-          setUpDependency({'path': path.join(sandboxDir, 'foo')},
-              hostedVersions: ["3.0.0-pre", "2.0.0", "1.0.0"]);
-          expectDependencyValidationError('  foo: ">=2.0.0 <3.0.0"');
-        });
-
-        integration("and should suggest the hosted prerelease version if "
-                    "it's the only version available", () {
-          setUpDependency({'path': path.join(sandboxDir, 'foo')},
-              hostedVersions: ["3.0.0-pre", "2.0.0-pre"]);
-          expectDependencyValidationError('  foo: ">=3.0.0-pre <4.0.0"');
-        });
-
-        integration("and should suggest a tighter constraint if primary is "
-                    "pre-1.0.0", () {
-          setUpDependency({'path': path.join(sandboxDir, 'foo')},
-              hostedVersions: ["0.0.1", "0.0.2"]);
-          expectDependencyValidationError('  foo: ">=0.0.2 <0.0.3"');
-        });
-      });
-
-      group('where no hosted version exists', () {
-        integration("and should use the other source's version", () {
-          setUpDependency({
-            'path': path.join(sandboxDir, 'foo'),
-            'version': '>=1.0.0 <2.0.0'
-          });
-          expectDependencyValidationError('  foo: ">=1.0.0 <2.0.0"');
-        });
-
-        integration("and should use the other source's unquoted version if "
-                    "concrete", () {
-          setUpDependency({
-            'path': path.join(sandboxDir, 'foo'),
-            'version': '0.2.3'
-          });
-          expectDependencyValidationError('  foo: 0.2.3');
-        });
-      });
-    });
-
-    group('has an unconstrained dependency', () {
-      group('and it should not suggest a version', () {
-        integration("if there's no lockfile", () {
-          d.dir(appPath, [
-            d.libPubspec("test_pkg", "1.0.0", deps: [
-              {'hosted': 'foo'}
-            ])
-          ]).create();
-
-          expect(schedulePackageValidation(dependency), completion(
-              pairOf(isEmpty, everyElement(isNot(contains("\n  foo:"))))));
-        });
-
-        integration("if the lockfile doesn't have an entry for the "
-            "dependency", () {
-          d.dir(appPath, [
-            d.libPubspec("test_pkg", "1.0.0", deps: [
-              {'hosted': 'foo'}
-            ]),
-            d.file("pubspec.lock", json.stringify({
-              'packages': {
-                'bar': {
-                  'version': '1.2.3',
-                  'source': 'hosted',
-                  'description': {
-                    'name': 'bar',
-                    'url': 'http://pub.dartlang.org'
-                  }
-                }
-              }
-            }))
-          ]).create();
-
-          expect(schedulePackageValidation(dependency), completion(
-              pairOf(isEmpty, everyElement(isNot(contains("\n  foo:"))))));
-        });
-      });
-
-      group('with a lockfile', () {
-        integration('and it should suggest a constraint based on the locked '
-            'version', () {
-          d.dir(appPath, [
-            d.libPubspec("test_pkg", "1.0.0", deps: [
-              {'hosted': 'foo'}
-            ]),
-            d.file("pubspec.lock", json.stringify({
-              'packages': {
-                'foo': {
-                  'version': '1.2.3',
-                  'source': 'hosted',
-                  'description': {
-                    'name': 'foo',
-                    'url': 'http://pub.dartlang.org'
-                  }
-                }
-              }
-            }))
-          ]).create();
-
-          expectDependencyValidationWarning('  foo: ">=1.2.3 <2.0.0"');
-        });
-
-        integration('and it should suggest a concrete constraint if the locked '
-            'version is pre-1.0.0', () {
-          d.dir(appPath, [
-            d.libPubspec("test_pkg", "1.0.0", deps: [
-              {'hosted': 'foo'}
-            ]),
-            d.file("pubspec.lock", json.stringify({
-              'packages': {
-                'foo': {
-                  'version': '0.1.2',
-                  'source': 'hosted',
-                  'description': {
-                    'name': 'foo',
-                    'url': 'http://pub.dartlang.org'
-                  }
-                }
-              }
-            }))
-          ]).create();
-
-          expectDependencyValidationWarning('  foo: ">=0.1.2 <0.1.3"');
-        });
-      });
-    });
-
-    integration('has a hosted dependency on itself', () {
-      d.dir(appPath, [
-        d.libPubspec("test_pkg", "1.0.0", deps: [
-          {'hosted': {'name': 'test_pkg', 'version': '>=1.0.0'}}
-        ])
-      ]).create();
-
-      expectValidationWarning(dependency);
-    });
-
-    group('has a top-level directory named', () {
-      setUp(scheduleNormalPackage);
-
-      var names = ["tools", "tests", "docs", "examples", "sample", "samples"];
-      for (var name in names) {
-        integration('"$name"', () {
-          d.dir(appPath, [d.dir(name)]).create();
-          expectValidationWarning(directory);
-        });
-      }
-    });
-
-    integration('is more than 10 MB', () {
-      expectValidationError(size(10 * math.pow(2, 20) + 1));
-    });
-
-    integration('contains compiled dartdoc', () {
-      d.dir(appPath, [
-        d.dir('doc-out', [
-          d.file('nav.json', ''),
-          d.file('index.html', ''),
-          d.file('styles.css', ''),
-          d.file('dart-logo-small.png', ''),
-          d.file('client-live-nav.js', '')
-        ])
-      ]).create();
-
-      expectValidationWarning(compiledDartdoc);
-    });
-
-    integration('has a README with invalid utf-8', () {
-      d.dir(appPath, [
-        d.binaryFile("README", [192])
-      ]).create();
-      expectValidationWarning(utf8Readme);
-    });
-  });
-}